.TLM in IGI 2 -- Full RGBA Terrain Lightmaps

1. Architectural Role & Engine Purpose

The TLM (Terrain Lightmap Cascades) format stores multi-layer 32-bit RGBA color lightmaps with 10 precomputed mipmap cascades in I.G.I. 2: Covert Strike.

Unlike IGI 1's monochrome 8-bit lightmaps, IGI 2's TLM files store full colored sunlight and ambient sky-radiosity (warm yellow direct sunlight, cool blue indirect mountain shadows), filtering seamlessly across vast valleys via 10 hardware mipmap cascades.

2. Binary File Layout & Memory Map Diagram

A TLM file contains lightmap dimensions, 10 mip cascade byte offsets, and contiguous RGBA pixel blocks:

IGI 2 TLM — 32-BIT RGBA COLORED LIGHTMAP CASCADE LAYOUT 0x00: Lightmap Header (32 Bytes) RGBA LIGHTMAP Magic "TLM " | Width (1024), Height (1024) | Format (32-bit RGBA) | Ambient Sky Tint | Direct Sun Color magic[4], version, width, height, mips(10), ambient_tint[4], sun_color[4] 10 Mip Cascade Byte Offsets (40 Bytes) 10 MIPS Array of 10 uint32 byte offsets pointing to each downsampled mipmap cascade level uint32_t mip_offsets[10] • Full 1024x1024 down to 2x2 32-Bit RGBA Colored Radiosity Cascades RADIOSITY Direct Sunlight (Warm Yellow) + Sky Ambient (Cool Blue) + Static High-Resolution Cast Shadows Precomputed radiosity lighting modulating diffuse terrain splatting

3. Multi-Texture Terrain Lighting Pipeline Diagram

The Direct3D 8 terrain shader modulates diffuse terrain splatting with colored TLM lightmap cascades:

IGI 2 TLM — COLORED RADIOSITY LIGHTING PIPELINE 1. STAGE 0: SPLAT • Terrain Splat Texture • Grass / Dirt / Rock • Direct3D 8 Texture 0 2. STAGE 1: TLM • Bind Colored TLM Mip • 32-Bit RGBA Sunlight • Trilinear Mip Filtering 3. RADIOSITY BLEND • D3DTA_DIFFUSE * TLM • Warm Sunlit Ridges • Cool Blue Shadow Valleys 4. FRAME PRESENT • Rich Colored Output • Vast Outdoor Vistas • Zero Dynamic GPU Rays

4. C++ Struct Definitions

#pragma pack(push, 1)
struct TlmHeader {
    char     magic[4];       // "TLM "
    uint16_t version;        // 2
    uint16_t width;          // 1024
    uint16_t height;         // 1024
    uint16_t mip_count;      // 10
    float    ambient_tint[4];// RGBA ambient color
    float    sun_color[4];   // RGBA sunlight color
    uint32_t mip_offsets[10];// Byte offsets to 10 mip cascades
};
static_assert(sizeof(TlmHeader) == 82, "TlmHeader must be 82 bytes");
#pragma pack(pop)