Panda3D
|
This controls the enabling of transparency. More...
#include "transparencyAttrib.h"
Public Types | |
enum | Mode { M_none = 0, M_alpha = 1, M_notused, M_multisample, M_multisample_mask, M_binary, M_dual } |
Public Member Functions | |
virtual TypeHandle | force_init_type () |
Mode | get_mode () const |
Returns the transparency mode. | |
virtual int | get_slot () const |
virtual TypeHandle | get_type () const |
virtual void | output (ostream &out) const |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. | |
Static Public Member Functions | |
static | CPT (RenderAttrib) make(Mode mode) |
static | CPT (RenderAttrib) make_default() |
static int | get_class_slot () |
static TypeHandle | get_class_type () |
static void | init_type () |
static void | register_with_read_factory () |
Tells the BamReader how to create objects of type TransparencyAttrib. | |
Protected Member Functions | |
virtual int | compare_to_impl (const RenderAttrib *other) const |
Intended to be overridden by derived TransparencyAttrib types to return a unique number indicating whether this TransparencyAttrib is equivalent to the other one. | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new TransparencyAttrib. | |
Static Protected Member Functions | |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type TransparencyAttrib is encountered in the Bam file. |
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).
Definition at line 36 of file transparencyAttrib.h.
int TransparencyAttrib::compare_to_impl | ( | const RenderAttrib * | other | ) | const [protected, virtual] |
Intended to be overridden by derived TransparencyAttrib types to return a unique number indicating whether this TransparencyAttrib is equivalent to the other one.
This should return 0 if the two TransparencyAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.
This will only be called with two TransparencyAttrib objects whose get_type() functions return the same.
Reimplemented from RenderAttrib.
Definition at line 103 of file transparencyAttrib.cxx.
void TransparencyAttrib::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new TransparencyAttrib.
Reimplemented from RenderAttrib.
Definition at line 161 of file transparencyAttrib.cxx.
References DatagramIterator::get_int8().
Referenced by make_from_bam().
TransparencyAttrib::Mode TransparencyAttrib::get_mode | ( | ) | const [inline] |
Returns the transparency mode.
Definition at line 34 of file transparencyAttrib.I.
Referenced by CullResult::add_object(), ShaderGenerator::analyze_renderstate(), TinyGraphicsStateGuardian::begin_draw_primitives(), DXGraphicsStateGuardian9::do_issue_blending(), DXGraphicsStateGuardian8::do_issue_blending(), and NodePath::get_transparency().
TypedWritable * TransparencyAttrib::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type TransparencyAttrib is encountered in the Bam file.
It should create the TransparencyAttrib and extract its information from the file.
Definition at line 142 of file transparencyAttrib.cxx.
References fillin().
Referenced by register_with_read_factory().
void TransparencyAttrib::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type TransparencyAttrib.
Definition at line 116 of file transparencyAttrib.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
Writes the contents of this object to the datagram for shipping out to a Bam file.
Reimplemented from RenderAttrib.
Definition at line 127 of file transparencyAttrib.cxx.
References Datagram::add_int8().