RasterCore
Ready to execute

Hardware Heritage

The Twister is a masterclass in pseudo-3D rasterization. It simulates a rotating, multi-sided column by calculating the width and shading of each face independently for every horizontal scanline.

Amiga Hardware

The Twister was an Amiga classic. By using the Copper to change the horizontal position and the bitplane pointers on every line, coders could "rotate" a tall column with virtually no CPU usage.

PC Math

On PC, the twister required calculating the width and visibility of 3-4 faces for every scanline and filling the resulting spans. It was a brutal test of raw integer rasterization speed.

Modern Ray-Box

The shader iterates through the faces of the twister, calculating their projected width and shading based on the rotation angle per-fragment.

Twister

A twisting 3D column of colored faces.

Legacy C (Scanline)

for (y=0; y < 200; y++) {
  float a = base + y * twist;
  x1 = sin(a) * width;
  x2 = sin(a + PI/2) * width;
  DrawSpan(x1, x2, color);
}

Modern GLSL

float angle = iTime + uv.y * 6.28;
for(int i=0; i < 4; i++) {
    float a = angle + i * 1.57;
    if (cos(a) > 0.0) draw_face();
}