2D engine done. Advice on optimisation, please?

Member
Posts: 166
Joined: 2009.04
Post: #17
Madrayken Wrote:[Blinks] How?! I know it's rude to ask, but having reduced the size of my sprites on-screen (they're now about 32-ish pixels square, randomly distributed in a huddle around a central point in world space), I can only get about 120 running at 30fps in my tests. My sprites are sorted according to which texture atlas they use. I have no render-state changes of any sort in my inner loop. My colours now use ubytes. I have a 3g ipod touch.

I don’t know cause I don’t know what exactly you are doing :-)

Maxing out at 120 32x32 seem way to low … you should really check if you have any other bottlenecks.
Run your code with Instrument/CPU Sample and see what comes up on top.
If it is something like presentRenderbuffer(..) then you are fillrate limited which is fine … you should be fillrate limited but not at this low number of sprites.

In my code I am using shorts for vert coords:
VertX, VertY, VertZ, PAD,R,G,B,A, UVX,UVY
2, 2, 2, 2, 1, 1,1,1, 4, 4

But it doesn’t really make any difference with 2d rendering … I am considering going back to using floats for 2d stuff because of all that casting going on which is slowing things down ( and it is a complete waste on the latest iPhone)
Quote this message in a reply
Post Reply 


Messages In This Thread
2D engine done. Advice on optimisation, please? - warmi - Jul 28, 2009 11:42 AM
Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  new engine in works. advice? godexsoft 4 3,798 Apr 7, 2012 07:25 AM
Last Post: godexsoft
  Advice on 3D Room engine? devGamer 4 3,410 Mar 21, 2010 10:05 AM
Last Post: Skorche