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

   

gSPBranchLessZ

Format
gSPBranchLessZ(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
  • gdl is the pointer to the graphics display list
  • branchdl is the pointer to the display list to branch to
  • zval is the Z value
  • near is the location of the near plane (a value specified by using either guPerspective or guOrtho)
  • far is the location of the far plane (a value specified by using either guPerspective or guOrtho)
  • flag specifies G_BZ_PERSP for perspective projection or G_BZ_ORTHO for orthogonal projection
What This Macro Does
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.


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 January 1998