A multithreaded, BVH enabled, cpu path tracer using a Whitted-style, iterative light transport integrator built to study performance, memory behaviour and algorithmic bottlenecks on multi-core CPUs.
- Materials are modeled as BSDF-like scattering functions that stochastically generate outgoing rays and attenuate energy (lambertian, dielectric, metal, emissive)
- Parallelizes rendering across image rows using OpenMP and employs a thread-local RNG (XorShift)
- Iterative ray traversal (no recursion)
- Bounding Volume Hierarchy (Median Split Strategy) has been implemented
Have CMake installed.
Use this when you just want to generate your image.
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
./raytracercmake -DCMAKE_BUILD_TYPE=Profile ..
make
# this runs the code, creates gmon.out, and generates analysis.txt
make analyzeUse feh output/image.ppm to view the generated image.
- AoS to SoA
- SIMD vectorization
- More primitive shapes
- Define explicit distribution functions for material types
- .obj file loading
- Ray Tracing in One Weekend by Sherley, Black and Hollasch
- What Every Programmer Should Know about Memory by U Drepper
- BVH - PBR Book
- BVH (Morton Codes) - Ten Minute Physics (Video)
- A reddit post on r/nvidia on BVH
- HackerNews thread on Fast and Slow If statements
- How Branch Prediction Works on CPUs - Computerphile (Video)

