I’m currently thinking/implemented an animation for my home game and engine. Two of my friends do the art, I do the programming and we all do bits of the design. Both being game artists by trade, there know exactly how to get good results from a limited set of options. My home engine, isn’t designed to have everything just whats need to do the current things.

The big thing that Mark feels we need is vertex morphing, we already support bones (actually it doesn’t but the old engine does, so its just a case of rip and improve) but we want morphs as well. Its actually fairly trivial once you get the data out of the art package.

A vertex morph is a series of vertex deltas that are scaled before being added to the base mesh. Usually not all vertices are morphed, so they take the form of an index position delta. struct VertexDelta { uint16_t index; float3 pos; };

Then the psuedo-code is simple

// normal skinning code and zero the deltas foreach( vertex ) basePos[i] = SkinVertex( inputPosition[i], boneWeights[i], boneIndices[i], boneMatrices); deltaPos[i] = 0,0,0 endfor // accumalate each delta in the appropiate deltaPos index for( each vertexDelta ) deltaPos[ vertexDelta[i].index ] += vertexDelta[i].pos * morphScale; endfor // sum the base and delta foreach( vertex ) finalPos[i] = basePos + deltaPos endfor

There are fundementally two ways of doing it A) computing deltaPos on the CPU and doing the skinning and the add on the GPU. This has the advantage that the number of morphs is only limited by CPU execution speeds, but has the disavantage of doing lots of work on the CPU and having to send data upto the GPU every frame. B) Flattening the indexed deltas (so producing a vertex size list of vertex deltas per vertex morph) and assigning each one to a seperate GPU stream. Then doing the scale and addition of all the vertex morpths on the GPU. The main disadvantage is a limit to the number of morphs, as you only have a few vertex streams available (you’ll be lucky to find 8 spare) and that it uses a lot of VRAM. The advantage is of course speed, the entire thing is then just pure vertex shader ops and they are really a bottleneck.

I’m likely to imlement both, where the number of morphs can fit in the hardware use that and fall back to software for the more complex cases…

The other main thing for an animation system, is the envelope system. I’m going to implement a general one, that will be used to animate bones, morphs and even material parameters. A simple TCB curve will be the main default type and then if I need more exotic ones I’ll just slot them in and all the different systems that can be driven by envelopes will automatically get the new types.

I pretty hopeful that with the two systems in place (bones and morphs) the art will be able to achieve the art-style we want. Were not looking for realism, but it still requires a powerful animation system so the guys can get the look and feel there aiming for. Its largely a character driven game, so it has to feel right. Animation is the key, there is already a physics system in place but physics is a poor substitute for a good animators eyes :-)