I recently had some problems getting animations working, using the latest release 1.6.4. After several days, I found out that the OGRE entities perform an internal optimization:
Code: Select all
void Entity::cacheBoneMatrices(void)
{
Root& root = Root::getSingleton();
unsigned long currentFrameNumber = root.getNextFrameNumber();
if (*mFrameBonesLastUpdated != currentFrameNumber) { // this nice little check here
mSkeletonInstance->setAnimationState(*mAnimationState);
mSkeletonInstance->_getBoneMatrices(mBoneMatrices);
*mFrameBonesLastUpdated = currentFrameNumber;
}
}I'm using deferred shading and I think I have valid reasons to update my render targets one at a time. I disable some stuff (for example GUI update callbacks) while updating some render targets. There are certainly other valid reasons, for example, one might not want to update all render targets during a frame at all (a minimap, for example).
After I looked specifically for this problem, I noticed that once can fire the frame events manually. So there is a way to deal with this, but is it really a necessary burden? IMHO, this optimization is non-obvious, nearly non-documented and the benefit is unclear to me (why would OGRE update the animation too often anyway?). I suggest to remove it and to check for other such things as well, outside of the animation code.
Of couse, it is possible that I'm overlooking something. I just wonder whether OGRE could be made easier to use here...

