Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
DepthOffsetAttrib Class Reference

This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to the generated depth values for rendered polygons, before they are written to the depth buffer. More...

Inheritance diagram for DepthOffsetAttrib:
RenderAttrib TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject

List of all members.

Public Member Functions

int getOffset ()
 Returns the depth offset represented by this attrib.

Static Public Member Functions

static int getClassSlot ()
static TypeHandle getClassType ()
static RenderAttrib const make (int offset)
 Constructs a new DepthOffsetAttrib object that indicates the relative amount of bias to write to the depth buffer for subsequent geometry.
static RenderAttrib const make ()
 Constructs a new DepthOffsetAttrib object that indicates the relative amount of bias to write to the depth buffer for subsequent geometry.
static RenderAttrib const makeDefault ()
 Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Detailed Description

This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to the generated depth values for rendered polygons, before they are written to the depth buffer.

This can be used to shift polygons forward slightly, to resolve depth conflicts. The cull traverser may optionally use this, for instance, to implement decals. However, driver support for this feature seems to be spotty, so use with caution.

The bias is always an integer number, and each integer increment represents the smallest possible increment in Z that is sufficient to completely resolve two coplanar polygons. Positive numbers are closer towards the camera.

Nested DepthOffsetAttrib values accumulate; that is, a DepthOffsetAttrib with a value of 1 beneath another DepthOffsetAttrib with a value of 2 presents a net offset of 3. (A DepthOffsetAttrib will not, however, combine with any other DepthOffsetAttribs with a lower override parameter.) The net value should probably not exceed 16 or drop below 0 for maximum portability.


Member Function Documentation

static int getClassSlot ( ) [static]
static TypeHandle getClassType ( ) [static]

Reimplemented from RenderAttrib.

Returns the depth offset represented by this attrib.

static RenderAttrib const make ( int  offset) [static]

Constructs a new DepthOffsetAttrib object that indicates the relative amount of bias to write to the depth buffer for subsequent geometry.

static RenderAttrib const make ( ) [static]

Constructs a new DepthOffsetAttrib object that indicates the relative amount of bias to write to the depth buffer for subsequent geometry.

static RenderAttrib const makeDefault ( ) [static]

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

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties