Its general goal is to get as close as possible to path-traced reference at real-time rates in dynamic scenes, without any precomputed light transport, or manually placed light probes.
kajiya
does not currently aim to be a fully-featured renderer used to ship games, support all sorts of scenes, lighting phenomena, or a wide range of hardware. It's a hobby project, takes a lot of shortcuts, and is perpetually a work in progress.
For more context, check out our announcement article on Embark's Medium. You'll also get to learn how kajiya
connects to our rendering work, and the rust-gpu
project!
Ruins environment rendered in kajiya. Scene by Crebotoly
- Hybrid rendering using a mixture of raster, compute, and ray-tracing
- Dynamic global illumination
- Multi-bounce temporally-recurrent voxel-based diffuse
- Short-range ray-traced diffuse for high-frequency details
- Single bounce specular, falling back to diffuse after the first hit
- Sun with ray-traced soft shadows
- Standard PBR with GGX and roughness/metalness
- Energy-preserving multi-scattering BRDF
- Reference path-tracing mode
- Temporal super-resolution and anti-aliasing
- Natural tone mapping
- Physically-based glare
- Basic motion blur
- Contrast-adaptive sharpening
- Optional DLSS support
- GLTF mesh loading (no animations yet)
- A render graph running it all
- A quick presentation about the renderer
- Repository highlights:
- HLSL shaders:
assets/shaders/
- Rust shaders:
crates/lib/rust-shaders/
- Main render graph passes:
world_render_passes.rs
- HLSL shaders:
- Notable branches:
restir-meets-surfel
- latest experimental branch, with new GI in the works
kajiya
currently works on a limited range of operating systems and hardware.
Hardware:
- Nvidia RTX series
- Nvidia GTX 1060 and newer (slow: driver-emulated ray-tracing)
- AMD Radeon RX 6000 series
Operating systems:
- Windows
- Linux
libtinfo5
uuid-dev
There's a very minimal asset pipeline in bake.rs
, which converts meshes from GLTF to an internal flat format, and calculates texture mips. In order to bake all the provided meshes, run:
- Windows:
bake.cmd
- Linux:
./bake.sh
When done, run the renderer demo (view
app from crates/bin/view
) via:
- Windows:
build_and_run.cmd [scene_name]
- Linux:
./build_and_run.sh [scene_name]
Where [scene_name]
is one of the file names in assets/scenes
, without the .ron
extension, e.g.:
build_and_run.cmd battle
or
cargo run --bin view --release -- --scene battle --width 1920 --height 1080 --no-debug
- WSAD, QE - movement
- Mouse + RMB - rotate the camera
- Mouse + LMB - rotate the sun
- Shift - move faster
- Ctrl - move slower
- Space - switch to reference path tracing
- Backspace - reset view to previous saved state
- Tab - show/hide the UI
To add new mesh(es), open bake.cmd
(Win) / bake.sh
(Linux), and add
- cargo run --bin bake --release -- --scene "[path]" --scale 1.0 -o [mesh_name]
To add new scenes, in \assets\scenes
, create a [scene_name].ron
with the following content:
(
instances: [
(
position: (0, 0, 0),
mesh: "[mesh_name]",
),
]
)
- Vulkan API usage is extremely basic. Resources are usually not released, and barriers aren't optimal.
- There are hard limit on mesh data and instance counts. Exceeding those limits will result in panics and Vulkan validation errors / driver crashes.
- Window (framebuffer) resizing is not yet implemented.
- The voxel GI uses a fixed-size volume around the origin by default.
- Use
--gi-volume-scale
to change its extent in theview
app - It can be configured to use camera-centered cascades at an extra performance cost (see
CASCADE_COUNT
andSCROLL_CASCADES
incsgi.rs
)
- Use
- Denoising needs more work (always).
This project is made possible by the awesome open source Rust community, and benefits from a multitude of crates ππ¦
Special shout-outs go to:
- Felix Westin for his MinimalAtmosphere, which this project uses for sky rendering
- AMD, especially Dominik Baumeister and Guillaume BoissΓ© for the FidelityFX Shadow Denoiser, which forms the basis of shadow denoising in
kajiya
. - Maik Klein for the Vulkan wrapper ash, making it easy for
kajiya
to talk to the GPU. - Traverse Research and Jasper Bekkers for a number of highly relevant crates:
- Bindings to the DXC shader compiler: hassle-rs
- SPIR-V reflection utilities: rspirv-reflect
- Vulkan memory management: gpu-allocator
- Blue noise sampling: blue-noise-sampler
We welcome community contributions to this project.
Please read our Contributor Guide for more information on how to get started. Please also read our Contributor Terms before you make any contributions.
Any contribution intentionally submitted for inclusion in an Embark Studios project, shall comply with the Rust standard licensing model (MIT OR Apache 2.0) and therefore be dual licensed as described below, without any additional terms or conditions:
This contribution is dual licensed under EITHER OF
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
For clarity, "your" refers to Embark or any other licensee/user of the contribution.