Function
gDPSetDepthSource
Sets which depth source value to use for comparisons with the Z buffer
Syntax
#include <ultra64.h> /* gbi.h */
gDPSetDepthSource(Gfx *gdl, u32 source)
gsDPSetDepthSource( u32 source)
Arguments
Description
Sets which depth source value to use for comparisons with the Z buffer.
For details, see Sections 12.7.6 "Depth Source", 14.7.1 "Primitive Z Value" and 15.5.8 "Z Calculation" in the N64 Programming Manual.
Example
When the flag is set to G_ZS_PRIM, you must use a Z-enabled rendering mode. The only modes which are Z-enabled are 1-cycle mode and 2-cycle mode.
// Set cycle type
gDPSetCycleType(gp++, G_CYC_2CYCLE);
// Set rendering mode
gDPSetRenderMode(gp++, G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2);
// Set depth source value
gDPSetDepthSource(gp++, G_ZS_PRIM);
// Set primitive depth
gDPSetPrimDepth(gp++, 0, 0);
See Also
Revision History
02/01/99 Completely rewritten.