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

## gSPSetGeometryMode

Syntax

    #include <ultra64.h> /* gbi.h */
    gSPSetGeometryMode(Gfx *gdl, u32 mode)
    gsSPSetGeometryMode(u32 mode)

Arguments

- gdl is the display list pointer.

- mode is the geometry pipeline mode:
  G_SHADE (Calculate vertex color)
  G_LIGHTING (Calculate lighting)
  G_SHADING_SMOOTH (Gouraud shading)
  G_ZBUFFER (Calculate Z buffer)
  G_TEXTURE_GEN (Automatically generate texture s,t coordinates)
  G_TEXTURE_GEN_LINEAR (Automatically generate texture s,t coordinates)
  G_CULL_FRONT (Front-face culling)
  G_CULL_BACK (Back-face culling)
  G_CULL_BOTH (Front-face and back-face culling)
  G_FOG (Generate vertex alpha coordinate fog parameters)
  G_CLIPPING (Clipping)

Explanation
Sets the geometry pipeline modes for culling, lighting, specular highlights, reflection mapping, fog, etc. Use gSPClearGeometryMode to disable the modes.

Numerous specifications can be set for mode with a bit sum of the following flags:

G_SHADE
  Enables calculation of vertex color for a triangle.
G_LIGHTING
  Enables lighting calculations.
G_SHADING_SMOOTH
  Enables Gouraud shading.
  When this is not enabled, flat shading is used for the triangle, based on the color of one vertex (see gSP1Triangle(3P)). G_SHADE must be enabled to calculate vertex color.
G_ZBUFFER
  Enables Z buffer calculations.
  Other Z buffer-related parameters for the frame buffer must also be set.
G_TEXTURE_GEN
  Enables automatic generation of the texture's s,t coordinates.
  Spherical mapping based on the normal vector is used.
G_TEXTURE_GEN_LINEAR
  Enables automatic generation of the texture's s,t coordinates.
G_CULL_FRONT
  Enables front-face culling.
  * This does not support F3DLX.Rej but it does support F3DLX2.Rej.
G_CULL_BACK
  Enables back-face culling.
G_CULL_BOTH
  Enables both back-face and front-face culling.
  * This does not support F3DLX.Rej but it does support F3DLX2.Rej.
G_FOG
  Enables generation of vertex alpha coordinate fog parameters.
G_CLIPPING
  Enables clipping.
  This mode is enabled in the initial state. When disabled, clipping is not performed (see the Comment section in gSPClearGeometryMode). This mode can only be used with F3DLX and F3DLX.NoN.

Note
Other elements which have their own commands also exist for the RSP rendering state. These involve changing the state with something more complicated than a single bit, or using other commands to optimize the RSP geometry engine.

See Also
gDPSetPrimColor
gSP1Triangle
gSPFogPosition
gSPClearGeometryMode

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