Anyone has a working example using this extension??
Thanks
Anyone has a working example using this extension??
Thanks
From The OpenGL Extensions Guide :
The following code shows how a stencil shadow volume might be rendered using the GL_ATI_separate_stencil extension. Stencil operations are specified for both front-facing and back-facing polygons, and a single rendering pass is made. The RenderShadowVolume() function makes whatever calls are needed to render the shadow volume geometry.
glDisable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glEnable(GL_STENCIL_TEST);// Disable writes to color and depth buffers
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_FALSE);glStencilMask(~0);
glStencilFunc(GL_ALWAYS, 0, ~0);// Set front-facing stencil state
glStencilOpSeparateATI(GL_FRONT, GL_KEEP,
GL_KEEP, GL_INCR_WRAP_EXT);// Set back-facing stencil state
glStencilOpSeparateATI(GL_BACK, GL_KEEP,
GL_KEEP, GL_DECR_WRAP_EXT);// Perform single rendering pass
RenderShadowVolume();
Thanks