GXSetViewportJitter

Syntax

#include <revolution/gx.h>

void GXSetViewportJitter( 
    f32 xOrig,
    f32 yOrig,
    f32 wd,
    f32 ht,
    f32 nearZ,
    f32 farZ,
    u32 field );

Arguments

xOrig Coordinate (in pixels) of the leftmost side of the viewport. Recommended value range: 0.0fxOrig < 640.0f
yOrig Coordinate (in pixels) of the topmost side of the viewport. Recommended value range: 0.0fyOrig < 528.0f
wd Width of the viewport (in pixels). Recommended value range: 0.0f < wd ≦ (640.0f - xOrig)
ht Height of the viewport (in pixels). Recommended value range: 0.0f < ht ≦ (528.0f - yOrig)
nearZ Floating-point value for the near side of the depth scale.
farZ Floating-point value for the far side of the depth scale.
field Whether the next field is even (0) or odd (1).

Return Values

None.

Description

Sets the viewport and adjusts the viewport's line offset for interlaced field rendering. Depending on whether the viewport starts on an even or odd line, and whether the next field to be rendered is even (0) or odd (1), the viewport may be adjusted by half a line. This has the same effect as slightly tilting the camera down and is necessary for interlaced field rendering. No other camera adjustment (i.e., the projection matrix doesn't change) is needed for interlaced field rendering.

Typical usage is shown below:

GXSetViewportJitter(0.0f, 0.0f, 640.0f, 240.0f, 0.0f, 1.0f, VIGetNextField());

Note: This function should only be applied to field rendering. If you use this for other rendering modes, such as interlaced frame rendering or progressive mode, it may cause redundant flickering.

To set a viewport without jitter, use the GXSetViewport function.

See Also

Render Modes
GXSetViewport

Revision History

2008/12/04 Revised the description of depth scale.
2006/03/01 Initial version.


CONFIDENTIAL