StencilAttrib

from panda3d.core import StencilAttrib
class StencilAttrib

Bases:

Bases: RenderAttrib

A StencilAttrib is a collection of all stencil render states. The render states in a StencilAttrib are read-only. A StencilAttrib is created with make or make2Sided(). To determine if two sided stencil is supported, call the function GraphicsStateGuardian:: get_supports_two_sided_stencil.

Inheritance diagram

Inheritance diagram of StencilAttrib

enum StencilComparisonFunction

Exists purely for backward compatibility.

enumerator SCF_never = 1
enumerator SCF_less_than = 2
enumerator SCF_equal = 3
enumerator SCF_less_than_or_equal = 4
enumerator SCF_greater_than = 5
enumerator SCF_not_equal = 6
enumerator SCF_greater_than_or_equal = 7
enumerator SCF_always = 8
enum StencilOperation
enumerator SO_keep = 0
enumerator SO_zero = 1
enumerator SO_replace = 2
enumerator SO_increment = 3
enumerator SO_decrement = 4
enumerator SO_invert = 5
enumerator SO_increment_saturate = 6
enumerator SO_decrement_saturate = 7
enum StencilRenderState

enums are duplicated here from class StencilRenderStates for use in Python

enumerator SRS_front_comparison_function = 0
enumerator SRS_front_stencil_fail_operation = 1
enumerator SRS_front_stencil_pass_z_fail_operation = 2
enumerator SRS_front_stencil_pass_z_pass_operation = 3
enumerator SRS_reference = 4
enumerator SRS_read_mask = 5
enumerator SRS_write_mask = 6
enumerator SRS_back_comparison_function = 7
enumerator SRS_back_stencil_fail_operation = 8
enumerator SRS_back_stencil_pass_z_fail_operation = 9
enumerator SRS_back_stencil_pass_z_pass_operation = 10
enumerator SRS_clear = 11
enumerator SRS_clear_value = 12
enumerator SRS_total = 13
property class_slot int
static getClassSlot() int
static getClassType() TypeHandle
getRenderState(render_state_identifier: StencilRenderState) int

Returns render state.

static make(front_enable: bool, front_comparison_function: PandaCompareFunc, stencil_fail_operation: StencilOperation, stencil_pass_z_fail_operation: StencilOperation, front_stencil_pass_z_pass_operation: StencilOperation, reference: int, read_mask: int, write_mask: int) RenderAttrib

Constructs a front face StencilAttrib.

static make2Sided(front_enable: bool, back_enable: bool, front_comparison_function: PandaCompareFunc, stencil_fail_operation: StencilOperation, stencil_pass_z_fail_operation: StencilOperation, front_stencil_pass_z_pass_operation: StencilOperation, reference: int, read_mask: int, write_mask: int, back_comparison_function: PandaCompareFunc, back_stencil_fail_operation: StencilOperation, back_stencil_pass_z_fail_operation: StencilOperation, back_stencil_pass_z_pass_operation: StencilOperation) RenderAttrib

Constructs a two-sided StencilAttrib.

static make2SidedWithClear(front_enable: bool, back_enable: bool, front_comparison_function: PandaCompareFunc, stencil_fail_operation: StencilOperation, stencil_pass_z_fail_operation: StencilOperation, front_stencil_pass_z_pass_operation: StencilOperation, reference: int, read_mask: int, write_mask: int, back_comparison_function: PandaCompareFunc, back_stencil_fail_operation: StencilOperation, back_stencil_pass_z_fail_operation: StencilOperation, back_stencil_pass_z_pass_operation: StencilOperation, clear: bool, clear_value: int) RenderAttrib

Constructs a two-sided StencilAttrib.

static makeDefault() RenderAttrib

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

static makeOff() RenderAttrib

Constructs a StencilAttrib that has stenciling turned off.

static makeWithClear(front_enable: bool, front_comparison_function: PandaCompareFunc, stencil_fail_operation: StencilOperation, stencil_pass_z_fail_operation: StencilOperation, front_stencil_pass_z_pass_operation: StencilOperation, reference: int, read_mask: int, write_mask: int, clear: bool, clear_value: int) RenderAttrib

Constructs a front face StencilAttrib.