XMMATRIX **ppMatrices = new XMMATRIX*[3];fxBoneMatrices->SetMatrixArray( (FLOAT*)ppMatrices[0], 0, 3 );
Im not sure if thats correct, since Im getting weird results, and using pix I dont understand the values Im getting(I want be sure the error is not sintax)..So I looked at DX10 sdk sample and they do it like that:
for( UINT i = 0; i < g_SkinnedMesh.GetNumInfluences( iMesh ); i++ ) { const D3DXMATRIX* pMat = g_SkinnedMesh.GetMeshInfluenceMatrix( iMesh, i ); g_pmConstBoneWorld->SetMatrixArray( ( float* )pMat, i, 1 ); }
So I guess Im doing it right..
On the shader Im doing that:
matrix skinningTransform = 0; if( input_p.BoneIDs.x != 5 )skinningTransform += mul( input_p.SkinWeights.x, BoneTransformsInterpolated[ input_p.BoneIDs.x ] ); if( input_p.BoneIDs.y != 5 )skinningTransform += mul( input_p.SkinWeights.y, BoneTransformsInterpolated[ input_p.BoneIDs.y ] ); if( input_p.BoneIDs.z != 5 )skinningTransform += mul( input_p.SkinWeights.z, BoneTransformsInterpolated[ input_p.BoneIDs.z ] ); if( input_p.BoneIDs.w != 5 )skinningTransform += mul( input_p.SkinWeights.w, BoneTransformsInterpolated[ input_p.BoneIDs.w ] );
Do you notice any mistake?