CesiumGS / gltf-pipeline

Content pipeline tools for optimizing glTF assets. :globe_with_meridians:
Apache License 2.0
1.87k stars 241 forks source link

Very poor compression performance #645

Closed maelp closed 9 months ago

maelp commented 9 months ago

I have a .glb file which I'm trying to compress using DRACO, when using an online tool like https://products.aspose.app/3d/compression/gltf and saving as ".drc" it compresses from 350k to 14k(!) but when using gltf-pipeline it only compresses to 250k or so (and when observing the file, there is still a lot of JSON-looking data in the compressed file).

If I simply to a "zip" compression on the model, I achieve much better results than DRACO (52kb) so I guess I'm doing something wrong?

lilleyse commented 9 months ago

.drc is a binary format native to the draco library whereas .glb is binary + JSON, so there will be some differences in the output.

If you want to reduce the amount of JSON in the GLB you could try using a tool like gltfpack to merge meshes prior to running draco compression. That seems to be the cause of most of the JSON bloat.

You can also try tweaking some of the draco compression settings in gltf-pipeline. I'm not sure what values https://products.aspose.app/3d/compression/gltf is using.

maelp commented 9 months ago

Thanks