Textures problem with the offline GLTF converter

Hi folks !
First of all, attached files are available here : https://drive.google.com/folderview?id=0B74xjCFINUjofkpjVTBmaHdUZ3Bibm5hR3pPa1hYczR1TEc3bkplX1JZU18tZXplQTNmN1k&usp=sharing
I have a 3d model in collada, referencing .dds textures (see attached file “ZoneAExporter.dae”) .
Everything works fine when I convert it with the online GLTF converter (see attached file “online.png”) provided here : http://cesiumjs.org/convertmodel.html
However, as I wanted to process a large scale conversion, I downloaded and built locally the GLTF converter (https://github.com/KhronosGroup/glTF).
The .dds textures were causing trouble, so I used the “convert” command-line of ImageMagick library: *
“convert -quality 100 file.dds file.jpg”*or
**“convert -quality 100 file.dds file.png”**That way, the model can be converted to GLTF, but the textures are bugged (see attached file “offline.png”).

What tools or libraries does the online converter use to convert the .dds textures ?
If someone has any idea on the reason for this trouble, please let me know.

Many thanks,

Elias

The textures are good when I display a model created by the online converter with the .dds textures already locally converted in .jpg.
Therefore, the texture files are most likely fine, even after being converted on my side in .jpg.

The
problem may be found in the different ways the GLTF is built between
the online and the offline converter, but it is hard to figure it out.

Still investigating, but any help would be welcomed !

Cheers,

Elias

So the online converter uses ImageMagick to convert from .dds to .jpg. It also modifies the collada model to use the jpg files before its handed off to the same code as the offline converter.

My guess is you are missing that second step. I’m thinking that you convert the .dds files to jpegs but the collada still points to the .dds files, so that is what the offline converter embeds, not the jpegs.

Thanks for your answer Tom.

Unfortunately, the problem does not come from what you noticed. Before to convert my .dae, I changed the paths in the collada file to reference the .jpg image files.

I updated the attached files (https://drive.google.com/folderview?id=0B74xjCFINUjofkpjVTBmaHdUZ3Bibm5hR3pPa1hYczR1TEc3bkplX1JZU18tZXplQTNmN1k&usp=sharing) with the last data I used, the “EXPORT_1296-13724_IMA” folder contains all the necesary textures.

I compared two gltf files created from the same dae/textures files :

  • one created with the online converter (textures displayed nicely)
  • one created with the offline converter (textures broken and ugly)

The structures of the two .gltf are globally the same, the only difference i noticed was in the text of the encoded images (after for example : “texture107”: {“uri”: "data:image/jpeg;base64,…)

Maybe I’m wrong, but i wonder why the encoding in base64 of the images is different according to whether I use the online or the offline converter.

Thanks in advance,

Elias

Can you post the modified dae file that use the jpegs? Also can you zip it up with the images? There are too many images to download them one at a time from google drive’s web interface.

Oups sorry.
Done (test_dae_gltf.zip).

Thanks,

Elias

If you look at the texture coordinates in the dae file there are some ‘nan’ values. That stands for not a number. The is not valid in collada. It is probably an issue in the exporter.

The online converter happens to load the model into another library that fixes that problem before it hands the model off to collada2gltf. It works online by complete accident. If you replace the nan values with 0 you will get the same result as the online converter.

Hi Tom,

indeed these “nan” were the sources of the issue. I can now workaround this problem, but still, I will investigate on how and when the “nan” values are introduced in my collada files and try to solve it.

Do you think it is easily possible to handle the “nan” values in the offline converter (either by using the online converter’s library, or by modifying the library currently used by the offline converter) ?

Anyway, thanks a lot for your time and your help,

Elias