// the take
A 256-line C++ raytracer written as lecture support code by ssloy, covering spheres, Phong shading, shadows, reflection and refraction in the smallest amount of code that still gets the point across. It's for someone learning the fundamentals of raytracing math, not for anyone who wants an actual rendering engine.
The whole thing fits in one file and one sitting — you can read top to bottom and see exactly how ray-sphere intersection, lighting and recursive reflection/refraction are implemented without any engine abstraction in the way. Zero dependencies, builds with a two-line CMake, and the Gitpod button gets you from click to rendered image with no local setup. It's part of a larger lecture series (tinykaboom, tinyrenderer) with an accompanying wiki that walks through the math, so the code isn't orphaned from its explanation.
It's a single hardcoded scene, not a library — there's no scene description format, no acceleration structure (BVH/KD-tree), so it's architecturally a dead end for anything beyond a handful of spheres. Single-threaded with no optimization of any kind, which is fine pedagogically but means there's nothing here to build a real renderer on top of. No tests and no error handling, which is expected for teaching code but worth knowing going in. Last commit is mid-2023 and the project is conceptually finished — don't expect fixes or feature additions, it's a frozen teaching artifact.
We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →