An object that defines the front-facing or back-facing stencil operations of a depth and stencil state object.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
A stencil test is a comparison between a masked reference value and a masked value stored in a stencil attachment. (A value is masked by performing a logical AND operation on it with the
read value.) The
MTLStencil object defines how to update the contents of the stencil attachment, based on the results of the stencil test and the depth test.
stencil property defines the stencil test. The
depth properties specify what to do to a stencil value stored in the stencil attachment for three different test outcomes: if the stencil test fails, if the stencil test passes and the depth test fails, or if both stencil and depth tests succeed, respectively.
write determines which stencil bits can be modified as the result of a stencil operation.