Table of Contents Glide Programming Guide



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

1Decompression Tables


A texture can be compressed into a Yab texture with an appropriate decompression table with the help of the 3Dfx Interactive Texture Utility Software (TexUS). The compressed texture is stored as a 3Dfx texture map file (.3DF) that can then be loaded using the Glide Utility routine gu3dfLoad(), which is described later in this chapter. Space for two NCC tables is provided so that they can be swapped on a per-triangle basis when performing multi-pass rendering without interrupting the rendering process with table downloading.
Glide represents NCC decompression tables with the GuNccTable data structure, shown below.
typedef struct {
FxU8 yRGB[16];
FxI16 iRGB[4][3];
FxI16 qRGB[4][3];
FxU32 packed_data[12];
} GuNccTable;
Before a compressed texture can be used as the texel source, one of the two NCC tables must be designated as the source for decompression operations. The Glide function grTexNCCTable() should be called before any rendering operations using the compressed table are initiated.
void grTexNCCTable( GrChipID_t tmu, GrNCCTable_t table )

grTexNCCTable() selects one of the two NCC tables on tmu as the current source for decompression operations. Valid values are GR_TEXTABLE_NCC0 and GR_TEXTABLE_NCC1.
Example Managing Texture Memory.7 Loading an NCC table.
NCC tables are created by programs in the TexUS library and written to a .3DF file. This code segment uses gu3dfLoad(), described in the next section, to read the file into memory. Once in memory, the table is downloaded to NCC1 in TMU0. Once the table is loaded, a texture in one of the compressed formats can be downloaded and used as the texel source.
Gu3dfInfo info;

gu3dfLoad(“ncctable.3df”, &info);


grTexDownloadTable(GR_TMU0, GU_TEX_NCC1, &info.table.nccTable);
grTexNCCTable(GR_TMU0, GR_TEXTABLE_NCC1);

Download 6.22 Mb.

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




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

    Main page