Jump to content
  • Advertisement

Archived

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

real2real

Alpha Blending & Depth trouble :o/

This topic is 5727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!