#include "../../VertexShader.h" ;------------------------------------------------------------------------------ ; Geometry transform ;------------------------------------------------------------------------------ ; Calculate bone indices mad r7, vIndices, c23.x, c23.y ; Sum weighted blendshape position deltas mul rTemp, vBlend0, c24.x mad rTemp, vBlend1, c24.y, rTemp mad rTemp, vBlend2, c24.z, rTemp mad rTemp, vBlend3, c24.w, rTemp mad rTemp.xyz, c26.x, rTemp, vPos mov rTemp.w, C_ONE ; Skin position by bone 0 MOVA a0.x, r7.x m4x3 r0.xyz, rTemp, c[a0.x] mul pPos.xyz, r0.xyz, vWeights.xxx ; Calculate the second bone weight from the first sub r8.x, C_ONE, vWeights.x ; Skin position by bone 1 MOVA a0.x, r7.y m4x3 r0.xyz, rTemp, c[a0.x] mad pPos.xyz, r0.xyz, r8.x, pPos mov pPos.w, C_ONE ; Sum weighted blendshape normal deltas mul rTemp, vBlendNorm0, c25.x mad rTemp, vBlendNorm1, c25.y, rTemp mad rTemp, vBlendNorm2, c25.z, rTemp mad rTemp, vBlendNorm3, c25.w, rTemp mad rTemp, c26.x, rTemp, vNormal ; Skin normal by bone 0 MOVA a0.x, r7.x m3x3 pNormal.xyz, rTemp, c[a0.x] NormalizeVector(pNormal) ; Transform skinned position to projection space m4x4 OPOS, pPos, C_PROJECTION_MATRIX FIXUP_OPOS