Textures

From CloudModding OoT Wiki
Jump to: navigation, search

Texture Formats

The color channels for each bit are described using R for Red, G for Green, B for Blue, A for Alpha, C for Greyscale (RGB channels combined) and X for Palette index.
If a format only has an alpha channel, it is also shared with the Greyscale channel. To save space, textures do not have headers or footers, just raw data. The format used is determined by a F3DZEX instruction series used to fetch and render the image data.

i4

AAAA
4 bits shared between greyscale and alpha channel, allowing values 0 through 15. To get the color/alpha, multiply by (255/15).

i8

AAAA AAAA
8 bits shared between greyscale and alpha channel, allowing values 0 through 255.

ia4

CCCA
3 bits for greyscale channel, allowing values 0 through 7. To get the color/alpha, multiply by (255/7).

ia8

CCCC AAAA
4 bits for greyscale channel and 4 bits for alpha channel, allowing values 0 through 15. To get the color/alpha, multiply by (255/15).

ia16

CCCC CCCC AAAA AAAA
8 bits for greyscale channel and 8 bits for alpha channel, allowing values 0 through 255.

rgb5a1 (rgba16)

RRRR RGGG GGBB BBBA
5 bits per color channel, limiting them to values 0 through 31. To get the color, multiply the value by (255/31).
1 bit for the alpha channel. To get the alpha, multiply the value by 255.

rgba32

RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA
8 bits per channel, allowing values 0 through 255 for each individual channel.

ci4

XXXX
This limits the palette to 16 colors.

ci8

XXXXXXXX
This limits the palette to 256 colors.

Palettes uses rgb5a1 and are completely separate from the ci textures. They are usually put after the texture itself, but the distance can vary a lot. Multiple textures may share the same palette, and the palette may sometimes be part of an actual texture.