Particle systems

Started by
2 comments, last by Necator 22 years, 1 month ago
I''ve read trough a couple of articles covering particle systems, but I cant figure one thing out, how to maintain depth buffer when rendering particles? Ie. In NeHe''s particle article (I beleve it''s nr 16) the code disables depth buffering & enables blending, but if you got an object in front of the particles, will that not make the particles draw on top of the object if rendered later then the object?? If so, how to get around the problem? [Edited by - Necator on May 29, 2007 11:16:15 AM]
Advertisement
How you use the depth buffer in relation to particle systems depends somewhat on what you''re trying to do. One solution that works in most cases is to leave the depth test enabled, but to disable depth buffer writes. This prevents the problem you mention, but allows the particles to be blended together nicely. Of course, for this to work properly, you need to render your particle system after everything else has been rendered.
How to disable the depth buffer writes?
buy the red book
gldepthmask(false)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

This topic is closed to new replies.

Advertisement