Binary Texture Image (BTI) - LordNed/WindEditor GitHub Wiki
(This article is under construction.)
Binary Texture Image, or BTI, is an image format used in many Nintendo games. It can be found alone (as a single .bti file) or in groups (as in the TEX1 chunk of BMD/BDL models).
####BTITextureHeader
// 0x20/32 bytes long
/*0x00*/ byte Format; //Data Format, seems to match tpl's format (see yagcd)?
/*0x01*/ bool AlphaEnabled;
/*0x02*/ short Width; //Width of texture
/*0x04*/ short Height; //Height of texture
/*0x06*/ byte WrapS; //0 = clamp to edge, 1 = repeat, 2 = mirror
/*0x07*/ byte WrapT; //Above
/*0x08*/ byte unknown1;
/*0x09*/ byte PaletteFormat; //Matches TPL palette format (see yagcd)?
/*0x0A*/ short PaletteEntryCount; //Number of Palettes
/*0x0C*/ int PaletteOffset; //Offsets relative to start of BTITextureHeader
/*0x10*/ Color BorderColor;
/*0x14*/ byte MinFilter; //Probably two U8s, first is 5 or 1, second 1 most of the time
/*0x15*/ byte MagFilter;
/*0x16*/ short Unknown2; //0 most of the time, sometimes 0x10, 0x18, 0x20, 0x28
/*0x18*/ byte MipmapCount; //How many mipmaps
/*0x19*/ byte unknown3;
/*0x1A*/ short LodBias;
/*0x1C*/ int DataOffset //Relative to BTITextureHeader. Image Data
//Some of the unknown data may be related to render state (lod bias, min/mag filter, etc.?)
Some .bti files are Yaz0-compressed, they will need to be uncompressed before usage. A BTI file stores a single image and zero or more mipmaps. The file starts with a BTITextureHeader (used in the TEX1 section of BMD/BDL/JPA)
ToDo: These BTI images look like the same thing as every other nintendo game (yay!). There's a btidump.exe written by thakis which can dump bti, but looks like creation of BTI may be possible through CTools. BTIs are parsed in ImageTool/Bti/BtiImage.cs, and they're spawned from a copy of ImageTool/Resources/FormatNewBti.bti
This should probably get scraped for Wiki knowledge + tool inclusion in WE.
ToDo: Palette data can come from here: http://wiki.tockdom.com/wiki/BTI_%28File_Format%29 ToDo: Image format data (layout of ImageData) can come from here: http://wiki.tockdom.com/wiki/Image_Formats