Merge pull request #15265 from hyperlogic/bug-fix/blendshape-precision

Improve blendshape precision for small models
This commit is contained in:
Sam Gondelman 2019-03-27 10:51:22 -07:00 committed by GitHub
commit 0f99280c15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1642,7 +1642,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;