iPhone Performance

webjeff
Posts: 15
Joined: Tue Dec 16, 2008 1:46 am

iPhone Performance

Post by webjeff »

Hello,

I ported bullet to the iphone, which was rather easy. I have a simple app which has a plane and about 10 ridigbody boxes. They fall from a few meters above and hit the ground and all proceed to move forward and hit a wall. Simple.

Odd issues:
On the simulator, it works great. FPS is ~30, animation timer is set to 30hz. Cool I thought. However, on the device I get FPS ~30 when it starts, as they drop its fine, but when they hit the ground, the FPS drops to 2. Then after a bit it goes to about 16 until they hit the wall and it drops and stays to 2.

So, it seems as though it's related to collisions and only on the iPhone (not on the simulator). Has anyone else experienced this? The oddest thing is that the simulator and the device act differently. I would think they should both work similar (maybe not exactly the same).

Any thoughts?

Thanks
Jeff.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: iPhone Performance

Post by Erwin Coumans »

What kind of collision shapes are you using? Do you use btBoxShape for the moving objects and btStaticPlaneShape for the ground?

There is a similar physics demo, with 10 boxes in the Oolong Engine, and the performance is better: around 30FPS even when objects collide and settle down.
http://code.google.com/p/oolongengine/

Can you compare it, and see why there is so much performance difference? Can you add CProfileManager::dumpAll(); right after stepSimulation and report where performance is going?
Thanks,
Erwin
jackjohnson
Posts: 8
Joined: Tue Sep 23, 2008 10:07 am

Re: iPhone Performance

Post by jackjohnson »

I have had the exact same problem. I am using sio2 engine, and cannot for the life of me get an acceptable physics simulation with smooth animation and framerate without tunneling....

Hopefully someone can provide something here....
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: iPhone Performance

Post by Erwin Coumans »

Can one of you please cut&paste the console output after running the demo on iPhone, with the dumpAll command?

Code: Select all

stepSimulation(deltaTime);
CProfileManager::dumpAll();
Thanks a lot,
Erwin

And please only use 1 argument to stepSimulation!
webjeff
Posts: 15
Joined: Tue Dec 16, 2008 1:46 am

Re: iPhone Performance

Post by webjeff »

I will get the log to you over the weekend.

Why do you prefer only 1 argument to the step function and not explicitly set the iterations to 2 or something low?

Also, do you want that output of just one frame? I ran it on my pc and it was spitting a ton of stuff out.

Thanks
Jeff.