Experimental precise-time global illumination renderer made with Rust and Vulkan
Its total arrangement is to gain as shut as seemingly to direction-traced reference at precise-time charges in dynamic scenes, with none precomputed light transport, or manually positioned light probes.
kajiya does no longer at the moment arrangement to be a totally-featured renderer passe to ship video games, toughen all kinds of scenes, lighting phenomena, or a gigantic choice of hardware. It be a ardour venture, takes reasonably a couple of shortcuts, and is without end a work in growth.
For additional context, compare out our announcement article on Embark’s Medium. It is seemingly you’ll perhaps perhaps gain to be taught the methodology
kajiya connects to our rendering work, and the
Ruins ambiance rendered in kajiya. Scene by Crebotoly
- Hybrid rendering the vow of a mixture of raster, compute, and ray-tracing
- Dynamic global illumination
- Multi-jump temporally-recurrent voxel-essentially based utterly mostly diffuse
- Brief-vary ray-traced diffuse for excessive-frequency principal facets
- Single jump specular, falling support to diffuse after the first hit
- Sun with ray-traced soft shadows
- Long-established PBR with GGX and roughness/metalness
- Vitality-keeping multi-scattering BRDF
- Reference direction-tracing mode
- Temporal effectively-organized-choice and anti-aliasing
- Pure tone mapping
- Physically-essentially based utterly mostly glare
- Long-established motion blur
- Distinction-adaptive sharpening
- Now no longer major DLSS toughen
- GLTF mesh loading (no animations yet)
- A render graph working all of it
- A mercurial presentation referring to the renderer
- Repository highlights:
- HLSL shaders:
- Rust shaders:
- Major render graph passes:
- HLSL shaders:
- Principal branches:
restir-meets-surfel– most recent experimental branch, with unique GI within the works
kajiya at the moment works on a runt vary of working techniques and hardware.
- Nvidia RTX sequence
- Nvidia GTX 1060 and newer (gradual: driver-emulated ray-tracing)
- AMD Radeon RX 6000 sequence
(Some) Linux dependencies
- In case the bundled
libdxcompiler.sodoesn’t work: https://github.com/microsoft/DirectXShaderCompiler#downloads
Building and working
There is a truly minimal asset pipeline in
bake.rs, which converts meshes from GLTF to an inner flat format, and calculates texture mips. In show to bake all the supplied meshes, bound:
When performed, bound the renderer demo (
deem about app from
crates/bin/deem about) by technique of:
[scene_name] is one amongst the file names in
assets/scenes, with out the
.ron extension, e.g.:
cargo bound --bin deem about --originate -- --scene fight --width 1920 --height 1080 --no-debug
Controls within the
deem about app
- WSAD, QE – circulation
- Mouse + RMB – rotate the camera
- Mouse + LMB – rotate the solar
- Shift – transfer sooner
- Ctrl – transfer slower
- Apartment – swap to reference direction tracing
- Backspace – reset deem about to outdated saved insist
- Tab – show/veil the UI
deem about app, DPI scaling within the working system affects the bodily choice of pixels of the rendering output. The
--height parameters correspond to logical window size and the inner rendering choice. Divulge the OS uses DPI scaling of
1.5, and the app is launched with
--width 1000, the actual bodily width of the window will be
1500 px. Rendering will aloof occur at
1000 px, with upscaling to
1500 px at the very pause, by technique of a Catmull-Rom kernel.
kajiya can also additionally render at a diminished inner choice, and reconstruct a bigger image by technique of temporal upsampling, buying and selling tremendous for performance. A personalised temporal effectively-organized-choice algorithm is passe by default, and DLSS is supported on some platforms. Both approaches consequence in higher tremendous than what’s going to be performed by simply spatially scaling up the image at the pause.
--width 1920 --height 1080 --temporal-upsampling 1.5 will gain a
1920x1080 image by upsampling by a express of
1280x720. A amount of the rendering will then occur with
1.5 1.5 = 2.25 cases fewer pixels, main to an almost 2x speedup.
Along side Meshes and Scenes
To add unique mesh(es), originate
bake.cmd (Procedure shut) /
bake.sh (Linux), and add
- cargo bound –bin bake –originate — –scene “[path]” –scale 1.0 -o [mesh_name]
To add unique scenes, in
assetsscenes, create a
[scene_name].ron with the following vow material:
( cases: [ ( position: (0, 0, 0), mesh: "[mesh_name]", ), ] )
- Vulkan API usage is amazingly atypical. Sources are on the total no longer released, and boundaries don’t seem to be optimal.
- There are laborious restrict on mesh files and instance counts. Exceeding these limits will consequence in panics and Vulkan validation errors / driver crashes.
- Window (framebuffer) resizing is no longer any longer yet applied.
- The voxel GI uses a mounted-size quantity all over the muse by default.
- Denoising wants extra work (consistently).
This venture is made seemingly by the excellent originate offer Rust community, and advantages from a gigantic amount of crates
Special shout-outs stir to:
- Felix Westin for his MinimalAtmosphere, which this venture uses for sky rendering
- AMD, critically Dominik Baumeister and Guillaume Boissé for the FidelityFX Shadow Denoiser, which forms the premise of shadow denoising in
- Maik Klein for the Vulkan wrapper ash, making it easy for
kajiyato discuss with with the GPU.
- Traverse Analysis and Jasper Bekkers for a range of extremely relevant crates:
- Bindings to the DXC shader compiler: bother-rs
- SPIR-V reflection utilities: rspirv-replicate
- Vulkan memory administration: gpu-allocator
- Blue noise sampling: blue-noise-sampler
We welcome community contributions to this venture.
Please be taught our Contributor Manual for extra info on how to gain began.
Please also be taught our Contributor Terms earlier than you build any contributions.
Any contribution intentionally submitted for inclusion in an Embark Studios venture, shall notice the Rust customary licensing mannequin (MIT OR Apache 2.0) and therefore be dual licensed as described under, with none extra phrases or stipulations:
This contribution is dual licensed below 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 choice.
For readability, “your” refers to Embark or every other licensee/particular person of the contribution.