CesiumGS / gltf-pipeline

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

GLTF-GLB conversion fails when using basis texture #506

Open ShantanuSriv opened 4 years ago

ShantanuSriv commented 4 years ago

I am trying to convert a GLTF file to GLB file and the GLTF file has images/uri mapped to basis format textures but while converting using gltf-pipeline

name: 'RuntimeError',
  message: 'Image data does not have valid header',
  stack:
   'Error\n    at new RuntimeError (/usr/lib/node_modules/gltf-pipeline/node_modules/cesium/Source/Core/RuntimeError.js:42:19)\n    at getImageExtension (/usr/lib/node_modules/gltf-pipeline/lib/getImageExtension.js:38:11)\n    at writeImage (/usr/lib/node_modules/gltf-pipeline/lib/writeResources.js:83:23)\n    at /usr/lib/node_modules/gltf-pipeline/lib/writeResources.js:47:9\n    at Function.ForEach.object (/usr/lib/node_modules/gltf-pipeline/lib/ForEach.js:46:27)\n    at Function.ForEach.topLevel (/usr/lib/node_modules/gltf-pipeline/lib/ForEach.js:65:20)\n    at Function.ForEach.image (/usr/lib/node_modules/gltf-pipeline/lib/ForEach.js:186:20)\n    at writeResources (/usr/lib/node_modules/gltf-pipeline/lib/writeResources.js:46:13)\n    at /usr/lib/node_modules/gltf-pipeline/lib/processGltf.js:63:16\n    at tryCatcher (/usr/lib/node_modules/gltf-pipeline/node_modules/bluebird/js/release/util.js:16:23)\n    at Object.gotValue (/usr/lib/node_modules/gltf-pipeline/node_modules/bluebird/js/release/reduce.js:155:18)\n    at Object.gotAccum (/usr/lib/node_modules/gltf-pipeline/node_modules/bluebird/js/release/reduce.js:144:25)\n    at Object.tryCatcher (/usr/lib/node_modules/gltf-pipeline/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/usr/lib/node_modules/gltf-pipeline/node_modules/bluebird/js/release/promise.js:512:31)\n    at Promise._settlePromise (/usr/lib/node_modules/gltf-pipeline/node_modules/bluebird/js/release/promise.js:569:18)\n    at Promise._settlePromise0 (/usr/lib/node_modules/gltf-pipeline/node_modules/bluebird/js/release/promise.js:614:10)' }

Is it possible to create a GLB file with basis textures using gltf-pipeline?

gabrieljbaker commented 4 years ago

Curious about this as well!

Squareys commented 4 years ago

Same here! I think this is because gltf-pipeline only supports png or jpeg and therefore cannot handle the basis binary data or detect the format on it.

(That has been added, though: https://github.com/CesiumGS/gltf-pipeline/pull/491 )

br-matt commented 3 years ago

Just following up on that #491 linked. It looks like KTX2 lost the battle here: https://github.com/KhronosGroup/glTF/pull/1612 and KHR_texture_basisu going to stay.

Support for this would be great!