27  Rendering: Lookup Tables

This tour examines DOOM’s lookup tables used for efficient rendering calculations, including angle tables, color maps, and view mapping tables.


tables.h declares lookup tables used for fast trigonometry calculations: - finesine and finecosine store pre-calculated sine/cosine values - finetangent stores pre-calculated tangent values - tantoangle converts slope values to angles

File: linuxdoom-1.10/tables.h (lines 56–65)


We’ll look at how Doom loads its color lookup tables from the COLORMAP lump into memory.


Binary Angle Measurement (BAM):

Explanation: BAM angles are converted to table indices by shifting right and masking. This maps the full 0–360° BAM range to table entries, with 90° aligning to quarter-points.


Trigonometric and Angle Tables:


Dynamic Lighting and View Mapping Tables:


Texture Mapping:


The next steps explore lookup tables used in DOOM’s rendering system. We’ll examine arctangent lookups, dynamic lighting calculations, and texture mapping tables.


And that was it.