GXSetZMode

C Specification

#include <revolution/gx.h>
void GXSetZMode(
GXBool       compare_enable,
GXCompare    func,
GXBool       update_enable );

Arguments

compare_enable When GX_TRUE, enables the process for comparing the original Z value and the target Z value. Disabled if not GX_TRUE.
func Z comparison function. Accepted values are:
Name: Z compare operation
GX_NEVER Never passes Z test.
GX_LESS Passes if new Z < existing Z.
GX_LEQUAL Passes if new Z <= existing Z.
GX_EQUAL Passes if new Z == existing Z.
GX_NEQUAL Passes if new Z != existing Z.
GX_GEQUAL Passes if new Z >= existing Z.
GX_GREATER Passes if new Z > existing Z.
GX_ALWAYS Always passes Z test.
update_enable When GX_TRUE, allows a Z buffer update.
Although a Z buffer update is only possible when GX_TRUE, the comparison process will continue.

Return Values

None.

Description

This function sets the Z-buffer compare mode. The result of the Z compare is used to conditionally write color values to the Embedded Frame Buffer (EFB).

When compare_enable is set to GX_DISABLE, Z buffering is disabled and the Z buffer is not updated.

The func parameter determines the comparison that is performed. In the comparison function, the newly rasterized Z value is on the left while the Z value from the Z buffer is on the right. If the result of the comparison is false, the newly rasterized pixel is discarded.

The parameter update_enable determines whether or not the Z buffer is updated with the new Z value after a comparison is performed. This parameter also affects whether the Z buffer is cleared during copy operations. See GXCopyDisp and GXCopyTex.

See Also

GXSetCoPlanar
GXSetBlendMode
GXSetZCompLoc

Revision History

03/01/2006 Initial version.