I have a model of a car that is currently using the Standard-Opaque shader, with a metallic look applied to it.
At some point in my game, I wish for this car to Fade out, by turning Transparent. However, when I change the material to Standard-Transparent, the mesh z-depth appears very incorrect.
As you can see, mesh from a non-visible angle are appearing. In fact using the Transparent / Fade shader on any complex mesh always gives incorrect results.
For those still struggling with this like me, Unity has a say in it:
Look under “Transparent shader with depth writes”.
Like the people above said, the transparent Shaders ignore Z-Order. Just write a new Shader, using the code provided on the link. It will enable Z-Order and call the standard transparent Shader. Worked like a charm here.
this is a classic computer rendering problem. transparent polygons are not sorted, they are rendered in arbitrary order. your model has a lot of internal geometry. When rendering solid… z-buffer sorting solves your issue. But not when transparent, as sorting is off…
several options… none too simple.
Get a car model without so much internal geometry… it will still have the render problem, but not look as bad
Get a 2 pass shader… with Z-write enabled, that renders z-depth only first… then renders again the transparent polygons, will solve your issue as it will only render the closest geom, not internal geometry, but hard to find that shader perhaps. Try the unity shader wiki (I’d go with this option)
The rendering procedural will be “Cutout → Skybox → Transparent → Geometry” instead of “Geometry → Cutout → Skybox → Transparent”.
Just my guess, I don’t have material displayed like that for testing.