Lines Matching refs:stencil
41 This extension provides two-sided stencil testing where the
42 stencil-related state (stencil operations, reference value, compare
44 polygons. Two-sided stencil testing may improve the performance
50 Is this sufficient for shadow volume stencil update in a single pass?
54 An application that wishes to increment the stencil value for
56 decrement the stencil value for rasterized fragments of depth-test
67 glStencilOp(GL_KEEP, // stencil test fail
74 glStencilOp(GL_KEEP, // stencil test fail
84 conventional GL_INCR and GL_DECR operations, is to clear the stencil
85 buffer to one half the stencil buffer value range, say 128 for an
86 8-bit stencil buffer. In the case, a pixel is "in shadow" if the
87 final stencil value is greater than 128 and "out of shadow" if the
88 final stencil value is 128. This does still create a potential
89 for stencil value overflow if the stencil value saturates due
91 with two-sided stencil testing than the conventional two-pass
96 Contrast the two-sided stencil testing approach with the more
97 or less equivalent approach using facingness-independent stencil
110 glStencilOp(GL_KEEP, // stencil test fail
118 glStencilOp(GL_KEEP, // stencil test fail
126 conventional approach, but only once with the two-sided stencil
129 Should there be just front and back stencil test state, or should
130 the stencil write mask also have a front and back state?
132 RESOLUTION: Both the stencil test and stencil write mask state
135 The shadow volume application for two-sided stencil testing does
136 not require differing front and back versions of the stencil write
141 (assuming the stencil bufer is cleared to the binary value 1010):
143 1) front-facing polygons that pass the depth test set stencil bit 0
145 2) front-facing polygons that fail the depth test zero stencil bit 1
147 3) back-facing polygons that pass the depth test set stencil bit 2
149 4) back-facing polygons that fail the depth test zero stencil bit 3
164 glStencilOp(GL_KEEP, // stencil test fail
171 glStencilOp(GL_KEEP, // stencil test fail
179 Is there a performance advantage to using two-sided stencil testing?
189 transform-limited, or setup-limited, two-sided stencil testing can
193 a single two-sided stencil testing pass is advantageous.
195 Often applications using stencil shadow volume techniques require
212 Two-sided stencil has no similiar performance justification.
215 would increase the amount of overhead required to set stencil
216 state, even for applications that don't use two-sided stencil.
218 How should the two-sided stencil enable operate?
223 light model boolean, the two-sided stencil testing is a standard
226 Here is the pseudo-code for the stencil testing enables:
230 use two-sided stencil testing
232 use conventional stencil testing
235 no stencil testing
238 How should the two-sided stencil interact with glPolygonMode?
244 two-sided stencil testing still operates based on the original
245 polygon facingness if stencil testing and two-sided stencil testing
288 "The stencil test conditionally discards a fragment based on the
289 outcome of a comparison between the value in the stencil buffer at
293 using the symbolic constant STENCIL_TEST. When disabled, the stencil
297 Stencil testing may operate in a two-sided mode. Two-sided stencil
299 using the symbolic constant STENCIL_TEST_TWO_SIDE_EXT. When stencil
300 testing is disabled, the state of two-sided stencil testing does
303 There are two sets of stencil-related state, the front stencil
304 state set and the back stencil state set. When two-sided stencil
305 testing is enabled, stencil tests and writes use the front set of
306 stencil state when processing fragments rasterized from non-polygon
308 polygon primitives while the back set of stencil state is used when
310 For the purposes of two-sided stencil testing, a primitive is still
315 When two-sided stencil testing is disabled, the front set of stencil
316 state is always used when stencil testing fragments.
318 The active stencil face determines whether stencil-related commands
319 update the front or back stencil state. The active stencil face is
325 StencilOp, and StencilMask) that update the stencil state update the
326 front stencil state if the active stencil face is FRONT and the back
327 stencil state if the active stencil face is BACK. Additionally,
328 queries of stencil state return the front or back stencil state
329 depending on the current active stencil face.
331 The stencil test state is controlled with
339 "In the initial state, stencil testing and two-sided stencil testing
340 are both disabled, the front and back stencil reference values are
341 both zero, the front and back stencil comparison functions are ALWAYS,
342 and the front and back stencil mask are both all ones. Initially,
343 both the three front and the three back stencil operations are KEEP."
349 "The initial state is for both the front and back stencil plane mask
350 to be all ones. The clear operation always uses the front stencil
351 write mask when clearing the stencil buffer."
358 "Finally, each stencil index is written to its indicated location
359 in the framebuffer, subject to the current front stencil mask state
388 OpenGL 2.0 provides similar "separate stencil" functionality with an API
391 back state simultaneously. Non-separate stencil functions (e.g.,
394 stencil face.
397 support both styles of two-sided stencil usage without API modification,
400 three different sets of stencil state:
406 OpenGL 2.0 separate stencil functions set the front and "OpenGL 2.0" back
407 state. Non-separate stencil functions use the stencil face selector to
411 If the two-sided stencil enable in this extension is set, implying
414 appropriately when using the active stencil face selector provided by this
417 If the two-sided stencil enable in this extension is not set, implying
420 usage, the separate stencil functions set either of these two pieces of
421 state appropriately, and the non-separate stencil functions set both. In
422 "one-sided" EXT_stencil_two_side usage, the separate stencil functions
430 (modify 2nd paragraph, p. 202) There are three sets of stencil-related
431 state, the front stencil state set, the OpenGL 2.0 back stencil state set,
432 and the EXT_stencil_two_side back stencil state set. Stencil tests and
433 writes use the front set of stencil state when processing fragments
436 fragments rasterized from back-facing polygon primitives, stencil tests
437 and writes use the OpenGL 2.0 back stencil state set when
439 stencil state set otherwise. ...
444 FRONT_AND_BACK, the OpenGL 2.0 back stencil state is modified, but the
446 based on the active stencil face. If the active stencil face is FRONT,
447 the corresponding front and OpenGL 2.0 back stencil state are set to
448 identical values. If the active stencil face is BACK, the corresponding
461 STENCIL_FUNC 2xZ8 GetIntegerv ALWAYS Stencil function 4.1.4 stencil-bu…
462 STENCIL_VALUE_MASK 2xZ+ GetIntegerv 1's Stencil mask 4.1.4 stencil-bu…
463 STENCIL_REF 2xZ+ GetIntegerv 0 Stencil reference 4.1.4 stencil-bu…
465 STENCIL_FAIL 2xZ6 GetIntegerv KEEP Stencil fail action 4.1.4 stencil-bu…
466 STENCIL_PASS_DEPTH_FAIL 2xZ6 GetIntegerv KEEP Stencil depth 4.1.4 stencil-bu…
468 STENCIL_PASS_DEPTH_PASS 2xZ6 GetIntegerv KEEP Stencil depth 4.1.4 stencil-bu…
477 STENCIL_TEST_TWO_SIDE_EXT B IsEnabled False Two-sided stencil 4.1.4 stencil-buff…
479 ACTIVE_STENCIL_FACE_EXT Z2 GetIntegerv FRONT Active stencil 4.1.4 stencil-buff…
486 STENCIL_WRITE_MASK 2xZ+ GetIntegerv 1's Stencil buffer 4.2.2 stencil-buff…
497 sided stencil.