GLTF2Export large texture size issue

I’m working with multiple 3D scans. At the end of my process I use GLTF2Export.GLBAsync to export the scans to a single GLB file. This works great, except for some textures. I have noticed that the scans that have an 8k texture, have their texture edited during export. Scans with 4k textures are fine.

While the original 8k texture covers the entire image file, the exported 8k texture is modified. The pixels of the texture are scaled down to only use a portion of the image file. The rest of the file is filled with black pixels.
Since the original pixels are shifted, they don’t match with the original UV’s.
Of course, this does not always happen :unamused:


An example of an exported 8k texture

Could you provide a repro in the playground ?

adding @bghgary our GLTF GURU

I have tried, but I’m unsuccessful reproducing the issue in the playground: https://playground.babylonjs.com/#8LFTCH#1146
This playground uses the process I also use for loading, importing and exporting the models. But I don’t get the texture issue.
In my app I don’t modify the material or texture. I only let the users move/rotate the individual scans.

Are you using the same preview version ?

I’m using bjs 4.20 in my current app. Is that what you mean?

Yup, could you try with 5.0 ?

I’ve updated to 5.0 and haven’t seen the issue since. I’m waiting for some input from my client to hear if they see the texture issue.

1 Like