RC RANDOM CHAOS

How Comanche's 1992 Voxel Space Engine Rendered Terrain Without a GPU

· via Hacker News

Original source

Voxel Space

Hacker News →

A walkthrough reconstructs the rendering trick behind NovaLogic’s 1992 helicopter game Comanche, whose textured, shaded terrain looked years ahead of polygon-based contemporaries. The engine, dubbed Voxel Space, is a 2.5D approach closer to ray casting than true 3D: it reads a 1024x1024 height map and a matching color map (with shading already baked in) and draws the world as a series of vertical screen columns.

The core loop is strikingly compact. Working from far to near using the painter’s algorithm, the renderer projects a line across the map at each depth, samples height and color per column, applies perspective scaling, and paints a vertical strip. Adding camera rotation only requires precomputing sine and cosine to rotate the sampled line. Because the colormap stores precomputed lighting, no per-pixel illumination math is needed at runtime — a key reason it ran on early-90s CPUs.

The write-up also covers the standard optimizations that made the technique practical: flipping to front-to-back rendering with a per-column y-buffer to skip occluded pixels, and lowering sampling density with distance for a cheap level-of-detail effect. The code is MIT-licensed, though the author notes the underlying Voxel Space technique may still be patented in some jurisdictions, and the Comanche maps themselves are reverse-engineered assets excluded from the license.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.