Table of Contents Glide Programming Guide


Downloading a Decompression Table or Color Palette



Download 6.22 Mb.
Page78/106
Date03.02.2023
Size6.22 Mb.
#60547
1   ...   74   75   76   77   78   79   80   81   ...   106
GLIDEPGM

11Downloading a Decompression Table or Color Palette


The texels in mipmaps that use texture formats GR_TEXFMT_YIQ_422 and GR_TEXFMT_AYIQ_8422 must be “decompressed” to 32-bit values before being filtered and combined in the TMU. Texels that are stored in texture formats GR_TEXFMT_P_8 and GR_TEXFMT_AP_88 must be looked up in a color palette to translate them to 32-bit color components. The translation tables must be downloaded to the same TMU as the textures that use them before texel selection can occur.
Each TMU has room for two NCC decompression tables and one 256-entry color palette. The NCC table or color palette must be downloaded before a texture that uses it can be used as the source for texels. Glide provides a routine that can download either a color palette or one of the two decompression tables.
void grTexDownloadTable( GrChipID_t tmu, GrTexTable_t tableType, void *data )

grTexDownloadTable() downloads either an NCC table or a 256-entry color palette to a TMU. The first argument names the TMU on which the table will be loaded. The second argument, tableType, describes the kind of table that will be downloaded and is specified with one of three Glide constants: GR_TEX_NCC0, GR_TEX_NCC1, or GR_TEX_PALETTE. The third argument points to the data for the table, which must be of type GuNccTable or GuTexPalette.
Part of a 256-entry color palette can be downloaded or replaced with the Glide function grTexDownloadTablePartial().
void grTexDownloadTablePartial( GrChipID_t tmu, GrTexTable_t tableType, void *data, int start, int end )

Entries from start up to and including end are downloaded. To download one entry, use the same value for start and end. Partial downloads of NCC tables is not supported at this time.


The two table types are discussed separately in the paragraphs that follow. A downloading example is included for each kind.

Download 6.22 Mb.

Share with your friends:
1   ...   74   75   76   77   78   79   80   81   ...   106




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

    Main page