BTI file
Jump to navigation
Jump to search
BTI is an image file format similar to TEX0, TPL and BREFT file formats. The only difference is the file header.
File Format
The file format is very simple and starts with a file header followed by the image data. All data is written in big endian.
File Header
The following table shows the file header. It is 0x20 bytes long. There is no magic to identify BTI files, so tools may do some plausibility checks to identify them.
Offset | Type | Description |
---|---|---|
0x00 | Byte | Image format. |
0x01 | Byte | Enable alpha (0x00 means alpha is disabled, anything higher means alpha is enabled). |
0x02 | UInt16 | Width of the image in pixels. |
0x04 | UInt16 | Height of the image in pixels. |
0x06 | Byte | Wrap S[1] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for U projection maps. |
0x07 | Byte | Wrap T[2] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for V projection maps. |
0x08 | UInt16 | Palette format (not used in Mario Kart Wii). |
0x0A | UInt16 | Number of palette entries. |
0x0C | UInt32 | Offset to palette data, relative to the start of the file header. |
0x10 | UInt32 | Template:Unknown-left Always 0 in Mario Kart Wii. |
0x14 | Byte | Magnification filter type (0x00 means nearest, 0x01 means linear). |
0x15 | Byte | Minification filter type. |
0x16 | UInt16 | Template:Unknown-left Always 0 in Mario Kart Wii. |
0x18 | Byte | Total number of images, thus number of mipmaps + 1. |
0x19 | Byte | Template:Unknown-left Always 0 in Mario Kart Wii. |
0x1A | UInt16 | Template:Unknown-left Always 0 in Mario Kart Wii. |
0x1C | UInt32 | Offset to image data, relative to the start of the file header. |
0x20 | colspan=2 End of file header[unsure] |
Image and Palette Data
The image and palette data starts at the given data offset in the file header. The data depends on the image and palette formats format. The image format values are listed below.
Credits: Gamecubing8619,Vulcan,wiki.tockdom.com