Blending mode for terrain materials....

Friendly conversations, and everything that doesn't fit into the other forums.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 10
94 posts Page 3 of 10
Duion
Posts: 1208
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Jul 09, 2017 6:09 pm
@
User avatar
Mitovo

You still have not provided any evidence to backup your claims.

You just made an empty claim that Torque's terrain system is outdated, but you did not even bother checking what blend algorithm is used and what algorithm other engines use.
Also you did not even post a comparison screenshot, nor let you allow me to test your materials.
LukasPJ
Site Admin
Posts: 402
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Sun Jul 09, 2017 11:45 pm
First of all, any opinion is valuable, and we shouldn't try and shut it down. In general, I happen to agree with @ Mitovo, the system is outdated which is why I'm looking to update the blending results ( sort of described here: http://forums.torque3d.org/viewtopic.php?f=8&t=1030 ).

@ Mitovo, if you have some clues or ideas as to how blending 3 textures would look best, i.e. how to take the colors and add them up then I would be happy to try it in the engine. I'm looking at implementing the technique from Andrey Mishkin ( http://www.gamasutra.com/blogs/AndreyMi ... atting.php ) and would be happy to look at the colors as well.

Alas, I don't own photoshop, so if I were to try and change the blending method here, could you verify the results in photoshop?
Furthermore, is there any blending technique that you'd prefer? Additive, multiplicative, etc? I could try them out, and we could see the results in-game and see what works and why.
Timmy
Posts: 371
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Mon Jul 10, 2017 1:51 am

Alas, I don't own photoshop, so if I were to try and change the blending method here, could you verify the results in photoshop?
Furthermore, is there any blending technique that you'd prefer? Additive, multiplicative, etc? I could try them out, and we could see the results in-game and see what works and why.
As i pointed out earlier be-careful with comparing screenshots with photoshop to in-game results. T3D now performs everything correctly in linear space and by default photoshop does not(for 8bit images anyway, 16/32bit is all linear space), this can obviously be easily changed in photoshop though.
LukasPJ
Site Admin
Posts: 402
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Mon Jul 10, 2017 4:02 am
As i pointed out earlier be-careful with comparing screenshots with photoshop to in-game results. T3D now performs everything correctly in linear space and by default photoshop does not(for 8bit images anyway, 16/32bit is all linear space), this can obviously be easily changed in photoshop though.
I never really understood the linear space stuff.. But if the images blended in photoshop are 32bit then it should be linear space, thus comparable to T3D, or am I misunderstanding something?
Timmy
Posts: 371
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Mon Jul 10, 2017 4:15 am
As i pointed out earlier be-careful with comparing screenshots with photoshop to in-game results. T3D now performs everything correctly in linear space and by default photoshop does not(for 8bit images anyway, 16/32bit is all linear space), this can obviously be easily changed in photoshop though.
I never really understood the linear space stuff.. But if the images blended in photoshop are 32bit then it should be linear space, thus comparable to T3D, or am I misunderstanding something?
You can change the 8bit to use linear space (but yeah 16/32 use linear space there is no changing that one), just gotta be-careful though that the 8bit ones are still saved using srgb space though. If you are not worried about comparing blending etc to T3D than it's just a preference thing, some may prefer the result of blending etc in srgb space even if it is technically wrong.

*edit:

Here GPU gems article on the subject here
JeffR
Steering Committee
Steering Committee
Posts: 900
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Mon Jul 10, 2017 3:53 pm
I'll note on the 'Textures always looked oversaturated to me" part: it could well be that the textures themselves have an element of being 'over done', as well. They're rather old textures at this point, and we use much different and more accurate color handling now. So that could easily be exacerbating any oddities with the terrain textures. I'll work with Lukas and get some new, properly modern terrain textures we can use to better assure testing and correctness, and replace the old ones.
JeffR
Steering Committee
Steering Committee
Posts: 900
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Tue Jul 11, 2017 4:39 am
So, just to give the cliffs notes to the conversation today, we pow-wowed on a game plan for terrain to get a better idea of where it needs to be, and how to get it there.

The unanimous consensus was that the detail textures need to be a full color diffuse texture which looks as-the-image-intends up close, where the detail textures are utilized.

So from there, we worked out the following concept for how terrain rendering of materials could proceed:

BaseTexture: Basically what 'DiffuseTexture' does now, but trades the confusing nomenclature. This texture basically paints onto the terrain-wide diffuse texture map that acts as your long-distance detailing(how mountains look in the distance, yada yada)

Detail Diffuse Texture: Full color, up-close texture. Behaves similarly to the detail textures now, where they will blend in based on distance, but doesn't do the weird light/darkening gray image business. You pass in a full color texture and it'll render it as expected.

Detail Diffuse Texture, Alpha Channel: While most cases of the detail texture brightening/darkening are annoying because of how the math is kinda weird, being able to take contribution from the base texture's color to help create visual variation and cut back on repetition is still useful, so we had the idea that the alpha channel could basically act as a 'Blend Mask'. Would basically be a lerp of the blend values of your diffuse textures. At 0(black), it would use the color of the BaseTexture, at 0.5, it would be a 50/50 blend of color, and at 1 it would fully use the Detail Diffuse's color. This would allow you to, say, have a grass texture with flowers, where the grass can pick up some color variation from the BaseTexture, but the flowers would keep their detail-texture-based color and be unmodified. Would also have a override in the mat editor to just assign a flat constant to the channel for simplicity if no special blend masks are required.

Detail Normal Texture: Normal map texture. Natch

Detail Normal Texture, Alpha Channel: Your height information. This and the normal will get used in Lukas' much nicer blending logic as detailed in his blog thread, and also can be utilized in parallax mapping for added depth fidelity.

Detail Composite Texture: This is for the PBR side of things. It'll contain the roughness, AO and metalness info for the detail texture, so that it renders the same as any non-terrain materials.

I also figured that with this setup, it would be quite easy to have the frontend accept picking regular materials, to which we would-in the backend out of view- pull the appropriate textures and fill in the data(allowing a clean, uniform hook to secondary material information, like particle effects to deploy, footstep sounds, etc).
So the front end would see a uniform interface as an option for picking materials, but the backend keeps a separate, streamlined terrain material to keep things efficient and targeted. This has the bonus of letting us get the texture packing to get the draw calls down as long as physically possible(potentially in 1!).

So yeah, I think this is actually a pretty sweet setup, that keeps the positives of the current terrain system, while shifting to a more intuitive and standardized setup with the pros of other, modern terrain systems.

If you guys have any ideas of suggestions to build on this stuff, by all means, throw it in the hat so we can get everything dialed in, but I feel this is a really good starting point.

I'm also gunna put together several new, PBR-ready terrain materials a) for better testing and b) a better example than the poor, old textures we currently have. They've served us well, but they're oooooold at this point, and need some replacing.
Duion
Posts: 1208
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Jul 11, 2017 12:21 pm
The base texture is supposed to give the detail texture the diffuse color, therefore the detail texture is supposed to be unsaturated, so the color adds up properly.
Having the detail texture full color diffuse will defeat the purpose of having other textures like base texture and macro texture blend into it.

How I make my textures is like the following: I make the base texture a blurred version of the detail texture, so you do not see the details in the distance, just the rough color with some variation, then the detail texture which is mostly removed of the main color, like if you have a grass texture I remove most or all of the green in the texture, so that the green from the base texture fills it up again with different variations depending on location and macro texture is mostly black and white which adds more variations. Later I often exchange the generated final base texture by hand to give each level individual colors, in that situation it is important to not have too much color in the detail textures, since they would not fit then.

If you make the detail texture a full color diffuse, it will probably never match the ground color, since the baste texture usually gives a slightly different color every meter ingame distance, but the full color detal texture will give you always the same.

Regarding the base texture it should be as big as your terrain like 1024x1024 terrain needs 1024x1024 base texture and it will vertex paint the terrain

So do not break a working well thought through system. I would consider Torques terrain system even better than other engines on mid ranges.
Timmy
Posts: 371
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Tue Jul 11, 2017 3:40 pm
The base texture is supposed to give the detail texture the diffuse color, therefore the detail texture is supposed to be unsaturated, so the color adds up properly.
Having the detail texture full color diffuse will defeat the purpose of having other textures like base texture and macro texture blend into it.

How I make my textures is like the following: I make the base texture a blurred version of the detail texture, so you do not see the details in the distance, just the rough color with some variation, then the detail texture which is mostly removed of the main color, like if you have a grass texture I remove most or all of the green in the texture, so that the green from the base texture fills it up again with different variations depending on location and macro texture is mostly black and white which adds more variations. Later I often exchange the generated final base texture by hand to give each level individual colors, in that situation it is important to not have too much color in the detail textures, since they would not fit then.

If you make the detail texture a full color diffuse, it will probably never match the ground color, since the baste texture usually gives a slightly different color every meter ingame distance, but the full color detal texture will give you always the same.

Regarding the base texture it should be as big as your terrain like 1024x1024 terrain needs 1024x1024 base texture and it will vertex paint the terrain

So do not break a working well thought through system. I would consider Torques terrain system even better than other engines on mid ranges.
I gotta say i agree with what duion says above. I think there is some confusion about the detail maps, currently in the T3D system these should be a grey scale image described exactly as duion said above, the detail maps job is to provide detail not color.

Just some references:

Unity: https://docs.unity3d.com/462/Documentat ... xture.html
Cryengine 3: http://docs.cryengine.com/display/SDKDO ... ng+Terrain
Cryengine 5: http://docs.cryengine.com/display/SDKDOC2/Detail+Maps

With CryEngine 5, they have optimized this since CryEngine 3, the "diffuse" is still a single channel image.
LukasPJ
Site Admin
Posts: 402
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Tue Jul 11, 2017 4:14 pm

I gotta say i agree with what duion says above. I think there is some confusion about the detail maps, currently in the T3D system these should be a grey scale image described exactly as duion said above, the detail maps job is to provide detail not color.

Just some references:

Unity: https://docs.unity3d.com/462/Documentat ... xture.html
Cryengine 3: http://docs.cryengine.com/display/SDKDO ... ng+Terrain
Cryengine 5: http://docs.cryengine.com/display/SDKDOC2/Detail+Maps

With CryEngine 5, they have optimized this since CryEngine 3, the "diffuse" is still a single channel image.
The issue with that, is that you might want micro-control over color on the terrain. E.g. for painting a flower on the grass, how would that work if the detail maps are just for gray-scale image-detail?
  • 1
  • 2
  • 3
  • 4
  • 5
  • 10
94 posts Page 3 of 10

Who is online

Users browsing this forum: SqHd and 5 guests