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:
authorJim Eckerlein <UX3D-eckerlein>2019-11-05 16:02:13 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-11-05 17:38:02 +0300
commitb85e93b24ef6fc9e6d951e6ea72afaa8ce8d838b (patch)
tree4520f891860ac5be7f34ffd7e0c541dc1666aa3c /extern/draco
parenta1747b058d7f8e06e2f317736509d6bdb2d7ae2a (diff)
Fix bug in Draco encoding for glTF, files are now smaller
Data was not quantified properly. It also lets the library choose the suitable encoding method rather than forcing it to use the edgebreaker method. Differential Revision: https://developer.blender.org/D6183
Diffstat (limited to 'extern/draco')
-rw-r--r--extern/draco/src/draco-compressor.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/extern/draco/src/draco-compressor.cpp b/extern/draco/src/draco-compressor.cpp
index 9e63b8d35cb..3262a2c4d4d 100644
--- a/extern/draco/src/draco-compressor.cpp
+++ b/extern/draco/src/draco-compressor.cpp
@@ -38,6 +38,7 @@
#include "draco/point_cloud/point_cloud.h"
#include "draco/core/vector_d.h"
#include "draco/io/mesh_io.h"
+#include "draco/compression/encode.h"
#if defined(_MSC_VER)
#define DLL_EXPORT(retType) extern "C" __declspec(dllexport) retType __cdecl
@@ -158,16 +159,14 @@ DLL_EXPORT(bool) compress(
printf("%s: Normal quantization bits: %d\n", logTag, compressor->quantizationBitsNormal);
printf("%s: Position quantization bits: %d\n", logTag, compressor->quantizationBitsTexCoord);
- draco::ExpertEncoder encoder(compressor->mesh);
+ draco::Encoder encoder;
encoder.SetSpeedOptions(10 - compressor->compressionLevel, 10 - compressor->compressionLevel);
encoder.SetAttributeQuantization(draco::GeometryAttribute::POSITION, compressor->quantizationBitsPosition);
encoder.SetAttributeQuantization(draco::GeometryAttribute::NORMAL, compressor->quantizationBitsNormal);
encoder.SetAttributeQuantization(draco::GeometryAttribute::TEX_COORD, compressor->quantizationBitsTexCoord);
- encoder.SetEncodingMethod(draco::MESH_EDGEBREAKER_ENCODING);
-
- draco::Status result = encoder.EncodeToBuffer(&compressor->encoderBuffer);
+ draco::Status result = encoder.EncodeMeshToBuffer(compressor->mesh, &compressor->encoderBuffer);
if(!result.ok()) {
printf("%s: Could not compress mesh: %s\n", logTag, result.error_msg());