TransparencyAttrib

from panda3d.core import TransparencyAttrib
class TransparencyAttrib

Bases:

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.

property class_slot int
static getClassSlot() int
static getClassType() TypeHandle
getMode() Mode

Returns the transparency mode.

static make(mode: Mode) RenderAttrib

Constructs a new TransparencyAttrib object.

static makeDefault() RenderAttrib

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

property mode Mode

Returns the transparency mode.