guLoadTextureBlockMipMap.3p 3.02 KB
.TH guLoadTextureBlockMipMap 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
guLoadTextureBlockMipMap \- computes a mipmap pyramid from a source texture 
array and returns a display list for loading and rendering the 
mipmapped texture.
.SH C SPECIFICATION
.nf
\f3#include "gu.h"

int guLoadTextureBlockMipMap(Gfx **glistp, unsigned char *tbuf,
			Image *imp, unsigned char pal,
			unsigned char cms, unsigned char cmt,
			unsigned char masks, unsigned char maskt,
			unsigned char shifts, unsigned char shiftt
			unsigned char cfs, unsigned char cft)

\fP
.fi
.SH PARAMETERS
.TP 10
.I glistp
address of pointer to returned display list 
(pointer is incremented to point to end of display list).
.TP
.I tbuf 
buffer to hold the mipmap tiles. Needs to be no bigger that tmem. tbuf is
an RSP segment address.
.TP
.I imp
pointer to image structure that contains information about the source image:
e.g.

    imp->base = (unsigned char *)&RGBA16grid_32[0];
    imp->fmt  = G_IM_FMT_RGBA;
    imp->siz  = G_IM_SIZ_16b;
    imp->xsize= 32;	/* source image 'x' size */
    imp->ysize= 32;	/* source image 'y' size */
    imp->lsize= 32* sizeof(unsigned short); /* size of a source image row */
    imp->addr = 0;	/* offset into storage buffer. Needs to be zero */
    imp->w    = 32;	/* width of rectangular section of image (tile) */
			/* to be extracted for mipmapping */
    imp->h    = 32;	/* height of rectangular section of image */
			/* to be extracted for mipmapping */
    imp->s    = 0; 	/* 's' and 't' offsets into source image to */
    imp->t    = 0; 	/* define rectangular tile */

.TP
.I pal
palette number for Color Index textures.
.TP
.I cms cmt
s and t clamp and mirror parameters (see gDPLoadTextureBlock).
.TP
.I masks maskt
s and t mask for wrapping (see gDPLoadTextureBlock).
.TP
.I shifts shiftt 
s and t address shifts for indexing into mipmap tiles (see gDPLoadTextureBlock).
.TP
.I cfs cft
clamp flags for filtering along s and t axes. If set, overhanging portion of
filter kernel will pick up same texel as the edge of the texture, otherwise
the kernel overhang will wrap to the opposite edge of the texture array.

.SH DESCRIPTION
This call takes a texture image in system memory and creates a mipmap pyramid
in tbuf. Each level in the pyramid is filtered down from the previous level
by applying a 3x3 filter kernel. A display list for loading the tiles and
setting tile parameters is inserted into the display list pointed to by glistp.
Upon return, the pointer is incremented to the end of the inserted list. The
value returned is interpreted thus:
.TP
	0	- 	succesful
.TP
	1	- 	Mipmap too big to load into tmem. Not Fatal,
			will load as many levels as there 
			is space for.
.TP
	2	- 	Texel format not supported.  (all ultra64 texel
		  	formats except RGBA32 and YUV 
			are supported)
.TP
NOTE: Mipmapping textures with alpha channels 
that are used for billboard
cutouts (trees) will result in the cutout shape changing with the LOD.
Texel formats with a 1-bit alpha (e.g. RGBA16, IA4) are especially
prone to this.

.SH SEE ALSO
.IR gDPLoadTexture (3P)