This repository is sample for how to use Bevy with Rust-GPU. You can use this as a template or just reference.
shader_builder
crate is tiny library to build shader crates in shaders
directory and copy the output .spv
to assets directory.
You can call it manually via xtask
or automatically via build.rs
in your game
crate.
cargo xtask --path <PATH_TO_CRATE>
will build your shader and Bevy will hot-reload it.
xtask
is a workflow to add automation to Rust projects.bevy_pbr
is the Bevy official PBR crate with WGSL shaders. It is really active and looks hard to maintain its equivalent Rust-GPU implements up-to-date.Bevy-Rust-GPU
is another project to use Bevy with Rust-GPU. Not sure it is active.bevy-pbr-rust
is Rust reimplementation ofbevy_pbr
's WGSL shaders. Part of theBevy-Rust-GPU
project.
- No support for ShaderDef.
- Since Bevy uses
wgpu
as renderer backend, shaders functions are limited to webgpu specs.- You may bypass this limitation switching the backend, though I don't know which renderer plugin is available and actively updated.
This repository is dual-licensed under MIT and Apache 2.0 at your option.