Skip to main content
Version: 5.x

Nodes > Inputs > Engine > Skin Matrix

Skin Matrix

Get the skin matrix at a given bone index. Note the skin matrix is not available in the fragment shader.

One usage of the skin matrix would be to reproduce the skinned vertex position. This can be achieved with the following Code Node snippet:

vec4 pos = vec4(system.getSurfacePositionObjectSpace(), 1.0);
vec4 indices = system.getBoneIndices();
vec4 weights = system.getBoneWeights();
mat4 skin1 = system.getSkinMatrix(indices.x);
mat4 skin2 = system.getSkinMatrix(indices.y);
mat4 skin3 = system.getSkinMatrix(indices.z);
mat4 skin4 = system.getSkinMatrix(indices.w);
vec4 m0 = skin1 * pos * weights.x;
vec4 m1 = skin2 * pos * weights.y;
vec4 m2 = skin3 * pos * weights.z;
vec4 m3 = skin4 * pos * weights.w;
vec4 transformedPos = m0 + m1 + m2 + m3;

Inputs

NameTypeDescription
IndexfloatThe bone index used to look up the skin matrix.

Outputs

NameTypeDescription
Skin MatrixmatrixThe skinning transform matrix at the given bone index.
Skin Normal MatrixmatrixThe skinning normal matrix at the given bone index.

Properties

NameTypeDescription
TypedropdownChoose to return either the Skin Matrix used for transforming vertex positions, or the Skin Normal Matrix used for transforming vertex normals.
Was this page helpful?
Yes
No