2D engine done. Advice on optimisation, please?
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)
|Messages In This Thread|
2D engine done. Advice on optimisation, please? - warmi - Jul 28, 2009 11:42 AM
Possibly Related Threads...
|new engine in works. advice?||godexsoft||4||4,103||
Apr 7, 2012 07:25 AM
Last Post: godexsoft
|Advice on 3D Room engine?||devGamer||4||3,588||
Mar 21, 2010 10:05 AM
Last Post: Skorche