mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 19:53:30 +02:00
Improve blendshape precision for small models
For avatars authored in meters, the max component length would often be less then 1. In that case, the blendshape offset was not normalized before quantization, resulting in loss of precision. This change will normalize the offset for all cases, except when the max component length is 0.
This commit is contained in:
parent
754b281bbf
commit
08c6acdf99
1 changed files with 1 additions and 1 deletions
|
@ -1648,7 +1648,7 @@ using packBlendshapeOffsetTo = void(glm::uvec4& packed, const BlendshapeOffsetUn
|
|||
void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) {
|
||||
float len = glm::compMax(glm::abs(unpacked.positionOffset));
|
||||
glm::vec3 normalizedPos(unpacked.positionOffset);
|
||||
if (len > 1.0f) {
|
||||
if (len > 0.0f) {
|
||||
normalizedPos /= len;
|
||||
} else {
|
||||
len = 1.0f;
|
||||
|
|
Loading…
Reference in a new issue