diff --git a/lib/compressDracoMeshes.js b/lib/compressDracoMeshes.js index 14facc9d..b2f77454 100644 --- a/lib/compressDracoMeshes.js +++ b/lib/compressDracoMeshes.js @@ -261,6 +261,11 @@ function compressDracoMeshes(gltf, options) { encoder.SetAttributeQuantization(encoderModule.GENERIC, skinQuantization); } + if (defined(primitive.targets)) { + // Set sequential encoding to preserve order of vertices. + encoder.SetEncodingMethod(encoderModule.MESH_SEQUENTIAL_ENCODING); + } + var encodedLength = encoder.EncodeMeshToDracoBuffer(newMesh, encodedDracoDataArray); if (encodedLength <= 0) { throw new DeveloperError('Error: Encoding failed.');