Android & GLES2.0

Hi,

I got a Android Tablet (Archos 10.1) so I started to develop on it ;).
My aim is to do a first 2D game with OpenGL ES 2.0. My first tries work but it is my first with GLES2 and I have performance problem so :

  • what texture internal format should I use (GL_RGBA, …) ? Will it impact performance ?
  • any tips to speed up things ?
  • what design are you using to deal with logic and rendering ? (you put the logic in a indepandent thread. you put it in the onDrawFrame()…)
  • what is your target FPS ? (60 fps is just a dream :slight_smile:
  • (not OpenGL) how can I suspend sleeping mod ?
  • what do you use to take screenshot/movie on the Android device ?

Thanks

During the development of jPCT-AE, i came up with some hints to increase performance on the Dalvik-VM. Most of these things will clutter your code, so apply them only if they do any good in a particular situation: http://www.jpct.net/wiki/index.php/Performance_tips_for_Android

Check out libgdx. It handles the tedious stuff like game loop and texture loading but doesn’t get in your way to just do OpenGL, both ES 1.0/1.1 and 2.0. Plus you can develop your Android app on the desktop for a ~10x productivity boost. At the very least, you can see how we do it (Apache license).

60fps is completely doable for many games on newer devices. Some devices, like the Droid, are fillrate limited and you’ll get ~45fps just by filling the screen once.

Blending and alpha testing is pretty much a no go, use it only when needed, messes with the tile engines of the mobile GPUs. FBOs incure an additional cost it seems due to the shitty compositing the Android window manager does at runtime, post processing effects will be hard to do with high performance. Know your texture filters, use mipmapping whenever possible (and the cheapest mipmapping filter if possible). Know your precision modifiers in the fragment shader, see the PowerVR SDK tools which can tell you how well your shaders will perform (counts cycles etc.).

Ok. I have plaied a few with my code and I get some improvement. I still not use libgdx (If I’m correcte the main reason to use it is that they have made their own GLES binding whish is better).

I have find out how to take screenshot (ddmm tool in the SDK) and it seem that movie can’t be done directly from the device.

What do you think about fixed-point format for vertices/texture coordinates ? If i’m not wrong, it doesn’t impact data flow between CPU to GPU since they are both 4 bytes. Or is there a lost of speed in conversion somewhere ?
The main speed up with fixed-point is on CPU side ?
The fixed-point format is 16b/16b, right ?

Since it is a 2D game, I think that precision is far enough with fixed-point.