Skip to content

daikiad/NovaRay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NovaRay

A C++20 path tracer that loads OpenUSD scenes, combining a real-time OpenGL preview with multi-threaded CPU path tracing.

Demo

NovaRay demo

Devlog: Path Tracer Progress 1

Features

  • OpenUSD input — loads .usda / .usd scenes 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)

Dependencies

The CMake setup targets macOS / Apple Silicon (links Cocoa / IOKit / Foundation frameworks, uses /opt/homebrew for include and link paths).

Build

Clone with submodules:

git clone --recursive <this-repo-url> NovaRay
cd NovaRay

Build 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
./NovaRay

The 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

Usage

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 count
  • path_termination_scale — Russian roulette aggressiveness
  • gamma_correction
  • algorithm — 0: naive, 1: NEE, 2/3: MIS
  • denoise — OIDN post-processing
  • update_result_interval — how often (in spp) results are written back to the preview

Layout

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

About

C++ path tracer with OpenUSD scene loading, MIS, and real-time OpenGL preview

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors