Fractal mountains
1985In the spirit of Rescue on Fractalus!: a fractal height map behind a cockpit frame, smothered in thick purple atmosphere, in a coarse 3-bit-per-channel palette.
screen_y = (cam_h − H[p]) / z + horizon
1985 to today
Fly low over mountains that are nothing but a height map and a colour map. Comanche made it famous, a 5 KB program called Mars made jaws drop, and the demoscene bent it into caves, letters and tunnels.
The algorithm
For every screen column, walk away from the camera across a height map. At each step, look up the terrain height there, project it to a screen row by dividing by the distance, and draw a vertical strip in the colour-map colour, but only the part that sticks out above everything drawn in that column so far. Step sizes grow with distance; far strips fade into fog.
The old-hardware trick
Draw front to back and keep a per-column ‘horizon’ (y-buffer): once a column is covered to the top, nothing behind it costs anything. One height and one colour per map position replace all 3D geometry, and a growing step size means distant terrain costs less than nearby terrain.
ybuffer[0..w] = screen_height
for z = 1; z < far; z += dz, dz += 0.01:
left, right = view_frustum_edge(z)
for x in 0..w: // one point per column
p = lerp(left, right, x / w)
y = (cam.h − HEIGHT[p]) / z · scale + horizon
if y < ybuffer[x]:
vline(x, y, ybuffer[x], fog(COLOUR[p], z))
ybuffer[x] = yDocumented milestones, with a source for each. Famous examples, not claims of who did it first.
Lucasfilm Games (fractals: Loren Carpenter) · Atari 8-bit
Fractal mountains generated in real time on an Atari 800, seen through a dense alien atmosphere from a cockpit, the landscape as a procedural object, on 8-bit hardware.
SourceNovaLogic · Comanche · PC · DOS
Terrain from a height map and a colour map instead of polygons, a 2.5D height field, not a volumetric voxel world, but the name stuck.
SourceTim Clarke · PC · DOS
Navigable procedural Martian terrain in a roughly 5 KB executable; the surviving disassembly project preserves a detailed reconstruction.
SourceTim Clarke · comp.graphics.algorithms
Clarke explains Mars: a wrapping 256×256 height and colour map, terrain by recursive subdivision, and visibility like a floating horizon.
SourceIguana · Heartquake · MS-DOS
Greetings rendered as voxel height fields, the famous WATER part among them. Wild Light's Drift (1995) later returned to voxel letters.
SourceEMF · Verses · MS-DOS · 64K
A voxel landscape mirrored into a ceiling, so the camera flies through a cave instead of over a plain.
SourceNoooN · Stars: Wonders of the World · MS-DOS
Voxel Space wrapped around the view axis: a height map bent into a tube, flown through at speed. One of the scene's signature tunnels.
SourceIguana · Despair · MS-DOS
Voxels used for an object instead of terrain: a morphing blob, far from the flight-simulator use of the technique.
SourceSebastian Macke · JavaScript
The terrain renderer reduced to a short, inspectable algorithm, with front-to-back drawing and y-buffer occlusion explained.
Source6 live versions, from the oldest platform to today: 4 on the CPU, 2 on the GPU. Retro versions run at their original resolution and palette. Demos pause when off screen.
In the spirit of Rescue on Fractalus!: a fractal height map behind a cockpit frame, smothered in thick purple atmosphere, in a coarse 3-bit-per-channel palette.
The Comanche algorithm: a 512×512 diamond-square height map, a slope-lit colour map with water, grass, rock and snow, a y-buffer and distance fog.
Tim Clarke's red planet, recreated with the same renderer: rust-coloured dunes and a dusty pink sky that swallows the distance.
After NoooN's Stars: one ray per angle fans out from the screen centre, walks the tube front to back, and wall height pushes the surface inward. A radial horizon replaces the y-buffer. The walls carry a sea-and-land map, and after a few seconds the tube starts to twist.
Not voxels, for contrast: this is how Elevated-style terrain works. Noise with analytic derivatives that damp the higher octaves on slopes, eroded-looking ridges, raymarched per pixel with sun, snow and aerial perspective.
What ‘voxel’ means now: a grid of cubes. Each ray steps cell by cell through the height columns (a DDA) and lights the face it hits.