General performance optimization

drummerd_ca
Posts: 3
Joined: Thu Aug 20, 2009 9:08 pm

General performance optimization

Post by drummerd_ca »

Hi,
I'm looking for some general pointers in order to optimize the performance of Bullet in my application.

My application consists of a relatively large number (ranging from 10 to 150) flattened btBoxShapes encosed in a room constructed of 5 walls (also flattened btBoxShapes). The items can be thrown around and interact with one another.

In my application, the physics engine definitely seems to be the bottleneck. I am running a physics step about 50 times per second, and in each step I am allowing 3 substeps ( stepSimulation(1.0f/60.0f, 3, 0.33f/60.0f) ). This is quite costly, but from experimentation, this number of iterations seems to be required in order to prevent objects from going through one another (In my case, items going through the walls).

Any ideas for things to try / investigate in order to attempt to reduce the physics load? I am relatively new to Bullet, so any suggestions could be very helpful, even if they seem very obvious :).
Thanks!
RBD
Posts: 141
Joined: Tue Sep 16, 2008 11:31 am

Re: General performance optimization

Post by RBD »

What are your wall/box sizes/thicknesses?
drummerd_ca
Posts: 3
Joined: Thu Aug 20, 2009 9:08 pm

Re: General performance optimization

Post by drummerd_ca »

The items are on the order of 1x1x0.125, (give or take a factor of 2 I'd say) and the walls are about 20 times bigger (and I've experimented with their thickness). The walls also have a sizeable (10%) overlap with each other, so as to avoid anything slipping through the cracks, so to speak.

Everything used to be 100x bigger, but I scaled it all down after doing a bit of reading about the optimal sizes for bullet. Items going through the walls seems to be unaffected by the scaling.