views:

996

answers:

2

I'm trying to squeeze some performance increases out of my iPhone OpenGL ES application. According to Instruments, my tiler utilization is near 100% most of the time, and my FPS is about 24. I'd like to get my FPS up over 30. I can get there by converting from GL_FLOAT to GL_SHORT, but that presents some fairly daunting technical problems for me at the moment. I'd rather not go there.

So, I'm considering switching from glDrawArrays() to glDrawElements(). I have 35 meshes made up of 708 vertices, but a lot of those vertices are shared between faces. I am texture mapping but the mesh is mostly uniform in color. The faces that require special texturing will be left as is.

Let's say I can cut the number of vertices in half. Let's also say that I also organize my geometry in a way that makes sense for the iPhone: say, using Imagination Technologies PVRTTriStrip tool. Ignoring the small amount of extra memory for the index array, that means I've roughly cut the memory bandwidth in half so I should see a fairly nice performance increase.

Is this true, or am I missing or misunderstanding something? Advice is appreciated.

+5  A: 

In case anyone is interested, I went ahead and tried this, without the PVRTTriStrip tool portion. All testing was done on an iPhone 3G. I was able to scale my vertices down from 708 to 113. And since I'm under 255, I'm using GLubyte as my index type. So, I went from:

35 * (708 * 32) = ~774K

To:

35 * (113 * 32 + 708 * 1) = ~148K

Which reduced my total memory bandwidth to under 20% of what it was. My FPS increased to ~34. So, I saw about a 42% improvement in FPS. Overall, I'm pretty happy. I think there's more to be gained, but I have bigger fish to fry now.

Also, I filtered out a bunch of degenerate triangles (not the useful kind) to get my index count down to 522, from 708. From that I saw an increase to ~40 FPS from the ~34 FPS I was seeing.

Rob Jones
A: 

If you're hitting a Tiler Utilization of 100% in Instruments (like I was), you're being constrained by the size of your geometry. Of all the things I tried to improve performance, I only noticed a significant bump in framerate when I reduced the geometry size. So, yes, if you can eliminate some vertices from being sent, you should see a boost in performance.

Even though you state that it is difficult to do, I highly recommend converting from GL_FLOAT to GL_SHORTs, because you will see a large jump in rendering speed. I did this in my application, and it wasn't too much of a hassle to implement for the kind of return I got.

Brad Larson
Oh, I whole heartedly agree with you. I actually had it working at one point, but then I started implementing some new features, and the GL_SHORT conversion was causing me problems. I backed it out to make progress on the new feature; then, when I went to add it back in, I found a new layer of complexity. It will definitely be the next thing I try if I find I need to squeeze out more performance.
Rob Jones