Hey guys, I keep getting CPU spikes which I've tracked in the profiler to Animation.RebuildInternalState. What can be done about this?
asked Sep 12 '11 at 11:17 PM
I was just checking this out over lunch - if I don't disable the animation component and I do disable the skinned mesh renderer, then it looks like my spikes have gone away with two caveats: I've not tested this on the 3G S I was using yesterday; on the 4S I did see a massive ~300MS spike in RebuildInternalState() very early on in the level (i.e. within the first few seconds) but that seemed to be the only one, probably just as a whole bunch of animations hit the camera frustum for the first time.
So my suggested solution - the one we are now using - is to set the skinned mesh renderer enabled to false and not both disabling the animation or moving either object off screen. Of course a solution that moved the object offscreen and disabled the Renderer may prove even more efficient...
I don't have a solution tested yet for the huge spike I received, but perhaps I can align the animations in front the camera for a second with all lights off/texture occluding them and then move them back to their proper positions. Feels like a bit of a hack though...