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

Poor performance with high amount of static colliders #1081

Closed
Armynator opened this issue Apr 29, 2024 · 1 comment
Closed

Poor performance with high amount of static colliders #1081

Armynator opened this issue Apr 29, 2024 · 1 comment

Comments

@Armynator
Copy link

Armynator commented Apr 29, 2024

I've compared Jolt to PhysX 4, PhysX 5 and bepuphysics2 for large worlds today. The result: Jolt is unusable in big static worlds.
From the project readme it looks like it's designed to load and unload only the nearby area. On a dedicated server this isn't really possible however.

What I'm doing:

  • load a 128x128 chunk grid (each 64m² in size, custom meshes with varying detail between ~256-2048 triangles)
  • add each chunk as static collider into the physics simulation
  • spawn 2000 dynamic rigidbody balls at terrain center in the air
  • run the simulation at 50hz / 20ms per tick

While PhysX and bepuphysics2 handle this easily, Jolt completely dies with a high amount of static colliders in the simulation. After around 10k static colliders the tick times are completely unacceptable already (200ms+).
PhysX and bepuphysics2 on the other hand can easily handle 2 million chunks/static colliders with less than 5ms per tick. (this is an extreme and unlikely test case, but puts the difference to Jolt clearly into perspective)

I've also tested it with regular box colliders instead of meshes, with the same result. After ~10-20k static colliders (with spacing between them) Jolt gets unusable, while PhysX and bepuphysicsv2 stay totally unimpressed far into the millions.

So... is this expected? or is there something special I have to do for this usecase to work?

@jrouwe
Copy link
Owner

jrouwe commented Apr 29, 2024

I would say that a lot of static colliders should not be a problem. Horizon easily had 100K static colliders active at the same time and the update took a couple of ms. Have you perhaps misconfigured your object layer configuration so that you're mixing dynamic and static objects in the same broad phase tree? The majority of those static objects should be in a tree that changes very infrequently.

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

No branches or pull requests

2 participants