Jump to content

  • Log In with Google      Sign In   
  • Create Account


Speeding up android open gl api calls fro java


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 SillyCow   Members   -  Reputation: 849

Like
0Likes
Like

Posted 28 December 2012 - 03:32 AM

I'm writing an android game in java. I render from Java code and most of my rendering code deals with rendering a static background. This background is made up of a bunch of VBOs which I translate and scale. These opengl calls take a lot of time to execute, and they never change (the background is not animated).

Is there a way to decrease the amount of openGl calls I am making? I read something about render lists, but I gather that they've been deprecated.


Edited by SillyCow, 09 February 2013 - 04:50 PM.

My new android game : Enemies of the Crown

My previous android game : Killer Bees


Sponsor:

#2 Ruben Moreno   Members   -  Reputation: 436

Like
1Likes
Like

Posted 28 December 2012 - 10:19 AM

Hi,

 

The dev area for iOS has a very good site about performance and tips using OpenGL ES. Nearly all can be applied to a Java coded Android application, except for VAOs.

 

http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008793-CH1-SW1

 

I created a game with hundreds of draw calls per frame, without VBOs for Android 2.2 compatibility, and it's playable even on older devices (20 fps on the aging HTC Desire on low quality, 60 fps on Galaxy S2 on max quality). How many draw calls do you have per frame?

 

Regards,

 

Rubén



#3 SillyCow   Members   -  Reputation: 849

Like
0Likes
Like

Posted 30 December 2012 - 12:42 AM

Thanks for the link. It's a very interesting read.

My new android game : Enemies of the Crown

My previous android game : Killer Bees


#4 SillyCow   Members   -  Reputation: 849

Like
0Likes
Like

Posted 09 February 2013 - 04:30 PM

The problem persists...

After some minor tweaks ( resulting in +3 FPS), the problem remains.

It seems that when rendering VBOs in Android from Java, each openGL call is very expensive.

With low poly VBO models ( < 1K faces ), calling openGL costs more than doubling the face count.

 

My problem is rendering a forest (a bunch of VBO tree instances).

For each tree, I have scale,rotate, and translate.

This taxes performance greatly, since each call takes alot of time.

 

I could switch to C + NDK (will that help?), but I really don't like native on android, since it makes my code CPU-specific. I own an ARM phone and a MIPS tablet, so I am not inclined to do so.

 

Any ideas?

 

 

PS: 

 

without VBOs for Android 2.2 compatibility

Not sure why you would do this, I'm using VBOs on Android 2.1


Edited by SillyCow, 09 February 2013 - 04:31 PM.

My new android game : Enemies of the Crown

My previous android game : Killer Bees


#5 jbadams   Senior Staff   -  Reputation: 18019

Like
0Likes
Like

Posted 23 February 2013 - 06:02 PM

If you're background never changes and isn't animated, is it possible for you to pre-render them as an image and then simply draw that behind the rest of your game, or are there lights/shadows or something interacting with them and making this impossible or impractical?



#6 SillyCow   Members   -  Reputation: 849

Like
0Likes
Like

Posted 23 February 2013 - 06:25 PM

The background is just a bunch of trees. As I move the camera, the perspective changes.

 

Besides, the vertex count does not seem to matter. I could be rendering quad-sprites or 500 poly VBOs, and the rendering speed does not change. The only thing that matters is how many opengl calls I make.

(By the way, this is not the case when using the emulator, only on actual devices).


My new android game : Enemies of the Crown

My previous android game : Killer Bees





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS