![]() |
|Download Files|
![]() ![]() ![]() ![]() ![]() Next: 4.1.6 Blending Up: 4.1 Per-Fragment Operations Previous: 4.1.4 Stencil test
4.1.5 Depth buffer testThe depth buffer test discards the incoming fragment if a depth comparison fails. The comparison is enabled or disabled with the generic Enable and Disable commands using the symbolic constant DEPTH_TEST. When disabled, the depth comparison and subsequent possible updates to the depth buffer value are bypassed and the fragment is passed to the next operation. The stencil value, however, is modified as indicated below as if the depth buffer test passed. If enabled, the comparison takes place and the depth buffer and stencil value may subsequently be modified. The comparison is specified with
void DepthFunc ( enum func ) ;
This command takes a single symbolic constant:
one of NEVER, ALWAYS,
LESS, LEQUAL, EQUAL,
GREATER, GEQUAL, NOTEQUAL.
Accordingly,
the depth buffer test passes never, always,
if the incoming fragment's
If the depth buffer test fails,
the incoming fragment is discarded.
The stencil value at the fragment's The necessary state is an eight-valued integer and a single bit indicating whether depth buffering is enabled or disabled. In the initial state the function is LESS and the test is disabled. If there is no depth buffer, it is as if the depth buffer test always passes.
![]() ![]() ![]() ![]() ![]() Next: 4.1.6 Blending Up: 4.1 Per-Fragment Operations Previous: 4.1.4 Stencil test David Blythe Sat Mar 29 02:23:21 PST 1997
|