tex-tlut

Description

This program can test color indexed textures with an arbitrary TLUT size. Appropriate color maps are generated at runtime and loaded into the TLUT. Two textured panels are displayed onscreen. One panel displays all the components of the generated color map and the other panel displays a sample image quantized by the color map. The user can control TLUT size, format, and other parameters to control color map generation.

Coverage

Functions Parameters Description
GXInitTexObjCI Pointer to image data. Appropriate value.
Width and height Power of 2 only.
Format GX_TF_C4, GX_TF_C8, GX_TF_C14X2
Wrap mode (s, t). Always GX_REPEAT.
Mipmap Always GX_FALSE.
TLUT name All self-defined values
GXLoadTexObj Destination texture name. Always GX_TEXMAP0.
GXInitTlutObj Pointer to data. Appropriate value.
Format GX_TL_IA8, GX_TL_RGB565, GX_TL_RGB5A3
Number of Entries Same as the texture region size.
GXLoadTlut Destination TLUT name. All self-defined values
GXInitTlutRegion TMEM address Appropriate address
Table size GX_TLUT_16 - GX_TLUT_4K
GXSetTlutRegionCallBack Callback Functions One function
GXGetTexBufferSize Width and height Power of 2 only.
Format GX_TF_C4, GX_TF_C8, GX_TF_C14X2
Mipmap Always GX_FALSE.
Max LOD N/A
GXSetTevOp TEV stage ID. Always GX_TEVSTAGE0.
Operation mode Always GX_REPLACE.
GXPackedRGB565 r, g, b Various values.
GXPackedRGB5A3 r, g, b, a Various values.

Using the Demo

START exits the test.

The L and R Buttons change the color entry (= TLUT size) number.
The number becomes a power of 2 (from 16 through 4096.)

The A Button changes the format of the TLUT.
The color map will also change.

The Control Stick changes parameters for controlling the color map. The bit size for a color component (R, G, B, I, A) will change.

Snapshot

C4 texture format. Tlut size = 16, Tlut format = IA8, I2A2 color map.

tex-tlut-0.jpg (13286 bytes)

C8 texture format. Tlut size = 256, Tlut format = RGB565, R3G3B2 color map.

tex-tlut-4.jpg (16249 bytes)

C14X2 texture format. Tlut size = 4096, Tlut format = RGB5A3, R3G3B3A3 color map.

tex-tlut-8.jpg (19127 bytes)

Data Files Required

None.

Revision History

2006/03/01 Initial version.


CONFIDENTIAL