bevy_xpbd icon indicating copy to clipboard operation
bevy_xpbd copied to clipboard

Stutter in with transform interpolation on

Open vladinator1000 opened this issue 11 months ago • 2 comments

Hey folks, I think I discovered a potential issue, check out this stuttering:

https://github.com/user-attachments/assets/98f599ef-7a94-494e-b5fa-a31cc684b4ae

Originally I thought it was caused by the tnua library (https://github.com/idanarye/bevy-tnua/issues/78) but the author said tnua doesn't mutate the transform, and the velocity remains constant. This makes us think that might be an Avian bug.

I followed these steps to reproduce: Cloned tnua from: https://github.com/idanarye/bevy-tnua

On Windows 11, ran the demo with this command (set the wgpu backend env var to prevent log noise in the terminal):

$env:WGPU_BACKEND="dx12"; cargo run --bin platformer_2d --features avian2d

I've tried to debug, following these docs:

  1. Adding a TransformExtrapolation and TransformInterpolation component to the setup_player function in for_2d_platformer.rs
  2. Changing the physics plugin addition fn main in platformer_2d.rs to
               app.add_plugins(
                    PhysicsPlugins::new(FixedPostUpdate)
                        .set(avian2d::interpolation::PhysicsInterpolationPlugin::interpolate_all()),
                );

But the stutter was still present.

Possibly related links:

  • Bevy time jitter issue https://github.com/bevyengine/bevy/issues/4669
  • Avian jitter issue https://github.com/Jondolf/avian/issues/211
  • Bevy discord help thread: https://discord.com/channels/691052431525675048/1327424197298753666/1327424197298753666

vladinator1000 avatar Jan 13 '25 02:01 vladinator1000

Hypothesis: maybe it's the debug render who stutters?

idanarye avatar Jan 13 '25 08:01 idanarye

I think it's Bevy time jitter issue

adsick avatar Feb 25 '25 16:02 adsick