bevy/crates/bevy_pbr/src
Carter Anderson 963e2f08a2 Materials and MaterialPlugin (#3428)
This adds "high level" `Material` and `SpecializedMaterial` traits, which can be used with a `MaterialPlugin<T: SpecializedMaterial>`. `MaterialPlugin` automatically registers the appropriate resources, draw functions, and queue systems. The `Material` trait is simpler, and should cover most use cases. `SpecializedMaterial` is like `Material`, but it also requires defining a "specialization key" (see #3031). `Material` has a trivial blanket impl of `SpecializedMaterial`, which allows us to use the same types + functions for both.

This makes defining custom 3d materials much simpler (see the `shader_material` example diff) and ensures consistent behavior across all 3d materials (both built in and custom). I ported the built in `StandardMaterial` to `MaterialPlugin`. There is also a new `MaterialMeshBundle<T: SpecializedMaterial>`, which `PbrBundle` aliases to.
2021-12-25 21:45:43 +00:00
..
render Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
alpha.rs Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
bundle.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
lib.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
light.rs enable Webgl2 optimisation in pbr under feature (#3291) 2021-12-22 20:59:48 +00:00
material.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
pbr_material.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
wireframe.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00