Texture wangle counld not save in glb

I use texture wangle to rotate image,in babylonjs is good,but export glb texture wangle is loss,see attachment for the model,how to resolve this problem
export_111d735d-5554-4954-8a1a-1ad383dc3110.zip (221.3 KB)

It seems it should work as we support the KHR_texture_transform extension in the gltf exporter.

cc @bghgary

This is expected. KHR_texture_transform only supports rotation center at the origin (0, 0). Babylon, by default, creates textures with a rotation center at (0.5, 0.5) and thus the glTF exporter will try to bake the texture with the transform instead of exporting with KHR_texture_transform. There are, however, a few issues that we perhaps should address.

  1. Baking the texture transform into a new texture doesn’t seem to be working for wAng.
  2. We should probably log a warning when we bake the texture transform during export.
  3. The inspector doesn’t show texture.uRotationCenter or texture.vRotationCenter for textures.

For now, you can manually change the rotation center to the origin with code and then it will export with KHR_texture_transform.


This PR addresses 1 and 2: Improve glTF material export code by bghgary · Pull Request #13229 · BabylonJS/Babylon.js (github.com)

I completely removed the baking of textures and replaced it with a warning. The baking process doesn’t actually work especially if the UVs are not 0,0 and 1,1.

3 would be a nice thing to add, but it’s not 100% required. If someone wants this, please contribute a change. It should be relatively straightforward.

1 Like