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
|
gSPBranchLessZFormatgSPBranchLessZ(Gfx *gdl, Gfx *branchdl, unsigned int vtx, float zval, float near, float far, int flag) gsSPBranchLessZ(Gfx *branchdl, unsigned int vtx, float zval, float near, float far, int flag)Arguments
It executes LOD processing for model. When the screen depth of the vector specified by vtx is zval or less, BranchDisplayList is executed to display the list specified with branchdl. When it is more than zval, nothing is done. By doing this, LOD processing is executed easily. The following is an example of a model that has three levels of LOD: Gfx model_near[] = { //model distance 32 to 200 ..... gsSPEndDisplayList(), }; Gfx model_mid[] = { // model distance 201 to 800 ..... gsSPEndDisplayList(), }; Gfx model_far[] = { // model distance 801 to 1600 ..... gsSPEndDisplayList(), }; Gfx model[] = { gsSPVertex(testvtx, 1, 0), gsSPBranchLessZ(model_near, 0, 200, 32, 2000, G_BZ_PERSP), gsSPBranchLessZ(model_mid, 0, 800, 32, 2000, G_BZ_PERSP), gsSPBranchLessZ(model_far, 0, 1600, 32, 2000, G_BZ_PERSP), gsSPEndDisplayList(), // nothing displayed if // distance 1601 or more };In this macro, both values of vp.vscale[2] and vp.vtrans[2], which are Z-directional parameters of the viewport, are assumed to be G_MAXZ/2. In this case, a value of depth is 0 or more and G_MAXZ or less. Usually changing the value of depth is not necessary in an application. However, if it is needed, please use the gSPBranchLessZrg macro instead. This GBI is supported in all F3DEX microcodes.
|