[SOLVED] Performance problems with version 2.85 and newer

Post Reply
Silverlan
Posts: 27
Joined: Thu Oct 30, 2014 9:15 pm

[SOLVED] Performance problems with version 2.85 and newer

Post by Silverlan »

Up until recently I've been using bullet 2.82. I wanted to try out the new VR-features, so I decided to upgrade to the latest version (2.86), however after the update I've noticed a massive drop in performance for the physics simulation in my engine (To a point where it's unplayable).
I did some testing with different versions of bullet, and noticed that version 2.85 is the one where the performance starts to take a hit and version 2.83 is the last stable one.
There's nothing special about my physics scene, just a few convex objects, a triangle mesh and a single dynamic object (A character controller), so there's absolutely no reason why the performance should be this bad. I've tried narrowing it down to a few objects, but it seems to occur somewhat randomly (Sometimes the performance is okay).
I can't post any code, since bullet is tightly integrated into the engine and I'm not even sure where to look.

Have there been any major changes between version 2.83 and 2.85 that could explain this phenomenon? Has anyone else had any issues like this?
What could I try to narrow the problem down?
Silverlan
Posts: 27
Joined: Thu Oct 30, 2014 9:15 pm

Re: Performance problems with version 2.85 and newer

Post by Silverlan »

I've done some further testing and it seems that the problems are also there with version 2.83.
I've recorded a video of the problem: https://youtu.be/ojAhcyOo4wg
The scene in the video has several rigid bodies, some with convex shapes and some with triangle shapes, as well as a kinematic character controller with a capsule shape.
All rigid bodies have a mass of 0 and the btCollisionObject::CF_STATIC_OBJECT flag set. If I disable simulation for the rigid bodies with triangle shapes, the performance is fine, but if I enable their simulation, it becomes unplayable, even if there is no interaction between any of the objects whatsoever.
All of the triangle shapes are of type btBvhTriangleMeshShape.

I've analyzed the program with CodeXL, and this was the result:
Image

I'm not that familiar with the internal workings of bullet, so this doesn't tell me all that much. Anyone got any ideas what could be causing this?

/EDIT:
Looks like the performance starts dropping rapidly as soon as I have more than one triangle mesh in the scene (Just one is fine).
I'm not entirely sure, but I think it might be checking for collisions between all of the triangle meshes constantly, would that be possible? If so, why/how?

/EDIT2:
I've disabled collisions between static objects in btOverlapFilterCallback::needBroadphaseCollision and that seems to fix it. Not sure why it was enabled in the first place / Why it used to work on the old versions.
Anyway, problem solved!
Post Reply