Sample Render
A very simple WIP hobby CPU ray tracer with minimal GUI elements.
Heavily based on Ray Tracing In One Weekend, Ray Tracing from the ground up, PBRT
- Multiple integrators: Path Tracing, Direct Illumination
- Materials: Matte, Reflective, Transparent, Emissive
- Lights: Directional, Point, Area
- 3D meshes in .obj format
- BVH Optimization
- Multithreaded rendering
- GUI
- Dear ImGui + OpenGL 3 backend - for immediate mode GUI elements
- Eigen math library for linear algebra, affine transformations and other geometry utilities
- spng + miniz - for PNG encoding and decoding
- tinyobjloader for 3D meshes
I found pbrt's approach of letting the Material populate a BSDF then returning it too complicated for the basic tracer I'm implementing here, so I followed the architecture of [2], where the material returns the color at the hit point. This might perhaps break other rendering algorithms like MLT or SPPM - TBD.
The natural way of implementing area lights is to use the area form of the rendering equation, but this conflicts with multiple importance sampling. Therefore, I used the approach pbrt takes, that is converting the PDF from area to solid angle.
There are many things to improve regarding image textures, mostly sampling and filtering. At the moment, I do not see a reason to go through the trouble of implementing this. I just store the original image, as-is, relying on the high AA samples to deal with any artifacts regarding texture sampling. Elliptical weighted average does sound like a really interesting algorithm that I'd love to implement one day.
3D MeshesAffine transformations- Multiple Importance Sampling
Textures(partially)- Environment Light
- Fresnel dielectrics and conductors
- Oren-Nayar diffuse model
- Optimize BVH and add Surface Area Heuristic
- Efficient bucket rendering
- Bidirectional path tracing
- Disney BSDF
- glTF scene description format
Modified Cornell Box showcasing affine transformations, lambertian diffuse, perfect specular reflection and simple transparency
The Mori Knob (© Yasutoshi Mori) with lambertian diffuse material
Ray tracing in One Weekend cover render with Stanford bunny and spherical area lights
A simple sphere with a diffuse, spherical mapped UV test texture
-
Ray Tracing in One Weekend, Peter Shirley. 2020
-
Ray Tracing from the Ground Up, Kevin Suffern. 2007.
-
Matt Pharr, Wenzel Jakob & Greg Humphreys (2016). Physically Based Rendering: From Theory to Implementation (3rd ed.). Morgan Kaufmann Publishers Inc.




