My texture is break!

4L4DD6ZJ3F65E`2%KK$7$91

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

https://wiki.jmonkeyengine.org/jme3/beginner/hello_terrain.html#what-is-texture-splatting

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?

https://javadoc.jmonkeyengine.org/v3.x/com/jme3/material/Material.html#getAdditionalRenderState--

https://javadoc.jmonkeyengine.org/v3.x/com/jme3/material/RenderState.html#setDepthFunc-com.jme3.material.RenderState.TestFunction-