Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics interpolation doesn't interpolate Skeleton2D animation correctly, resulting in wobbly visuals #92872

Closed
Calinou opened this issue Jun 7, 2024 · 6 comments · Fixed by #93368

Comments

@Calinou
Copy link
Member

Calinou commented Jun 7, 2024

Tested versions

System information

Godot v4.3.dev (b7feebe) - Fedora Linux 39 (KDE Plasma) - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4090 (nvidia; 550.78) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

Issue description

Physics interpolation doesn't interpolate Skeleton2D animation correctly, resulting in wobbly visuals.

I've tried disabling interpolation on specific nodes on the SkeletalPlayer scene, but the only thing that fixes the issue is disabling interpolation on the entire CharacterBody2D – which makes any movement not interpolated. I've also tried changing the process mode of the AnimationPlayer and/or AnimationTree to Physics instead of Idle, but that didn't help either.

This issue is still noticeable at 60 tps on a 120 Hz display, so it's not just at low physics FPS.

All videos were recorded at 60 FPS.

10 ticks per second, physics interpolation enabled

10_tps_with_interpolation.mp4

10 ticks per second, physics interpolation disabled

Skeleton updates at the rendered framerate, so does it actually need to be interpolated here? I've tried disabling interpolation on the skeleton/AnimationPlayer/AnimationTree/Polygon2D nodes and it didn't help though. I've also tried changing the process mode of the AnimationPlayer and/or AnimationTree to Physics instead of Idle.

10_tps_without_interpolation.mp4

10 ticks per second, physics interpolation enabled, AnimationPlayer + AnimationTree using Physics callback mode

10_tps_interpolation_physics_callback.mp4

120 ticks per second, physics interpolation enabled

At this stage, it looks pretty much the same whether interpolation is enabled or not.

120_tps_with_interpolation.mp4

Steps to reproduce

  • Create an animation that uses Skeleton2D.
  • Enable physics interpolation and set physics ticks per second to 10.

Minimal reproduction project (MRP)

skeleton.zip

@lawnjelly
Copy link
Member

Ah this is interesting, I hadn't noticed that.

It's likely it will need to the interpolated transform somewhere in the relative xforms, will investigate. 👍

@lawnjelly
Copy link
Member

Have figured this out, took a while debugging the numbers but wasn't as bad a problem as I feared.
Will prepare PR, as it will be good to have this fixed in 3.x and 4.x.

@lawnjelly
Copy link
Member

Fixed by #93309.

@akien-mga akien-mga modified the milestones: 4.3, 3.6 Jun 19, 2024
@akien-mga
Copy link
Member

This still needs to be fixed in 4.3 IIUC?

@lawnjelly
Copy link
Member

lawnjelly commented Jun 19, 2024

This still needs to be fixed in 4.3 IIUC?

Possibly, I'll be looking at this with @rburing .

There are significant differences in the 2D skinning in 4.x if I remember right, so we'll have to see whether the same issue / fix is needed.

@lawnjelly
Copy link
Member

Re-opening as still needs to be done in 4.x (my mistake).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants