Software rendering in 500 lines of bare C++(haqr.eu)
293 points by mpweiher 1 day ago | 69 comments
tl;dr: A tutorial series that builds a software renderer in ~500 lines of C++ from scratch, with no third-party graphics libraries, to teach how APIs like OpenGL, Vulkan, Metal, and DirectX actually work under the hood. Starting from just a TGA image class with pixel-setting capability, students implement line and triangle rasterization themselves, typically taking 10-20 hours to produce a capable renderer that handles 3D models with textures. Full source is on GitHub.
HN Discussion:
  • Personal success stories of completing this tutorial and learning a lot from it
  • This resource is an indispensable classic for learning software rendering
  • The tutorial falls short by not properly covering triangle clipping, which is essential in practice
  • The 'bare C++' framing is misleading since modern systems always run on layers of APIs and drivers
  • Questions about complementary resources or related lectures on the topic