Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Open gl es descending frame rate  (Read 874 times)
0 Members and 1 Guest are viewing this topic.
Offline ~Spaceaholic

Senior Member


Medals: 3
Projects: 1



« Posted 2013-01-09 18:28:19 »

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

Junior Newbie





« Reply #1 - Posted 2013-01-13 22:23:45 »

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


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.
Offline HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #2 - Posted 2013-01-13 22:27:04 »

Use anything other than immediate mode.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline badlogicgames
« Reply #3 - Posted 2013-01-13 22:35:08 »

This is not immediate mode :/

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.

http://www.badlogicgames.com - musings on Android and Java game development
Offline HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #4 - Posted 2013-01-13 22:41:55 »

This is not immediate mode :/

Is the OP using LibGDX?

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

Offline pitbuller
« Reply #5 - Posted 2013-01-13 23:06:05 »

This is not immediate mode :/

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?
Offline ~Spaceaholic

Senior Member


Medals: 3
Projects: 1



« Reply #6 - Posted 2013-01-14 23:28:35 »

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
Offline badlogicgames
« Reply #7 - Posted 2013-01-14 23:55:33 »

Released way after libgdx Smiley glad you figured it out.

http://www.badlogicgames.com - musings on Android and Java game development
Offline ~Spaceaholic

Senior Member


Medals: 3
Projects: 1



« Reply #8 - Posted 2013-01-16 19:27:22 »

its all relative Smiley
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (6 views)
2014-07-23 21:16:32

Riven (7 views)
2014-07-23 21:07:15

Riven (8 views)
2014-07-23 20:56:16

ctomni231 (40 views)
2014-07-18 06:55:21

Zero Volt (36 views)
2014-07-17 23:47:54

danieldean (30 views)
2014-07-17 23:41:23

MustardPeter (32 views)
2014-07-16 23:30:00

Cero (47 views)
2014-07-16 00:42:17

Riven (48 views)
2014-07-14 18:02:53

OpenGLShaders (38 views)
2014-07-14 16:23:47
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!