lsetdepth - sets the depth range
void lsetdepth(near, far)
long near, far;
near expects the screen coordinate of the near clipping plane.
far expects the screen coordinate of the far clipping plane.
viewport specifies the mapping of the left, right, bottom, and top
clipping planes into screen coordinates. lsetdepth completes this
mapping for homogeneous world coordinates; it specifies the mapping of
the near and far clipping planes into values stored in the z-buffer.
lsetdepth is used in z-buffering, depth-cueing, and certain feedback
The valid range of the parameters depends on the state of the
GLC_ZRANGEMAP compatibility mode (see glcompat). If it is 0, the valid
range depends on the graphics hardware. When multisample is enabled, and
multisample buffers exist in the current framebuffer configuration in the
current drawmode, the minimum is the value returned by
getgconfig(GC_MS_ZMIN) and the maximum is the value returned by
getgconfig(GC_MS_ZMAX). Otherwise, the minimum is the value returned by
getgconfig(GC_ZMIN) and the maximum is the value returned by
getgconfig(GC_ZMAX). If the state of the GLC_ZRANGEMAP compatibility
mode is 1, the minimum is 0x0 and the maximum is 0x7FFFFF. The depth
range defaults to the full range supported by the graphics hardware.
Acceptable mappings include all those where both near and far are within
the supported range, including mappings where near > far. In particular,
it is sometimes desirable to call lsetdepth(0x7FFFFF, 0x0) on IRIS-4D GT
and GTX models.
depthcue, feedback, getgdesc, glcompat, zbuffer
Error accumulation in the iteration of z can cause wrapping when the full
depth range supported by the graphics hardware is used. (An iteration
wraps when it accidentally converts an large positive value into a
negative value, or vice versa.) While the effects of wrapping are
typically not observed, if they are, they can be eliminated by reducing
the depth range by a small percentage.
When using this routine, you should always explicitly set the
GLC_ZRANGEMAP mode of glcompat because its default is different on
PPPPaaaaggggeeee 1111 [ Back ]