Blending mode for terrain materials....

Friendly conversations, and everything that doesn't fit into the other forums.
93 posts Page 7 of 10
Bloodknight
Posts: 95
Joined: Tue Feb 03, 2015 8:58 pm
by Bloodknight » Thu Jul 20, 2017 12:20 am
I think the issue is more one of an emergent behaviour based on more than one change in a variety of slightly different systems, rather than a specific decision made on a particular part.

Or at least that is my understanding after the past few hours or work and discussion by those smart enough to fix such things :)
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Thu Jul 20, 2017 4:20 am
Bloodknight wrote:Or at least that is my understanding after the past few hours or work and discussion by those smart enough to fix such things :)


*Edit: I won't even bother
Azaezel
Posts: 385
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Thu Jul 20, 2017 5:56 am
Caleb wrote:So if everyone here believes that being able to choose the older blending behavior and greyscale detail really adds something to T3D 4.0 moving forward, then absolutely keep it in. If its left in for any other reason. . . please just trash it.

I'm not trying to start an argument. Just adding my two cents.


The financial argument is being able to have that many more sources to get art from.

Unlike the upcoming kill-off of the concepts behind specular maps, this would be one hit for folks we can mitigate without causing retooling nightmares since we're just talking an internal shadergen switch, not unlike the https://github.com/Azaezel/Torque3D/blo ... SL.cpp#L81 bit for folks more familiar with old specular greyscales vs a metalness/roughness workflow. (they go in opposite directions for similar, but not truly equal, outcomes.)
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Thu Jul 20, 2017 7:06 am
I modified shadergen in the current development version and tweaked the blending and got the following results:

Current unmodified development version (see below for explanation):
Image

Torque 3.8(this is before the linear changes that cause the above):
Image

Tweaked blending with development version:
Image

So the tweaked version is pretty close to the original results in older versions of T3D (versions before the linear change over)

One thing to note is in the source code here https://github.com/GarageGames/Torque3D/blob/development/Engine/source/terrain/hlsl/terrFeatureHLSL.cpp#L563-L573 . What is happening is the detail texture is getting brought from a 0 -> 1 (0-255) range into a -1 -> 1 range. So if the brightness is 0.5 in the original texture(128) than that value is mapped to 0, it won't darken or brighten your base texture. if your value is below 0.5 or above 0.5 is will darken or brighten the base color. The final equation is here https://github.com/GarageGames/Torque3D ... L.cpp#L585 ... output += detailColor * detailBlend; The reason the first picture in my example is so dark is because the output color is in linear space which actually gives technically correct results, it just so happens the old method using gamma space looks better for most cases. So much so that CryEngine actually manually converts the 'outColor' back to gamma space, perform the final maths operation and than convert back to linear space. So yep that method is exactly what i used to produce the last screenshot, it effectively is restoring the old blend method or at least a result that is pretty darn close to it.
Duion
Posts: 837
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Jul 20, 2017 11:39 am
So looks like we found the "bug", even though probably unrelated to the initial issue.
It looks to me that the 3.9 changes improved the overall look of the terrain, making it more realistic, but also made the whole blending more sensitive so you hit black and white spots more early.
Did you use the same method as Cry Engine?
LukasPJ
Site Admin
Posts: 358
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Thu Jul 20, 2017 12:06 pm
The change in blending, that Timmy mentioned, has a PR here : https://github.com/GarageGames/Torque3D/pull/2051 so you can try it out for yourself is anyone is interested.
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Thu Jul 20, 2017 12:42 pm
Duion wrote:So looks like we found the "bug", even though probably unrelated to the initial issue.
It looks to me that the 3.9 changes improved the overall look of the terrain, making it more realistic, but also made the whole blending more sensitive so you hit black and white spots more early.
Did you use the same method as Cry Engine?


I only borrowed the idea of doing the blending in gamma space even though they are using a full linear pipeline like we now are. So the blending equation is completly unchanged from T3D 3.8. I'm guessing the CryEngine guys either ran into the same problem we did or maybe they didn't want to break older projects or they just liked the results this way better? Anyway hopefully the blending should be back to how everyone was used to in T3D 3.8 and earlier (i honestly can't remember if we switched to linear pipeline in 3.9 or 3.10). There still are few differences compared to the old way but i think the results are pretty close.
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Thu Jul 20, 2017 12:59 pm
oh yeah i should point out, if you want to see the difference between using the correct color space and the incorrect one, look at the color of the sand texture in picture 3 from my above post and compare it to picture 2, picture 2 is T3D 3.8 which is incorrect, you will notice it is brighter and has a more yellow tinge compared to picture 3. If you open that texture in photoshop picture 3 will match up perfectly and picture 2 will not
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
  by Timmy » Thu Jul 20, 2017 1:12 pm
Sorry my last post on the subject, my apologies if i come across angry or grumpy to anyone, i just didn't want to see a battle tested method get scrubbed. I'm not against a new way of doing the texturing and especially if it could be done in a way that preserves the current method and gives the user a choice. There have been some really nice advancements with this stuff in other engines like used in Battlefield and FarCry that use virtual textures (improved method based on the original Id mega textures), having unlimited layers and decals i'm sure is an artists wet dream :lol:
Duion
Posts: 837
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Jul 20, 2017 2:17 pm
Well that picture 2 is wrong we pretty much agree upon I think, but picture 1 and 3 have the same color but the intensity is different.
Now the question is which method is actually better, picture 1 or picture 3.
I already adapted all my levels and textures to work well with the new method, so before I change everything back I need to decide if there is actually any real benefit.
It is a bit deceptive marketing if you use textures adapted to an old method and use them unchanged with new methods they are not adapted for, obviously they will look wrong, since they are not made for that, so just because one test looks better than the other proves not much at this point.
All you need to do to fix the over dark areas is to brighten up the texture by 10-20 points.
93 posts Page 7 of 10

Who is online

Users browsing this forum: No registered users and 3 guests