ColorBlendAttrib
from panda3d.core import ColorBlendAttrib
- class ColorBlendAttrib
Bases:
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
-
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)
-
enumerator M_none = 0
-
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
-
enumerator O_zero = 0
- property alpha_mode Mode
Returns the blending mode for the alpha channel.
- property alpha_operand_a Operand
Returns the alpha multiplier for the first component.
- property alpha_operand_b Operand
Returns the alpha multiplier for the second component.
- get_alpha_mode() Mode
Returns the blending mode for the alpha channel.
- get_alpha_operand_a() Operand
Returns the alpha multiplier for the first component.
- get_alpha_operand_b() Operand
Returns the alpha multiplier for the second component.
- static get_class_type() TypeHandle
- get_mode() Mode
Returns the blending mode for the RGB channels.
- get_operand_a() Operand
Returns the RGB multiplier for the first component.
- get_operand_b() Operand
Returns the RGB multiplier for the second component.
- involves_color_scale() bool
Returns true if the this attrib uses the color scale attrib, false otherwise.
- involves_color_scale(operand: Operand) bool
Returns true if the indicated operand uses the color scale attrib, false otherwise.
- involves_constant_color() bool
Returns true if the this attrib uses the constant color, false otherwise.
- involves_constant_color(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.
- 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.
- 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.
- static make_default() RenderAttrib
Returns a
RenderAttrib
that corresponds to whatever the standard default properties for render attributes of this type ought to be.
- static make_off() RenderAttrib
Constructs a new
ColorBlendAttrib
object that disables special-effect blending, allowing normal transparency to be used instead.
- property rgb_mode Mode
Returns the blending mode for the RGB channels.
- property rgb_operand_a Operand
Returns the RGB multiplier for the first component.
- property rgb_operand_b Operand
Returns the RGB multiplier for the second component.
-
enum Mode