This repository has been archived by the owner on Oct 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
TEX File Format
Matt (iRzilla) edited this page May 23, 2013
·
3 revisions
When uncompressed, the format of the file is as follows:
Offset | Size (bits) | Name | Description |
---|---|---|---|
0x00 | 32 | Magic ID | A magic ID is a constant number used to identify the texture file format. The current value is KTEX. |
0x04 | 4 | Platform | PC/XBOX360/PS3, always seems to be 0. |
5 | Pixel Format | DXT1/DXT3/DXT5/ARGB | |
4 | Texture Type | 1D/2D/3D/Cubemapped | |
5 | Number Of Mipmaps | The number of mipmaps to read from the file. | |
2 | Flags | Flags to indicate? | |
12 | Remainder | All 1. | |
0x08 | Variable | Mipmap Info | For every mipmap, there will be an entry like: |
16 | Width | Width of the mipmap in pixels. | |
16 | Height | Height of the mipmap in pixels. | |
16 | Pitch | Pitch of the mipmap. ( Used for DXT compression ) | |
32 | Data Size | Number of bytes to read of raw image data for this mipmap. | |
Variable | Raw Image Data | For every mipmap, there will be raw image data stored in the correct format. |