A CPU raytracer built with C++20, featuring physically-based rendering with Cook-Torrance materials, soft shadows via area lights, and BVH acceleration.
- Whitted-style ray tracing on the CPU
- Parallel rendering with
std::execution::par_unseq - Cook-Torrance BRDF (GGX distribution, Smith geometry, Fresnel-Schlick)
- Lambert and Lambert-Phong shading models
- Soft shadows with area lights (triangular)
- Progressive rendering with per-frame accumulation
- Anti-aliasing: random and uniform multi-sampling
- Triangle mesh rendering with OBJ loading
- Bounding Volume Hierarchy (BVH) acceleration
- AABB slab test for ray-box intersection
- Multiple debug visualization modes: observed area, radiance, BRDF, combined
- Tone mapping (Reinhard Jodie, ACES approximation)
- Custom math library (vectors, matrices)
Camera
WASD: Move
LMB + drag: Rotate
Settings
X: Screenshot
F2: Toggle shadows
F3: Cycle light mode (observed area / radiance / BRDF / combined)
F4: Cycle sample mode (random / uniform)
F5: Decrease samples per frame
F6: Increase samples per frame
F7: Cycle tone mapping (none / Reinhard Jodie / ACES)
F8: Toggle progressive rendering
F9: Toggle BVH acceleration
F10: Cycle BVH debug (off / leaf colors / AABB wireframe)
Scenes
1-9: Switch scene
The project uses CMake.
cmake -S . -B build
cmake --build build


