aWeirdo Posted September 12, 2016 Share Posted September 12, 2016 Hi guys, i notised that when using terrain material, the transition between two materials is very dark and not very pretty to look at.. I found out that you can fix it by throwing in 1-2 pixels of the two meeting colors mixed together 50/50, e.g. red & green = yellow But doing that manually on a large scale is rather time consuming so i wanted to ask here if anyone knows if the "darkening" can be avoid via coding. examples: //The terrain material PG with flat ground, the darkness is very visible around the small spot of bricks.http://www.babylonjs-playground.com/#E6OZX#55 //Side by side comparison, you can see where the yellow line is added, there is no darkness between the textures, but where it changes between blue & green the edges are darkend slightly. //Better visiblity of the darkness, Here the dark "outline" is very distinct Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted September 14, 2016 Share Posted September 14, 2016 hi this is your alternative solution if you can not find your solution in standard material you can fix that with customshader http://www.babylonjs-playground.com/#E6OZX#58 Wingnut and aWeirdo 2 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted September 14, 2016 Author Share Posted September 14, 2016 @NasimiAsl That is awesome Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted September 14, 2016 Share Posted September 14, 2016 you welcome for complete this ask anything you want Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted September 15, 2016 Share Posted September 15, 2016 Hello @aWeirdo Actually, the terrain material mixes the 3 textures according to RBA (just a simple mix). If I understand, do you prefer to mix only R and G if B is equal to 0 ? (for example) Thanks ! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted September 15, 2016 Share Posted September 15, 2016 in shaderBuilder you can mix 8 color black ,red ,green ,blue, yellow ,cyan ,pink , white and you can use step too ( for example 0-255 > 0-50 , 50-100 , 100 - 150 , 150-200 , 200-255 ) usage 1. get Mixed Reference .Reference( [ref number = 1] , BABYLONX.Helper().Map({ path:'mixMap' }).Build() /* mak mix map material */ ) 2. replace your Color with your wanted Material .Red( [ref number = 1] , BABYLONX.Helper(). [custom material ] .Build() , option ) // You can use all 8 color 3. option : export interface IReplaceColor { rangeStep: any, // control your color area 0.4888 (nan range) -0.4888 (full range) rangePower: any // control your color power 0. (default) colorIndex: number, // choose color index 0-4 colorStep: number, // count of color level for example 5 => 0-51 ,52 - 102 , ... indexToEnd: boolean, // if that is true fill your color from index to end of color } julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted September 15, 2016 Author Share Posted September 15, 2016 4 hours ago, Luaacro said: Hello @aWeirdo Actually, the terrain material mixes the 3 textures according to RBA (just a simple mix). If I understand, do you prefer to mix only R and G if B is equal to 0 ? (for example) Thanks ! Hi @Luaacro What i ment was that if you go strait from red to blue or blue to green or green to red, the transition between the textures are darkend, if you look at my second picture in the original post, you can see a clear dark outline where the textures transition between grass and grass with dirt spots Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.