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

   

gSPTexture

Format
#include "gbi.h"

gSPTexture(Gfx *gdl,
   int sc, int tc,
   int level, int tile, int on)
gsSPTexture(int sc, int tc,
   int level, int tile, int on)
Arguments
  • gdl is the pointer to the graphics display list
  • sc, tc specify the texture coordinate s,t scaling parameters (16 bits each in .16 format)
  • level is the maximum number of mip-map levels - 1
  • tile is the texture tile number (one of eight texture tiles descriptors in the RDP)
  • on is the flag (G_ON or G_OFF) that enables or disables the texture
What This Macro Does
It sets the parameters in the RSP for texturing. The resulting texture coordinates are computed by the RSP using this formula:

out_texture_coord = scale * in_texture_coord

The final output texture coordinate is based on an application-defined intersection of the sc and tc scale parameters and the s,t coordinates of the model. It is the application's responsibility to combine these so that the binary point in the final s,t values is an appropriate S10.5 format number.

A typical example might use an sc and tc values of 0.5, and then scale the s,t coordinates in the model up by 2.0.

The texture tile tells the RDP which texture tile you want to use. In case of mip-mapping, it sends the lowest number in the tile sequence that represents the mip-map (in other words, the tile number of the finest map). Therefore, for a sequence of tiles (n, n+1, n+2, and so on), n is the finest map tile and the one you set in this macro; whereas n+1, n+2, and so on are the decreasing resolution tiles. If you have detailed textures, they should be loaded at tile n with the finest resolution map at n+1.

The on argument is either G_ON or G_OFF. In the case of G_OFF, the other parameters are still updated, which could be a source of display list bugs if the state of the texture engine is assumed later.

See Also
gDPLoadTexture
gDPSetTextureImage



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