Selective Clearing of Alpha Buffer

Started by
2 comments, last by ViperG 17 years, 11 months ago
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.
Black Sky A Star Control 2/Elite like game
Advertisement
bump
Black Sky A Star Control 2/Elite like game
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
yeah I want to write black (0) into the alpha buffer.

Thx ill try that
Black Sky A Star Control 2/Elite like game

This topic is closed to new replies.

Advertisement