Make Custom Shader Contribute to the Depth Pass?

Just like it says, how does the standard materials shaders or the material itself allow the mesh to stay in the depth pass stack when applied? I assume its something in the shader but I might just be dumb.

I’ve noticed with one of my shaders, that the order the meshes get put on the scene with the shader is the order that the depth stack renders them, and they kinda glitch around. Which is not something I understand the cause of.

I enabled depthPrePasses on all the materials, and that fixed the sorting issues… but now there is a odd opacity error.

Move around and look at the pylon.
https://playground.babylonjs.com/#2M96BV

Hi Pryme8,

As I understand it, transparency is typically handled in a separate pass: opaque meshes are rendered first, then transparent meshes are rendered afterward. Since you’re not using meshes, it seems that logic ceases to apply, so I think you’ll either have to replace that logic with something else or specify the rendering order manually. If I had to guess, RenderingGroupId is probably the easiest way to get that behavior. It’s already available on SpriteManagers; would it be possible to add that to SpriteMaps as well?

I have a sneaking suspicion you are right, it is using a plane mesh though so I wonder why the behavior does not inherit from the plane.