Skeleton Animation Blending and Ogre Compositing
Friday, February 22, 2008 by petlik-5Last week David and I was working on a issue with skeleton animation blending, the problem was that when we ran two animations on the same skeleton the joint movements of each animation was not in full effect.
After some reading in the Pro OGRE 3D Programming book and the Ogre3D forum we figured out that Ogre’s default skeleton animation blending mode was set to ANIMBLEND_AVERAGE, meaning if you have two animations active it divides each weight with the amount of animations active (1.0/2). What we wanted for our skeleton animation blending was ANIMBLEND_CUMULATIVE which would let all the active animations perform their joint movements and skeleton animations in full without weight reduction.
Accessing libraries in yake (like Ogre) is not much of a problem when you figure out how to go about it, so setting the skeleton animation blending to ANIMBLEND_CUMULATIVE worked really well. Here is a little snippet of changing the blendmode of a skeleton.
typedef yake::graphics::ogre3d::OgreEntity OgreEnt;
void setAnimationBlendMode( yake::graphics::IEntity* ent, Ogre::SkeletonAnimationBlendMode mode )
{
Ogre::Entity* ogreEnt = ((OgreEnt*)ent)->getEntity_();
Ogre::SkeletonInstance* skel = ogreEnt->getSkeleton();
skel->setBlendMode( mode );
}
Also last week I started to look into Ogre Compositing but I pretty much ran into a wall, I’ll have to take a good look at it this week and see if we can work around the problem. What is Ogre Compositing? you might ask youself, Ogre Compositing is used for making post-frame-effects, meaning we render the games frame onto a texture where we then run different material programs and shaders to enhance the image.
We want to use this post-effect functionality to make colour corrections to the game, a few weeks back David was messing around with a screenshot making some colour corrections in photoshop, the difference was amazing compared to the original.
If/when I get this Ogre Compositing working I’ll post a with/without screenshot to show the difference:)
Cheers.