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

Heavy buoyancy jitter #10

Open
lw64 opened this issue Feb 13, 2024 · 7 comments
Open

Heavy buoyancy jitter #10

lw64 opened this issue Feb 13, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@lw64
Copy link

lw64 commented Feb 13, 2024

When switching in the demo to the boat mode and increasing wind speed and chopiness, the jitter is very visible. It seems to not come from the physics system, but the wave heights computed in the compute shader.

@Tattomoosa
Copy link
Contributor

Tattomoosa commented Feb 13, 2024

Could you share your settings/OS/render mode? I'm not getting any jitter if frameskip and heightmap sync frameskip are set to 0, and only getting the amount of jitter I'd expect to see with those settings increased.

@lw64
Copy link
Author

lw64 commented Feb 13, 2024

Bildschirmaufzeichnung.vom.2024-02-13.22-03-56.webm

This is the latest commit on devel. I also have frameskip and heihgtmap sync set to 0. I reduced the lods to 1 to get acceptable fps.

@lw64
Copy link
Author

lw64 commented Feb 13, 2024

I use Linux/integrated graphics, so I only got ~25fps, but that shouldnt affect the waves.

@tessarakkt
Copy link
Owner

I think that may possibly be Z-fighting, the cameras in the example scene have a very large range (near 1.0 far 16000.0) which would make that likely to happen.

If you lower the far plane on the camera, does that reduce this flickering?

@tessarakkt
Copy link
Owner

I've finally had a chance to sit down and investigate this closer, and it's definitely not Z-fighting. It's also noticeable on Windows 10 with a Radeon 6700.

It appears to be the result of the ocean simulation being out of sync with the buoyancy/physics system. If I run on a strong enough computer to reach 60fps, Vsync enabled, and 0 simulation and height map sync frame skips, then the ocean simulation is in sync (or near enough) with the physics system, the jitter is not noticeable.

If the Ocean TPS counter in the example scene is either above or below 60, the jitter becomes noticeable. Possibly because the height map is getting updated by the compute shaders on the render thread when the physics thread is trying to use it.

So the solution here is likely to make the height map sync in the render thread happen in sync with the buoyancy calculations in the physics thread, ideally without a significant performance impact.

@tessarakkt tessarakkt added the bug Something isn't working label Feb 21, 2024
@lw64
Copy link
Author

lw64 commented Feb 21, 2024

Also setting the "maximum physics steps per frame" godot setting to 1 helped for me a bit. I tried once to get the wave height of buoyancy probes in _process(), store them, and access them later in _physics_process(), but that didnt seem to work (maybe I did it wrong though)

@QuinnLeavitt
Copy link

Once asynchronous gpu readbacks get implemented into godot it might help with the jitteriness of buoyant objects as explained by acerola in his buoyancy video

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
None yet
Development

No branches or pull requests

4 participants