MipTex: Difference between revisions
No edit summary |
No edit summary |
||
| Line 9: | Line 9: | ||
{{binary_struct|MipData|type=byte[]|length=?|description=One MipMap for each mipmap level.}} | {{binary_struct|MipData|type=byte[]|length=?|description=One MipMap for each mipmap level.}} | ||
{{binary_struct|ColorsUsed|type=uint16|length=2|description=Number of colors used in the palette (always 256 for GoldSrc).}} | {{binary_struct|ColorsUsed|type=uint16|length=2|description=Number of colors used in the palette (always 256 for GoldSrc).}} | ||
{{binary_struct| | {{binary_struct|Palette|type=color[]|length=256 * 3|description=Up to 256 RGB colors used in the texture. Each group of 3 uint32 form a R G B color.}} | ||
For the MipMap images, the first image (level 0) is the texture image in its original dimensions. | For the MipMap images, the first image (level 0) is the texture image in its original dimensions. | ||
Revision as of 22:34, 31 December 2025
This is the file type used by world textures and is the typical type of file you find in WAD3 archives. The structure is similar to what's used to describe textures in the BSP format.
File Structure
FileName <string> (32 bytes)
File name, with up to 16 characters. The unused trailing characters are null.
Width <uint32> (4 bytes)
Image width, in pixels. Must be divisible by 16.
Height <uint32> (4 bytes)
Image height, in pixels. Must be divisible by 16.
MipOffsets <uint32[4]> (16 bytes)
Offset from start of this struct to each mipmap level's image.
MipData <byte[]> (? bytes)
One MipMap for each mipmap level.
ColorsUsed <uint16> (2 bytes)
Number of colors used in the palette (always 256 for GoldSrc).
Palette <color[]> (256 * 3 bytes)
Up to 256 RGB colors used in the texture. Each group of 3 uint32 form a R G B color.
For the MipMap images, the first image (level 0) is the texture image in its original dimensions. All following levels have dimensions that are a quarter the size of the previous level. For example, for a 16x16 texture:
Level 0 is 16x16 (original) Level 1 is 8x8 Level 2 is 4x4 Level 3 is 2x2