Sign in to follow this  
ViperG

Selective Clearing of Alpha Buffer

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this