Archived

This topic is now archived and is closed to further replies.

real2real

Alpha Blending & Depth trouble :o/

Recommended Posts

Hey there. Using blending is easy... just draw first the "solid" things (i.e. the world) and then draw the blending objects ... heh. That''s theory. Now since I need to disable the depth test when drawing my particles, all the depth work is wrong ... well, if you already had to work with particles in a "real" world you should know what i''m talking about ... Anyone may help ?

Share this post


Link to post
Share on other sites
When draiwing your particles, don''t disable depth test, just disable depth writing.

That is, instead of doing :

  
draw_solid_things();
glDisable(GL_DEPTH_TEST);
draw_particles();
glEnable(GL_DEPTH_TEST);

do that :

  
draw_solid_things();
glDepthMask(GL_FALSE);
draw_particles();
glDepthMask(GL_TRUE);

Share this post


Link to post
Share on other sites