Jump to content

MipTex

From modding.dev WIKI
Revision as of 13:20, 1 January 2026 by XBLAH (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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