5 minutes
Keep the World Precise as You Fly Far
Point the falcon at empty space and hold the throttle. For a while the view looks clean. Then you fly far out, tens of thousands of units from the start, and the picture starts to break up: the hull shimmers, the motion picks up a small jitter, distant edges crawl. Your code did not change. Precision ran thin.
A single-precision float — what every matrix handed to the GPU is made of — carries about seven significant digits, and they are significant, not absolute. Spend five of them on the integer part and only two are left for everything smaller. The gap between neighbouring representable positions grows with distance from zero:
At a million units out the ship can only land on a grid whose steps are a hundredth of its own length — and it is the whole world landing on that grid, not just the ship. Every frame everything snaps to the nearest point on it, and that is the jitter — nothing is moving badly, the numbers just can't say where it is any more. The same thinning precision spread across a 200,000-unit depth range is what makes distant edges crawl.
See the jitter a million units out
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.