An ongoing multithreaded offline ray tracer (CPU-based), written in C++, focusing on rendering, spatial acceleration structures, and multithreaded performance optimization.
(Note: This is an active Work in Progress. Current implementation covers high-performance spatial sorting and temporal rendering, with upcoming plans to integrate pure Monte Carlo integration and Probability Density Functions (PDFs).)
The following benchmarks were recorded rendering the high-density Book 1 final scene (approx. 500 primitives) to demonstrate the performance impact of algorithmic spatial sorting compared to raw hardware multithreading.
Benchmarks recorded on an Intel Core Ultra 7 155H, with VisualStudio 2022 being configured on Release mode with -O2 compiler optimisation. To maximize performance without being bottlenecked by hardware scheduling, thread count was dynamically set via std::thread::hardware_concurrency. For optimal results on this specific architecture, utilizing the 6 Performance (P) cores is recommended over the Efficiency (E) or Low-Power (LP) cores.)
| Algorithm | Sequential | Multithreaded |
|---|---|---|
| Linear Intersection - |
3638.43 seconds (1 hour 38 seconds 430 milliseconds) | 499.92 seconds (8 minutes 19 seconds 920 milliseconds) |
| BVH Traversal - |
450.33 seconds (7 minutes 30 seconds 330 milliseconds) | 84.64 seconds (1 minute 24 seconds 640 milliseconds) |
- Algorithmic Optimization > Hardware Brute Force: A sequential BVH implementation (~450s) actively outperformed a fully multithreaded brute-force approach (~500s).
-
Hardware Scaling: After the
$O(\log{N})$ spatial optimization, multithreading yielded a highly efficient ~5.3x performance speedup (~450s down to ~84s). - Total Optimization: The combination of acceleration structure and hardware concurrency reduced the render time from over an hour to just 1.5 minutes, providing ~43x overall speedup.
- Surface Area Heuristic (SAH) for optimized BVH node splitting.
- Monte Carlo Integration and Importance Sampling.
- Participating Media (Volumetrics/Fog).
- Texture mapping and Perlin noise generation.
- Built following the foundational mathematics outlined in Peter Shirley's Ray Tracing in One Weekend and Ray Tracing: The Next Week books.


