Holiday notice: Cycling '74 will be closed Monday, October 9th. Manual authorization, support cases, and manual order processing will be delayed.

Jan 02 2007 | 6:24 am

Hi everyone,
There was some talk a few weeks ago about vertex skinning. Here's a
patch that demos the technique. It's a little hairy, especially the
vertex shader, but it does work. This patch is not completely error
free yet. For some reason the vertex interpolation is squishing
segments together and I haven't figured out why, but I think the idea
still comes across.

Here's how it works:
I've divided the mesh into 5 sections, each controlled by the position
and rotation (modelview matrix without the scale) of a gridshape. I
generated a cylindrical mesh and assigned each vertex to a section
(bone in the vertex skinning terminology) and a weight. The weight
says how much a given vertex is affected by a particular bone.
Getting all this data into a vertex shader is a bit tricky. Here I
put the weights in the texture coordinate matrix and the bone
assignment in the tangents matrix. This choice was for convenience
but is not the only way to do it.

The trickiest part of this whole business is getting the modelview
matrix for each segment ( aka the bone matrices) into the shader. To
conserve space, only the rotation and translation portions of the
matrix are sent which ends up being a 3x4 matrix. In the shader,
these are stored as an array of vec4s. For convenience, I actually
send the transpose of the 3x4 bone matrix so that a row of the matrix
is stored in a single vec4. Again, this isn't the only way to go. In
the shader, I build a modelview matrix from this data and use it to
find a new position for the vertex.

Theoretically, all of this data could be generated in Maya. Maya has
really nice tools for building skins and bones for a mesh, but the
m********* f********* has really lame export facilities. I tried
about half a dozen plugins that supposedly export skin and bone data
but none of them worked. If someone knows how to do this, I would be
most grateful to know how.

Here's the link.
http://www.mat.ucsb.edu/~whsmith/PlaydoughMesh.zip

best,
wes