Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces the nannou specific trait
ShaderModel
, as well as a convenient attribute macro#[shader_model]
that can be used to generate the bevy boilerplate derives needed for implementingMaterial
.Although
Material
is used to drive much of the bevy ecosystem, including it in our public api and examples couples us too tightly to the bevy pbr pipeline. It's also confusing, because while we ask users to implement things from the trait like fragment and vertex shaders, there's a ton of additional features included in this trait that they would not want to touch.As such, the nannou trait
ShaderModel
is a simple trait that specifies which shaders to use, as well as adding all the required bounds to make everything work. Users can implement this themselves, but can also use the macro as such:Additionally, this will help future extensions, like supporting indirect drawing in compute shaders, where we do not want to depend directly on
T: Material
but insteadT: AsBindGroup
.Other changes:
nightly
feature andinit_fragment_shader
experiment. While this is cool, we want to focus on makingShaderModel
the first class way to interact with these apis.