A fully-unbiased pathtracer. It started off as a toy project in Python, but I recently translated it into C++ due to performace reasons and implemented a bunch of features. It is about 2,200 lines of code and is not dependent upon any external libraries (save for FreeGLUT, which renders the GUI) so it can be compiled on any system.
Currently, the following features have been implemented:
- OBJ object description format (partial support: no materials)
- Basic geometric primitives (sphere, triangle, quadrilateral, plane, and axis-aligned bounding box)
- Variance-reduction sampling methods (uniform and jittered)
- Path tracing (bruteforce)
The following features are still being implemented:
- Full support for the OBJ file format (materials and textures)
- More geometric primitives (cone, circle, capped and capless cylinder, box, and possibly any mathematically-describable surface)
- Variance-reduction camera sampling methods (Hammersly, Halton, and Low-Discrepancy)
- Variance reduction for BRDFs (MIS, Bidirectional, and Metropolis)
- Acceleration structures (grid and Kd-tree)
- More BXXDFs (numerical BXXDFs, specular, and glass)
- Matrix transformations (scaling, rotation, and translation)
- A Blender exporter/importer (possibly, as OBJ is not very versatile)
A sample image (a modified Cornell box rendered with 2,116 samples per pixel):
The source code is avaliable from this GitHub repository.