from panda3d.core import 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

static make(mode: Mode) → RenderAttrib

Constructs a new TransparencyAttrib object.

Return type


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


getMode() → Mode

Returns the transparency mode.

Return type


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


property mode

Returns the transparency mode.

Return type


property class_slot
Return type


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.