Cockpit view
1979In the spirit of Star Raiders: three brightness levels, wide pixels, a crosshair and a HUD counting down energy.
x' = x / z , y' = y / z
1979 to today
The cheapest way to say ‘space’: a few hundred dots and a division. Behind countless intros, cracktros and diskmags, the starfield was the stage everything else performed on.
The algorithm
Give each star a position (x, y, z). Every frame, move it closer by decreasing z, project it with x/z and y/z, and draw it brighter and bigger the closer it is; recycle it far away when it passes the camera. For a 2D parallax field, simply scroll layers sideways at different speeds. Join each star's previous and current projection with a line and you have warp speed.
The old-hardware trick
Stars are sparse, so only a few hundred pixels change per frame, a perfect fit for slow machines. The Amiga reused a single hardware sprite many times down the screen, so the starfield cost no bitplane memory at all. On the PC, a division per star (or a reciprocal table) was all the maths needed.
for star in stars:
star.z -= speed · dt
if star.z < near: respawn(star, z = far)
sx = cx + star.x / star.z · focal
sy = cy + star.y / star.z · focal
plot(sx, sy, brightness = 1 − star.z)
// warp: line(previous projection → current)Documented milestones, with a source for each. Famous examples, not claims of who did it first.
Doug Neubauer · Atari · Atari 400/800
A first-person space game whose 3D starfield streaming past the cockpit made the effect iconic on home computers.
SourceChristian A. Weber · Insanity Fight intro · Amiga
Weber's own account: the starfield used sprites and no bitplanes, so it could be combined with other graphics at almost no memory cost. It was reused in SCA intros.
SourceTristar · Stars -Born- · Amiga OCS/ECS
A sparse logo-and-stars production where the moving background itself is the show.
SourcePhenomena · The Star Flight · Amiga
A horizontal starfield combined with a Soundtracker tune, the combination that became standard intro vocabulary.
SourcePhantom / Epical · Hoax #3 · DOS
A diskmag opening with a 3D starfield flying behind a sine scroller: perspective motion gives depth to readable foreground text.
SourcePablo Andrioli (Kali) · Shadertoy · GLSL
No points at all: a volumetric fractal that reads as stars and nebulae. A descendant of the starfield rather than the same algorithm.
SourceMorgan McGuire · GLSL · GeForce 650M
A performance-engineered adaptation renders procedural parallax at 3.7 ms per 1080p frame by working at reduced resolution and upsampling.
SourceColorauGuiyino · Godot 3 shader
The shader becomes a reusable engine component, with the advice to render it downscaled because it is so expensive.
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 Star Raiders: three brightness levels, wide pixels, a crosshair and a HUD counting down energy.
Three layers scrolling sideways at 30, 70 and 150 pixels per second in three greys. On real hardware: one sprite, reused on every line.
700 stars, one division each, slowly rolling. Brightness from a 64-step palette, 2×2 pixels when close.
A line from each star's previous to its current position, over a fading frame. The speed breathes from cruise to hyperspace.
After Kali's Star Nest: a folded fractal volume sampled along every view ray. Stars and dust appear from maths, not from a list.
Twelve layers of procedurally placed, twinkling, coloured stars, zooming through each other over a faint nebula, infinite, with no star list.