I'm animating body+ face moments using skeleton animation , SceneKit and Metal custom shader.
I need to deform some vertices in the vertex shader, therefore I need skinningJointMatrices in the vertex shader.
However if I just add the line
float4 skinningJointMatrices[183];
in the NodeBuffer :
struct NodeBuffer {
float4x4 inverseModelTransform;
float4x4 inverseModelViewTransform;
float4x4 modelTransform;
float4x4 modelViewProjectionTransform;
float4x4 modelViewTransform;
float4x4 normalTransform;
float2x3 boundingBox;
float4 skinningJointMatrices[765];
};
I get the following assertion:
[SceneKit] Assertion 'C3DSkinnerGetEffectiveCalculationMode(skinner, C3DNodeGetGeometry(context->_nodeUniforms.instanceNode)) == kC3DSkinnerCalculationModeGPUVertexFunction' failed. skinningJointMatrices should only be used when skinning is done in the vertex function
Is there a way to workaround this assert?
The code seems to be working fine although the assertion.