N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential





gSPClipRatio

Syntax
#include <ultra64.h> /* gbi.h */
gSPClipRatio(Gfx *gdl,r)
gsSPClipRatio(r)

Arguments

  • gdl is the display list pointer.

  • r is the relative size (Clipping box : scissoring box).
    FRUSTRATIO_1 (1:1)
    FRUSTRATIO_2 (2:1)
    FRUSTRATIO_6 (6:1)

Explanation
This macro specifies the size ratio between the clipping box and the scissoring box in order to boost performance. This explanation assumes that the scissoring box is the same size as the viewport region (see gDPSetScissor and gSPViewport).

Scissoring is performed by rasterizing the entire triangle and then deleting pixels which lay outside the screen. (This consumes processing time in the RDP.) Clipping is performed by converting a large triangle that protrudes out of the clipping box, into a number of small triangles, all of which fit inside the clipping box. (This consumes RSP processing time in the RSP.) For details, please see Section 12.3.1, Figure 12-4 "Scissoring/Clipping/Screen Rectangles" in the N64 Online Programming Manual.

When the clipping box is near in size to the scissoring box there are more occasions for clipping, which places a greater burden on the RSP. In addition, RDP processing speed declines because there is also more rendering, due to the increase in the number of polygons that results from the clipping process, where a large triangle is divided up into many small ones, as explained above. (The rendering of two small triangles generally requires more RDP processing time than one large triangle.)

Conversely, when the clipping box is much larger than the scissoring box, there are few occasions for clipping so the burden on the RSP declines. However, RDP processing speed will also decline because there are more occasions for scissoring (which is performed by the RDP).

The performance of the RSP was improved significantly with the release of F3DEX2. Thus, you should place greater regard on the above-mentioned influences on the RDP when determining the optimal size ratio.

Since the most effective ratio will differ depending on the model, try various values and choose the one that works best. For details, please see Section 11.6 "Clipping and Culling" in the N64 Programming Manual.

Comment
The initial value in F3DEX2 is FRUSTRATIO_2.

Example

// Makes the clipping box five times larger than the scissoring box
gSPClipRatio(glist++, FRUSTRATIO_5);

See Also
gDPSetScissor
gSPViewport

Revision History
2/1/1999 Completely rewritten.


Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1999