'\" t .\" Title: glStencilOpSeparate .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 01/03/2018 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "GLSTENCILOPSEPARATE" "3G" "01/03/2018" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" glStencilOpSeparate \- set front and/or back stencil test actions .SH "C SPECIFICATION" .HP \w'void\ glStencilOpSeparate('u .BI "void glStencilOpSeparate(GLenum\ " "face" ", GLenum\ " "sfail" ", GLenum\ " "dpfail" ", GLenum\ " "dppass" ");" .SH "PARAMETERS" .PP \fIface\fR .RS 4 Specifies whether front and/or back stencil state is updated\&. Three symbolic constants are valid: \fBGL_FRONT\fR, \fBGL_BACK\fR, and \fBGL_FRONT_AND_BACK\fR\&. .RE .PP \fIsfail\fR .RS 4 Specifies the action to take when the stencil test fails\&. Eight symbolic constants are accepted: \fBGL_KEEP\fR, \fBGL_ZERO\fR, \fBGL_REPLACE\fR, \fBGL_INCR\fR, \fBGL_INCR_WRAP\fR, \fBGL_DECR\fR, \fBGL_DECR_WRAP\fR, and \fBGL_INVERT\fR\&. The initial value is \fBGL_KEEP\fR\&. .RE .PP \fIdpfail\fR .RS 4 Specifies the stencil action when the stencil test passes, but the depth test fails\&. \fIdpfail\fR accepts the same symbolic constants as \fIsfail\fR\&. The initial value is \fBGL_KEEP\fR\&. .RE .PP \fIdppass\fR .RS 4 Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled\&. \fIdppass\fR accepts the same symbolic constants as \fIsfail\fR\&. The initial value is \fBGL_KEEP\fR\&. .RE .SH "DESCRIPTION" .PP Stenciling, 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\&. .PP 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 \fBglEnable\fR() and \fBglDisable\fR with argument \fBGL_STENCIL_TEST\fR; to control it, call \fBglStencilFunc\fR() or \fBglStencilFuncSeparate\fR()\&. .PP There can be two separate sets of \fIsfail\fR, \fIdpfail\fR, and \fIdppass\fR parameters; one affects back\-facing polygons, and the other affects front\-facing polygons as well as other non\-polygon primitives\&. \fBglStencilOp\fR() sets both front and back stencil state to the same values, as if \fBglStencilOpSeparate\fR() were called with \fIface\fR set to \fBGL_FRONT_AND_BACK\fR\&. .PP \fBglStencilOpSeparate\fR 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\*(Aqs color or depth buffers, and \fIsfail\fR specifies what happens to the stencil buffer contents\&. The following eight actions are possible\&. .PP \fBGL_KEEP\fR .RS 4 Keeps the current value\&. .RE .PP \fBGL_ZERO\fR .RS 4 Sets the stencil buffer value to 0\&. .RE .PP \fBGL_REPLACE\fR .RS 4 Sets the stencil buffer value to \fIref\fR, as specified by \fBglStencilFunc\fR()\&. .RE .PP \fBGL_INCR\fR .RS 4 Increments the current stencil buffer value\&. Clamps to the maximum representable unsigned value\&. .RE .PP \fBGL_INCR_WRAP\fR .RS 4 Increments the current stencil buffer value\&. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value\&. .RE .PP \fBGL_DECR\fR .RS 4 Decrements the current stencil buffer value\&. Clamps to 0\&. .RE .PP \fBGL_DECR_WRAP\fR .RS 4 Decrements the current stencil buffer value\&. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero\&. .RE .PP \fBGL_INVERT\fR .RS 4 Bitwise inverts the current stencil buffer value\&. .RE .PP Stencil buffer values are treated as unsigned integers\&. When incremented and decremented, values are clamped to 0 and 2 n \- 1, where n is the value returned by querying \fBGL_STENCIL_BITS\fR\&. .PP The other two arguments to \fBglStencilOpSeparate\fR specify stencil buffer actions that depend on whether subsequent depth buffer tests succeed (\fIdppass\fR) or fail (\fIdpfail\fR) (see \fBglDepthFunc\fR())\&. The actions are specified using the same eight symbolic constants as \fIsfail\fR\&. Note that \fIdpfail\fR is ignored when there is no depth buffer, or when the depth buffer is not enabled\&. In these cases, \fIsfail\fR and \fIdppass\fR specify stencil action when the stencil test fails and passes, respectively\&. .SH "NOTES" .PP Initially the stencil test is disabled\&. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes\&. .SH "ERRORS" .PP \fBGL_INVALID_ENUM\fR is generated if \fIface\fR is any value other than \fBGL_FRONT\fR, \fBGL_BACK\fR, or \fBGL_FRONT_AND_BACK\fR\&. .PP \fBGL_INVALID_ENUM\fR is generated if \fIsfail\fR, \fIdpfail\fR, or \fIdppass\fR is any value other than the eight defined constant values\&. .SH "ASSOCIATED GETS" .PP \fBglGet\fR() with argument \fBGL_STENCIL_FAIL\fR, \fBGL_STENCIL_PASS_DEPTH_PASS\fR, \fBGL_STENCIL_PASS_DEPTH_FAIL\fR, \fBGL_STENCIL_BACK_FAIL\fR, \fBGL_STENCIL_BACK_PASS_DEPTH_PASS\fR, \fBGL_STENCIL_BACK_PASS_DEPTH_FAIL\fR, or \fBGL_STENCIL_BITS\fR .PP \fBglIsEnabled\fR() with argument \fBGL_STENCIL_TEST\fR .SH "VERSION SUPPORT" .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ \fBOpenGL Version\fR T} T{ \fBFunction / Feature Name\fR T}:T{ \fB2\&.0\fR T}:T{ \fB2\&.1\fR T}:T{ \fB3\&.0\fR T}:T{ \fB3\&.1\fR T}:T{ \fB3\&.2\fR T}:T{ \fB3\&.3\fR T}:T{ \fB4\&.0\fR T}:T{ \fB4\&.1\fR T}:T{ \fB4\&.2\fR T}:T{ \fB4\&.3\fR T}:T{ \fB4\&.4\fR T}:T{ \fB4\&.5\fR T} .T& l c c c c c c c c c c c c. T{ \fBglStencilOpSeparate\fR T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} .TE .sp 1 .SH "SEE ALSO" .PP \fBglBlendFunc\fR(), \fBglDepthFunc\fR(), \fBglEnable\fR(), \fBglLogicOp\fR(), \fBglStencilFunc\fR(), \fBglStencilFuncSeparate\fR(), \fBglStencilMask\fR(), \fBglStencilMaskSeparate\fR(), \fBglStencilOp\fR() .SH "COPYRIGHT" .PP Copyright \(co 2006 Khronos Group\&. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1\&.0, 8 June 1999\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 1991-2006 Silicon Graphics, Inc. .br