Broken textures after GLB export

Hello!

I am loading this model to Sandbox, and executing this code snippet from console to export the file in .glb format.

const scene = BABYLON.Engine.LastCreatedScene
BABYLON.GLTF2Export.GLBAsync(scene, "download.glb").then(result => result.downloadFiles())
# hdrSkyBox is manually removed from Scene Explorer

I have been using this for a very long time over the course of years and had no problem. In the last couple months I have upgraded Babylon JS version from 6.39.0 to 8.29.1, and realized that in some cases textures are now corrupted when exported. I can confirm that this specific model, which I use as a test model for animations with skeletons, had been exported successfully before.

You can download the original model file here: https://drive.google.com/file/d/1fM9S0rLzdUGB44UMIM2Yg8y_4h0I6-yf/view?usp=drive_link

Original

Exported

Any help and guidance is much appreciated, thank you!

1 Like

Hello :slight_smile:

On my side, the export from the sandbox won’t even load on Blender, which is indeed quite weird.


That said, there is something weird from the initial state :
Your dog.glb file loads with such materials :


Which is an old way of creating materials (glossy + diffuse, etc)
So I guess the initial GLB is not up to date.


I tried to replace the specular-glossiness (where you need to invert alpha) by a normal “roughness” image, along with a principled BSDF :

  • Exported to .glb
  • Loaded to Sandbox
  • Exported from Sandbox
  • Exported file is loading fine in both Blender & BJS
1 Like

cc @alexchuber (please be patient she is on vacation)

1 Like

That was an informative answer, thank you very much. However, it is a requirement for my application to be able to export what it could import and successfully load. This model is only a test model with such imperfections, which is a usual case for visitors of my application. So I shouldn’t be manually fixing the model myself. But in any case, thank you for the knowledge!

1 Like

Thanks for the report! This should fix things:

3 Likes