All effects

x' = x / z , y' = y / z

Starfields.

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.

8-bit16-bitPCGPU

How it works

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.

Per frame, in pseudo-code
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)

Timeline

Documented milestones, with a source for each. Famous examples, not claims of who did it first.

  1. 19798-bit

    Star Raiders

    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.

    Source
  2. 198716-bit

    Sprite-only parallax

    Christian 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.

    Source
  3. 198716-bit

    Stars as the main act

    Tristar · Stars -Born- · Amiga OCS/ECS

    A sparse logo-and-stars production where the moving background itself is the show.

    Source
  4. 198816-bit

    Horizontal stars and Soundtracker

    Phenomena · The Star Flight · Amiga

    A horizontal starfield combined with a Soundtracker tune, the combination that became standard intro vocabulary.

    Source
  5. 1993PC

    3D stars behind the text

    Phantom / Epical · Hoax #3 · DOS

    A diskmag opening with a 3D starfield flying behind a sine scroller: perspective motion gives depth to readable foreground text.

    Source
  6. 2013GPU

    Star Nest

    Pablo 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.

    Source
  7. 2013GPU

    A starfield shader for games

    Morgan 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.

    Source
  8. 2022GPU

    Star Nest in an engine

    ColorauGuiyino · Godot 3 shader

    The shader becomes a reusable engine component, with the advice to render it downscaled because it is so expensive.

    Source

Over time

6 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.

Atari 8-bit · 160 wide

Cockpit view

1979

In the spirit of Star Raiders: three brightness levels, wide pixels, a crosshair and a HUD counting down energy.

8-bitCPU3Dcrosshair
Detail page
Amiga · hardware sprites

Sprite parallax

1987

Three layers scrolling sideways at 30, 70 and 150 pixels per second in three greys. On real hardware: one sprite, reused on every line.

16-bitCPUparallax12-bit colour
Detail page
PC · VGA mode 13h

3D starfield

1993

700 stars, one division each, slowly rolling. Brightness from a 64-step palette, 2×2 pixels when close.

PCCPUperspective256 colours
Detail page
PC · 320×200

Warp streaks

'90s

A line from each star's previous to its current position, over a fading frame. The speed breathes from cruise to hyperspace.

PCCPUlinesfeedback
Detail page
GPU · after Star Nest

Fractal star volume

2013

After Kali's Star Nest: a folded fractal volume sampled along every view ray. Stars and dust appear from maths, not from a list.

GPUGPUvolumetrickaliset
Detail page
GPU · GLSL

Layered hash stars

today

Twelve layers of procedurally placed, twinkling, coloured stars, zooming through each other over a faint nebula, infinite, with no star list.

GPUGPUproceduralparallax
Detail page