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 positions are incorrect when renderer set to MultiThreaded #59736

Closed
lawnjelly opened this issue Mar 31, 2022 · 5 comments

Comments

@lawnjelly
Copy link
Member

Godot version

3.5 beta 2, beta 3

System information

All

Issue description

Exhibits as the objects and Camera being rendered in incorrect positions.

Will add more info when I know more, but for now, recommend using the default safe single threaded renderer mode. This may be some assumption I've made about the order of operations and the interpolated lists are not getting flushed correctly / in order.

Steps to reproduce

Try 3D Platformer demo, set to low physics tick rate, turn physics interpolation on, switch to multithreaded renderer.

Minimal reproduction project

No response

@mrezai
Copy link
Contributor

mrezai commented Apr 1, 2022

I have a project here that using Physics Interpolation. I tested multiple settings and these are what I found:

  • When Thread Model = Multi-Threaded and Use V-Sync = ON, Engine.get_frames_per_second() returns inconsistent results that will be seen as jitters in player movement. This is unrelated to what Physics Interpolation is set to.
  • When Thread Model = Multi-Threaded and camera.set_physics_interpolated(false), Physics Interpolation works correctly but if "Visible Collision Shapes" is enabled and player moves, position of debugging view of player's collision shape updated after couple of seconds and not instantly like when Thread Model = Single-Safe.
  • When Thread Model = Multi-Threaded and camera.set_physics_interpolated(true), chaos happened! It seems like a bug in camera and not Physics Interpolation as a whole.

@lawnjelly
Copy link
Member Author

Ah that will be useful info thank you. 👍

I'm sure this will not be too tricky, I'm just trying to finish up some work on PoolVector first, as I don't think this bug is super pressing as it is possible to just set to single-threaded renderer until it is fixed.

It could indeed be related to the Engine.get_frames_per_second() not working correctly in multithreaded, that is interesting (presumably that happens also before 3.5, I don't think I changed anything to do with this).

@mrezai
Copy link
Contributor

mrezai commented Apr 1, 2022

You right, Engine.get_frames_per_second() has same behavior in Godot 3.4.2 when multithreading is enabled.

@Calinou
Copy link
Member

Calinou commented Apr 1, 2022

When Thread Model = Multi-Threaded and Use V-Sync = ON, Engine.get_frames_per_second() returns inconsistent results that will be seen as jitters in player movement. This is unrelated to what Physics Interpolation is set to.

Remember that #52314 is not merged in master yet, and #48555 does not have a master counterpart yet.

@akien-mga
Copy link
Member

Fixed by #60147.

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

No branches or pull requests

4 participants