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
Using struct in an extended material is pretty simple as just adding the #[derive(Reflect,AsBindGroup)] and annotating the fields with uniform, etc.
However, for compute shader it is not very straightforward and there is very few examples in bevy.
Luckily wgpu crate has a lot of examples, albeit more manual copying and serializing.
Serializing a uniform in this example seems to be error prone and can easily be overlooked. I feel like bevy has a utility function to do this, and could even be manually called for this specific purpose.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Using struct in an extended material is pretty simple as just adding the
#[derive(Reflect,AsBindGroup)]
and annotating the fields withuniform
, etc.However, for compute shader it is not very straightforward and there is very few examples in bevy.
Luckily
wgpu
crate has a lot of examples, albeit more manual copying and serializing.Serializing a uniform in this example seems to be error prone and can easily be overlooked. I feel like bevy has a utility function to do this, and could even be manually called for this specific purpose.
Beta Was this translation helpful? Give feedback.
All reactions