Hi Everyone,
I am developing a 3d endless runner for the android os and I am having some very strange performance issues...
my game will initially run at 30fps on a low end device, 60fps on my higher end devices... as you continue to play the game the frame rate descends, after only a few minutes on the low end device the game will slow to an unplayable 8-14 fps on low end devices(totaly unacceptable) and aboout 25fps on the high end device...
I am pooling all my objects and have monitored for the garbage collector, he is nowhere to be found...
The issue is in my rendering, the update cycle is using a maximum of 3-5milliseconds...
I have sampled the number of milliseconds it takes to render the scene, and each subset of objects... any list of objects is always between 0-10 objects in length the time taken to render that list is ever increasing...
Has anyone ever experienced something like this / know of anything stupid I must be doing? it doesn't make sense to me that rendering the same scene would take ever increasing time!
Thanks for your help
here is a snippet of rendering code, it looks about the same for every object type
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| if(hoops.size() > 0){ Assets.hoopMod.bind(); Assets.hoopTex.bind(); for(Hoop h: hoops){ gl.glPushMatrix(); gl.glTranslatef(h.pos.x, h.pos.y, h.pos.z); gl.glPushMatrix(); gl.glScalef(.5f * h.scale,.5f * h.scale,.5f * h.scale); gl.glRotatef(h.orien.x, 1, 0, 0); gl.glRotatef(h.orien.y, 0, 1, 0); gl.glRotatef(h.orien.z, 0, 0, 1); Assets.hoopMod.draw(gl.GL_TRIANGLES, 0, Assets.hoopMod.getNumVertices()); gl.glPopMatrix(); gl.glPopMatrix(); } Assets.hoopMod.unbind(); } |