sorting problems with transparent materials and complex objects

Hello :slight_smile:

If I use transparent shader on a complex object, it renders with a strange sorting order (if I look at the object from behind, front parts of the object show up first, so it looks weird). I suppose this is a generic problem with transparency and can not be fixed - am I right?

big thanks!

Ok. I’ve solved the problem.

The idea for the fix is borrowed from AlphaVertexLitZ shader on the wiki.

You can add one additional pass to a transparent shader and the sorting will be ok.

SubShader { 
	Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
	LOD 400
	
	// Render into depth buffer only
    Pass {
        ColorMask 0
        }