A game developer debugging a visual artifact in their game Blackshift discovered that GPU perspective-correct interpolation can introduce floating-point imprecision even when all three vertices of a triangle share the same value. The bug only appeared on certain hardware using perspective projection, not orthographic. The fix was simple: add 0.5f to the integer-cast-to-float value before writing it into the instance buffer, so any interpolation jitter stays within the correct integer range rather than rounding down to the wrong value.

7m read timeFrom foon.uk
Post cover image
Table of contents
ConclusionLinks

Sort: