My texture is break!


The upper texture is 0.002f higher than the lower one!

z-fight issue. change frustrum to fix it a little, or use bigger value than 0.002f, but anyway you do it wrong overall.

if you want to have 2 textures, mix them in shader. its a proper way.

1 Like

i cant use shader becaue! the terrain like war3! i have 10 textureLords_Grass and one texture can use uv to show 32 texture! so , if i use the shader then i will get 10*32^4 material! too many material!

You cannot solve the problem the way you are going. That’s just a fact.

You will either have to write your own shader that combines your layers or structure your problem in a different way that can use the default shaders. (For example, if your bottom and top meshes are identical except for the texture coordinates, ie: identical vertex positions then you should render them in EXACTLY the same location and set the Z-test function to equals… and make sure the bottom layer is always drawn first (custom sort order).

set the Z-test function to equals? can i get more info?