Difference between revisions of "BTI file"
Jump to navigation
Jump to search
(Created page with "A form of 2d data the can be opened in gcft {{Credits|Gamecubing8619}}") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | '''BTI''' is an image file format similar to [[TEX0]], [[TPL]] and [[BREFT]] file formats. The only difference is the file header. | |
− | {{Credits|Gamecubing8619}} | + | |
+ | __TOC__ | ||
+ | |||
+ | == 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. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |+ File Header | ||
+ | |- | ||
+ | ! Offset !! Type !! Description | ||
+ | |- | ||
+ | | 0x00 || Byte || '''[[Image Formats|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'''[http://www.amnoid.de/gc/bti.txt] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for U projection maps. | ||
+ | |- | ||
+ | | 0x07 || Byte || '''Wrap T'''[http://www.amnoid.de/gc/bti.txt] (0x01 for posteffect.bti, 0x00 for others). Probably repeat, clamp or mirror wraps for V projection maps. | ||
+ | |- | ||
+ | | 0x08 || UInt16 || '''[[Image Formats#Palette_Formats|Palette format]]''' (not used in [[Mario Kart Wii]]). | ||
+ | |- | ||
+ | | 0x0A || UInt16 || '''Number of palette entries'''. | ||
+ | |- | ||
+ | | 0x0C || UInt32 || '''Offset to [[#Image and Palette Data|palette data]]''', relative to the start of the file header. | ||
+ | |- | ||
+ | | 0x10 || UInt32 || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. | ||
+ | |- | ||
+ | | 0x14 || Byte || '''Magnification filter type''' (0x00 means nearest, 0x01 means linear). | ||
+ | |- | ||
+ | | 0x15 || Byte || '''Minification filter type'''. | ||
+ | |- | ||
+ | | 0x16 || UInt16 || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. | ||
+ | |- | ||
+ | | 0x18 || Byte || '''Total number of images''', thus number of mipmaps + 1. | ||
+ | |- | ||
+ | | 0x19 || Byte || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. | ||
+ | |- | ||
+ | | 0x1A || UInt16 || {{Unknown-left|'''Unknown'''.}} Always 0 in [[Mario Kart Wii]]. | ||
+ | |- | ||
+ | | 0x1C || UInt32 || '''Offset to [[#Image and Palette Data|image data]]''', relative to the start of the file header. | ||
+ | |- | ||
+ | | 0x20 || colspan=2 {{unknown|End of file header}} | ||
+ | |} | ||
+ | |||
+ | === 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}} |
Latest revision as of 04:56, 9 March 2024
BTI is an image file format similar to TEX0, TPL and BREFT file formats. The only difference is the file header.
File Format[edit]
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[edit]
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[edit]
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