Lab · hands-on
Mode 7 live
One flat texture layer, drawn by inverse mapping scanline by scanline. Turn the rotation and the camera height, move the horizon, switch on per-scanline perspective — and watch a flat map go from a spinning carpet to a track running off to the horizon. Turn on "retro precision" and the shimmer crawls in near the horizon.
How to use this
The picture is drawn the way F-Zero does it: every scanline below the horizon gets its own scale ∝ 1/p (p being pixels below the horizon), and one flat tilemap is sampled along the line. Rotation spins the whole layer (like the world around the car). Camera height squeezes or stretches the depth. Perspective off → every line gets the same scale → a flat spinning carpet with no horizon. Retro precision 8.8 → the step across the map is quantized and shimmer appears in the distance (there are no mipmaps).
What to notice: 1) turn off perspective — the horizon disappears and all that is left is a rotating flat layer (affine, no depth). 2) lower the camera height — the depth flattens and the horizon comes closer; raise it and the floor stretches into the distance. 3) turn on retro precision 8.8 and look right at the horizon: the texture shimmers — a huge scale plus a quantized step, and no mipmaps. 4) hit auto-fly and turn θ — the world flows under a fixed camera, exactly like the track around the car.
🏠 What's next
Go back to the lesson, block "🔧 Run it and poke at it": open F-Zero in bsnes-plus/Mesen-S and in an HDMA trace you'll see exactly this computed scale written into the M7A…M7D matrix before every scanline.
Connections
from the lesson
SNES Mode 7 — the theory: the affine matrix, inverse mapping, per-scanline perspective
scale(p)=h/p, 8.8 fixed point.next
Quake: real 3D — when depth changes along the scanline, one divide per line isn't enough → per-pixel perspective.
What to notice afterwards (observation checklist)
- Perspective off → a flat spinning carpet; on → the floor runs to the horizon. Depth here is a per-scanline scale, not geometry.
- Camera height stretches and squeezes the depth, the horizon moves the vanishing line.
- Retro precision 8.8 → shimmer at the horizon (enormous scale + quantized step + nearest, no mipmaps).
- Auto-fly + rotation: the world moves and spins under a fixed camera — the F-Zero trick.