class DepthBiasAttrib

Bases: RenderAttrib

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 class replaces the old DepthOffsetAttrib, which had a more limited parameterization. The differences are: - The sign of the factor parameter was inverted. - The slope and constant factors are specified separately. - The factors are specified as floating-point instead of integer. - There is a new clamp parameter.

Nested DepthBiasAttrib values accumulate; that is, a DepthBiasAttrib with a value of 1 beneath another DepthBiasAttrib with a value of 2 presents a net offset of 3. (A DepthBiasAttrib will not, however, combine with any other DepthBiasAttribs with a lower override parameter.)

New in version 1.11.0.

Inheritance diagram

Inheritance diagram of DepthBiasAttrib

static int get_class_slot(void)
static TypeHandle get_class_type(void)
static ConstPointerTo<RenderAttrib> make(PN_stdfloat slope_factor, PN_stdfloat constant_factor, PN_stdfloat clamp = 0)

Constructs a new DepthBiasAttrib object that indicates the slope factor, constant factor, and an optional clamping value.

static ConstPointerTo<RenderAttrib> make_default(void)

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