How or where to access bone indicies, weights, and matricies?

wasn’t sure if things changed a lot in Vulcan, Not seeing anything obvious through the errors dumps using the TD console window or in exported materials -

I know there’s the pCaptPath detail attribute, makes sense the length of this, is the number of bones/matricies.

What is pCaptData? Is this weights? or matrices unrolled somehow?


Hey lucas,

The pCaptData is indeed the unrolled 4x4 matrices (20 values per bone, not sure what the last 4 floats are doing). pCaptPath the bone names. The vertex weights per bone is stored in the pCapt[] buffer. It contains pairs of values (first value is the id of the bone, second the weight).
The size of this buffer depends on how many bones are connected to a single vertex. Like if there are weights for a certain vertex on 3 bones tops, the pCapt buffer would be 6.
As far as I noticed not much has changed in the vulkan versions concerning this.

Hope this helps.

Thanks Tim! Will give this a go :smiley:

ps. if you’re planning to integrate it in a shader, the pCapt buffer is always a vec4 array, so the amount of quantized to 4 floats. (so for example the above example with pCapt size 6, it will be something like:
in vec4 pCapt[2]; (since up to 8 floats fit in this)

one last ps. :)… Deforming Geometry (Skinning) - Derivative this might be useful in that case :smiley:

1 Like

Ah yes, forgot where to find this one, thank you for that as well!

So pCapt is big enough to contain the weights / indices for the worst case vertex if I understand correctly, and the same array is accessible to all?

it’s a vertex attribute that you can access in your vertex shader with an ‘in’ statement similar to a tangent. Also to get more intuition about what exact values it contains, check out the soptoDAT. The ‘points’-extract option gives you the pCapt values per point, and the ‘detail’-extract option gives you the pCaptData and pCaptPath.
When a point has less bones connected to it, the pCapt value of that point will be -1 if I remember correctly.

ok will take a look at the sop to dat more closely, thanks for the tip there

1 Like