High precision sum?

Maybe you could use a n-pass algorithm (where n is the maximum number of overlapping particles). In combination with stenciling so you always render one layer per pass, and an occlusion query extension to know which particles have been rendered completely.

  1. clear the stencil buffer to zero, set the stencil function to EQUAL with reference value 0. Stencil operation should be INCR for stencil pass.
  2. render all particles. Because of stenciling, you only get one layer.
  3. increment the stencil reference value.
  4. swap render target and texture
  5. render all particles with occlusion query (maybe for particle groups)
  6. mark all particles that had zero pixels rendered as done, don’t use them in the next pass.
  7. go to 3. until all particles are done.