gltf-pipeline icon indicating copy to clipboard operation
gltf-pipeline copied to clipboard

Command to uncompress Draco

Open lilleyse opened this issue 6 years ago • 14 comments

See discussion in https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/368.

@FrankGalligan has a work in progress branch here: https://github.com/FrankGalligan/gltf-pipeline/tree/decompress_draco

lilleyse avatar Jun 25 '18 18:06 lilleyse

Any updates on this functionality? Would love to be able to freely convert to and from DRACO using only one tool.

TyLindberg avatar Jan 24 '19 00:01 TyLindberg

Sorry, no update on this functionality yet.

But the functionality is about 90% there. There is a separate option draco.uncompressedFallback that decodes the Draco geometry and saves it to a different buffer. That functionality would just need to be broken out into its own stage.

lilleyse avatar Jan 24 '19 15:01 lilleyse

still no?

makc avatar Apr 08 '20 20:04 makc

@makc sorry, no update on this issue.

lilleyse avatar Apr 08 '20 20:04 lilleyse

Just tried omitting the -d option expecting it to decompress. I went looking online when it didn't and found this.

I also would appreciate the ability to decompress using gltf-pipeline.

Is there another tool out there that decompresses gltf with Draco?

For now I will try the uncompressedFallback.

JoelTrain avatar Jun 26 '20 02:06 JoelTrain

Also requested in https://github.com/CesiumGS/gltf-pipeline/issues/567

lilleyse avatar Dec 15 '20 13:12 lilleyse

Draco decompression is in development for ~~a future version of~~ Blender here: https://github.com/KhronosGroup/glTF-Blender-IO/pull/1268

EDIT: Draco decompress/import shipped with the Blender glTF addon in January 2021. You can use any recent stable version of Blender to decompress and open Draco glTF models.

emackey avatar Dec 16 '20 21:12 emackey

Looking forward to see the function

loooog avatar Apr 08 '21 09:04 loooog

still nothing?

DmytroRomanchuk avatar Aug 09 '21 12:08 DmytroRomanchuk

You can try this branch which unfortunately I haven't been able to review yet: https://github.com/CesiumGS/gltf-pipeline/pull/572

lilleyse avatar Aug 11 '21 02:08 lilleyse

Any chance of getting this pull request #572 reviewed?

ptc-alhill avatar Dec 01 '21 22:12 ptc-alhill

Anything we can do to help getting this merged? From what I'm understanding from the code, this wouldn't make it possible to first decompress and then compress again (to guarantee it's using the same version regardless of the draco potentially used in the input) in a single run, correct? maybe that's something we could also add.

I ran it locally and updated a few things so that it works with the latest 4.0.2--meanwhile some polyfills were removed, etc.

I also think there's some issues still:

  • it should also remove draco from required extensions (gltf.extensionsRequired = gltf.extensionsRequired.filter(extension => extension !== 'KHR_draco_mesh_compression'); )
  • textures do not seem to be working after decompression. See input vs output glb and gltf, attached. Input shows 21 notes on https://gltf-viewer.donmccurdy.com/, whereas the output, even with the extensionsRequired fix, shows 50 errors.
image image

InputAndOutputModels.zip

Edit: This probably won't be correct 100% of the time or for all the models, but got the uncompressed one of this particular example to show the textures by replacing TEX_COORD with TEXCOORD_0 when outputting the primitive attributes (only works because baseColorTexture is using texCoord 0. If they were set to a different value X, then the attributes should also use TEXCOORD_X -- see https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_013_SimpleTexture.md). Now the model has 52 hints rather than errors.

Apidcloud avatar Mar 15 '23 13:03 Apidcloud

Any updates? My use case is to store draco compressed GLBs in the cloud, then fetch them later and decompress them, and do mesh simplification. Without the decompress functionality, I might have to store the original GLBs in the cloud, which costs more storage/bandwidth.

zoan37 avatar Aug 13 '23 17:08 zoan37