TransparencyAttrib

class TransparencyAttrib

Bases: RenderAttrib

This controls the enabling of transparency. Simply setting an alpha component to non-1 does not in itself make an object transparent; you must also enable transparency mode with a suitable TransparencyAttrib. Similarly, it is wasteful to render an object with a TransparencyAttrib in effect unless you actually want it to be at least partially transparent (and it has alpha components less than 1).

Inheritance diagram

Inheritance diagram of TransparencyAttrib

enum Mode
enumerator M_none = 0

No transparency.

enumerator M_alpha = 1

Normal transparency, panda will sort back-to-front.

enumerator M_premultiplied_alpha = 2

Assume textures use premultiplied alpha.

enumerator M_multisample = 3

Uses ms buffer, alpha values modified to 1.0.

enumerator M_multisample_mask = 4

Uses ms buffer, alpha values not modified.

enumerator M_binary = 5

Only writes pixels with alpha >= 0.5.

enumerator M_dual = 6

opaque parts first, then sorted transparent parts.

static int get_class_slot(void)
static TypeHandle get_class_type(void)
Mode get_mode(void) const

Returns the transparency mode.

static ConstPointerTo<RenderAttrib> make(TransparencyAttrib::Mode mode)

Constructs a new TransparencyAttrib object.

static ConstPointerTo<RenderAttrib> make_default(void)

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