Efficiency : Bullet much slower than PhysX?

Started by
4 comments, last by erwincoumans 13 years ago
Hi!

I am in charge of physics engine in our engine team and simply encapsulated PhysX and Bullet with the same interface to have a test to look out which is more effective.
Because most collision detections in our engine and game are produced by character and terrain, so I added hundreds of capsules at random positions above the terrain which was made in triangle mesh. And Then sweep them downward. Then got the result and time cost.

Finally I found that the same test in Bullet cost 10 times more than PhysX.
e.g (average)

capsule Number / Bullet / PhysX
1 / 0.757ms / 0.132ms
100 / 73.388ms / 3.790ms
500 / 488.205ms / 43.287ms

I don't know if it was usual or I missed something important.

Thanks.
Advertisement
I think we'd need some more information to constructively debate this.
Just some questions that come to mind:
  • PhysX can use hardware acceleration on (NVidia) graphics cards. Bullet has support for this as well. Did you enable/disable this in both engines?
  • Is your terrain a height field? If so, did you use Bullet's [type]btHeightfieldTerrainShape[/type]?
  • and probably many more...

I think we'd need some more information to constructively debate this.
Just some questions that come to mind:
  • PhysX can use hardware acceleration on (NVidia) graphics cards. Bullet has support for this as well. Did you enable/disable this in both engines?
  • Is your terrain a height field? If so, did you use Bullet's [type]btHeightfieldTerrainShape[/type]?
  • and probably many more...




PhysX is declared in software simulation type while I used default configuration for Bullet and I don't know where the switch is.
Because we used triangle mesh to describe terrain in client in PhysX but not height field, so I used triangle mesh also in Bullet to make this test "fair" in a sense.

PhysX:
Terrain: NxTriangleMeshShape
Capusle: NxCapsuleShape
Function: linearSweep in NxActor

Bullet:
Terrain: btBvhTriangleMeshShape
Capsule : btCapsuleShape
Function : convexSweepTest in btCollisionWorld
World : btDiscreteDynamicsWorld
Config : btDefaultCollisionConfiguration
Dispatcher : btCollisionDispatcher
Boardphase : btDbvtBroadphase
Solver :?btSequentialImpulseConstraintSolver

Thanks!

Hi!

I am in charge of physics engine in our engine team and simply encapsulated PhysX and Bullet with the same interface to have a test to look out which is more effective.
Because most collision detections in our engine and game are produced by character and terrain, so I added hundreds of capsules at random positions above the terrain which was made in triangle mesh. And Then sweep them downward. Then got the result and time cost.

Finally I found that the same test in Bullet cost 10 times more than PhysX.
e.g (average)

capsule Number / Bullet / PhysX
1 / 0.757ms / 0.132ms
100 / 73.388ms / 3.790ms
500 / 488.205ms / 43.287ms

I don't know if it was usual or I missed something important.

Thanks.



What must I append is that in Release Bullet worked much better than in Debug...
In Release When there are 100 capsules, time cost in Bullet is 6.55ms while in PhysX it is 1.877ms
Don't ever profile Debug code. That simply doesn't make sense to compare Debug build of Bullet to Release build of PhysX library.
PhysX has a highly optimized swept capsule test, for its character controller. Bullet uses a generic, iterative convex sweep.

Can you share a benchmark, so we might optimize it in a future version of Bullet?

This topic is closed to new replies.

Advertisement