Skip to content
pavlov-netPublic

About

Experimental OpenPBR Raytracing Renderer

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

orr

orr (OpenPBR Raytracing Renderer) is an experimental renderer for Rust and Vulkan (with a Metal 4 backend in progress for Apple silicon), built around path tracing and OpenPBR materials, and aimed at today's top end GPUs and the ones coming next.

It starts from one question: what would you build if you were starting now and looking ahead? So all lighting is ray traced, geometry is meshlets from the start, the GPU decides what to draw, and assets are built ahead of time into the forms the GPU reads directly. There's no shadow map fallback and no older path kept alongside.

Full documentation is coming as a separate site.

Get the data onto the GPU and let it work

orr follows the thinking in Sebastian Aaltonen's No Graphics API, across the whole renderer and not only at the GPU layer:

  • Data, not objects. The scene is plain structs in GPU memory, reached through 64-bit pointers and 32-bit indices. There are no descriptor sets, vertex input or resource states to manage, and no CPU side copy of the scene to keep in sync.
  • You write data. Updating the scene means writing to mapped memory in a known layout, then making a few calls in a fixed frame order. One render thread runs those steps, with no render graph or task scheduler. orr starts only a loading thread and a present thread, and other CPU work runs on your threads.
  • The GPU does the work. Level of detail selection, culling, draw generation and streaming requests all happen on the GPU, and neural textures decode there too.
  • Your code is linked in. Surfaces, displacement, skies and media are Slang functions compiled into orr's shaders. There are no material graphs or plugin registries.

orr is a renderer and stays low level. Your application owns the window, the simulation and the world.

What's in it

Geometry

  • Meshlets in a cluster LOD DAG, with two pass HZB occlusion culling
  • Mesh shaders for large triangles and compute rasterization for small ones, writing a visibility buffer
  • Cluster acceleration structures and a partitioned TLAS, so ray tracing sees the same detail as raster
  • Opacity micromaps for alpha tested geometry
  • GPU skinning through cluster templates, Catmull-Clark subdivision and displacement as tessellated clusters, and strands as linear swept spheres
  • Projected decals evaluated in both raster and ray tracing, runtime GPU mesh edits, and procedural geometry from your own GPU code
  • Large world precision with automatic render origin rebasing

Streaming

  • Meshlet streaming: mesh pages and their cluster acceleration structures stream in as the view needs them
  • Texture streaming through sparse images, driven by what shaders actually sample
  • Neural texture compression (NTC), decoded on the GPU with cooperative vectors, with its latents streamed as tiles
  • Instance pages and animation windows that stream and evict, plus custom blobs streamed into your own buffers and images
  • Fast file IO through IoRing (Windows) and io_uring (Linux), with VRAM budgets that adapt when memory runs short

Lighting and materials

  • Path tracing with shader execution reordering, plus an unbiased accumulation reference mode with thin lens camera rays
  • A real time OpenPBR BSDF, verified against the reference implementation
  • Light selection across many lights, including directional, point, sphere, area, emissive meshes and environment domes, guided by per pixel feedback, with light and BSDF samples weighed against each other, plus a world radiance cache
  • Glass with nested interiors, absorption and hero wavelength dispersion, which every path ray bends at
  • Direct lighting from the sun and local lights through glass and water surfaces by manifold next-event estimation, solving refracted paths through curved, normal-mapped or rough surfaces
  • Caustics through glass and mirrors from photons traced each frame into a world space grid, and a progressive photon map in the accumulation reference, for specular paths that next-event estimation doesn't find
  • Random walk subsurface scattering
  • Froxel fog, smoke, volumes from cooked or your own data, and lit, fogged particles
  • A physically based, spectral sky, sun and moon in orr_atmosphere

Output

  • HDR first: rendering happens in linear Rec.2020, with HDR10 (PQ), scRGB and SDR output that follows the display's settings
  • Gran Turismo 7's tone mapping, gamut compression for SDR, and lights in physical units
  • DLSS ray reconstruction, super resolution, DLAA and frame generation, with Reflex for low latency (dlss feature, on by default on Vulkan)
  • MetalFX ray reconstruction, temporal upscaling and antialiasing, and frame interpolation (metalfx feature, on by default on Apple silicon)
  • Auto exposure, auto white balance, local exposure, depth of field, motion blur and glare, plus hooks before exposure and after tone mapping
  • A transparent UI layer composited over presented (including generated) frames, with orr_egui and orr_gpui integrations

Assets

  • orr_cook turns glTF, USD, MaterialX and OpenVDB sources into archives of GPU friendly data: mesh pages, LOD DAGs, opacity micromaps, subdivision cages, BCn and NTC textures, sparse volume bricks, lights, domes and animations
  • Use it as an offline CLI tool, or as a library to cook in process at run time
  • Cooks are incremental, and results are cached by content

Getting started

You'll need:

  • an NVIDIA RTX card with a current driver (Vulkan 1.4), or a Mac with Apple silicon on macOS 27 or later with Xcode 27 or later and its Metal toolchain (Metal support is a work in progress)
  • on x86-64, a CPU that supports x86-64-v3
  • Rust, with the version picked by rust-toolchain.toml
  • a C++17 compiler
  • optionally, the NVIDIA DLSS SDK (DLSS_SDK), Vulkan headers (VULKAN_SDK) and clang for DLSS on Windows (orr builds without them)

Then:

bash tools/fetch-slang.sh
cargo run -p orr_examples --example viewer

The other programs in examples/ show one feature each: try sky, dielectrics for glass, skinned for animated characters, dense-vegetation for a large scene, reconstruction for DLSS or MetalFX, and gpui-overlay (--features gpui) for GPUI. When you're ready to read code, start with those examples and the orr crate.

Contributing

Install the pre-commit hook, which runs fmt, clippy and typos:

cargo install --locked prek typos-cli
prek install

Run tests with cargo run -p xtask -- test [FILTER]. Set VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation to run them under the validation layer. Its synchronization checks are much slower and stay off unless VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true asks for them too.

The glare and subsurface tables are generated and committed. After a change to the glare fit, the subsurface simulation or what either reads, cargo run -p xtask -- regen rewrites them.

About

Experimental OpenPBR Raytracing Renderer

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages