<depthstencil> (//pfx/pipeline/depthstencil)

<depthstencil> element configures the depth/depthstencil buffer used by the pipeline

<depthstencil> element configures the depth/depthstencil buffer. This element is usually omitted in favour of default values: depth write enabled, depth test enabled, function less, and no stencil.

The attributes ending with ...Front or ...Back are stencil configurations that can be set separately for front facing and back facing polygons. If the ...Front and ...Back are omitted, they apply to front and back

For example, if the following is set:

<depthstencil stencilOpDepthPass=“invert” stencilOpDepthFailBack=“zero” stencilOpDepthFailFront=“incrementWrap”>
then:
  • The stencil op for Depth Pass will be set to invert for both front and back facing polygons,
  • The stencil op for Depth Fail will be set to incrementWrap for front facing polygons.
  • The stencil op for Depth Fail will be set to zero for back facing polygons

XML Attributes (<depthstencil> element)

ATTRIBUTE

Description

depthTest

Set to enabled or true for depth testing, false or disabled otherwise.

Default: disabled

depthWrite

Set to enabled or true for depth testing, false or disabled otherwise.

Default: enabled

depthFunc

Set the depth testing function.

Valid values:

always, never, equal, notequal, less, lequal, greater, gequal

Default: less

stencilTest

Set to enabled or true for stencil testing, false or disabled otherwise.

Default: enabled

stencilOpDepthPass

stencilOpDepthPass{Front,Back}

Set the stencil function to execute if both depth and stencil tests pass.

Valid values: keep, zero, replace, incrementClamp, decrementClamp, incrementWrap, decrementWrap, invert.

If Front or Back is not specified, applies to both.

stencilOpDepthFail

stencilOpDepthFail{Front,Back}

Set the stencil function to execute if stencil test passes but depth test fails.

Valid values: keep, zero, replace, incrementClamp, decrementClamp, incrementWrap, decrementWrap, invert.

If Front or Back is not specified, applies to both.

stencilOpStencilFail

stencilOpStencilFail{Front,Back}

Set the stencil function to execute if stencil test fails.

Valid values: keep, zero, replace, incrementClamp, decrementClamp, incrementWrap, decrementWrap, invert.

If Front or Back is not specified, applies to both.

stencilCompareMask

stencilCompareMask{Front,Back}

An integer bitmask to apply to the values before comparing.

If Front or Back is not specified, applies to both.

stencilWriteMask

stencilWriteMask{Front,Back}

An integer bitmask to apply to the values before updating.

If Front or Back is not specified, applies to both.

stencilReference

stencilReference{Front,Back}

The reference value used in the stencil tests.

If Front or Back is not specified, applies to both.

stencilFunc

stencilFunc{Front, Back}

The stencil function (Front, Back, or both)

Always, never, equal, notequal, less, lequal, greater, gequal.

Default: always

If Front or Back is not specified, applies to both.