Jump to content
  • Advertisement
Sign in to follow this  
ViperG

Selective Clearing of Alpha Buffer

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

I use the alpha buffer to do a blend check, but then I want to clear that section of the alpha buffer (by making the area that changed to 1 to change back to 0) Doing a full screen clear in the alpha buffer is too expensive and I want to avoid doing that. I am able write into the with the stencil buffer with a 1 or 0, but I cant seem to get parts of the alpha buffer to clear.

Share this post


Link to post
Share on other sites
Advertisement
Just throwing out some ideas for you. If I understand you correctly you have an alpha component for the back buffer you want to clear.

glColorMask( 0,0,0, 1 ); // turns off all color bits being written
// disable blending
glColor( 0.0f, 0.0f, 0.0f, 0.0f ); // set alpha color to zero
// draw quad or tri
glColorMask( 1,1,1, 1 ); // re-enable colors

Share this post


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

  • 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!