bevy/pipelined
Robert Swain f4aa3284a8 bevy_pbr2: Add support for not casting/receiving shadows (#2726)
# Objective

Allow marking meshes as not casting / receiving shadows.

## Solution

- Added `NotShadowCaster` and `NotShadowReceiver` zero-sized type components.
- Extract these components into `bool`s in `ExtractedMesh`
- Only generate `DrawShadowMesh` `Drawable`s for meshes _without_ `NotShadowCaster`
- Add a `u32` bit `flags` member to `MeshUniform` with one flag indicating whether the mesh is a shadow receiver
- If a mesh does _not_ have the `NotShadowReceiver` component, then it is a shadow receiver, and so the bit in the `MeshUniform` is set, otherwise it is not set.
- Added an example illustrating the functionality.

NOTE: I wanted to have the default state of a mesh as being a shadow caster and shadow receiver, hence the `Not*` components. However, I am on the fence about this. I don't want to have a negative performance impact, nor have people wondering why their custom meshes don't have shadows because they forgot to add `ShadowCaster` and `ShadowReceiver` components, but I also really don't like the double negatives the `Not*` approach incurs. What do you think?

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-08-25 19:44:20 +00:00
..
bevy_core_pipeline Sub app label changes (#2717) 2021-08-24 06:37:28 +00:00
bevy_gltf2 Port bevy_gltf to pipelined-rendering (#2537) 2021-07-30 03:37:34 +00:00
bevy_pbr2 bevy_pbr2: Add support for not casting/receiving shadows (#2726) 2021-08-25 19:44:20 +00:00
bevy_render2 Sub app label changes (#2717) 2021-08-24 06:37:28 +00:00
bevy_sprite2 Sub app label changes (#2717) 2021-08-24 06:37:28 +00:00