Slow Physics Animations

View previous topic View next topic Go down

Slow Physics Animations

Post  jj on Wed Dec 10, 2008 2:43 pm

Hi,

I'm having quite a problem with the iPhone performance of rendering both sio2 and bullet and an acceptable framerate. Using provided template project.

Here is my profile:
glView.animationInterval = 1/30
sio2window->fps ~ (supposed to be 30) varies from 8+ to 28...
15600 faces, 7900 vertices
14 staticMesh, 2 dynamic Sphere, etc...?

Code:

http://physic.cc
void sio2PhysicRender( SIO2physic *_SIO2physic,
                 SIO2window *_SIO2window )
{
   if( _SIO2physic->state == SIO2_PHYSIC_PLAY )
   { _SIO2physic->_btDiscreteDynamicsWorld->stepSimulation( (btScalar)( 1.0f / _SIO2window->fps ), 0 ); }
}

FixedInternalTimestep = 1/60

Can anyone tell me why I still get motion like its "on the moon" (if I want it smooth)... Is there anything I'm missing in order to have "framerate independence", or at least have a workable game?

Any suggestions?

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  uprise78 on Wed Dec 10, 2008 4:41 pm

I may be wrong, but I think you need to drop your poly count. 15,600 faces is a LOT. Try reducing that to around 7,000 and you should be good to go.

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  sio2interactive on Wed Dec 10, 2008 4:58 pm

I would suggest the same...
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Slow Physics Animations

Post  jj on Wed Dec 10, 2008 7:25 pm

I'm not really sure.

It's frustrating to think that I have 10-12 item that are fairly simple meshes in construction, and any less vertices will lose any of the detail in the model whatsoever.

I'm attempting to throw a ball through space and can't get the glView/sio2 numbers and the bullet numbers in the stepping of the simulation and fps to work properly at all.

Seems to make the whole thing useless. A performance hinderance on the iPhone platform? It frustrates me to think of the apps out there that seem to have WAY more complex models than I'm using.

Any other suggestions from people who have run across the same issue. The game is unplayable...

Do the following (default) values make a game playable with < 7k faces? the window->fps NEVER gets up that high...

glView.animationInterval = 1/60
stepSimulation: timeStep = 1/window->fps, maxSubSteps 0
fixedTimeStep = 1/60

Why do I feel like I'm missing something else...


Last edited by jj on Wed Dec 10, 2008 7:30 pm; edited 1 time in total

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  meteors on Wed Dec 10, 2008 7:29 pm

Is this your first time modeling for a game?

Realtime rendering is not like software rendering. Even with today's powerful hardware, you still need to learn how to create low poly models.

If you're interested, google for "primitive up method"


best,
-joshua
avatar
meteors

Posts : 241
Join date : 2008-11-08
Location : Sunny Florida

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  jj on Wed Dec 10, 2008 7:31 pm

Thx j,

I'll check it out

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  jj on Wed Dec 10, 2008 8:58 pm

I guess a better question might be,

How do you control and maintain the FPS of the sio2 engine and game? and what are the most important determining factors to adjust the speed/accuracy of the animation/simulation?

Another note: when I "play" the ball, the window->fps goes no higher than 10, and then mid way through my simulation (falling to the ground) it jumps up to 21 fps. Whats up w/ this? I've tried changing just about every variable in the simulation and timing intervals...

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  uprise78 on Thu Dec 11, 2008 9:15 am

You really wont be able to get a reasonable frame rate with that many polys. It's just not going to happen. Remember, this is running on a phone, not a computer. That being said, physics (Bullet) probably accounts for the biggest chunk of processor time.

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  jj on Thu Dec 11, 2008 9:02 pm

I actually discovered there was a problem (duplicate vertices or something) with my blender file.

I have tried a couple different poly counts (1200 faces up to 5500 faces) and I still cant seem to control the 1) sio2window->fps, or the resulting speed of my animation.

I'm getting a drop from 40fps (supposed to be 60) to 6 ! when I PLAYphysic.

And then near the end of the simulation (ball falling back to the ground) it jumps up to 21 fps.... just plain unusable...I really need to know what is causing the fps to drop so low at the beginning of the animation...

Any other suggestions? How do I maintain the sio2window->fps???

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  sio2interactive on Thu Dec 11, 2008 9:13 pm

It's Bullet, plain and simple... the calculations are heavy... however what you can do is take a look at tutorial06_2 Im showing a technique about how to offload the physic calculation to another thread... that might help you... and forget to have a 60fps on the device... if you can control the FPS to be between 15 to 30 its ok...

Cheers,
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Slow Physics Animations

Post  drunknbass on Fri Dec 12, 2008 1:57 am

you should be thankful we even have bullet working.. i know many that hard a hard time getting it to work at all in thier engines.

drunknbass

Posts : 16
Join date : 2008-12-04

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  jj on Fri Dec 12, 2008 2:28 am

sio2interactive wrote:take a look at tutorial06_2 Im showing a technique about how to offload the physic calculation to another thread... that might help you...

Looking, but I can't seem to get the callback

void templatePhysicCullingThread( void *_ptr ) to actually run, I placed an NSLog inside it, and it doesn't get called, nor does PhysicRender... missing something?

jj

Posts : 77
Join date : 2008-09-24

View user profile

Back to top Go down

Re: Slow Physics Animations

Post  sio2interactive on Fri Dec 12, 2008 2:35 am

Coudn't agree more... cuz also by default Bullet memory size is too big for the device, I had to tweak and found some workaround in order to make it work at a low memory cost...
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Slow Physics Animations

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum