-
Notifications
You must be signed in to change notification settings - Fork 173
Stencil
can be used as a general purpose per pixel mask for saving or discarding pixels. The stencil buffer is usually an 8 bit integer per pixel. The value can be written to, increment or decremented. Subsequent draw calls can test against the value, to decide if a pixel should be discarded before running the pixel shader.
The value to be compared against (if Comp is anything else than always) and/or the value to be written to the buffer (if either Pass, Fail or ZFail is set to replace). 0–255 integer.
An 8 bit mask as an 0–255 integer, used when comparing the reference value with the contents of the buffer (referenceValue & readMask) comparisonFunction (stencilBufferValue & readMask). Default: 255.
An 8 bit mask as an 0–255 integer, used when writing to the buffer. Note that, like other write masks, it specifies which bits of stencil buffer will be affected by write (i.e. WriteMask 0 means that no bits are affected and not that 0 will be written). Default: 255.
What to do with the contents of the buffer if the stencil test (and the depth test) passes. Default: keep.
What to do with the contents of the buffer if the stencil test fails. Default: keep.
What to do with the contents of the buffer if the stencil test passes, but the depth test fails. Default: keep.
The function used to compare the reference value to the current contents of the buffer. Default: always.
Same as above but only effects outlines.