Selective Clearing of Alpha Buffer
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement