Jump to content
  • Advertisement
Sign in to follow this  
swinchen

OpenGL, Blending and Depth Buffer

This topic is 4850 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

Hi I am just creating what I thought was a simple little demo. I have a solid object in the middle of the screen and I want to simulate bubbles rising around this "rock". So I made up a couple quick .tga files and made them mostly transparent and they look ok. So to simulate the bubbles rising around this rock, I am thinking perhaps a particle system would be the way to go, and use Alpha blending to get the "clear" look for the bubbles. So long story short... when using alpha blending, the correct way to draw on the screen is: 1) Enble Depth Buffer 2) Draw all non transparent objects first (the rock) 3) Enable Blending 4) Draw (alpha < 1.0f) objects to the screen in reverse order (lowest z first) 5) Disable Blending 6) Swap Buffers Does this sound about right? Thanks, Sam EDIT: The reason I ask is because I have seen a lot of demos on the net that do strange tricks with disabling the depth buffer, and these make no sense to me. I don't understand how they even get the desired effect.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!