Download

Objects disappearing behind each other

I have a simple scene with a terrain mesh and some trees on it. For some reason, the terrain mesh is either appearing completely behind the trees or completely in front of them, depending on the view angle.

Here it is behind the trees (the roots should be hidden under the ground):

e1d2f1253529b1f4aed72d3eae07f09f8e0498f6.jpeg

Here it is in front of the trees:

786321b857ab450bd36c17828e117607568a819e.jpeg

It pops between these two states when I pan the camera above and below a certain height.

Does anyone know why this could be happening?

Are any of your materials using translucency?

Yes, all the materials use translucency. Is there some specific setting causing this to happen?

You can use this information here Using Transparency | Unreal Engine Documentation . Using translucency this heavily shouldn’t be necessary, since I don’t see any parts of the meshes that are actually less than opaque. Setting the material blend mode to “Masked” instead of translucent should be helpful.

1 Like

Ah, seems like this might be down to translucency sort priority, but I’m not sure how I could fix that, since the terrain needs to be both behind and in front of the trees (in front of the roots, but behind the trunks), so I can’t easily assign it a sort priority number.

The reason I’m using translucent materials is that the materials can be switched from looking as they do above (more of a standard diffuse look) to an X-Ray kinda look which is using a shader that is transparent in the centre with fresnel glowing edges. I’m blending between the two with a parameter. However, since its encapsulated by a single material, the domain has to be set to translucent.

Maybe there’s an alternative way to go about this…

Seeing strange issues with depth too, but with meshes that are separated by huge distances.
Translucent materials aren’t at fault, the engine is just rendering certain depth inconsistently.
Sort Priority is tricky anyway because other parts of the level may suffer when you dial that up.