Sorting of mesh with vertex colors and custom shader

The bad mesh is considered as transparent, so it won’t write to the depth buffer and the faces will be displayed in a “random order” (actually, in the order they are defined in the mesh geometry).

Make sure that mesh.hasVertexAlpha == false and mesh.visibility == 1, else the mesh will be considered to have transparency.

1 Like