Crates.io | rafx-nodes |
lib.rs | rafx-nodes |
version | 0.0.7 |
source | src |
created_at | 2021-01-17 04:44:43.450795 |
updated_at | 2021-02-06 21:15:41.8949 |
description | Rendering framework built on an extensible asset pipeline |
homepage | https://github.com/aclysma/rafx |
repository | https://github.com/aclysma/rafx |
max_upload_size | |
id | 343031 |
size | 50,091 |
Rafx is a multi-backend renderer that prioritizes performance, flexibility, and productivity. It optionally integrates
with the distill
asset pipeline to provide workflows and tools suitable
for real-world projects with multidisciplinary teams.
This crate contains several layers:
rafx-api
: Low-level graphics API abstractionrafx-framework
: Mid-level framework that eases resource management, lifetime handling, and draw call dispatchingrafx-assets
: Asset layer that integrates with distill
Rafx also provides tools for building shaders and packing assets.
Rafx supports most mainstream platforms via vulkan
and metal
backends. Proprietary platforms can be supported by
adding an additional backend.
cargo doc --no-deps --open
in the root of the crate (docs.rs is incomplete because it does not build with features)^ Video of this renderer running on iOS hardware
rafx-api
is unlikely to change significantlyrafx-framework
and rafx-assets
may get some refactoring/improvements based on demo improvements and dogfooding in
other projectsThis crate will use semantic versioning rules after 0.1.0 of this project has been published. The 0.0.x versions do not follow semantic versioning rules.
The demo should be run from the root of the repository. These commands should clone the repo and run the demo.
git clone https://github.com/aclysma/rafx.git
cd rafx
cd demo
cargo run --bin demo --release --features "[BACKEND_FEATURE]"
BACKEND_FEATURE should either be "rafx-vulkan" or "rafx-metal"
Running in release reduces logging and disables GPU validation. The first time it will load more slowly because it has to import the assets, including a GLTF mesh with large textures. Using profile overrides to optimize upstream crates is highly recommeneded. Asset processing is extremely slow in debug mode. (i.e. 30s instead of 2s)
The demo uses SDL2 and in debug mode, vulkan validation. If you have trouble running the demo, please check that dependencies for both SDL2 and vulkan are available.
The renderer includes a few tools for processing shaders and packing data in a binary blob.
This tool parses GLSL and produces matching rust code. This makes working with descriptor sets easier and safer!
shaders
crate to compile the generated rust code. It's located at /demo/shaders.
Just the rust code is auto-generated, not the Cargo.toml.cargo install rafx-shader-processor
. Be sure to install the same version as you include in your project.
Also, don't forget to update it if you update your project's dependencies!The shader processor produces the following assets artifacts
The shader package can be loaded as an asset and contains everything needed to load a compiled shader.
This tool currently is only useful for packing assets.
run --package cli -- --pack out.pack
run --package demo -- --packfile out.pack
rafx-vulkan
: Use the vulkan backendrafx-metal
: Use the metal backendrafx-base
- Shared helpers/data structures. Nothing excitingrafx-api
- Rendering API abstraction layer.
rafx-nodes
- Inspired by the 2015 GDC talk "Destiny's Multithreaded Rendering Architecture." (A low-budget
version and jobs are not actually MT yet)
rafx-visibility
- Placeholder visibility system. Doesn't do anything yet (returns all things visible all the
time). See the GDC talk for more info on how this will work.rafx-framework
- Resource management for images, buffers, descriptor sets, etc.
rafx-assets
- An asset loading and management system.
Licensed under either of
at your option.
The demo/fonts directory contains several fonts under their own licenses:
mplus-1p-regular.ttf
, available under its own license.The assets/blender contains some shaders from from https://freepbr.com, available under its own license
Some dependencies may be licensed under other terms. These licenses include "ISC", "CC0-1.0", "BSD-2-Clause", "BSD-3-Clause", and "Zlib". This is validated on a best-effort basis in every CI run using cargo-deny.
Rafx benefits from many great ideas and projects!
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See LICENSE-APACHE and LICENSE-MIT.