All effects

Σ sin(…) → palette

Plasma.

1988 to today

Add a few sine waves, push the sum through a colour palette, move the phases. The plasma is the warm-up exercise of every demo coder, and on 1990 hardware, a clever lie: often only the palette moved.

8-bit16-bitPCGPU

How it works

The algorithm

For every pixel, add several sine waves of the x and y coordinates (and sometimes of the distance to a moving point). Animate their phases over time, then map the sum through a smooth, cyclic colour gradient. A variant computes a static fractal ‘plasma cloud’ once and animates only the colours.

The old-hardware trick

Sines were never computed at runtime: a 256-entry sine table and integer offsets did the work. On indexed-colour screens like VGA mode 13h, rotating the 256-colour palette animates every pixel at once for the cost of rewriting 768 bytes, the image itself never changes.

Per frame, in pseudo-code
for y in 0..199, x in 0..319:
  v  = SIN[x·a + t₁] + SIN[y·b + t₂]
     + SIN[(x+y)·c + t₃] + SIN[dist(x,y,cx,cy)·d]
  index = (v + 4) · 32          // 0..255
  pixel = palette[(index + t) & 255]

// palette cycling: draw once, then each frame
rotate(palette, 1)

Timeline

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

  1. 1988PC

    The palette-cycled fractal plasma

    Bret Mulvey · PC · VGA

    A diamond-square ‘plasma cloud’ is generated once, then animated purely by cycling the hardware palette, distributed on CompuServe. A different idea from the per-frame sine plasma that followed.

    Source
  2. 199116-bit

    Plasma in the intro vocabulary

    Yobbo / Anthrox · Amiga OCS/ECS

    ‘Plasma Intro’, a BBS advert, shows the effect has moved from graphics experiment into the standard toolkit of short Amiga intros.

    Source
  3. 1993PC

    Plasma becomes a surface

    Future Crew · Second Reality · PC · DOS / VGA

    Second Reality, winner at Assembly 1993, wraps an animated plasma around a spinning cube, no longer a full-screen background but a texture computed every frame.

    Source
  4. 2013GPU

    Shadertoy

    Iñigo Quilez & Pol Jeremias · Browser · WebGL

    Shader code that runs per pixel, shared in the browser. A plasma becomes a five-line fragment shader at full resolution, the ‘hello world’ of a new generation.

    Source
  5. 2013PC

    The original source code is released

    Future Crew · DOS source code

    For Second Reality's twentieth anniversary the full source is published, so the 1993 plasma can be studied line by line instead of reconstructed from video.

    Source
  6. 2015GPU

    From tutorial to shader

    Salomonsson · Shadertoy · C++

    A documented walk from the sum-of-sines maths to a Shadertoy shader and then into a native application, the plasma as a teaching staple.

    Source

Over time

7 live versions, from the oldest platform to today: 5 on the CPU, 2 on the GPU. Retro versions run at their original resolution and palette. Demos pause when off screen.

C64 · 40×25 chars

Character plasma

late '80s

One colour pair per 8×8 character cell, mixed with a dither pattern in fat 2:1 multicolour pixels, how a 1 MHz machine fakes a smooth gradient. Light-blue border included.

8-bitCPU16 coloursdither
Detail page
Amiga · Copper

Copper plasma

1991

No bitmap at all: the Copper co-processor rewrites a colour register every 8 pixels of every scanline. Blocky horizontally, silky vertically, in 4096 possible colours.

16-bitCPU12-bit colourcopper
Detail page
PC · VGA mode 13h

Palette-cycled cloud

1988

A diamond-square fractal computed once. Every frame only the 256-colour palette rotates, the picture never changes, yet everything flows.

PCCPUpalette cyclingfractal
Detail page
PC · 486 · 320×200

Sine-table plasma

1993

Four lookups in a 256-entry sine table per pixel, one of them on the distance to a wandering point, recomputed every frame.

PCCPUlookup tables256 colours
Detail page
PC · DOS

Plasma cube

1993

After Second Reality: a 64×64 plasma is recalculated every frame and texture-mapped onto a rotating cube with affine mapping and 16 shade levels.

PCCPUtexture3D
Detail page
GPU · GLSL

Shader plasma

2010s

The same sum of sines, evaluated per pixel at full resolution with a cosine colour palette instead of a table.

GPUGPUfragment shader
Detail page
GPU · GLSL

Domain-warped plasma

today

Noise fed into noise fed into noise: fractal Brownian motion whose coordinates are warped by more fbm. The plasma grown into marbled smoke.

GPUGPUfbmdomain warping
Detail page