Textures by reference in GLTF converted models

Hi,

It use to be possible with the online (and stand alone) DAE to GLTF converter to omit the texture files (not drop them with the DAE file) in order to simply keep the URI reference to the texture in the GLTF (or GLB) file.

At that time, doing this would throw and error message but the file was converted none the less.

It was then possible to upload the texture file next to the GLTF (or GLB) file and Cesium would load the texture on demand.

This allowed to share a single texture file across several models: very handy and weight saving!

Sadly, this is not possible anymore: if the texture file is not dropped along with the DAE file, the online converter throws a meaningless error (500 Internal Server Error) and nothing comes out of it.

It is part of the glTF specs to be able to reference a texture with a URI.

I could not try this with the recent stand-alone converter as the binaries are not available any more.

Regards,

Xavier

Following up:

I managed to run the stand-alone converter from a SNAPSHOT build:

  • it will choke and stop if texture files are not present: annoying - this could just be a warning

  • I provided the texture files to keep moving on

Running the optimization pipeline after that:

  • option -t allows to separate textures from glb file at the output

  • however, texture files are copied over from the source (gltf) and renamed with the original Collada ID: annoying

  • and if I edit the glb file to restore original texture files names it won’t load in Cesium any more: very annoying

  • only workaround is to edit the original DAE file and make sure the Collada ID match the texture file name: deal-breaker :wink:

Xavier.

Hi Xavier, Sorry you’re having trouble with the converter. Our online converter is designed to only work when you have all of the texture files.
You could try using the offline collada2gltf converter found here: https://github.com/KhronosGroup/COLLADA2GLTF/wiki

Best,

Hannah

Hi Hannah,

I see: it’s not a bug, its a feature :wink:

Also, as described in my second message, the offline Collada converter is also broken when it comes to handling external texture files.

Finally, the offline converter wiki does not offer any binaries to download.

Regards,

Xavier

Hi Xavier,

The binaries can be found on this page, but it hasn’t been updated in a while: https://github.com/KhronosGroup/COLLADA2GLTF/releases
They do have instructions for building it from the source with cmake if you wanted to try that.

From looking at the documentation, they have a -e flag for embeding resources in glTF file so I would imagine if you don’t use that flag it wouldn’t embed them. If that’s broken and you think it’s bug, maybe you could create bug report issue in their GitHub repo.

-Hannah

Hi Hannah,

You are right, I’ll file a bug there: it makes more sense.

Please note that the binaries are not present on the page you mentioned, but only the source.

Thanks for your help,

Xavier.