Fixed raccoon not rendering for animated material

This commit is contained in:
Kah Wei 2023-01-13 20:33:25 +08:00
parent 74d6e5cee7
commit d1a41ea194
6 changed files with 9 additions and 21 deletions

View File

@ -3,6 +3,6 @@
SubPass: G-Buffer Write SubPass: G-Buffer Write
Properties: Properties:
data.color: {x: 1, y: 1, z: 1, w: 1} data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 0 data.textureIndex: 64651793
data.alpha: 0 data.alpha: 0
data.beta: {x: 1, y: 1, z: 1} data.beta: {x: 1, y: 1, z: 1}

View File

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

Binary file not shown.

View File

@ -602,10 +602,6 @@ namespace SHADE
dynamicOffset dynamicOffset
); );
} }
if (boneMatrixBuffer[frameIndex] && boneFirstIndexBuffer[frameIndex])
{
cmdBuffer->BindVertexBuffer(SHGraphicsConstants::VertexBufferBindings::BONE_INDICES, boneFirstIndexBuffer[frameIndex], 0);
}
cmdBuffer->DrawMultiIndirect(drawDataBuffer[frameIndex], static_cast<uint32_t>(drawData.size())); cmdBuffer->DrawMultiIndirect(drawDataBuffer[frameIndex], static_cast<uint32_t>(drawData.size()));
cmdBuffer->EndLabeledSegment(); cmdBuffer->EndLabeledSegment();
} }
@ -716,13 +712,6 @@ namespace SHADE
if (!boneMatrixData.empty()) if (!boneMatrixData.empty())
{ {
// Update GPU Buffers // Update GPU Buffers
const uint32_t BONE_IDX_DATA_BYTES = static_cast<uint32_t>(boneMatrixIndices.size() * sizeof(uint32_t));
SHVkUtil::EnsureBufferAndCopyHostVisibleData
(
device, boneFirstIndexBuffer[frameIndex], boneMatrixIndices.data(), BONE_IDX_DATA_BYTES,
BuffUsage::eVertexBuffer,
"Batch Bone Indices Buffer"
);
const uint32_t BONE_MTX_DATA_BYTES = static_cast<uint32_t>(boneMatrixData.size() * sizeof(SHMatrix)); const uint32_t BONE_MTX_DATA_BYTES = static_cast<uint32_t>(boneMatrixData.size() * sizeof(SHMatrix));
SHVkUtil::EnsureBufferAndCopyHostVisibleData SHVkUtil::EnsureBufferAndCopyHostVisibleData
( (

View File

@ -134,7 +134,6 @@ namespace SHADE
TripleBuffer instancedIntegerBuffer; TripleBuffer instancedIntegerBuffer;
TripleBuffer matPropsBuffer; TripleBuffer matPropsBuffer;
TripleBuffer boneMatrixBuffer; TripleBuffer boneMatrixBuffer;
TripleBuffer boneFirstIndexBuffer;
TripleDescSet instanceDataDescSet; TripleDescSet instanceDataDescSet;
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/