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 Breaks Terrain #470

Open
mrjustaguy opened this issue Aug 28, 2024 · 11 comments · May be fixed by #611
Open

Physics Interpolation Breaks Terrain #470

mrjustaguy opened this issue Aug 28, 2024 · 11 comments · May be fixed by #611
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mrjustaguy
Copy link

mrjustaguy commented Aug 28, 2024

Terrain3D version

v0.9.2

System information

4.4 dev1

Is the issue reproducable in the demo?

Not applicable

Issue description

Turning on Physics Interpolation Breaks the Terrain at runtime while moving, causing 2 issues:

  1. Textures smear
  2. Clipmaps get detached causing holes

They happen because the position is getting Interpolated. Disabling Interpolation on Terrain3D in question doesn't do anything.

This May be an Issue with how Godot is Handling it's Interpolation, or something internally setup wrong on Terrain3D's end regarding how the Meshes are handled, but I'm not sure Which is the case.

If the Clipmaps are using MultiMesh see godotengine/godot#91818 (comment) to resolve this issue

Logs

No response

@TokisanGames
Copy link
Owner

4.4 is not supported until the release candidates. Clipmaps don't use multimesh, but foliage does.

Does the issue occur with our collision disabled?

Does the issue still exist with Jolt?

Disabling Interpolation on Terrain3D in question doesn't do anything.

We don't have a way to enable or disable interpolation

Did you report this on Godot's issues, or on the PR that implements physics interpolation, or on their developer chat? Physics Interpolation is the new thing here, not Terrain3D. The temporal nature of the meshes may conflict with the interpolation, similar to how TAA and FSR have issues. #302

@TokisanGames TokisanGames added bug Something isn't working low priority Low Priority labels Aug 28, 2024
@TokisanGames TokisanGames added this to the Stable 1.0.x milestone Aug 28, 2024
@TokisanGames TokisanGames moved this to 1.0-Stable in Terrain3D Roadmap Aug 28, 2024
@mrjustaguy
Copy link
Author

Physics interpolation has no effect on the physics engine used, as it's basically just getting last physics frame transform and current physics frame transform and the process time to figure out what the display transform should be for the given frame.

To this end, Disabling Collisions and Jolt result in absolutely no differences.

It's hard to tell if this is a Terrain3D or a Godot issue, given that Physics Interpolation fundamentally does require proper user usage to work right.

@TokisanGames
Copy link
Owner

"Physics" Interpolation is a confusing name then. If it's not a Godot bug, then at the very least we need documentation on how to use it or setup our meshes or shader to support it, or disable it, or not conflict with it. The key feature of our clipmap terrain is that the vertices and meshes move potentially every frame, though visually they look the same. That causes TAA & FSR to get wonky and is probably the same here.

@TokisanGames
Copy link
Owner

TokisanGames commented Oct 28, 2024

Physics Interpolation provides a teleport option that can be reset after moving the terrain

There's also an option to disable it

Original PI PR godotengine/godot#92391

@TokisanGames TokisanGames moved this from 1.x to 1.0 in Terrain3D Roadmap Oct 28, 2024
@TokisanGames TokisanGames modified the milestones: 1.1, 1.0 Oct 28, 2024
@mrjustaguy
Copy link
Author

Terrain3D has PI been attempted with it disabled for Terrain3D in the OG post and it didn't help, and as such reseting doesn't work either.

@TranquilMarmot
Copy link

Trying out Godot 4.4-beta1 and can confirm that this is still an issue with physics interpolation turned on.

Godot v4.4.beta1 - macOS Sequoia (15.2.0) - Multi-window, 1 monitor - Metal (Forward+) - integrated Apple M4 Pro (Apple9) - Apple M4 Pro (14 threads)

Terrain3D version: v0.9.3a

This is with Jolt Physics as the selected physics engine (the built-in version that comes with Godot 4.4, not the godot-jolt plugin) but it also repros with the default physics engine.

The terrain itself doesn't move and is a static shape.

Video of it happening, with "vertex grid" debug mode on:

Screen.Recording.2025-01-16.at.9.07.09.PM.mov

I did make sure that physics interpolation was set to "off" for the Terrain3D node itself:
Image

Turning off physics interpolation for the entire project fixes the issue, but it's safe to assume that a majority of projects will have physics interpolation turned on.

@TokisanGames
Copy link
Owner

Has 4.4 enabled it by default?

@TranquilMarmot
Copy link

No, 4.4 does not have physics interpolation enabled by default

@mrjustaguy
Copy link
Author

IIRC Godot was really close to enabling it by default on new projects, but luckily it seems the idea was scrapped as it needs the user to know what they're doing to avoid some crazy bugs, like this one (tho this seems like something that could be on Godot)

@TranquilMarmot
Copy link

TranquilMarmot commented Jan 17, 2025

Any project that needs to run on slower hardware (physics ticks < graphics ticks) is going to need to turn physics interpolation on.

With Godot 4.3, I had to use smoothing-addon all over the place which was a massive pain to remember and has its own issues.

@TokisanGames TokisanGames linked a pull request Feb 1, 2025 that will close this issue
@TokisanGames TokisanGames removed the low priority Low Priority label Feb 1, 2025
@TokisanGames TokisanGames moved this from 1.0 to In Progress in Terrain3D Roadmap Feb 1, 2025
@TokisanGames TokisanGames self-assigned this Feb 1, 2025
@TokisanGames
Copy link
Owner

TokisanGames commented Feb 1, 2025

#611 fixes physics interpolation. See the PR for caveats. Please test and let me know your results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants