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.
Speeding up android open gl api calls fro java
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.
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
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
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?
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).