Skip to content

RDPipelineDepthStencilState

Inherits: RefCounted < Object

Pipeline depth/stencil state (used by RenderingDevice).

RDPipelineDepthStencilState controls the way depth and stencil comparisons are performed when sampling those values using RenderingDevice.

Type Name Default
RenderingDevice.CompareOperator back_op_compare 7
int back_op_compare_mask 0
RenderingDevice.StencilOperation back_op_depth_fail 1
RenderingDevice.StencilOperation back_op_fail 1
RenderingDevice.StencilOperation back_op_pass 1
int back_op_reference 0
int back_op_write_mask 0
RenderingDevice.CompareOperator depth_compare_operator 7
float depth_range_max 0.0
float depth_range_min 0.0
bool enable_depth_range false
bool enable_depth_test false
bool enable_depth_write false
bool enable_stencil false
RenderingDevice.CompareOperator front_op_compare 7
int front_op_compare_mask 0
RenderingDevice.StencilOperation front_op_depth_fail 1
RenderingDevice.StencilOperation front_op_fail 1
RenderingDevice.StencilOperation front_op_pass 1
int front_op_reference 0
int front_op_write_mask 0

back_op_compare

RenderingDevice.CompareOperator back_op_compare = 7

The method used for comparing the previous back stencil value and back_op_reference.

back_op_compare_mask

int back_op_compare_mask = 0

Selects which bits from the back stencil value will be compared.

back_op_depth_fail

RenderingDevice.StencilOperation back_op_depth_fail = 1

The operation to perform on the stencil buffer for back pixels that pass the stencil test but fail the depth test.

back_op_fail

RenderingDevice.StencilOperation back_op_fail = 1

The operation to perform on the stencil buffer for back pixels that fail the stencil test.

back_op_pass

RenderingDevice.StencilOperation back_op_pass = 1

The operation to perform on the stencil buffer for back pixels that pass the stencil test.

back_op_reference

int back_op_reference = 0

The value the previous back stencil value will be compared to.

back_op_write_mask

int back_op_write_mask = 0

Selects which bits from the back stencil value will be changed.

depth_compare_operator

RenderingDevice.CompareOperator depth_compare_operator = 7

The method used for comparing the previous and current depth values.

depth_range_max

float depth_range_max = 0.0

The maximum depth that returns true for enable_depth_range.

depth_range_min

float depth_range_min = 0.0

The minimum depth that returns true for enable_depth_range.

enable_depth_range

bool enable_depth_range = false

If true, each depth value will be tested to see if it is between depth_range_min and depth_range_max. If it is outside of these values, it is discarded.

enable_depth_test

bool enable_depth_test = false

If true, enables depth testing which allows objects to be automatically occluded by other objects based on their depth. This also allows objects to be partially occluded by other objects. If false, objects will appear in the order they were drawn (like in Orblit’s 2D renderer).

enable_depth_write

bool enable_depth_write = false

If true, writes to the depth buffer whenever the depth test returns true. Only works when enable_depth_test is also true.

enable_stencil

bool enable_stencil = false

If true, enables stencil testing. There are separate stencil buffers for front-facing triangles and back-facing triangles. See properties that begin with “front_op” and properties with “back_op” for each.

front_op_compare

RenderingDevice.CompareOperator front_op_compare = 7

The method used for comparing the previous front stencil value and front_op_reference.

front_op_compare_mask

int front_op_compare_mask = 0

Selects which bits from the front stencil value will be compared.

front_op_depth_fail

RenderingDevice.StencilOperation front_op_depth_fail = 1

The operation to perform on the stencil buffer for front pixels that pass the stencil test but fail the depth test.

front_op_fail

RenderingDevice.StencilOperation front_op_fail = 1

The operation to perform on the stencil buffer for front pixels that fail the stencil test.

front_op_pass

RenderingDevice.StencilOperation front_op_pass = 1

The operation to perform on the stencil buffer for front pixels that pass the stencil test.

front_op_reference

int front_op_reference = 0

The value the previous front stencil value will be compared to.

front_op_write_mask

int front_op_write_mask = 0

Selects which bits from the front stencil value will be changed.