mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 06:00:20 +00:00
f4aa3284a8
# 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> |
||
---|---|---|
.. | ||
3d_scene.rs | ||
3d_scene_pipelined.rs | ||
cornell_box_pipelined.rs | ||
load_gltf.rs | ||
load_gltf_pipelined.rs | ||
msaa.rs | ||
orthographic.rs | ||
parenting.rs | ||
pbr.rs | ||
pbr_pipelined.rs | ||
render_to_texture.rs | ||
shadow_biases_pipelined.rs | ||
shadow_caster_receiver_pipelined.rs | ||
spawner.rs | ||
texture.rs | ||
texture_pipelined.rs | ||
update_gltf_scene.rs | ||
wireframe.rs | ||
z_sort_debug.rs |