Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GraphicsDevice.ReferenceStencil Property

Gets or sets a reference value for stencil testing. The default value is zero.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in

public int ReferenceStencil { get; set; }

Property Value

The stencil reference value.

The reference value is compared (using the comparison function specified by StencilFunction) to the pixel data in the stencil buffer using the equation:

      ReferenceStencil StencilFunction (stencil buffer entry)

This comparison applies only to the bits marked enabled by the stencil mask. If the comparison is true, the stencil test passes and the pass operation (specified by the DepthStencilState.StencilPass Property) is performed.

Xbox 360, Windows 7, Windows Vista, Windows XP

Community Additions

© 2017 Microsoft