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
|
gSPCullDisplayListSyntax#include <ultra64.h> /* gbi.h */ gSPCullDisplayList(Gfx *gdl, u32 v0, u32 vn) gsSPCullDisplayList(u32 v0, u32 vn)Arguments
Explanation
The vertices of the bounding volume form a complete boundary around the object to be culled. Although normally eight vertices are used as the object bounding cube, any number of vertices can be used within the allowable range. These bounding vertices are specified before this macro with gSPVertex and can be placed anywhere in the vertex buffer. v0 and vn indicate the first and last index within the bounding volume. The bounding volume vertices can be the same as the object vertices, but whatever the case the entire object must be contained in the bounding volume. For details, please see Section 11.6.4 "Volume Culling" in the N64 Online Programming Manual.
Note
To load the bounding volume vertices only for use by this macro, set the RSP rendering state lighting to OFF so the lighting calculation is not performed when the vertices are loaded. Basically, not much processing time is required for execution of this command, other than for bounding volume vertex transformations. The RSP geometry engine maintains the various clipping codes inside the vertex buffer. This macro performs culling by simply using those clipping codes. Also, it is not affected by gSPClipRatio; the viewing volume defined by the projection matrix and the viewport becomes the clipping volume.
Comment
Example
gSPVertex(glist++, bound_vtx, 8, 0); /* Load vertex indices 0~8 */ gSPCullDisplayList(glist++, 0, 7); /* Cull using vertices 0~7 *
See Also
Revision History
|