A SERVICE OF

logo

78
Chapter 6: Placing Shapes in a Scene
Overriding the Default Order of Layering Shapes
To override this layering effect, you can use the csContext::setcsDepthFunc() method; it
determines the layering order of geometries in a scene according to values in the Z
dimension. To specify a layering method, use one of the tokens in
csContext::DepthFuncEnum.
NEVER_DFUNC
LESS_DFUNC
EQUAL_DFUNC
LEQUAL_DFUNC
GREATER_DFUNC
NOTEQUAL_DFUNC
GEQUAL_DFUNC
ALWAYS_DFUNC
Here are the effects of some of the arguments:
NEVER_DFUNC
the incoming pixel is never displayed on top of the current,
corresponding pixel in the buffer. This function has the effect of
reversing the normal order of layering: pixels are rendered behind the
pixels currently in the buffer.
LESS_DFUNC A pixel is displayed only if its Z component is less than the Z value of
the corresponding pixel currently in the buffer. This function presents
the intuitive representation of close objects appearing in front of distant
objects.
ALWAYS_DFUNC
The incoming pixel is always displayed on top of what is currently
displayed regardless of the Z component.
The default is LEQUAL_DFUNC.