4 ms·
This was great, and took me back to the late 80s/early 90s when I was studying Michael Abrash and building software renderers before the first hardware 3D accel
by kingcharles 5y ago
This was great, and took me back to the late 80s/early 90s when I was studying Michael Abrash and building software renderers before the first hardware 3D accelerators appeared on the market.
While I eventually figured out that the reason my textures looked fucked up, especially in long corridors, was because they didn't take into account perspective and thus needed an extra set of per-row and per-pixel interpolations (which killed the frame rate), I actually never realized until this article that my Gouraud shading was actually suffering from the same issue because it was so much less noticeable to the eye.
- ggambetta 5y agoInterestingly, even the depth buffer is wrong if you interpolate Z linearly, but it's such a subtle effect, it's almost imperceptible. IIRC games back then also used to do perspective-correct interpolation every 8 or 16 pixels, and linearly in between, which is a good compromise (you always have to interpolate U and V, what they wanted to avoid was the division, which is more expensive). I've written about this here, https://gabrielgambetta.com/computer-graphics-from-scratch/12-hidden-surface-removal.html#why-1z-instead-of-z https://gabrielgambetta.com/computer-graphics-from-scratch/1..., including some detailed examples of how the math works. Very fun topic :)
- kingcharles 5y agoGod, your statement about the zbuffer is true too, and as you say it was too imperceptible to notice - though if I'd looked carefully there would surely have been some strange effects where polygons intersected. I didn't even think about the zbuffer and the shading when I wrote my engine - I was too preoccupied by the weirdness of the textures.
- kingcharles 5y agoAlso, please can you mail a copy of your book back to 1988 for me. Thanks.