Order independent transparency in particle system
- by Stepan Zastupov
I'm writing a particle system and would like to find a trick to achieve proper alpha blending without sorting particles because:
Each particle is a point sprite in a single mesh and I can't use scene graph ability to sort transparent nodes. The system node should be properly sorted, though.
Particle position is computed on shader from initial velocity, acceleration and time. In order to sort the system I would have to perform all this computations on CPU, which is something I want to avoid.
Sorting hundreds of particles against camera position and uploading it on GPU each frame seams to be quiet heavy operation.
Alpha testing seems to be fast enough on GLES 2.0 and works fine for non-transparent but "masked" textures. Still, it's not enough for semi-transparent particles.
How would you handle this?