All effects

angle = f(y, t)

Twister.

1990 to today

A square bar, rotating by a different amount on every line, so it twists like taffy. It looks like a 3D object, but it is only a stack of 1D drawing problems, one scanline at a time.

8-bit16-bitPCGPU

How it works

The algorithm

Treat the bar as a stack of square cross-sections, one per scanline. Rotate each square by an angle that depends on the line and on time. Project its four corners onto the x-axis: an edge whose right corner lies to the right of its left corner faces you, so draw that span. The span's width doubles as lighting, a wide face points at you, a narrow one is turning away.

The old-hardware trick

No 3D maths per pixel: a sine table gives the four corner positions per line, and the visible spans are plain horizontal fills, exactly what blitters and 68000 move loops were good at. Texturing just steps a u coordinate across each span.

Per frame, in pseudo-code
for y in 0..199:
  a = t + SIN[y·k + t] · twist
  for i in 0..3:
    x[i] = cx + COS[a + i·90°] · R
  for i in 0..3:
    if x[i+1] > x[i]:              // face is visible
      light = (x[i+1] − x[i]) / (R·√2)
      hline(y, x[i], x[i+1], face[i] · light)

Timeline

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

  1. 199016-bit

    A twister in an Amiga demo

    Brainwave · Brand New Demo · Amiga OCS

    One of the earliest dated productions in Break's Amiga collection carrying the ‘twister’ tag.

    Source
  2. 199116-bit

    Hardwired

    Crionics & The Silents · Amiga OCS

    The celebrated trackmo released at the end of 1991 is also tagged for its twister.

    Source
  3. 200116-bit

    A textured bar on the ST

    Sector One & Dune · Odd Stuff · Atari ST

    Featured in the Atari effects history: a texture wrapped around the twisting bar.

    Source
  4. 200916-bit

    A large shaded twister

    Rave Network Overscan · Sodium · Atari ST

    A big, carefully coloured bar: gradients give surface depth without any general 3D geometry.

    Source
  5. 2012PC

    A twister in 128 bytes

    frag / fsqrt · cord · MS-DOS

    Demozoo tags this March release as a twister, squeezed into a 128-byte intro.

    Source
  6. 201316-bit

    The twister becomes a trunk

    Genesis Project · ElefantaSTic · Atari ST

    The twisting form reworked into an elephant's trunk: the effect as a designed object rather than an anonymous bar.

    Source
  7. 2020GPU

    The formula, published

    Nikos Papadopoulos (4rknova) · GLSL · Shadertoy

    A blog article with live shader sets out the cross-section formula and the visible-edge test.

    Source
  8. 20218-bit

    Back on the C64

    Booze Design · For Your Sprites Only · Commodore 64

    A 16K intro tagged ‘twister’, proof that the history does not run one way from 8-bit to GPU.

    Source

Over time

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

Amiga · 12-bit colour

Flat twister

1990

Four faces in four colour gradients, each lit by its own width, over pulsing copper bars.

16-bitCPUspansgradient
Detail page
Atari ST · 512 colours

Textured twister

2001

An XOR texture wrapped around the bar: u steps across each visible face, v scrolls down the screen. Quantised to the ST's 9-bit colour.

16-bitCPUtexture9-bit colour
Detail page
MS-DOS · default palette

128-byte style

2012

Three twisters coloured straight from the VGA palette the PC boots with, no bytes left to set your own.

PCCPUsizecodingVGA default palette
Detail page
C64 · multicolour

C64 twister

2021

The 8-bit revival: fat 2:1 pixels, two C64 colour ramps on alternating faces, four shade steps.

8-bitCPU16 coloursrevival
Detail page
GPU · SDF

Raymarched twister

today

A real 3D box, twisted in space by rotating each point's xz-plane by its height, sphere-traced with diffuse, specular and rim light.

GPUGPUraymarchingdomain twist
Detail page