Strange framerate fluctation with a specific mesh
Posted: Tue Apr 26, 2011 12:07 pm
Hi,
Ran into a bug in my game this week which has had me tearing my hair out.
I enable vsync to keep everything at a steady 60fps. However suddenly my delta time between frames started fluctuating, making the game jerky and unplayable. I started removing parts of my game right to the bare bones where all I had was a standard irrlicht render loop displaying some meshes, and still had the problem.
I tracked it down to a specific mesh file and I don't know why it specifically would cause a problem.
So if I load and display 100 scenenodes with the fighter mesh from Psionic's webpage : http://www.psionic3d.co.uk/?page_id=25 I get big spikes in my deltatime between frames. I logged them like this:
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.029
Deltatime 0.009
Deltatime 0.009
Deltatime 0.018
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.029
Deltatime 0.009
Deltatime 0.01
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
The mesh has ~900 tris in 1 group, 1 texture.
If I change one line in my code to replace the mesh filename with another, an asteroid containing 2000 tris, I get a rock steady 60fps.
Deltatime 0.016
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.016
Deltatime 0.016
Deltatime 0.018
Deltatime 0.016
Deltatime 0.018
Deltatime 0.016
Deltatime 0.016
Deltatime 0.018
Deltatime 0.016
Deltatime 0.016
Deltatime 0.017
Deltatime 0.016
Any idea why this would be?
D
Ran into a bug in my game this week which has had me tearing my hair out.
I enable vsync to keep everything at a steady 60fps. However suddenly my delta time between frames started fluctuating, making the game jerky and unplayable. I started removing parts of my game right to the bare bones where all I had was a standard irrlicht render loop displaying some meshes, and still had the problem.
I tracked it down to a specific mesh file and I don't know why it specifically would cause a problem.
So if I load and display 100 scenenodes with the fighter mesh from Psionic's webpage : http://www.psionic3d.co.uk/?page_id=25 I get big spikes in my deltatime between frames. I logged them like this:
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.029
Deltatime 0.009
Deltatime 0.009
Deltatime 0.018
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.029
Deltatime 0.009
Deltatime 0.01
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
The mesh has ~900 tris in 1 group, 1 texture.
If I change one line in my code to replace the mesh filename with another, an asteroid containing 2000 tris, I get a rock steady 60fps.
Deltatime 0.016
Deltatime 0.017
Deltatime 0.017
Deltatime 0.017
Deltatime 0.016
Deltatime 0.016
Deltatime 0.018
Deltatime 0.016
Deltatime 0.018
Deltatime 0.016
Deltatime 0.016
Deltatime 0.018
Deltatime 0.016
Deltatime 0.016
Deltatime 0.017
Deltatime 0.016
Any idea why this would be?
D