gSPTexture.3p 1.96 KB
.TH gSPTexture 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
gSPTexture, gsSPTexture
\- texture enable and coordinate scaling in RSP
.SH C SPECIFICATION
.nf
\f3#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)
\fP
.fi
.SH PARAMETERS
.TP 10
.I *gdl
graphics display list pointer.
.TP
.I sc, tc
texture coordinate s,t scaling parameters,
16 bits each in .16 format.
.TP
.I level
maximum number of mip-map levels - 1.
.TP
.I tile
texture tile number.
Selects one of 8 texture tiles descriptors in the RDP.
.TP
.I on
texture enable or disable.
.SH DESCRIPTION
This command sets the parameters in the RSP for texturing.
Resulting texture coordinates computed by the RSP is given by:
.Ex
.B out_texture_coord = scale * in_texture_coord.
.Ee
The final output texture coordinate is a conspiracy between the
.B sc 
and 
.B 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.
.PP
A typical example might use an
.B sc
and
.B tc
values of 0.5, then scale the s,t coordinates in the model up by 2.0.
.PP
The texture tile tells the RDP which texture tile you would like to use.
In case of mip-mapping, send the lowest number in the tile sequence that represent the mip-map.
In other words, the tile number of the finest map.
So for a sequence of tiles n, n+1, n+2 etc.
n is the finest map tile and the one you set in this command.
n+1, n+2 etc 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.
.PP
The
.B on
parameter is either
.B G_ON
or
.B G_OFF.
In the case of
.B 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.
.SH SEE ALSO
.IR gDPLoadTexture (3P)
.IR gDPSetTextureImage (3P)