Is color writing possible on SolidParticleSystems?

Hey, in the following project I have an object (e.g. sphere) with an occlusion effect by enabling/disabling color writing so that other objects behind the invisible object are also invisible.
Is it possible to apply this effect to particles in a SolidParticleSystem (SPS)? I have tried it in the following project, but without success (commented out lines).

Thanks in advance!


Welcome aboard!

If you want your SPS particles to occlude other meshes, they should be rendered before these meshes. In Babylon, meshes are sorted by material id, so you should create the material used by the SPS mesh before the material of the other objects.

Also, you can create a material, disable color write for it, and assign this material to the SPS mesh instead of changing the engine state:


Thank you, just what I wanted! :smiling_face: