Skip to content

How to handle "Skipping Draco compression on non-indexed primitive" #394

Answered by donmccurdy
marcofugaro asked this question in Q&A
Discussion options

You must be logged in to vote

The primitive needs to be indexed for compression, and that isn't done automatically because it's generally lossy... You can do this manually with the weld function though:

import { weld } from '@gltf-transform/functions';

await document.transform(weld({tolerance: 0.0001}));

const glb = io.writeBinary(document);

const { json: compressedGltf } = io.writeJSON(document);

Note that resources are returned here as well; if you need a single file it's best to write to a binary GLB.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marcofugaro
Comment options

Answer selected by marcofugaro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #393 on October 22, 2021 18:19.