Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-29-2009, 10:30 AM   #3 (permalink)
warmi
Registered Member
 
Join Date: Nov 2008
Posts: 234
Default

Quote:
Originally Posted by wynodir View Post
I find it weird that it would cost less to do all the matrix multiplications manually on the vertices instead of letting OpenGL take care of it. Perhaps it depends on how complex the mesh is? Tim Omernick showed that it is better to combine many simple objects into one big array and calculate all the translations and rotations manually, than using glTranslate/glRotate operations and calling glDrawArrays() for each object. I wonder if that is still the case for complex objects? If you have a few but very complex mesh objects, you will also have few glTranslate/glRotate and glDrawArrays() calls for each frame, in which case it might be better to let OpenGL do it all?

Does anyone have any insight into this? Should we always combine all the objects into one big array and make just one glDrawArrays() call per frame, or does it depend on the complexity of the scene?
It depends... the old iPhone has an inneficient implementation in terms of uselessly copying vertex data on each draw call but I wouldn't go as far as calculating everyting on the CPU and then issuing a single draw call.
The key optimization for the old iPhone is to minimize the size of your vertex data which means turning floats (uv/positions) into shorts etc ... and, if possible, using PVRT compression for textures.
On the other hand if you are doing 2d (quads) then obviously combining as many of them into one big array makes perfect sense since you don't want issue a separate batch for every quad (4 vertices)

I generally combine all static objects into single renderable (calculating their world coordinates once ) but keep all moveable objects as separate geometry.

This only applies to OpenGL 1.x .. the latest iPhone fully supports VBOs and overall behaves quite differently in terms of performance.
warmi is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,808
Threads: 89,206
Posts: 380,627
Top Poster: BrianSlick (7,129)
Welcome to our newest member, kaileymo123
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:33 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.