tags:

views:

635

answers:

2

I have this game with some variety of textures. Whenever I draw a texture I bind It and draw It.

It's possible to draw all the elements of my game in just one draw call ? , with Interleaved Arrays ...how can I do It ?

The performance of my game will increase by doing this ?

+1  A: 

TBH you are better off doing it with seperate draw calls. Performance is unlikely to be noticeably affected.

There "may" be ways to do it by indexing into slices of a volume texture (or texture array) but you'd need the 3GS to do this and it wouldn't work on the old iPhone. I also doubt you'd get any noticeable performance improvement by doing it.

Goz
+1, but what does TBH mean?
unforgiven3
To be honest .
Perspx
oh, haha, internet slang fail on my part ;-)
unforgiven3
+3  A: 

I believe that you would benefit from using a texture atlas, one giant texture containing all of your smaller ones. For OpenGL ES on the iPhone, Apple recommends that you place all of the vertices that you can draw at one time in a Vertex Buffer Object (VBO), and that you interleave the vertex, normal, color, and texture information within that buffer (in that order). Note that the VBO itself doesn't give you a significant performance boost over a standard array on the original iPhones, but the 3GS has hardware VBO support.

Either by grouping data into a VBO or an array, I've seen significant performance improvements in my application when I reduced the number of draw calls.

Another area that you might want to look at is in reducing the size of your geometry. By going from a GLfloat to GLshort for my vertex and normal coordinate data, I saw an over 30% improvement in OpenGL ES rendering speed on the iPhone 3G.

Brad Larson
In addition, it might be worth checking out this presentation by ngmoco: Overview of iPhone OpenGL optimization techniques - http://gamemakers.ngmoco.com/post/111712416/stanford-university-and-apple-were-kind-enough-to
Dave
Agreed. That's an excellent presentation when it comes to tuning OpenGL ES.
Brad Larson