Jump to content

Terrain Material is dark at texture transitions


aWeirdo
 Share

Recommended Posts

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.
terrainComparison.png


//Better visiblity of the darkness, Here the dark "outline" is very distinct
terrainComparison2.png

Link to comment
Share on other sites

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

}

 
   
   
   
   
   
   
Link to comment
Share on other sites

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 :) 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...