Physically based software pathtracer
- Support for multiple types of primitives (Spheres, Triangles, Parallelograms, Parallelipeds)
- Handrolled BVH2 implementation (SAH construction, ordered traversal)
- Triangle mesh loading (.obj format)
- Materials: Lambertian diffuse BRDF, basic glass BSDF and metallic BRDF
- Environment map defined lighting (.hdr, .exr)
- Generation of auxiliary passes (albedo, normal) for denoising
- Generation of BVH debug and visualization passes (node intersects, primitive checks)
- Multithreaded, tiled rendering
- Denoising through Intel OpenImageDenoise integration
- Basic filmic tonemapping
All images were rendered and postprocessed exclusively within this software on an i7U quadcore @ 3.1 GHz processor.
1080p, 512 spp, ~870k triangles @ ~1 MRays/s in 17:45 minutes

1080p, 1024 spp, ~5k primitives @ ~0.7 MRays/s in 49:40 minutes (no denoising/tonemapping)

In addition to the final render, Softpasses also produces and outputs a collection of auxiliary/intermediate passes.
The raw computed HDR luminance data before denoising, tonemapping and gamma correction.

Describing the diffuse reflection and surface normal properties of the scene, they serve as common auxiliary inputs for denoisers, and are fed to the Intel OIDN library during the postprocessing stage.

BVH visualization passes such as Average number of node checks per pixel and Average number of primitive checks per pixel aid in profiling and debugging the acceleration structure. Both heatmapped (ie normalized to 0-1, as seen below) and raw HDR versions are supplied.

- Environment map importance sampling (Contrast-rich environment maps lead to very noisy images currently. Ideally take advantage of MIS to importance sample both the environment map and materials.)
- Support for texture mapping on models (eg diffuse, roughness, metallic maps)
- Implementation of a physically based general-purpose BSDF, eg the Burley BSDF
- Support for a user friendly scene description format, like glTF or USD
Prerequisites:
- Have Intel OpenImageDenoise library installed
Then build in release mode (debug builds are very slow):
cargo build --release
Run the following to render the current scene:
cargo run --release -- <output directory>
There is no proper, user friendly way to do so at the moment, but you can play around with the scene and render settings inside main.
A practical introduction to the basics of raytracing, which this project was originally loosely based on:
Peter Shirley - Ray Tracing in One Weekend
For all your PBR needs:
Pharr, Jakob, Humphreys - Physically Based Rendering: From Theory to Implementation
A great tutorial on building BVHs:
Bikker - How to Build a BVH (Article series)
Arguably more of historical importance, these two papers were among the first to discuss the usage of BVHs in Raytracing. Regardless, they give a good overview of the fundamental problem at hand:
Kay, Kajiya (1986) - Ray Tracing Complex Scenes
Goldsmith, Salmon (1987) - Automatic Creation of Object Hierarchies for Ray Tracing