bevy/crates
Greeble 76318d99d7 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-05 01:08:55 +02:00
..
bevy_a11y Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_animation Add PartialEq and Hash reflections for AnimationNodeIndex (#18718) 2025-04-04 23:16:49 +02:00
bevy_app Add sleep based on spin to bevy_platform_support (#18633) 2025-04-03 21:45:42 +02:00
bevy_asset Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702) 2025-04-03 21:46:46 +02:00
bevy_audio Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_color Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_core_pipeline Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_derive Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_dev_tools Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_diagnostic Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_dylib Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_ecs Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702) 2025-04-03 21:46:46 +02:00
bevy_encase_derive Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_gilrs Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_gizmos Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_gltf Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_image Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_input Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_input_focus Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00
bevy_internal Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_log Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_macro_utils Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_math Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_mesh Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_mikktspace Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_pbr Fix motion blur on skinned meshes (#18712) 2025-04-05 01:08:55 +02:00
bevy_picking Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00
bevy_platform_support Add sleep based on spin to bevy_platform_support (#18633) 2025-04-03 21:45:42 +02:00
bevy_ptr Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_reflect Add PartialEq and Hash reflections for AnimationNodeIndex (#18718) 2025-04-04 23:16:49 +02:00
bevy_remote Fix indentation of bevy/query strict parameter in docs (#18681) 2025-04-03 21:45:43 +02:00
bevy_render Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00
bevy_scene Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00
bevy_sprite Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_state Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_tasks Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_text Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00
bevy_time Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_transform Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00
bevy_ui Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00
bevy_utils Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_window Release 0.16.0-rc.3 2025-03-31 23:07:43 +02:00
bevy_winit Switch ChildOf back to tuple struct (#18672) 2025-04-03 21:45:43 +02:00