bevy/crates
Greeble 5da64ddbee
Fix motion blur on skinned meshes (#18712)
## Objective

Fix motion blur not working on skinned meshes.

## Solution

`set_mesh_motion_vector_flags` can set
`RenderMeshInstanceFlags::HAS_PREVIOUS_SKIN` after specialization has
already cached the material. This can lead to
`MeshPipelineKey::HAS_PREVIOUS_SKIN` never getting set, disabling motion
blur.

The fix is to make sure `set_mesh_motion_vector_flags` happens before
specialization.

Note that the bug is fixed in a different way by #18074, which includes
other fixes but is a much larger change.

## Testing

Open the `animated_mesh` example and add these components to the
`Camera3d` entity:

```rust
MotionBlur {
    shutter_angle: 5.0,
    samples: 2,
    #[cfg(all(feature = "webgl2", target_arch = "wasm32", not(feature = "webgpu")))]
    _webgl2_padding: Default::default(),
},
#[cfg(all(feature = "webgl2", target_arch = "wasm32", not(feature = "webgpu")))]
Msaa::Off,
```

Tested on `animated_mesh`, `many_foxes`, `custom_skinned_mesh`,
Win10/Nvidia with Vulkan, WebGL/Chrome, WebGPU/Chrome. Note that testing
`many_foxes` WebGL requires #18715.
2025-04-04 22:36:03 +00:00
..
bevy_a11y
bevy_animation Add PartialEq and Hash reflections for AnimationNodeIndex (#18718) 2025-04-04 16:35:12 +00:00
bevy_anti_aliasing Remove Image::from_buffer name argument (only present in debug "dds" builds) (#18538) 2025-03-25 19:25:01 +00:00
bevy_app Add sleep based on spin to bevy_platform_support (#18633) 2025-03-31 23:21:49 +00:00
bevy_asset Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702) 2025-04-03 17:06:01 +00:00
bevy_audio
bevy_color fix typo (#18696) 2025-04-03 17:18:09 +00:00
bevy_core_pipeline reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
bevy_derive
bevy_dev_tools
bevy_diagnostic Fix LogDiagnosticsPlugin log target typo (#18534) 2025-03-29 17:07:21 +00:00
bevy_dylib
bevy_ecs Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702) 2025-04-03 17:06:01 +00:00
bevy_encase_derive
bevy_gilrs reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
bevy_gizmos Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 06:04:26 +00:00
bevy_gltf reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
bevy_image bevy_image: derive TypePath when Reflect is not available (#18501) 2025-03-30 02:50:24 +00:00
bevy_input
bevy_input_focus Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
bevy_internal Upgrade to Glam 0.29.3 and Simplify Feature Gating (#18638) 2025-03-31 18:54:46 +00:00
bevy_log
bevy_macro_utils
bevy_math Upgrade to Glam 0.29.3 and Simplify Feature Gating (#18638) 2025-03-31 18:54:46 +00:00
bevy_mesh
bevy_mikktspace Upgrade to Glam 0.29.3 and Simplify Feature Gating (#18638) 2025-03-31 18:54:46 +00:00
bevy_pbr Fix motion blur on skinned meshes (#18712) 2025-04-04 22:36:03 +00:00
bevy_picking fix typo (#18696) 2025-04-03 17:18:09 +00:00
bevy_platform_support Add sleep based on spin to bevy_platform_support (#18633) 2025-03-31 23:21:49 +00:00
bevy_ptr
bevy_reflect Add PartialEq and Hash reflections for AnimationNodeIndex (#18718) 2025-04-04 16:35:12 +00:00
bevy_remote Fix indentation of bevy/query strict parameter in docs (#18681) 2025-04-02 17:33:02 +00:00
bevy_render Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
bevy_scene Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
bevy_sprite Parallelize bevy 0.16-rc bottlenecks (#18632) 2025-03-31 18:32:45 +00:00
bevy_state Fix misleading documentation of Main schedule (#18579) 2025-03-28 01:12:19 +00:00
bevy_tasks
bevy_text Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
bevy_time
bevy_transform Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
bevy_ui Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
bevy_utils
bevy_window Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 06:04:26 +00:00
bevy_winit Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00