### Blending mode for terrain materials....

Friendly conversations, and everything that doesn't fit into the other forums.
• 1
• 6
• 7
• 8
• 9
• 10

#### Re: Blending mode for terrain materials....

Timmy
Posts: 351
Joined: Thu Feb 05, 2015 3:20 am
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.
There is only 4 lines of code to switch between the methods, so should be easy enough for ya to keep the current method in place for your game build. Fire me a PM if you are doing a merge with the GG development branch and i will point you to area that was changed so you can ignore it. Well that is provided these changes even go into the GG repo, i only passed along a potential 'fix', nothing more

#### Re: Blending mode for terrain materials....

LukasPJ
Site Admin
Posts: 382
Joined: Tue Feb 03, 2015 7:25 pm

All you need to do to fix the over dark areas is to brighten up the texture by 10-20 points.
Could you make an example of that with the @ JeffR textures? Just using the albedo as detail?
And is it always the same level it needs to brighten with? It's possible to add a "brighten" setting to the texture layer.

#### Re: Blending mode for terrain materials....

Timmy
Posts: 351
Joined: Thu Feb 05, 2015 3:20 am
All you need to do to fix the over dark areas is to brighten up the texture by 10-20 points.
Could you make an example of that with the @ JeffR textures? Just using the albedo as detail?
And is it always the same level it needs to brighten with? It's possible to add a "brighten" setting to the texture layer.
If ya have photoshop look at the histogram and check the mean avg. 0 - 127 will darken , 128 will keep the same 129-255 will be brighter. If you bring those values into floating point range which the shaders use just do mean_avg * 1/255. Than take that number and multiply by 2 and minus 1, now you have an easy reference, if the number is positive it goes bright if the number is negative it goes dark

#### Re: Blending mode for terrain materials....

Timmy
Posts: 351
Joined: Thu Feb 05, 2015 3:20 am
One other method you could do, this one is for peeps that prefer grey scale only, change this https://github.com/GarageGames/Torque3D ... #L571-L572 (this would need to be changed for MFT_TerrainSideProject feature and also for the macro version too and glsl) .
//Enforce GreyScale only
meta->addStatement(new GenOp("      @ = ( @.Sample( @, @.xy ).rrrr * 2.0 ) - 1.0;\r\n",detailColor, detailTex, detailMap, inDet));
Impossible than to have a detail with color this way. Not suggesting this be changed in the main repo but if that is your personal preference, that is how you do it.

#### Re: Blending mode for terrain materials....

Duion
Posts: 997
Joined: Sun Feb 08, 2015 1:51 am

OK I made some tests using that fix:

normal: http://duion.com/files/temp/bugs/DRday_021-0002.png fixed: http://duion.com/files/temp/bugs/fixedD ... 2-0000.png

close normal: http://duion.com/files/temp/bugs/DRday_021-0000.png close fixed: http://duion.com/files/temp/bugs/fixedD ... 0-0000.png

very close normal: http://duion.com/files/temp/bugs/DRday_021-0001.png very close fixed: http://duion.com/files/temp/bugs/fixedD ... 0-0001.png

Conclusion: The current method results in high contasts and more color and the fixed version does avoid high contrasts and dark spots and has less color.

I did not adjust the textures in any way, but I noticed that I can increase the texture strength easily up to 2 times the intensity depending on texture without getting too high contrasts and black or white spots, which results in better detail. This means that I could now go and raise the strength of each terrain texture layer up to 2 times the intensity depending on texture around 1.5 average seems to work and get more closeup detail without getting black or white spots. So there may be an advantage there also the textures can look more original.

PS: Also when I would switch algorithms now, there would be no need for me to adjust anything, it still looks fine, just occasionally some textures could use a higher strength value which can be done in Torque directly.

#### Re: Blending mode for terrain materials....

Duion
Posts: 997
Joined: Sun Feb 08, 2015 1:51 am

Some more tests on another map:

Old:
http://duion.com/files/temp/bugs/screen ... 3-0000.png

With fix:
http://duion.com/files/temp/bugs/screen ... 4-0000.png

With fix and more texture strength on the cliffs:
http://duion.com/files/temp/bugs/screen ... 5-0000.png

So as you can see that in the first image (the current method) the texture on the cliffs is already close to black at some spots, especially in the shadow, so if you were to increase the texture strength there it would fade into total black and look ugly.
But in the second image everything is more bright and washed out, but this is not so much of a problem, since it allows you to add more texture strength as I have shown in image three on the cliffs. So I now have much more texture in the detail as well as macro texture and it is still not as close to black as in the first image.
A little downside is that the new method washes out the colors, but that is not that bad, but less color makes it look more realistic and if you really wanted you could just add more color in the textures to make off for it.

#### Re: Blending mode for terrain materials....

Timmy
Posts: 351
Joined: Thu Feb 05, 2015 3:20 am
Some more tests on another map:

Old:
http://duion.com/files/temp/bugs/screen ... 3-0000.png

With fix:
http://duion.com/files/temp/bugs/screen ... 4-0000.png

With fix and more texture strength on the cliffs:
http://duion.com/files/temp/bugs/screen ... 5-0000.png

So as you can see that in the first image (the current method) the texture on the cliffs is already close to black at some spots, especially in the shadow, so if you were to increase the texture strength there it would fade into total black and look ugly.
But in the second image everything is more bright and washed out, but this is not so much of a problem, since it allows you to add more texture strength as I have shown in image three on the cliffs. So I now have much more texture in the detail as well as macro texture and it is still not as close to black as in the first image.
A little downside is that the new method washes out the colors, but that is not that bad, but less color makes it look more realistic and if you really wanted you could just add more color in the textures to make off for it.
Thanks for all the examples. If anyone else wants to test it but doesn't like dealing with git, just pm or something and i'll chuck up a binary for testing with these changes, i can supply a windows, linux or mac binary.

#### Re: Blending mode for terrain materials....

damik
Posts: 36
Joined: Thu Jun 23, 2016 12:02 pm
i don't understand what this happen )), but this my screenshots before and after
befor

after

#### Re: Blending mode for terrain materials....

damik
Posts: 36
Joined: Thu Jun 23, 2016 12:02 pm
Some more tests on another map:
Thanks for all the examples. If anyone else wants to test it but doesn't like dealing with git, just pm or something and i'll chuck up a binary for testing with these changes, i can supply a windows, linux or mac binary.
sorry, up images is default blending

#### Re: Blending mode for terrain materials....

Duion
Posts: 997
Joined: Sun Feb 08, 2015 1:51 am

@
damik

What have you done? I don't think this is terrain blending since the other models are also different.
• 1
• 6
• 7
• 8
• 9
• 10

#### Who is online

Users browsing this forum: No registered users and 2 guests