Panda3D
Public Types | Public Member Functions | Static Public Member Functions | List of all members
EggRenderMode Class Reference

This class stores miscellaneous rendering properties that is associated with geometry, and which may be set on the geometry primitive level, on the group above it, or indirectly via a texture. More...

Inheritance diagram for EggRenderMode:
EggGroup EggPrimitive EggTexture EggBin EggCompositePrimitive EggCurve EggPatch EggPoint EggPolygon EggSurface EggLine EggTriangleFan EggTriangleStrip EggNurbsCurve EggNurbsSurface

Public Types

enum  AlphaMode {
  AM_unspecified = 0, AM_off = 1, AM_on = 2, AM_blend = 3,
  AM_blend_no_occlude = 4, AM_ms = 5, AM_ms_mask = 6, AM_binary = 7,
  AM_dual = 8, AM_premultiplied = 9
}
 
enum  DepthTestMode { DTM_unspecified = 0, DTM_off = 1, DTM_on = 2 }
 
enum  DepthWriteMode { DWM_unspecified = 0, DWM_off = 1, DWM_on = 2 }
 
enum  VisibilityMode { VM_unspecified = 0, VM_hidden = 1, VM_normal = 2 }
 

Public Member Functions

 __init__ ()
 
 __init__ (const EggRenderMode copy)
 
 clearBin ()
 Removes the bin name that was set for this particular object. More...
 
 clearDepthOffset ()
 Removes the depth-offset flag from this particular object. More...
 
 clearDrawOrder ()
 Removes the draw-order flag from this particular object. More...
 
EggRenderMode::AlphaMode getAlphaMode ()
 Returns the alpha mode that was set, or AM_unspecified if nothing was set. More...
 
str getBin ()
 Returns the bin name that has been set for this particular object, if any. More...
 
int getDepthOffset ()
 Returns the "depth-offset" flag as set for this particular object. More...
 
EggRenderMode::DepthTestMode getDepthTestMode ()
 Returns the depth_test mode that was set, or DTM_unspecified if nothing was set. More...
 
EggRenderMode::DepthWriteMode getDepthWriteMode ()
 Returns the depth_write mode that was set, or DWM_unspecified if nothing was set. More...
 
int getDrawOrder ()
 Returns the "draw-order" flag as set for this particular object. More...
 
EggRenderMode::VisibilityMode getVisibilityMode ()
 Returns the visibility mode that was set, or VM_unspecified if nothing was set. More...
 
bool hasBin ()
 Returns true if a bin name has been set for this particular object. More...
 
bool hasDepthOffset ()
 Returns true if the depth-offset flag has been set for this particular object. More...
 
bool hasDrawOrder ()
 Returns true if the draw-order flag has been set for this particular object. More...
 
bool operator != (const EggRenderMode other)
 
bool operator< (const EggRenderMode other)
 
EggRenderMode operator= (const EggRenderMode copy)
 
bool operator== (const EggRenderMode other)
 
 setAlphaMode (EggRenderMode::AlphaMode mode)
 Specifies precisely how the transparency for this geometry should be achieved, or if it should be used. More...
 
 setBin (str bin)
 Sets the "bin" string for this particular object. More...
 
 setDepthOffset (int bias)
 Sets the "depth-offset" flag associated with this object. More...
 
 setDepthTestMode (EggRenderMode::DepthTestMode mode)
 Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer). More...
 
 setDepthWriteMode (EggRenderMode::DepthWriteMode mode)
 Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry. More...
 
 setDrawOrder (int order)
 Sets the "draw-order" flag associated with this object. More...
 
 setVisibilityMode (EggRenderMode::VisibilityMode mode)
 Specifies whether this geometry is to be considered normally visible, or hidden. More...
 
 write (Ostream out, int indent_level)
 Writes the attributes to the indicated output stream in Egg format. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
static EggRenderMode::AlphaMode stringAlphaMode (str string)
 Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value. More...
 
static EggRenderMode::DepthTestMode stringDepthTestMode (str string)
 Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value. More...
 
static EggRenderMode::DepthWriteMode stringDepthWriteMode (str string)
 Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value. More...
 
static EggRenderMode::VisibilityMode stringVisibilityMode (str string)
 Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value. More...
 

Detailed Description

This class stores miscellaneous rendering properties that is associated with geometry, and which may be set on the geometry primitive level, on the group above it, or indirectly via a texture.

It's intended to be a base class for egg objects that can have these properties set.

This class cannot inherit from EggObject, because it causes problems at the EggPolygon level with multiple appearances of the EggObject base class. And making EggObject a virtual base class is just no fun.

Member Enumeration Documentation

◆ AlphaMode

enum AlphaMode
Enumerator
AM_unspecified 
AM_off 

No transparency.

AM_on 

Use whatever the default model is.

AM_blend 

Normal alpha blending, e.g. TransparencyAttrib::M_alpha.

AM_blend_no_occlude 

Alpha blending w/o depth write.

AM_ms 

TransparencyAttrib::M_multisample.

AM_ms_mask 

TransparencyAttrib::M_multisample_mask.

AM_binary 

TransparencyAttrib::M_binary.

AM_dual 

TransparencyAttrib::M_dual.

AM_premultiplied 

TransparencyAttrib::M_premultiplied_alpha.

◆ DepthTestMode

Enumerator
DTM_unspecified 
DTM_off 
DTM_on 

◆ DepthWriteMode

Enumerator
DWM_unspecified 
DWM_off 
DWM_on 

◆ VisibilityMode

Enumerator
VM_unspecified 
VM_hidden 
VM_normal 

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const EggRenderMode  copy)

◆ clearBin()

clearBin ( )

Removes the bin name that was set for this particular object.

See set_bin().

◆ clearDepthOffset()

clearDepthOffset ( )

Removes the depth-offset flag from this particular object.

See set_depth_offset().

◆ clearDrawOrder()

clearDrawOrder ( )

Removes the draw-order flag from this particular object.

See set_draw_order().

◆ getAlphaMode()

EggRenderMode::AlphaMode getAlphaMode ( )

Returns the alpha mode that was set, or AM_unspecified if nothing was set.

See set_alpha_mode().

◆ getBin()

str getBin ( )

Returns the bin name that has been set for this particular object, if any.

See set_bin().

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getDepthOffset()

int getDepthOffset ( )

Returns the "depth-offset" flag as set for this particular object.

See set_depth_offset().

◆ getDepthTestMode()

EggRenderMode::DepthTestMode getDepthTestMode ( )

Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.

See set_depth_test_mode().

◆ getDepthWriteMode()

EggRenderMode::DepthWriteMode getDepthWriteMode ( )

Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.

See set_depth_write_mode().

◆ getDrawOrder()

int getDrawOrder ( )

Returns the "draw-order" flag as set for this particular object.

See set_draw_order().

◆ getVisibilityMode()

EggRenderMode::VisibilityMode getVisibilityMode ( )

Returns the visibility mode that was set, or VM_unspecified if nothing was set.

See set_visibility_mode().

◆ hasBin()

bool hasBin ( )

Returns true if a bin name has been set for this particular object.

See set_bin().

◆ hasDepthOffset()

bool hasDepthOffset ( )

Returns true if the depth-offset flag has been set for this particular object.

See set_depth_offset().

◆ hasDrawOrder()

bool hasDrawOrder ( )

Returns true if the draw-order flag has been set for this particular object.

See set_draw_order().

◆ operator !=()

bool operator != ( const EggRenderMode  other)

◆ operator<()

bool operator< ( const EggRenderMode  other)

◆ operator=()

EggRenderMode operator= ( const EggRenderMode  copy)

◆ operator==()

bool operator== ( const EggRenderMode  other)

◆ setAlphaMode()

setAlphaMode ( EggRenderMode::AlphaMode  mode)

Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.

The default, AM_unspecified, is to use transparency if the geometry has a color whose alpha value is non-1, or if it has a four-channel texture applied; otherwise, AM_on forces transparency on, and AM_off forces it off. The other flavors of transparency are specific ways to turn on transparency, which may or may not be supported by a particular rendering backend.

◆ setBin()

setBin ( str  bin)

Sets the "bin" string for this particular object.

This names a particular bin in which the object should be rendered. The exact meaning of a bin is implementation defined, but generally a GeomBin matching each bin name must also be specifically added to the rendering engine (e.g. the CullTraverser) in use for this to work. See also set_draw_order().

◆ setDepthOffset()

setDepthOffset ( int  bias)

Sets the "depth-offset" flag associated with this object.

This adds or subtracts an offset bias into the depth buffer. See also DepthOffsetAttrib and NodePath::set_depth_offset().

◆ setDepthTestMode()

setDepthTestMode ( EggRenderMode::DepthTestMode  mode)

Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).

Note that this is different, and independent from, the depth_write mode.

◆ setDepthWriteMode()

setDepthWriteMode ( EggRenderMode::DepthWriteMode  mode)

Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.

◆ setDrawOrder()

setDrawOrder ( int  order)

Sets the "draw-order" flag associated with this object.

This specifies a particular order in which objects of this type should be drawn, within the specified bin. If a bin is not explicitly specified, "fixed" is used. See also set_bin().

◆ setVisibilityMode()

setVisibilityMode ( EggRenderMode::VisibilityMode  mode)

Specifies whether this geometry is to be considered normally visible, or hidden.

If it is hidden, it is either not loaded into the scene graph at all, or loaded as a "stashed" node, according to the setting of egg- suppress-hidden.

◆ stringAlphaMode()

static EggRenderMode::AlphaMode stringAlphaMode ( str  string)
static

Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value.

◆ stringDepthTestMode()

static EggRenderMode::DepthTestMode stringDepthTestMode ( str  string)
static

Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value.

◆ stringDepthWriteMode()

static EggRenderMode::DepthWriteMode stringDepthWriteMode ( str  string)
static

Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value.

◆ stringVisibilityMode()

static EggRenderMode::VisibilityMode stringVisibilityMode ( str  string)
static

Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value.

◆ write()

write ( Ostream  out,
int  indent_level 
)

Writes the attributes to the indicated output stream in Egg format.