![]() -> Click here to learn how to get live help <- |
GLSTENCILOPIndexNAMEglStencilOp - set stencil test actionsC SPECIFICATIONvoid f3glStencilOpfP( GLenum fIfailfP,f2failfP Specifies the action to take when the stencil test fails. Six symbolic constants are accepted: %f3GL_KEEPfP, %f3GL_ZEROfP, %f3GL_REPLACEfP, %f3GL_INCRfP, %f3GL_DECRfP, and %f3GL_INVERTfP. The initial value is %f3GL_KEEPfP.
DESCRIPTIONStenciling, like depth-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the value in the stencil buffer and a reference value. To enable and disable the test, call %f3glEnablefP and %f3glDisablefP with argument %f3GL_STENCIL_TESTfP; to control it, call %f3glStencilFuncfP. %f3glStencilOpfP takes three arguments that indicate what happens to the stored stencil value while stenciling is enabled. If the stencil test fails, no change is made to the pixel's color or depth buffers, and f2failfP specifies what happens to the stencil buffer contents. The following six actions are possible.
NOTESInitially the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil tests always pass, regardless of any call to %f3glStencilOpfP.ERRORS%f3GL_INVALID_ENUMfP is generated if f2failfP, f2zfailfP, or f2zpassfP is any value other than the six defined constant values. %f3GL_INVALID_OPERATIONfP is generated if %f3glStencilOpfP is executed between the execution of %f3glBeginfP and the corresponding execution of %f3glEndfP.ASSOCIATED GETS%f3glGetfP with argument %f3GL_STENCIL_FAILfP%f3glGetfP with argument %f3GL_STENCIL_PASS_DEPTH_PASSfP %f3glGetfP with argument %f3GL_STENCIL_PASS_DEPTH_FAILfP %f3glGetfP with argument %f3GL_STENCIL_BITSfP %f3glIsEnabledfP with argument %f3GL_STENCIL_TESTfP SEE ALSO%f3glAlphaFunc(3G)fP, %f3glBlendFunc(3G)fP, %f3glDepthFunc(3G)fP, %f3glEnable(3G)fP, %f3glLogicOp(3G)fP, %f3glStencilFunc(3G)fP
Index |