Skip to content
landris006Public

About

Real-time PBR renderer (work in progress)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Real-time Vulkan path tracer engine

Features

  • Hardware ray tracing (VK_KHR_ray_tracing_pipeline, VK_KHR_acceleration_structure)
  • Monte Carlo path tracing with progressive accumulation
  • Cook-Torrance BRDF: GGX NDF, Fresnel-Schlick, VNDF importance sampling
  • Next event estimation with explicit emissive triangle sampling, and MIS against the BRDF path
  • ReSTIR DI (Bitterli et al. 2020): RIS, temporal reuse and spatial reuse
  • SVGF denoising (Schied et al. 2017): separate direct and indirect channels, à-trous filter
  • Emissive radiance baked per triangle from emissive textures
  • HDR environment map lighting
  • glTF 2.0 / GLB (fastgltf) and Wavefront OBJ (tinyobjloader)
  • PBR textures: albedo, metallic-roughness, normal, emissive. DDS/BCn support
  • ACES tonemapping, gamma correction, firefly clamping
  • Shader hot reload
  • ImGui panels: camera, lights, denoiser controls, frame time
  • Headless mode for batch renders to PNG and EXR

Build

If you have Nix, you can just run:

nix develop

Otherwise, see flake.nix for required packages.

Building:

cmake -B build/debug -DCMAKE_BUILD_TYPE=Debug
cmake --build build/debug -j

Run

Interactive:

build/debug/engine --model assets/cornell.obj

Headless:

# reference path trace
build/debug/engine_headless --model assets/cornell.obj --samples 512 -o out.png

# ReSTIR DI and SVGF, single-frame quality
build/debug/engine_headless --model scene.gltf \
    --restir on --svgf on --accumulate off --samples 32

Common flags:

flag default meaning
--model path assets/cornell.obj glTF, GLB or OBJ scene
--skybox path - HDR environment map
--samples N 1 samples (headless frames) per pixel
--bounces N 4 path length. 1 is direct lighting only
-w, -h 1920, 1080 resolution
-o path output.png PNG output
--exr path - linear fp32 output, for metrics
--accumulate on|off on off keeps the last frame only
--restir on|off off ReSTIR DI
--svgf on|off off SVGF denoiser. Needs --restir on

scene.ini holds the camera. Ctrl+S saves it from the interactive renderer.

Example renders

4 bounces, 1000 samples:

dir_light

4 bounces, 4000 samples:

dir_light_4k

4 bounces, 1000 samples, no directional light:

output

About

Real-time PBR renderer (work in progress)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages