Blending animations
It is possible to blend between two animations in a vertex shader. There are two reasons why you may would want to avoid blending between animations in a vertex shader. First, doing so will double the amount of texel fetches, which will make the shader more expensive.
This explosion of texel fetches happens because you would have to retrieve two copies of the pose matrices – one for each animation – and then blend between them. The shader code for doing so might look like the following code snippet:
mat4 pose0a = GetPose(animTexA, joints.x, instance); mat4 pose1a = GetPose(animTexA, joints.y, instance); mat4 pose2a = GetPose(animTexA, joints.z, instance); mat4 pose3a = GetPose(animTexA, joints.w, instance); mat4 pose0b = GetPose(animTexB, joints.x, instance); mat4 pose1b = GetPose(animTexB, joints.y...