Hello,
I have a problem with the shadergraph, I have created texture mixing according to the depth of the terrain via Triplanar and it gives me this weird distortion of the textures. It only does it at sharp edges and I don’t know where the problem is and I don’t even know how to solve this. I have Blend set to 5 and more doesn’t affect anything.
Can someone advise me how to solve this? There is also a SampleTexture2D option, but there, on the contrary, the texture is deformed according to the UV, but it actually looks better than this with Triplanar.
This appears to be caused by terrain vertex normals that are blended/smoothed across the sharp edges instead of hard. It’s making the lighting look wrong on the sharp angles as well. Terrain isn’t really designed to do hard edges like this. Does your project have other areas where the shapes are smooth, or are all of the angles hard?
This is how it looks when I deform it via script (digging). It does not create such sharp edges as in the one above, but that depends on how the player “digs” it. It may happen that in the end such sharp edges can arise there. The most of the transition can be seen at the very bottom, there is a terrain limitation (intentionally). As such, I will then adjust the shader so that the transitions are smooth and not a cut-off texture where another one follows, but I still can’t get past the sharp edges with a deformed texture and I don’t know how to solve it. I will use my first shadergraph where I use everything via SampleTexture2D, but there again the problem arises that the texture of the clay is deformed according to the UV and is then disgustingly stretched (but at least it doesn’t make nasty sharp edges). I don’t care how I solve it, but mainly that it is solved somehow.
Btw, I deliberately made the hole like this so that I could test the changes in the shadergraph if I accidentally fix it.
Edit: I also thought of mixing it somehow, using SampleTexture2D for grass and bedrock (the bottom layer) and solving the clay (middle layer) in some way.
In my local tests, I’m able to reduce the streaking artifacts significantly if I set the Triplanar node’s Blend value to 32 or higher. I know that you said in your original post that it didn’t make a difference, but does it help if you set it to 32 or 64?
Unfortunately, everything above 5 has no effect
I created a shadergraph where I mix classic SampleTexture2D with a middle layer (triplanar) and it looks “good” compared to previous shadergraphs. It’s still not perfect, but I think I can leave it like that for now, but it will need to be properly fixed again. Here the textures have no intersection, but where the first ends, the second begins. I’ll leave it like this for now so I can continue development. In any case, I will still be happy for a better solution, where I can best use triplanar everywhere, even with smooth transitions of textures.
I am attaching the current shadergraphs as they are made. I currently have it set to _Mixed
9348119–1307687–ShaderGraphs.rar (65.2 KB)