setStencilReferenceValues(front:back:)
Configures different comparison values for front- and back-facing primitives.
Declaration
func setStencilReferenceValues(front frontReferenceValue: UInt32, back backReferenceValue: UInt32)Parameters
- frontReferenceValue:
A stencil test comparison value the render pipeline applies to only front-facing primitives.
- backReferenceValue:
A stencil test comparison value the render pipeline applies to only back-facing primitives.
Discussion
The command sets separate reference values for front- and back-facing primitives (see stencilCompareFunction, frontFaceStencil, and backFaceStencil). These reference values apply to the stencil state you set with the setDepthStencilState(_:) method.
The render pass’s default reference value for the front and back stencil compare function is 0.