BioShock on the PlayStation 3! My first task was to optimize the character ‘skinning’. For Bioshock, a lot of resources go into the character animation – here ‘skinning’ refers to the process of taking the various animated joints (spine, elbows, knees, wrists, etc) and deforming the rendered character to match that animation.
Skinning was coded for PS3 in two phases: first I made it work on the main CPU (actually Sony calls their CPU a PPU) using their specialized math instruction set (much faster than straight up C/C++). That was about four times faster, but the PS3 still had more love. That love was the final step, take that code and run it entirely on a SPU, freeing up the PPU for other tasks. The SPU processors run along side the PPU, chewing data while the PPU worries about something else. The idea being, if you have spare SPU time, your skinning is essentially ‘free’ (done before the rendering system even asks for it).
After that was working, I helped out with profiling and memory optimization. Things you want to do when you change memory architectures, like adding a second straw to your milkshake. In this amazing analogy the two straws would be the collision system and the rendering system. The ‘milkshake’ (chocolate) would be the objects in the world that need to be drawn but, just as importantly, shot, knocked over and generally interacted with. By dividing the data describing the objects between the two dedicated areas of memory I eliminated the need to make a second copy of the object while giving both systems full-speed access to the parts they needed.
As we wrapped, I was slogging on TRC issues (not fun) and crashes (quite fun actually). Such are the tasks of taking it the last mile … as usual it comes down to some nuanced and hard to nail down issues.