Hi.
So, I’ve started writing a game on the Android platform. Everything is working out quite well so far, except one [major] thing: Performance.
I’ve always been slow on catching up on the OpenGL stuff since I’ve always worked under the philosophy “Optimize later” (and never really had to). But on Android, “later” is “earlier” it seems.
I’m working on a standard 800480 display, and I am filling it with a varying number of 1616 textured quads (rendered as GL_TRIANGLES) (Ranging from 0 quads to filling the whole screen). I’ve been using Vertex Arrays with index pointers and glDrawElements, and I’ve tried several approaches that work from very poor to pretty poor.
Approach 1: Vertex array for one quad, located at 0,0, - render each of the textured quads by translating to their location.
Approach 2: Large vertex array to hold all quads with absolute location, render it all in one go.
Approach 3: Bundling the 16*16 quads where possible (forming larger quads, and using the texture’s s&t repeats to fill them).
Approach 1 is horrible. I wasn’t too surprised about that, but I figured I’d give it a go. Performance on approach 2 and 3 vary abit, depending on the composition of the quads, and their quantity. But none of the approaches perform sufficiently.
I manage about ~15 FPS on my HTC Hero, when the screen is full.
So, I figured I would give VBO’s a shot. I know they aren’t too far from Vertex Arrays in regards to implementation, but I’m not really sure how they differ. (Vertex arrays have always been more than good enough for me on the PC platform, so I was always too lazy to learn VBO’s).
I’m looking for some help on how to implement them properly, and how they’re incorporated and used in the following points.
-> Surface creation
-> Surface resizing
-> Setting up rendering for an entity
-> Rendering the entity
-> Cleaning up after the rendering
I should note that in my specific problem, my grid of textured quads is dynamic, in that it changes based on user action. It does not however, change on every cycle.
Thanks for any help offered