Sweaty Ass Animations

I got multiple animations in a model and animation blending working a couple of days ago. Which was pretty easy, just a case of putting the time in.

When I came to test multiple models I had a problem. With 100 models I only got 29 fps. Which probably sounds fine, when am I ever going to have 100 animated models on screen at once? It was about a day before I realise that I was creating D3D with D3DCREATE_SOFTWARE_VERTEXPROCESSING, which was left over after some tests I was doing. Switching it to D3DCREATE_HARDWARE_VERTEXPROCESSING predictably gave me an FPS boost. Not a huge one though, I was up to 51 fps.

Some commenting out revealed that the problem was the software vertex blending I was doing. Moving that to the shader knocked the fps up to about 400-500 with 100 models. That’s good enough for me right now.

You can download my latest BenchTest here.