Function
gDPSetPrimDepth
Sets the primitive depth (Z) in the RDP
Syntax
#include <ultra64.h> /* gbi.h */
gDPSetPrimDepth(Gfx *gdl, s32 z, s32 dz)
gsDPSetPrimDepth( s32 z, s32 dz)
Arguments
Description
Sets the Z value (as well as the deltaZ value) to be used for the entire primitive in the RDP. The Z format used in the blender (BL) is 15.3 fixed point. The primitive Z is a 16-bit register. So when the depth source is set to G_ZS_PRIMI (see g*DPSetDepthSource), the high-order bit is ignored, and the integer value corresponding to the Z value is given to the remaining 15 bits. When the primitive Z is being used, the bit for the fractional part is set to 0. The deltaZ format used in the BL is 16-bit. The primitive deltaZ uses all 16 bits. Note that for storage in the Z buffer, the Z value is converted to a 14-bit value, and the deltaZ value is converted to a 4-bit value. For details about using and storing Z values, see Section 12.7.6 "Depth Source" in the N64 Programming Manual.
See Also
gDPSetDepthSource, gDPSetPrimColor
Revision History
02/01/99 Completely rewritten.