panda3d.core.ColorBlendAttrib

from panda3d.core import ColorBlendAttrib
class ColorBlendAttrib

Bases: RenderAttrib

This specifies how colors are blended into the frame buffer, for special effects. This overrides transparency if transparency is also specified.

Inheritance diagram

Inheritance diagram of ColorBlendAttrib

enum Mode
enumerator M_none = 0

Blending is disabled

enumerator M_add = 1

incoming color * A + fbuffer color * B

enumerator M_subtract = 2

incoming color * A - fbuffer color * B

enumerator M_inv_subtract = 3

fbuffer color * B - incoming color * A

enumerator M_min = 4

min(incoming color, fbuffer color)

enumerator M_max = 5

max(incoming color, fbuffer color)

enum Operand
enumerator O_zero = 0
enumerator O_one = 1
enumerator O_incoming_color = 2
enumerator O_one_minus_incoming_color = 3
enumerator O_fbuffer_color = 4
enumerator O_one_minus_fbuffer_color = 5
enumerator O_incoming_alpha = 6
enumerator O_one_minus_incoming_alpha = 7
enumerator O_fbuffer_alpha = 8
enumerator O_one_minus_fbuffer_alpha = 9
enumerator O_constant_color = 10
enumerator O_one_minus_constant_color = 11
enumerator O_constant_alpha = 12
enumerator O_one_minus_constant_alpha = 13
enumerator O_incoming_color_saturate = 14

valid only for operand a

enumerator O_incoming1_color = 15

The following are used for dual-source blending, where the fragment shader outputs a second color that will be used for blending.

enumerator O_one_minus_incoming1_color = 16
enumerator O_incoming1_alpha = 17
enumerator O_one_minus_incoming1_alpha = 18
enumerator O_color_scale = 19

These modes are being considered for deprecation.

enumerator O_one_minus_color_scale = 20
enumerator O_alpha_scale = 21
enumerator O_one_minus_alpha_scale = 22
property alpha_mode

Returns the blending mode for the alpha channel.

Return type

Mode

property alpha_operand_a

Returns the alpha multiplier for the first component.

Return type

Operand

property alpha_operand_b

Returns the alpha multiplier for the second component.

Return type

Operand

property class_slot
Return type

int

property color

Returns the constant color associated with the attrib.

Return type

LColor

getAlphaMode() → Mode

Returns the blending mode for the alpha channel.

Return type

Mode

getAlphaOperandA() → Operand

Returns the alpha multiplier for the first component.

Return type

Operand

getAlphaOperandB() → Operand

Returns the alpha multiplier for the second component.

Return type

Operand

static getClassSlot() → int
static getClassType() → TypeHandle
Return type

TypeHandle

getColor() → LColor

Returns the constant color associated with the attrib.

Return type

LColor

getMode() → Mode

Returns the blending mode for the RGB channels.

Return type

Mode

getOperandA() → Operand

Returns the RGB multiplier for the first component.

Return type

Operand

getOperandB() → Operand

Returns the RGB multiplier for the second component.

Return type

Operand

involvesColorScale() → bool

Returns true if the this attrib uses the color scale attrib, false otherwise.

involvesColorScale(operand: Operand) → bool

Returns true if the indicated operand uses the color scale attrib, false otherwise.

involvesConstantColor() → bool

Returns true if the this attrib uses the constant color, false otherwise.

involvesConstantColor(operand: Operand) → bool

Returns true if the indicated operand uses the constant color, false otherwise.

static make(mode: Mode) → RenderAttrib

Constructs a new ColorBlendAttrib object.

Deprecated: Use the three- or four-parameter constructor instead.

Return type

RenderAttrib

static make(rgb_mode: Mode, rgb_a: Operand, rgb_b: Operand, alpha_mode: Mode, alpha_a: Operand, alpha_b: Operand, color: LColor) → RenderAttrib

Constructs a new ColorBlendAttrib object that enables special-effect blending. This supercedes transparency. This form is used to specify separate blending parameters for the RGB and alpha channels.

Return type

RenderAttrib

static make(mode: Mode, a: Operand, b: Operand, color: LColor) → RenderAttrib

Constructs a new ColorBlendAttrib object that enables special-effect blending. This supercedes transparency. The given mode and operands are used for both the RGB and alpha channels.

Return type

RenderAttrib

static makeDefault() → RenderAttrib

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

Return type

RenderAttrib

static makeOff() → RenderAttrib

Constructs a new ColorBlendAttrib object that disables special-effect blending, allowing normal transparency to be used instead.

Return type

RenderAttrib

property rgb_mode

Returns the blending mode for the RGB channels.

Return type

Mode

property rgb_operand_a

Returns the RGB multiplier for the first component.

Return type

Operand

property rgb_operand_b

Returns the RGB multiplier for the second component.

Return type

Operand