View Full Version : Inverting stencil buffer

04-04-2005, 05:34 AM
I have a stencil-based mirror, which reflects objects.
In my special case I want to draw only to parts of the buffer, where the 'mirror' isn't visible. Can someone tell me how to invert the stencil buffer's bits, or at least how to draw outside the mirror?

Thx in advance

04-04-2005, 07:47 AM
Using the opposite test for stencil test should be enough.
ie inside mirror:
glStencilFunc(GL_EQUAL, 0, ~0);
for outside:
glStencilFunc(GL_NOTEQUAL, 0, ~0);