Particles Render Behind Alpha Blended Mesh

In this PG - Babylon.js Playground, the particles are rendering behind the alpha blended mesh, even though the z position of the particles is less than the mesh. I would assume the particles themselves are alpha-blended so I would expect that my custom render order would ensure that the particles render after the alpha blended mesh that has a greater z, but this does not appear to be the case. Note that setting the custom rendering order doesn’t change this behavior, but I need a custom render order in any case for my application. How do I get the particles to render after alpha blended meshes with greater z values?

Setting rendering group Id for the particles isn’t really an option for me either as I don’t want particles to always render on top, i.e. if the particles are emitter from a mesh that is behind another mesh, and I’m already using multiple rendering groups to deal with other render order problems with alpha blended meshes.

The particle systems are rendered before the alpha blended meshes. As alpha blended objects don’t write to the zbuffer, the order they are drawn is significant, indeed.

No, there are really two different loops in the render function: the first loop renders all the particle systems and the second loop all the alpha blended meshes.

You won’t be able to interleave particles and alpha blended meshes: you can either have the current working state, which draws the particles first then the meshes, or change the renderingGroupId value.

1 Like

Thank you very much for the quick response.