bevyengine / bevyengine/bevy

Morph targets have incorrect motion vectors

Open
#23,118 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version and features

08a3f24deca5f07b699c674ddf1633a25b4853af (0.19.0-dev)

## Relevant system information

```
SystemInfo { os: "Windows 10 Pro", kernel: "19045", cpu: "AMD Ryzen 9 7900 12-Core Processor", core_count: "12", memory: "63.2 GiB" }
AdapterInfo { name: "NVIDIA GeForce RTX 4060", vendor: 4318, device: 10370, device_type: DiscreteGpu, device_pci_bus_id: "0000:01:00.0", driver: "NVIDIA", driver_info: "572.83", backend: Vulkan, subgroup_min_size: 32, subgroup_max_size: 32, transient_saves_memory: false }
```

## What you did

After #23060 lands:

```sh
cargo run --example many_morph_targets -- --count 1 --motion-blur --weights one
```

## What went wrong

The colored bars are motion blurred even though they're not moving:

Image

They should look the same as when `--motion-blur` is off:

Image

## Theories

I believe the bug is due to stale specialization. As a result, during motion vector calculation the vertex's current position has morph targets applied but the previous position does not. See this thread for details and thoughts on possible fixes: https://github.com/bevyengine/bevy/pull/23023#discussion_r2833149378

Contributor guide

Open the contributing guide

Research direction

Run `cargo run --example many_morph_targets -- --count 1 --motion-blur --weights one` and compare it with motion blur disabled. Read the discussion on PR #23023 about stale specialization, then trace the motion-vector calculation used by the `many_morph_targets` example; done means stationary colored bars are no longer blurred.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.