- Home /
A mesh behind other meshes appears above depending on viewing distance.
Hi.
I am have some trouble with my rendering. It seems like meshes renders weirdly depending on their distance from the viewing point (not even the camera since I have this glitch also in the editor window)
It might be difficult to understand the problem I'm having since it is difficult to explain and I don't have a perfect english, so here is a picture to explain myself :
As you can see on the first picture I can see the crystal and the shadow (it's a plane mesh with a particle shader) of the tower.
On the second picture, I went a bit backwards and the shadow disapeared and the ground (also a plane with a texture on it) appears on top of the crystal.
If I disable the ground, I can see the shadow and the crystal normally no matter the distance, so I guess the issue comes from my ground prefab. Thank you for your help :)
Answer by FortisVenaliter · May 14, 2015 at 04:32 PM
Two things I recommend you check:
Make sure all materials that do not contain transparency are set to "Opaque". Otherwise, they may be rendering out-of order.
Make sure your camera's near and far clip values are not too far apart. Rule of thumb is that a ratio of 1:1000 for near:far is the maximum. If they're too far, you'll get what is called "Z-fighting"
I think your point 1 is the way to go. The problem comes from the shaders.
When I change the transparent material of the crystal and I change the shadows with an opaque shader everything is O$$anonymous$$.(it's obviously not what I'm looking for but it's just for testing).
If I use a "Cutout" or "Transparent" shader of the ground material everything is also O$$anonymous$$. However for some reason when I export to android cutout textures are invisible so I try to stick with vertexlit opaque shaders.
All my shaders are derived from $$anonymous$$obile/VertexLit exept for the transparent ones like the shadows and the crystal.
O$$anonymous$$ so I can't really tell why but everything is fine now. I haven't really changed anything but the issue was certainly in the shaders. Thank you. Problem solved !
Your answer
Follow this Question
Related Questions
3D Object Scrolling Panel 0 Answers
Mesh Clipping / Cross Sections 1 Answer
How to acheive wireframe effect with dots? 0 Answers
Render inside of mesh as black 2 Answers