mirror of
https://github.com/bevyengine/bevy
synced 2024-12-21 10:33:08 +00:00
c99351f7c2
# Objective allow extending `Material`s (including the built in `StandardMaterial`) with custom vertex/fragment shaders and additional data, to easily get pbr lighting with custom modifications, or otherwise extend a base material. # Solution - added `ExtendedMaterial<B: Material, E: MaterialExtension>` which contains a base material and a user-defined extension. - added example `extended_material` showing how to use it - modified AsBindGroup to have "unprepared" functions that return raw resources / layout entries so that the extended material can combine them note: doesn't currently work with array resources, as i can't figure out how to make the OwnedBindingResource::get_binding() work, as wgpu requires a `&'a[&'a TextureView]` and i have a `Vec<TextureView>`. # Migration Guide manual implementations of `AsBindGroup` will need to be adjusted, the changes are pretty straightforward and can be seen in the diff for e.g. the `texture_binding_array` example. --------- Co-authored-by: Robert Swain <robert.swain@gmail.com> |
||
---|---|---|
.. | ||
color_material.rs | ||
color_material.wgsl | ||
material.rs | ||
mesh.rs | ||
mesh2d.wgsl | ||
mesh2d_bindings.wgsl | ||
mesh2d_functions.wgsl | ||
mesh2d_types.wgsl | ||
mesh2d_vertex_output.wgsl | ||
mesh2d_view_bindings.wgsl | ||
mesh2d_view_types.wgsl | ||
mod.rs |