A C++20 path tracer that loads OpenUSD scenes, combining a real-time OpenGL preview with multi-threaded CPU path tracing.
Devlog: Path Tracer Progress 1
- OpenUSD input — loads
.usda/.usdscenes directly (meshes, transforms, MaterialX surfaces) - Physically based rendering — Diffuse / Dielectric / GGX / GGX-Dielectric / Principled BSDFs, F82-tinted Fresnel, Smith G, cosine / GGX importance sampling
- Multiple integrators — naive path tracing, next-event estimation, and multiple importance sampling (MIS)
- BVH acceleration — two-level BVH (per-mesh and scene-level) built with the Surface Area Heuristic
- OpenGL preview — G-Buffer + SSAO, shadow mapping, debug drawing (BVH / TBN / axes)
- ImGui UI — live editing of rendering parameters, materials, and camera
- Denoising via OpenImageDenoise
- Math notes on the rendering equation and BSDFs: rendering_memo.md (Japanese)
- C++20 compiler
- CMake 3.10+
- OpenUSD (submodule, prebuilt artifacts expected at
extern/usd/) - Boost 1.85+ (
headers,log,log_setup) - Eigen3
- GLFW3
- OpenGL
- Dear ImGui (submodule)
- GLM (
extern/glm/) - OpenImageDenoise
- Python (required when linking OpenUSD)
The CMake setup targets macOS / Apple Silicon (links Cocoa / IOKit / Foundation frameworks, uses /opt/homebrew for include and link paths).
Clone with submodules:
git clone --recursive <this-repo-url> NovaRay
cd NovaRayBuild OpenUSD from extern/OpenUSD and place its include/ and lib/ under extern/usd/.
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j
./NovaRayThe build type controls the log level:
CMAKE_BUILD_TYPE |
Log level | Optimization |
|---|---|---|
Debug |
debug |
none |
Release |
warning |
-O3 -ffast-math -march=native |
RelWithDebInfo |
debug |
optimized + ENABLE_ASSERT |
| (default) | info |
– |
Running the binary opens a preview window. From the ImGui panels you can load a scene (.usda), move the camera, edit BSDF parameters, and start rendering. A sample scene is included: testscene.usda.
Rendering parameters (src/renderer.h):
min_depth/max_depth— minimum / maximum path bounce countpath_termination_scale— Russian roulette aggressivenessgamma_correctionalgorithm— 0: naive, 1: NEE, 2/3: MISdenoise— OIDN post-processingupdate_result_interval— how often (in spp) results are written back to the preview
src/ renderer core
app.{h,cpp} app / GUI / worker thread management
renderer.{h,cpp} camera and path tracers
mesh.{h,cpp} Mesh / BVH / SceneBVH / USD loader
material.{h,cpp} BSDFs (Diffuse / GGX / Dielectric / Principled)
*.vs / *.fs preview GLSL shaders (G-Buffer, SSAO, depth)
extern/ third-party deps
OpenUSD/ OpenUSD source (submodule)
usd/ prebuilt OpenUSD (gitignored)
glm/ GLM headers
imgui/ Dear ImGui (submodule)
testscene.usda sample scene
textures/ texture assets
rendering_memo.md math notes on the rendering equation and BSDFs
