Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
AuxBitplaneAttrib Class Reference

Modern frame buffers can have 'aux' bitplanes, which are additional bitplanes above and beyond the standard depth and color. More...

#include "auxBitplaneAttrib.h"

Inheritance diagram for AuxBitplaneAttrib:
RenderAttrib TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Types

enum  AuxBitplaneOutput { ABO_glow = 1, ABO_aux_normal = 2, ABO_aux_glow = 4 }

Public Member Functions

virtual TypeHandle force_init_type ()
int get_outputs () const
 Returns the AuxBitplaneAttrib output bits.
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()
static CPT (RenderAttrib) make(int outputs)
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 AuxBitplaneAttrib.

Protected Member Functions

virtual int compare_to_impl (const RenderAttrib *other) const
 Intended to be overridden by derived AuxBitplaneAttrib types to return a unique number indicating whether this AuxBitplaneAttrib is equivalent to the other one.
virtual CPT (RenderAttrib) get_auto_shader_attrib_impl(const RenderState *state) const
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 AuxBitplaneAttrib.
virtual size_t get_hash_impl () const
 Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type AuxBitplaneAttrib is encountered in the Bam file.

Detailed Description

Modern frame buffers can have 'aux' bitplanes, which are additional bitplanes above and beyond the standard depth and color.

This attrib controls what gets rendered into those additional bitplanes. It can also affect what goes into the alpha channel of the primary color buffer.

ABO_glow: copy the glow map into the alpha channel of the primary frame buffer. If there is no glow map, set it to zero. Caveat: it is not possible to write glow or depth values to the framebuffer alpha channel at the same time as using alpha blending or alpha testing. Any attempt to use transparency, blending, or alpha testing will cause this flag to be overridden.

ABO_aux_normal: put the camera-space normal into the into the R,G components of the first auxiliary bitplane.

ABO_aux_modelz: put the clip-space Z coordinate of the center of the model (after perspective divide) into the B channel of the first auxiliary bitplane.

ABO_aux_glow: put a copy of the glow map into the alpha channel of the first auxiliary bitplane. If there is no glow map, set it to zero.

AuxBitplaneAttrib is relevant only when shader generation is enabled. Otherwise, it has no effect.

Definition at line 57 of file auxBitplaneAttrib.h.


Member Function Documentation

int AuxBitplaneAttrib::compare_to_impl ( const RenderAttrib other) const [protected, virtual]

Intended to be overridden by derived AuxBitplaneAttrib types to return a unique number indicating whether this AuxBitplaneAttrib is equivalent to the other one.

This should return 0 if the two AuxBitplaneAttrib 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 AuxBitplaneAttrib objects whose get_type() functions return the same.

Reimplemented from RenderAttrib.

Definition at line 90 of file auxBitplaneAttrib.cxx.

void AuxBitplaneAttrib::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 AuxBitplaneAttrib.

Reimplemented from RenderAttrib.

Definition at line 179 of file auxBitplaneAttrib.cxx.

References DatagramIterator::get_int32().

Referenced by make_from_bam().

size_t AuxBitplaneAttrib::get_hash_impl ( ) const [protected, virtual]

Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.

RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash.

Reimplemented from RenderAttrib.

Definition at line 111 of file auxBitplaneAttrib.cxx.

References integer_hash< Key, Compare >::add_hash().

int AuxBitplaneAttrib::get_outputs ( ) const [inline]

Returns the AuxBitplaneAttrib output bits.

Definition at line 34 of file auxBitplaneAttrib.I.

Referenced by ShaderGenerator::analyze_renderstate().

TypedWritable * AuxBitplaneAttrib::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type AuxBitplaneAttrib is encountered in the Bam file.

It should create the AuxBitplaneAttrib and extract its information from the file.

Definition at line 160 of file auxBitplaneAttrib.cxx.

References fillin().

Referenced by register_with_read_factory().

Tells the BamReader how to create objects of type AuxBitplaneAttrib.

Definition at line 134 of file auxBitplaneAttrib.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

void AuxBitplaneAttrib::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from RenderAttrib.

Definition at line 145 of file auxBitplaneAttrib.cxx.

References Datagram::add_int32().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations