GXSetZScaleOffset

C Specification

#include <revolution/gx.h>
void GXSetZScaleOffset( f32 scale, f32 offset );

Arguments

scale Specifies scale value for Z adjustment
offset Specifies offset value for Z adjustment

Return Values

None.

Description

This function sets scale and offset values that are applied to the depth value of each pixel before it is written into the Z buffer. The Z modification function is:

Zs' = Zs * scale + offset;

where Zs is the result value in screen-space after model-view, projection and viewport transformations.
This function internally adjusts the viewport setting to realize these scaling/offsetting. With this function, you can easily modify depth priorities for each primitive without changing the entire viewport.

The viewport depth parameters are normalized coordinates from 0.0f - 1.0f; thus, the offset value should be defined in the same manner.

See Also

GXSetViewport

Revision History

03/01/2006 Initial version.