Fix blend shapes normals usage

#2459
This commit is contained in:
Wojtek Figat
2024-04-20 16:52:07 +02:00
parent 6aacea99ab
commit 1072b90c5b
3 changed files with 21 additions and 10 deletions

View File

@@ -640,7 +640,7 @@ void AnimatedModel::RunBlendShapeDeformer(const MeshBase* mesh, MeshDeformationD
ASSERT_LOW_LAYER(blendShapeVertex.VertexIndex < vertexCount);
VB0SkinnedElementType& vertex = *(data + blendShapeVertex.VertexIndex);
vertex.Position = vertex.Position + blendShapeVertex.PositionDelta * q.Second;
Float3 normal = (vertex.Normal.ToFloat3() * 2.0f - 1.0f) + blendShapeVertex.NormalDelta;
Float3 normal = (vertex.Normal.ToFloat3() * 2.0f - 1.0f) + blendShapeVertex.NormalDelta * q.Second;
vertex.Normal = normal * 0.5f + 0.5f;
}
}