Dynamic Textures appearing inside out with gltf model exported from blender

Hey,

We’re exporting our 3d assets using the gltf format. A specific mesh within each assets is named ‘Label’ and we target that mesh and apply a dynamic texture to it with live content. This dynamic textures displays inside out on the mesh which I find really weird. I checked the normals for the mesh and they faced outwards as I would expect. I found I can partially solve this issue by flipping the normals inside out, unfortunately this also means the textures displays upside down. I’m confused as to where in the pipeline this is breaking. Is it the blender exporter, is Babylon importing the gltf uv map incorrectly. I’m unsure, I was hoping perhaps someone would be aware of the issue and be able to point me in the right direction.

Kind regards,
Liam

Hello it would be easier to help you with a repro but let me try an uneducated guess.

Can you try to call update on your dynamic texture with false as the first parameter?

Hey Delta,

I’ve made a small playground scene to demonstrate the issue. I created a new scene in blender and exported the default cube as a glb/gltf file. You’ll notice the dynamic textures displays inside out on the cube, despite the normals & material being set up by default to display as you would expect, outwards facing in Blender.

https://playground.babylonjs.com/indexStable.html#SX08PV

Let me know if you need any information. Also, I should point out that we’re actually using Babylon 3.2 at work but the issue seems to persist in 3.3.

Just providing an update on this issue. I’ve managed to resolve the problem by updating the winding order on the dynamic material. It appears by default the winding is counter clockwise, is this intended? I would have expected it to be clockwise? Either way:

dynamicMaterial.sideOrientation = BABYLON.Orientation.CW;

I also had to pass false to the update as you suggested to get the texture right way up.

Hello!
As babylon.js is left handed, our right winding order is CCW :slight_smile: