Open gl es descending frame rate

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

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();
		}

OK, maybe I am missing something here, but I see you binding both HoopMOD and HoopTexture… but I only see you unBinding HoopMod. Running out of ram maybe ? Also, are you able to write that IF loop so that the two binds are only called once BEFORE you enter the IF loop ? This way you keep your asset overhead down. Just my observations. Hope it helps.

Use anything other than immediate mode.

This is not immediate mode :confused:

A few things come to mind. First, try to coalesce all these matrix operations into equivalent CPU side operations and upload the resulting matrix to the GPU once. That might not solve your problem of decreasing FPS over time, but might give you better FPS to start with.

Given your problem and your scenario, my first guess would be that hoops actually grows unbounded. You already said you checked that, i assume you don’t only render hoops, but other things that are in lists which could potentially grow.

Is the OP using LibGDX?

EDIT: Okay, maybe I should start assuming that Android development means LibGDX.

There are no immediate mode at openGl es. You need to use vertex arrays/vbo for every draw call.

edit:
Is that hoop list already frustum culled?

ok so this is kind of embarrassing…
part of my issue was insufficient profiling… it all goes kind of like this…

I made these hoops, they are activated when you jump through them, and when activated they shrink down to nothing…
hoops are always moving towards the camera (at the speed of the user moving in the z axis) until they move past it and are deleted from memory.
the hoops didnt look quite right just shrinking down so I made them also translate to the users position on activation, where they would stay, scaled to 0, not ever making it into the “kill zone”… I was rendering more and more hoops at scale 0 as the level progressed… and when I was checking the sizes of the lists for the issue i just left the game running, not actively playing and thusly not activating the hoops and causing the issue…

Thanks for your replys, in the end this one was programmer error…

note: the engine I use is the one in the book “beginning android games” by mario zechner, released just before libgdx i believe

Released way after libgdx :slight_smile: glad you figured it out.

its all relative :slight_smile: