Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

RDPipelineDepthStencilState

繼承: RefCounted < Object

管線的深度/範本狀態(由 RenderingDevice 使用)。

說明

RDPipelineDepthStencilState 控制的是在使用 RenderingDevice 對深度和範本進行取樣時,如何進行深度和範本的比較。

屬性

CompareOperator

back_op_compare

7

int

back_op_compare_mask

0

StencilOperation

back_op_depth_fail

1

StencilOperation

back_op_fail

1

StencilOperation

back_op_pass

1

int

back_op_reference

0

int

back_op_write_mask

0

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

CompareOperator

front_op_compare

7

int

front_op_compare_mask

0

StencilOperation

front_op_depth_fail

1

StencilOperation

front_op_fail

1

StencilOperation

front_op_pass

1

int

front_op_reference

0

int

front_op_write_mask

0


屬性說明

CompareOperator back_op_compare = 7 🔗

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


int back_op_compare_mask = 0 🔗

  • void set_back_op_compare_mask(value: int)

  • int get_back_op_compare_mask()

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


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.


StencilOperation back_op_fail = 1 🔗

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


StencilOperation back_op_pass = 1 🔗

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


int back_op_reference = 0 🔗

  • void set_back_op_reference(value: int)

  • int get_back_op_reference()

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


int back_op_write_mask = 0 🔗

  • void set_back_op_write_mask(value: int)

  • int get_back_op_write_mask()

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


CompareOperator depth_compare_operator = 7 🔗

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


float depth_range_max = 0.0 🔗

  • void set_depth_range_max(value: float)

  • float get_depth_range_max()

The maximum depth that returns true for enable_depth_range.


float depth_range_min = 0.0 🔗

  • void set_depth_range_min(value: float)

  • float get_depth_range_min()

The minimum depth that returns true for enable_depth_range.


bool enable_depth_range = false 🔗

  • void set_enable_depth_range(value: bool)

  • bool get_enable_depth_range()

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.


bool enable_depth_test = false 🔗

  • void set_enable_depth_test(value: bool)

  • bool get_enable_depth_test()

如果為 true,則會啟用深度測試,能夠讓物件根據深度自動被其他物件遮擋。這樣物件就能夠被其他物件部分遮擋。如果為 false,則會按照繪制順序顯示(類似 Godot 的 2D 算繪器)。


bool enable_depth_write = false 🔗

  • void set_enable_depth_write(value: bool)

  • bool get_enable_depth_write()

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


bool enable_stencil = false 🔗

  • void set_enable_stencil(value: bool)

  • bool get_enable_stencil()

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.


CompareOperator front_op_compare = 7 🔗

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


int front_op_compare_mask = 0 🔗

  • void set_front_op_compare_mask(value: int)

  • int get_front_op_compare_mask()

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


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.


StencilOperation front_op_fail = 1 🔗

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


StencilOperation front_op_pass = 1 🔗

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


int front_op_reference = 0 🔗

  • void set_front_op_reference(value: int)

  • int get_front_op_reference()

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


int front_op_write_mask = 0 🔗

  • void set_front_op_write_mask(value: int)

  • int get_front_op_write_mask()

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