bevy/crates/bevy_render/src
robtfm c99351f7c2
allow extensions to StandardMaterial (#7820)
# 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>
2023-10-17 21:28:08 +00:00
..
batching Use EntityHashMap<Entity, T> for render world entity storage for better performance (#9903) 2023-09-27 08:28:28 +00:00
camera Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
color Remove useless single tuples and trailing commas (#9720) 2023-09-08 21:46:54 +00:00
mesh Add consuming builder methods for more ergonomic Mesh creation (#10056) 2023-10-09 19:47:41 +00:00
primitives Add a method to compute a bounding box enclosing a set of points (#9630) 2023-08-31 01:33:13 +00:00
render_graph Fix the clippy::explicit_iter_loop lint (#9834) 2023-09-19 03:35:22 +00:00
render_phase Replaced parking_lot with std::sync (#9545) 2023-10-02 12:44:34 +00:00
render_resource allow extensions to StandardMaterial (#7820) 2023-10-17 21:28:08 +00:00
renderer ignore time channel error (#9981) 2023-10-01 07:55:17 +00:00
texture Deferred Renderer (#9258) 2023-10-12 22:10:38 +00:00
view Fixed mod.rs in rendering to support Radeon Cards (#10132) 2023-10-16 10:45:11 +00:00
extract_component.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
extract_instances.rs chore: Renamed RenderInstance trait to ExtractInstance (#10065) 2023-10-13 17:06:53 +00:00
extract_param.rs Improve doc formatting. (#9840) 2023-09-18 19:43:56 +00:00
extract_resource.rs Allow optional extraction of resources from the main world (#10109) 2023-10-14 16:07:49 +00:00
globals.rs Unify FixedTime and Time while fixing several problems (#8964) 2023-10-16 01:57:55 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
instance_index.wgsl Work around naga/wgpu WGSL instance_index -> GLSL gl_InstanceID bug on WebGL2 (#9383) 2023-08-09 18:38:45 +00:00
lib.rs Improve linking within RenderSet docs. (#10143) 2023-10-16 17:13:20 +00:00
maths.wgsl Use instancing for sprites (#9597) 2023-09-02 18:03:19 +00:00
pipelined_rendering.rs Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
render_asset.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
settings.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
spatial_bundle.rs Improve SpatialBundle docs (#9673) 2023-09-02 23:44:12 +00:00