I have this obsession to make character animation in real time based on inverse kinematics and morphing goals.
I did a great job with Animata, an open source animation program (FLTK-based, unfortunately) IK-chain. I even ported their rendering code to various platforms (Java / Processing and iPhone) alt video http://ats.vimeo.com/612/732/61273232_100.jpg of Animata video objects
Nevertheless, I was never sure that their code is especially optimized, and it seems that modeling every frame requires a lot of simulation on the processor, which seems a bit unnecessary to me.
Now I'm starting a project to create an application on the iPad, which relies heavily on real-time character animation and browses through the iOS documentation. I found a code snippet for the "Two Shader Shaders"
// A vertex shader that efficiently implements two bone skinning.
attribute vec4 a_position;
attribute float a_joint1, a_joint2;
attribute float a_weight1, a_weight2;
uniform mat4 u_skinningMatrix[JOINT_COUNT];
uniform mat4 u_modelViewProjectionMatrix;
void main(void)
{
vec4 p0 = u_skinningMatrix[int(a_joint1)] * a_position;
vec4 p1 = u_skinningMatrix[int(a_joint2)] * a_position;
vec4 p = p0 * a_weight1 + p1 * a_weight2;
gl_Position = u_modelViewProjectionMatrix * p;
}
Does anyone know how I will use such a fragment? It is presented with very little context. I think what I need to do is to make the IK code animation that I want to do, but on the GPU.
source
share