As some will know I started developing the core before the iPad was available to buy. This meant a lot of guesswork in terms of rendering performance, draw calls, vertex count and all the other fun stuff you have to think about from time to time.
This weekend just past I spent a good amount of time doing optimisation to get the core to run nice enough to make it playable.
The map screen is very light with just the star sprites and the ship taking basically no vram, and the background being the biggest memory hog here theres also no light sources and nothing really moves. So I’m getting a solid 60fps in the map screen.
Coming into a system view with planets is a different story: originally I was getting around 15 fps on the sol system (Sol is the heaviest a system can really be with 9 planets and asteroids). The sun for each system is a particle system and a point light.
In the first system view I had clouds of very light dust sweeping through the background crossing each other.
It seems alpha test is very pricey so any layered transparency means big performance hits so unfortunately they all had to go, but I immediately gained about 5fps.
Next the planet orbit lines. These were originally drawn with line renders, one for each line. The only problem with that was line renderers don’t batch, So even though they all share a material, if there’s 9 planets that’s 9 extra draw calls, just for little lines.
So instead of line renderers, I just built custom meshes in runtime for the lines, that way batching works and i save 8 draw calls. The intensity of the sun was something worth changing, originally it was 50 particles which gave the sun some life as you can see the shape moving and flaring away.
However I reduced the particle number to 12 and made the particles bigger which seemed to have a positive effect on the frame rate and still looks good, the sun kept its
shape a little more too it just has slightly less movement, which is fine.
Lastly it seems the ipad fill rate isn’t so hot, so having large areas of the screen changing frequently hurts. Simply zooming out with the camera slightly making all objects appear smaller had a very positive effect on the frame rate.
Now the system view is running at around 30fps I feel confident it’ll be playable. The only problem I can see is because the map view is so smooth, maxed out at 60 fps, you notice the drop to 30 when you enter the system view. Perhaps I should cap the framerate to 30 to ensure the game is consistent throughout. It just seem a shame because it looks really slick at 60!
So to summarise:
The key thjngs to remember on the iPad are low fill rate and alpha test causes strain. For those just interested in the numbers, the draw calls in system view are 33-45 with optimisations and 48-58 without. The triangle count didn’t change as i didn’t remove any meshes, so the triangles are 15,000, which means I don’t think polygon count is going to be an issue with most games on the iPad. Your more likely to hit a speed bump from fill rate before you need to redo your models.
Remember the iPhone? Well the iPad 3GS has the same GPU. But it has 5 times the pixels to draw. So by that nature things on the iPad cant really be expected to look “better” than they do on their smaller sibling, just bigger (which could be construed as better). I do think that having a nice big multi touch display that’s the most responsive on the market definitely makes the little niggles worth putting up with and remains a tremendously fun device to develop for.