Fix math error in blend shape application tolerance

This commit is contained in:
Kayomn 2021-02-17 03:34:48 +00:00
parent 7f63d6e848
commit fa8a47e1bf

View File

@ -100,7 +100,7 @@ void main() {
for (uint i = 0; i < params.blend_shape_count; i++) { for (uint i = 0; i < params.blend_shape_count; i++) {
float w = blend_shape_weights.data[i]; float w = blend_shape_weights.data[i];
if ((w < 0.0001) || (w > 0.0001)) { if (abs(w) > 0.0001) {
uint base_offset = (params.vertex_count * i + index) * params.vertex_stride; uint base_offset = (params.vertex_count * i + index) * params.vertex_stride;
blend_vertex += uintBitsToFloat(uvec3(src_blend_shapes.data[base_offset + 0], src_blend_shapes.data[base_offset + 1], src_blend_shapes.data[base_offset + 2])) * w; blend_vertex += uintBitsToFloat(uvec3(src_blend_shapes.data[base_offset + 0], src_blend_shapes.data[base_offset + 1], src_blend_shapes.data[base_offset + 2])) * w;