Animation WIP merge #321

Merged
XiaoQiDigipen merged 76 commits from SP3-17-animation-system into main 2023-01-30 17:35:57 +08:00
5 changed files with 7 additions and 3 deletions
Showing only changes of commit 7ecb8b11ad - Show all commits

View File

@ -71,5 +71,5 @@ void main()
boneMatrix += BoneMatrices.data[aBoneIndices[3]] * aBoneWeights[3];
// clip space for rendering
gl_Position = cameraData.vpMat * worldTransform * vec4 (aVertexPos, 1.0f);
gl_Position = cameraData.vpMat * worldTransform * boneMatrix * vec4 (aVertexPos, 1.0f);
}

Binary file not shown.

View File

@ -86,7 +86,7 @@ namespace SHADE
currClip = newClip;
secsPerTick = 1.0f / currClip->GetTicksPerSecond();
if (!rig)
if (rig)
{
updatePoseWithClip(0.0f);
}

View File

@ -185,7 +185,9 @@ namespace SHADE
}
else
{
const auto OG_SIZE = vertBoneWeightStorage.size();
vertBoneWeightStorage.resize(vertBoneWeightStorage.size() + addJob.VertexCount);
std::fill_n(vertBoneWeightStorage.begin() + OG_SIZE, addJob.VertexCount, SHVec4(1.0f, 0.0f, 0.0f, 0.0f));
}
indexStorage.insert
(

View File

@ -211,7 +211,9 @@ namespace SHADE
assetData.VertexTangents.data(),
assetData.VertexNormals.data(),
assetData.Indices.size(),
assetData.Indices.data()
assetData.Indices.data(),
assetData.VertexBoneIndices.empty() ? nullptr : assetData.VertexBoneIndices.data(),
assetData.VertexBoneWeights.empty() ? nullptr : assetData.VertexBoneWeights.data()
);
}
// Textures