smallpt: Global Illumination in 99 lines of C++

smallpt is a global illumination renderer.
Features:

* Global illumination via unbiased Monte Carlo path tracing
* 99 lines of 72-column (or less) open source C++ code
* Multi-threading using OpenMP
* Soft shadows from diffuse luminaire
* Specular, Diffuse, and Glass BRDFs
* Antialiasing via super-sampling with importance-sampled tent distribution, and 2×2 subpixels
* Ray-sphere intersection
* Modified Cornell box scene description
* Cosine importance sampling of the hemisphere for diffuse reflection
* Russian roulette for path termination
* Russian roulette and splitting for selecting reflection and/or refraction for glass BRDF
* With minor changes compiles to a 4 KB binary (less than 4096 bytes)

Related Posts