A physically based offline CPU pathtracer written in C++20
San Miguel - Rendered with 1024 SPP, 128 bounces

- C++20 compiler
- Cmake 3.22+ for building
- Cloning the project with submodules:
git clone --recurse-submodules https://github.com/marko176/PathTracing.git- Building the project:
cd PathTracing
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release -j N (set N to thread count)- Running the pathtracer do:
./Release/PathTracer
Output images will be stored in: Output/
-
Camera with field of view and thin-lens approximation
-
BVH2 using SAH-based binned building and simd during traversal and BVH4 based on BVH4, split into:
- TLAS (Top-Level Acceleration Structure)
- BLAS (Bottom-Level Acceleration Structure)
-
Model Loading with Assimp
- Supports obj and gltf formats
- Supports model serialization for faster reloads in assbin format
-
Physically Based Materials
- Microfacet Dielectric
- Microfacet Diffuse
- Specular Dielectric
- Specular Conductor
-
Volumetric Rendering
- Supports participating media (homogeneous)
- Handles volumetric scattering and absorption within the path tracer
- Works with MIS and NEE for efficient light transport through media
-
Sampling
- Cosine-weighted importance sampling for Lambertian BRDF
- VNDF (visible normal distribution function) importance sampling for GGX specular BRDF
- Multiple Importance Sampling (MIS) with Next Event Estimation (NEE) weighted with the power heuristic Veach (1997)
- Russian Roulette path termination
-
Texture Mapping
- Albedo, Normal, Roughness, Metallic, Alpha, Emissive
- support for HDR textures