.TEX in IGI 2 -- Texture Cascades (v9/v11)

1. Architectural Role & Engine Purpose

The TEX (Covert Strike Texture Container) format stores compressed surface artwork, character skins, weapon textures, environmental bump maps, and cubemap reflections in I.G.I. 2: Covert Strike.

In IGI 2, textures transitioned to Version 9 and Version 11 formats, implementing native DXTC hardware texture compression (DXT1, DXT3, DXT5). Textures are transferred directly from disk into GPU video RAM without CPU decompression, dramatically improving detail and visual fidelity.

2. Binary File Layout & Memory Map Diagram

An IGI 2 TEX file contains a version header, format flags, and precomputed DXT compressed block mipmaps:

IGI 2 TEX TEXTURE — DXT1/DXT5 COMPRESSED CONTAINER LAYOUT 0x00: Header (32 Bytes) VERSION 11 FourCC "TEX " | Version (9 or 11) | Width, Height | Mip Levels | Compression FourCC ("DXT1", "DXT3", "DXT5") magic[4], version, width, height, mips, fourcc_format[4], flags (Cubemap, NormalMap) Hardware Block-Compressed Texel Payload (4x4 Blocks) DXTC BLOCKS Contiguous 4x4 pixel blocks: DXT1 (8 bytes per block, 6:1 compression), DXT5 (16 bytes per block, 4:1 smooth alpha) Directly mapped to Direct3D 8 D3DFMT_DXT1 and D3DFMT_DXT5 hardware surface formats Precomputed Mipmap Cascade Chain MIP CHAIN Downsampled 4x4 block pyramids down to 1x1 • Supports 6-sided environmental cubemap reflections Uploaded directly to GPU video RAM with zero software decompression

3. Direct3D 8 Zero-Copy GPU Upload Pipeline Diagram

Because texels are stored in hardware DXTC format, the texture loader uploads them directly via Direct3D 8:

IGI 2 TEX — ZERO-COPY DIRECT3D 8 GPU UPLOAD PIPELINE 1. DISK READ • Read DXT5 Stream • Inspect FourCC Format • Check Mipmap Count 2. D3D8 CREATE • CreateTexture() • D3DFMT_DXT5 Format • D3DPOOL_MANAGED 3. ZERO-COPY DMA • LockRect & Direct Memcpy • Zero CPU Decompression • Direct VRAM Transfer 4. GPU DECOMPRESS • Hardware Texturing • Trilinear Filtering • Cubemap Reflections

4. Architectural Mechanics & Engine Implementation Details

The introduction of DXTC in IGI 2 revolutionized the game's visuals:

  • 4:1 and 6:1 Memory Savings: DXT1 compresses 24-bit color at 6:1 ratio, and DXT5 compresses 32-bit color with smooth alpha at 4:1 ratio. This allowed high-resolution 1024x1024 textures to fit comfortably inside 32MB and 64MB GeForce graphics cards.
  • Bump Maps & Environmental Reflections: Version 11 introduced normal maps and 6-sided cubemap textures, giving metal weapon barrels and wet tarmac realistic specular highlights.

5. C++ Struct Definitions

#pragma pack(push, 1)
struct TexHeaderIgi2 {
    char     magic[4];       // "TEX "
    uint16_t version;        // 9 or 11
    uint16_t width;          // Texture width in pixels
    uint16_t height;         // Texture height in pixels
    uint16_t mip_levels;     // Mipmap count
    char     fourcc_format[4];// "DXT1", "DXT3", "DXT5"
    uint32_t flags;          // 1=Cubemap, 2=BumpMap, 4=Alpha
    uint32_t reserved[3];
};
static_assert(sizeof(TexHeaderIgi2) == 32, "TexHeaderIgi2 must be 32 bytes");
#pragma pack(pop)