View Single Post
Old 12-26-06, 12:28 PM   #1
Registered User
Join Date: Aug 2006
Posts: 38
Talking Boneinterpolations

Yesterday I've do some experiments with an interactice geometrie program (See attachment). A bonesystem wich use a linear interpolation isn't a problem,
a month ago, I've wrote a vertexshader that do that with compressed matrices. For lowpolymodels is the linear interpolation doesn't makes trouble, but for medium and highpolymodels (>100K faces) it doesn't looks good. Knees or elbows looks more than a buckled pipe than something organic.

So I've create in Kig a geometrical model of my linear bone interpolation (blue) and add a lerp interpolation (green). The Lerp interpolation is verry cheap in the Verteshader it cost only a normalisation and a multiplication with the distance from joint to vertex (it's static, so it could be the W componet from gl_Vertex)
The convex side looks much better but the concav side has still a too large hack.

After that I've add a third interpolation: I've add the differens between linear and lerp to the the lerp interpolation (red) . It looks like a usable simple way to fill the hacks.

For the standart linear bonesystem I need two atribute vec4 per bone. One for weighting and one for indexing (practicel 3 bones per Vertex should be enough) for the lerp interpolation another storage would be better:
Each vertex is assigned to one joint. Most joints connect two and rare three bones. Because the jointnummber is needet for each vertex and every times the same bones are joined at the same joint, it would be enough to store the bonedepencys as uniform variable indexed by the jointnumber. So only one value is needet to index all bonerotationmatrices (or quarternions) The tree other values could be used for weighting up to four bones per joint (The sum is every time 1.0 so only 3 values for 4 bones are needet)
An other Idea is to store one value in that vector, that modify the interpolation form linear over lerp to hyperlerp. Then there remain only two values, but enough to store weigthing for three bones.

Writing a vertexshader shouldn't be a problem, but I don't know an editor that is able to edit meshes that are transformed by a custom vertexshader or is able to skinn for lerp or slerp. (I think about to add that features to my shadereditor, but it's too early for adding mesh editing tools)
Attached Thumbnails
Click image for larger version

Name:	bones_interpolate.png
Views:	248
Size:	24.0 KB
ID:	23066  
oc2k1 is offline   Reply With Quote