You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ First, add `bevy-rust-gpu` to your `Cargo.toml`:
40
40
bevy-rust-gpu = { git = "https://github.com/Bevy-Rust-GPU/bevy-rust-gpu", tag = "v0.3.0" }
41
41
```
42
42
43
+
43
44
Next, implement a `Material` type to describe your material's bind group layout and pipeline specialization:
44
45
45
46
```rust
@@ -57,6 +58,7 @@ struct MyRustGpuMaterial {
57
58
implMaterialforMyRustGpuMaterial {}
58
59
```
59
60
61
+
60
62
Then, implement `RustGpuMaterial` for your `Material` type.
61
63
62
64
```rust
@@ -86,6 +88,7 @@ impl RustGpuMaterial for MyRustGpuMaterial {
86
88
87
89
(See [`bevy_pbr_rust.rs`](https://github.com/Bevy-Rust-GPU/bevy-rust-gpu/blob/master/src/bevy_pbr_rust.rs) for the [`bevy-pbr-rust`](https://github.com/Bevy-Rust-GPU/bevy-pbr-rust)-backed `StandardMaterial` reference implementation.)
88
90
91
+
89
92
Next, add `RustGpuPlugin` to your bevy app to configure the backend.
90
93
91
94
```rust
@@ -94,6 +97,7 @@ Next, add `RustGpuPlugin` to your bevy app to configure the backend.
94
97
app.add_plugins(DefaultPlugins);
95
98
```
96
99
100
+
97
101
For each `RustGpuMaterial` implementor, add a `RustGpuMaterialPlugin::<M>` to your app to setup backend rendering machinery.
98
102
This will also configure hot-reloading and hot-rebuilding if the corresponding features are enabled.
99
103
@@ -102,11 +106,13 @@ This will also configure hot-reloading and hot-rebuilding if the corresponding f
102
106
103
107
```
104
108
109
+
105
110
If using hot-rebuilding, tell the material where to export its entry points:
0 commit comments