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
assets/shaders/
crates/lib/rust-shaders/
world_render_passes.rs
kajiya
currently works on a limited range of operating systems and hardware.
Hardware:
Operating systems:
kajiya
has a rudimentary "RTX Off" mode which runs on a wider range of systems, but most of its visual features are disabled.
Hardware:
Operating systems:
uuid-dev
libdxcompiler.so
doesn't work: https://github.com/microsoft/DirectXShaderCompiler#downloadsossp-uuid
(brew install ossp-uuid
)To build kajiya
you need Rust.
Once Rust is installed, open a command prompt in the project folder, then build and run the viewer app via:
cargo run --bin view --release
This will compile a binary in the target/release
folder, and then run it.
For a list of supported command-line switches see --help
. In order to pass it through cargo
to the renderer, you need to separate the cargo
arguments from view
arguments using --
e.g.:
cargo run --bin view --release -- --help
kajiya
supports meshes in the glTF 2.0 format, and also has its own tiny RON-based scene format which can refer to multiple glTF 2.0 meshes.
To load either, simply drag-n-drop the .gltf
, .glb
, or .ron
file onto the window of the view
app. See the assets/
folder for a few bundled examples.
The first time a mesh is loaded, it is converted to a runtime format: the vertices are packed, and textures are compressed. The next time the same mesh is used, it's loaded from the cache/
folder.
Please note that only the roughness-metalness workflow in glTF is supported. In Blender that corresponds to Principled BSDF.
kajiya
can also load image-based lights (examples). To do so, drag-n-drop an .exr
or .hdr
file onto window of the view
app.
The loaded assets can be manipulated in the Scene
section of the UI. The app state is persisted in view_state.ron
.
view
appFor the view
app, DPI scaling in the operating system affects the physical number of pixels of the rendering output. The --width
and --height
parameters correspond to logical window size and the internal rendering resolution. Suppose the OS uses DPI scaling of 1.5
, and the app is launched with --width 1000
, the actual physical width of the window will be 1500
px. Rendering will still happen at 1000
px, with upscaling to 1500
px at the very end, via a Catmull-Rom kernel.
kajiya
can also render at a reduced internal resolution, and reconstruct a larger image via temporal upsampling, trading quality for performance. A custom temporal super-resolution algorithm is used by default, and DLSS is supported on some platforms. Both approaches result in better quality than what could be achieved by simply spatially scaling up the image at the end.
For example, --width 1920 --height 1080 --temporal-upsampling 1.5
will produce a 1920x1080
image by upsampling by a factor of 1.5
from 1280x720
. Most of the rendering will then happen with 1.5 * 1.5 = 2.25
times fewer pixels, resulting in an almost 2x speedup.
This project is made possible by the awesome open source Rust community, and benefits from a multitude of crates 💖🦀
Special shout-outs go to:
kajiya
.kajiya
to talk to the GPU.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
at your option.
For clarity, "your" refers to Embark or any other licensee/user of the contribution.