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

[Jolt] Ghost Collisions #102544

Closed
yahkr opened this issue Feb 7, 2025 · 4 comments · Fixed by #102614
Closed

[Jolt] Ghost Collisions #102544

yahkr opened this issue Feb 7, 2025 · 4 comments · Fixed by #102614

Comments

@yahkr
Copy link
Contributor

yahkr commented Feb 7, 2025

Tested versions

  • Reproducible in v4.4.beta3.mono.official [06acfcc] (with built-in jolt)
  • Reproducible in v4.3.stable.mono.official [77dcf97] (with godot-jolt plugin)

System information

Godot v4.4.beta3.mono - Windows 11 (build 22631) - Single-window, 2 monitors - Vulkan (Forward+)

Issue description

Experiencing ghost collisions on Rigidbody3D to static ConcavePolygonShape3D collisions.

Related to #89458

Jolt Physics (the body gets randomly stuck, the video does not pause when the body does):

phys1.mp4

Godot Physics:

phys2.mp4

Steps to reproduce

Create a flat ConcavePolygonShape3D with dense vertex count
Make Rigidbdoy3D slide across surface
Observe ghost collisions

Minimal reproduction project (MRP)

MRP.zip

@mihe
Copy link
Contributor

mihe commented Feb 7, 2025

I simplified the MRP a bit, mainly to not require a Blender import, but also to rule out a few things: jolt-ghost-collision.zip

I have...

  • Created a new ConcavePolygonShape3D based on a subdivided PlaneMesh
  • Reset all the project settings
  • Reset all the properties of the RigidBody3D, including the axis locks
  • Set friction to zero for the RigidBody3D
  • Changed it to apply only an initial linear velocity to the RigidBody3D

Despite all that, the ghost collisions seem to generally persist, albeit at different places.

This one has me scratching my head a bit, @jrouwe. As best I can tell there seems to be something odd going on with mEnhancedInternalEdgeRemoval, as disabling it using the physics/jolt_physics_3d/simulation/use_enhanced_internal_edge_removal project setting (and thus falling back on the active edge detection) resolves the ghost collisions.

I'm able to recreate the issue in Jolt's Samples application using a snapshot as well: jolt_snapshot_2025-02-07_23-47-36_4462471020544.zip

Samples.mp4

@mihe mihe moved this from For team assessment to Up for grabs in Physics Issue Triage Feb 7, 2025
@mihe mihe added this to the 4.4 milestone Feb 7, 2025
@mihe mihe moved this from Unassessed to Very Bad in 4.x Release Blockers Feb 7, 2025
@mihe mihe moved this from Very Bad to Bad in 4.x Release Blockers Feb 7, 2025
@mihe
Copy link
Contributor

mihe commented Feb 8, 2025

When tinkering with some other subdivisions, the problem does seem to be related to the size of the triangles in some way.

Here's another version of the above revised MRP, with some different triangle densities: jolt-ghost-collision.zip

... which looks like this:

godot.windows.editor.dev.x86_64_xUhlw9ypyf.mp4

Here's a snapshot of that scene (right after applying the impulses): jolt_snapshot_2025-02-08_15-53-14_4578435137536.zip

... which looks like this in Jolt's Samples application:

Samples_yUdWVZA5o3.mp4

@mihe mihe moved this from Bad to Not Critical in 4.x Release Blockers Feb 8, 2025
@jrouwe
Copy link
Contributor

jrouwe commented Feb 8, 2025

Thanks for the investigations @mihe! I will take a look at this.

jrouwe added a commit to jrouwe/JoltPhysics that referenced this issue Feb 9, 2025
Fixed InternalEdgeRemovingCollector not working when colliding with a very dense triangle grid because it ran out of internal space. Now falling back to memory allocations when this happens to avoid ghost collisions.

See: godotengine/godot#102544
@jrouwe
Copy link
Contributor

jrouwe commented Feb 9, 2025

I've created a fix, see #102614.

@mihe mihe moved this from Up for grabs to Fix pending review in Physics Issue Triage Feb 10, 2025
@github-project-automation github-project-automation bot moved this from Fix pending review to Done in Physics Issue Triage Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Not Critical
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants