Physics interpolation - Move out of Scenario#60147
Conversation
Move VisualServer interpolation data out of Scenario and into VisualServerScene, so the interpolation data and enabled status is now common to all Scenarios. Fix physics interpolation in multithreaded mode by ensuring tick and pre-draw are called.
|
Feedback from reduz:
Given that the latter two could introduce new bugs, and this PR currently fixes the outstanding multitthreading bug with (hopefully) no other side effects, we should probably also consider merging this in the meantime so we have a solid build in the current 3.5. The latter two may take a bit of time to come up with good improvements (as they are essentially housekeeping changes), and probably deserve to be considered in separate PRs where they can be examined in more detail. |
akien-mga
left a comment
There was a problem hiding this comment.
Let's go with this for 3.5 beta 4 as discussed.
|
Thanks! |
|
@lawnjelly Cool stuff. Does this men that now it be used from 2D as well? Unfortunately it looks like all the major sexy features of the recent 3.x betas like this one and ubershader don’t apply to a 2D/gles2 setup for me to try out on an advanced project. |
Not yet – physics interpolation still needs to be ported to the 2D physics engine. |
Move VisualServer interpolation data out of Scenario and into VisualServerScene, so the interpolation data and enabled status is now common to all Scenarios.
Fix physics interpolation in multithreaded mode by ensuring tick and pre-draw are called.
Fixes #59736
Alternative to #59875
Notes
Scenarioand have it global, so there is a global on or off. He suggested there should usually only be oneSceneTree, and this should fit 99% use cases.SceneTreefor his game (further description is in Physics interpolation - Fix multithreaded rendering #59875 (comment) )SceneTrees to create a RID in the VisualServer and hang the interpolation data of this, thus making it selectable per SceneTree (there is currently no concept of aSceneTreein the VisualServer afaik)VisualServerScenethus is only global in the sense ofVisualServerbeing a singleton, and thus if @jordo is creating several VisualServers, he may be able to independently turn interpolation on and offusing the
VisualServer::set_physics_interpolation_enabled(bool)function. I don't know enough about his version to know if this would work for his purpose.