Racing the beam
1977Every scanline gets its own background colour from the 128-colour NTSC palette, and a mirrored 20-block playfield is reprogrammed on the fly, there is no frame buffer to draw into.
colour = f(scanline)
1977 to today
The oldest trick in the book: change a colour register at exactly the right moment while the electron beam sweeps the screen. No pixels drawn, just perfect timing, line after line.
The algorithm
A raster bar is a colour gradient that belongs to scanlines, not to pixels. For each line of the screen, decide which bar covers it (bars move on sine curves, nearer ones drawn last) and set the background colour for that line. Kefrens bars are a different beast: one line buffer that is never cleared, so every scanline adds a small bar and shows the accumulated result.
The old-hardware trick
On the C64 a raster interrupt fires at a chosen line and the code rewrites the border colour register, timed to the cycle. The Amiga's Copper co-processor runs a tiny program in sync with the beam: ‘wait for line 100, set colour 0 to $F80’, free bars without using the CPU. The Atari 2600 had no frame buffer at all, so every game raced the beam.
on every scanline y: // raster interrupt / copper
c = background
for bar in bars sorted by depth:
if |y − bar.y(t)| < bar.size / 2:
c = bar.gradient[y − bar.top]
COLOR0 = c // written as the beam passes
// Kefrens bars: line buffer is never cleared
draw_bar(linebuffer, x = sine(y, t))
show(linebuffer) on line yDocumented milestones, with a source for each. Famous examples, not claims of who did it first.
Atari 2600 programmers · Atari 2600
The console has no frame buffer: programs set colours while the beam draws each line. Raster-bar-style colour changes were part of the hardware's everyday reality, on the 2600 and on Atari's 8-bit computers.
SourceC64 coders · Commodore 64
A raster interrupt at a chosen scanline lets code rewrite the border or background colour register mid-frame, gradients without touching a single bitmap byte.
SourceCommodore Amiga · Amiga OCS
The Amiga's Copper co-processor executes a list of ‘wait for beam position, write register’ instructions in sync with the display. Copper bars cost the CPU nothing.
SourceAlcatraz · Megademo 3 · Amiga
The ‘We Are First’ part shows the vertical curtain of bars built line by line from a buffer that is never cleared, known to most as Kefrens bars.
SourceAngels · Amiga OCS/ECS
A whole production dedicated to Copper effects. Its preservation notes describe timing repairs, proof of how tightly these effects hung on display timing.
SourceRachy, TPSH, LBM · 48 Hours Party · Commodore Plus/4
Part 3 is explicitly labelled ‘Kefrens Bars’: the effect migrates from the Amiga to another 8-bit architecture.
SourceXtaC / Garbage · MS-DOS
Without any display co-processor, the PC packs the look into a 256-byte intro: executable size, not hardware, becomes the constraint.
Sourcereilar · GLSL · KodeLife / Shadertoy
The appearance rebuilt from pure shader arithmetic, no longer timed to a physical CRT beam.
Source5 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.
Every scanline gets its own background colour from the 128-colour NTSC palette, and a mirrored 20-block playfield is reprogrammed on the fly, there is no frame buffer to draw into.
Five classic C64 colour ramps race through the border while BASIC sits there, READY. The screen is untouched: only the border colour register changes per line.
Seven 12-bit gradient bars on sine paths, depth-sorted so they pass behind each other, mirrored in a wobbling copper floor.
One 320-pixel line buffer that is never cleared. Each scanline stamps a 16-pixel bar at a sine-driven x and shows the buffer, the curtain builds itself.
The same bars as a fragment shader: additive glow, a reflective floor, scanlines and CRT curvature, the beam simulated instead of raced.