I’ve incorporated my new shader code into the game I’m working on. My goal for this game is to get full dynamic shadows on all devices (even old iPhone3GS). However, trying it out I found a scene with 41,000 triangles, including 7 skinned meshes took more than 100ms to render. By optimizing the meshes and removing conditional statements from shaders I got that down to 93ms – still way too much. Then, tried pre-calculating all matrices before sending to shader and the render time suddenly dropped to 38ms – that’s about 26 FPS, nearly acceptable. I hadn’t quite realised how important it is to precalculate.
I used vcacne to optimise the meshes. Vcacne reorders the triangle groups to take advantage of the GPU vertex cache. This gives a small, but noticable increase in performance (about 4%).