Table of Contents Glide Programming Guide


Changing Mipmap Attributes



Download 6.22 Mb.
Page97/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   93   94   95   96   97   98   99   100   ...   106
GLIDEPGM

1Changing Mipmap Attributes


When a mipmap is made current, all of its attributes take effect. Some of these attributes can be temporarily overridden with grTexClampMode(), grTexFilterMode(), grTexLodBiasValue(), and grTexMipMapMode(). Note, however, that these routines do not change the mipmapā€™s attribute, only the current mode of the rendering hardware.
guTexChangeAttributes() changes some of the attributes of a mipmap. This allows a section of texture memory to be reused without resetting all of texture memory. Upon success, FXTRUE is returned, else FXFALSE is returned.
For projected textures, the clamp modes, sClampMode and tClampMode, should always be set to GR_TEXTURECLAMP_CLAMP.
FxBool guTexChangeAttributes( GrMipMapId_t mipmapID,
int width,
int height,
GrTextureFormat_t format,
GrMipMapMode_t mipmapMode,
GrLOD_t smallLOD,
GrLOD_t largeLOD,
GrAspectRatio_t aspectRatio,
GrTextureClampMode_t sClampMode,
GrTextureClampMode_t tClampMode,
GrTextureFilterMode_t minFilterMode,
GrTextureFilterMode_t magFilterMode
)

2Retrieving Information about Mipmaps


guTexGetCurrentMipMap() returns the handle of the currently active mipmap on a selected TMU. Each TMU has one currently active mipmap. Mipmaps are made current with guTexSource().
GrMipMapId_t *guTexGetCurrentMipMap ( GrChipID_t tmu )

guTexGetMipMapInfo() allows an application to retrieve information about a mipmap.
typedef struct {
int sst; /* SST where this texture map was stored */
FxBool valid; /* set when this table entry is allocated */
int width, height;
GrAspectRatio_t aspect_ratio; /* aspect ratio of the mipmap. */
void *data; /* actual texture data */


GrTextureFormat_t format; /* format of the texture table */
GrMipMapMode_t mipmap_mode; /*mipmap mode for this texture */
GrTextureFilterMode_t magfilter_mode; /* filtering to be used when magnified */
GrTextureFilterMode_t minfilter_mode; /* filtering to be used with minified */
GrTextureClampMode_t s_clamp_mode; /* how this texture should be clamped in s */
GrTextureClampMode_t t_clamp_mode; /* how this texture should be clamped in t */
FxU32 tLOD; /* Register value for tLOD register */
FxU32 tTextureMode; /* Register value for tTextureMode register */
/* not including non-texture specific bits */
FxU32 lod_bias; /* LOD bias of the mipmap in preshifted 4.2 */
GrLOD_t lod_min, lod_max; /* largest and smallest levels of detail */
int tmu; /* tmu on which this texture resides */
FxU32 odd_even_mask; /* mask specifying levels on this tmu */
FxU32 tmu_base_address; /* base address (in TMU memory) of this texture */
FxBool trilinear; /* should we blend by lod? */


GuNccTable ncc_table; /* NCC compression table (optional) */
} GrMipMapInfo;


GrMipMapInfo *guTexGetMipMapInfo( GrMipMapId_t mipmapID )


Download 6.22 Mb.

Share with your friends:
1   ...   93   94   95   96   97   98   99   100   ...   106




The database is protected by copyright ©ininet.org 2024
send message

    Main page