Page 1 of 1

Improvement to additive blending using deltas?

Posted: Sun Jan 31, 2010 6:09 pm
by BSer
In my use of additive blending in Ogre, I've been unable to make it work satisfactorily. It would add two animations together in an undesirable way that would impact every bone. For example, I wanted to add an animation where the eyes blink, but with Ogre, his body contorted in the extreme, because this eye blinking animation had the character in an idle pose. The transformations for that pose were all additive, contorting the body in the extreme.

Some might suggest that I redo the animation and put it in the binding pose, but in my situation I cannot. I would like a way to run an animation as additive, but in a manner that uses the deltas of that animation, not adding the full transformations and causing extreme contortions of all bones.

Other engines, such as Unity, seem to do this by default when doing additive blending. It proves far more useful.

Maybe Ogre already supports what I'm looking to do. If so, then sorry about that.

Re: Improvement to additive blending using deltas?

Posted: Mon Feb 01, 2010 11:29 pm
by Kojack
One way to get around it is to use blend masks.
Animation States have an optional blend mask which is a floating point weight per bone. You could create a blend mask for your blink animation which sets all the bones to zero (so they have no effect in the animation) except for the eyes which are set to one.
The methods in AnimationState to take a look at are: createBlendMask, setBlendMaskEntry, destroyBlendMask (and some more with similar names, but those are the main ones).

Re: Improvement to additive blending using deltas?

Posted: Tue Feb 02, 2010 12:04 am
by madmarx
Yes, and this works only if the OP is using bones.

In other case, what is extremely common is Pose animation (which I use fairly often with Ogre3d), and which stores the 'delta' of a mesh against an idle pose. It's the same as 'blendshape' in maya and blender, or 'morpher' in 3DSMAX. Please note that you will need to export your animation as PoseAnimation and **not** as MorphAnimation (otherwise it will not work correctly).

Re: Improvement to additive blending using deltas?

Posted: Tue Feb 02, 2010 4:52 am
by Kojack
Yes, and this works only if the OP is using bones.
Well, he did say bone twice, so I'm guessing there's bones involved.

Re: Improvement to additive blending using deltas?

Posted: Tue Feb 02, 2010 1:15 pm
by madmarx
Damn me, I missed these lines!
:mrgreen: