stencil-mode


Vocabulary
gpu.state

Class description
A stencil-mode is specified as part of the stencil-state to define the interaction between an incoming fragment and the stencil buffer.
The value slot contains an integer value that is used as the reference value for the comparison of the stencil test.
The mask slot contains an integer mask value that indicates which bits are relevant to the stencil test.
The comparison slot contains a comparison value that indicates the comparison taken between the masked reference value and stored stencil buffer value to determine whether the fragment is allowed to pass.
The stencil-fail-op, depth-fail-op, and depth-pass-op slots all contain stencil-op values that determine how the value in the stencil buffer is affected when the stencil test fails, the stencil test succeeds but depth test fails, and both stencil and depth tests succeed, respectively.
op-keep leaves the stencil buffer value unchanged.
op-zero sets the stencil buffer value to zero.
op-replace sets the stencil buffer value to the reference value.
op-invert bitwise NOTs the stencil buffer value.
op-inc-sat adds one to the stencil buffer value, leaving it unchanged if it is already the maximum storable value.
op-dec-sat subtracts one from the stencil buffer value, leaving it unchanged if it is already zero.
op-inc-wrap adds one to the stencil buffer value, wrapping the value to zero if it was the maximum storable value.
op-dec-wrap subtracts one from the stencil buffer value, wrapping the value to the maximum storable value if it was zero.


See also
<stencil-mode>

Definition