Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc')
-rw-r--r--extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc b/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc
index 41193f1452f..237becefc61 100644
--- a/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc
+++ b/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc
@@ -92,6 +92,11 @@ bool AttributeQuantizationTransform::ComputeParameters(
range_ = dif;
}
+ // In case all values are the same, initialize the range to unit length. This
+ // will ensure that all values are quantized properly to the same value.
+ if (range_ == 0.f)
+ range_ = 1.f;
+
return true;
}