Rationale:
Our app uses right handed system with z-up. However, Babylon’s default left handed system is chosen with an internal converter for all transform vectors, instead of using scene.useRightHandedSystem = true flag, because according to @Deltakosh:
Blockquote
babylon.js is by default left handed and thus mostly tested in that mode.
thus didn’t want to risk having to deal with unknown bugs related to the scene.useRightHandedSystem.
the texture .invertedY argument set to true did not work
The +Y up is already ticked in Blender (in our app, z is up from end user’s perspective, even though internally it’s Babylon’s Y).
I know someone may recommend changing Blender settings to suit Babylon, but that would not be an option for us, because the app is designed to be newbie friendly, and uses conventions most familiar to people. You cannot ask users to fiddle with Blender settings to make it work, it must work with default Blender settings from user’s perspective.
This is not the case. Blender’s z axis turned into y axis in Babylon is the expected behavior.
Like I explained above, the app internally uses Babylon left-handed system with y up, it only labels that y axis as z for the User, so that when they import Meshes from right-handed system, visually it will look exactly the same as they see in other apps (Blender is one example, but it could be files from SketchFab, etc.).
This is an app where Users can import meshes from different systems, and combine them to create their designs. Only planning to support .glb file for the same reason - it provides certain standard for the web.
Manually flipping Texture on imported Meshes is also not an option, because Textures can be shared among imported and Babylon’s native meshes. (Like in the real world, you’d not flip a fabric print to make a skirt, and flip it again to make a jacket - it’s the UV map that you flip, not the texture)
Sorry I’m not sure if I’m absolutely correct, but I think the reason is the uv is diffrent in bjs and blender.
In blender, uv starts from the left top of image while left bottom in bjs. When you creating a texture in bjs, It’s impossible to realize that you will use it on a right-hand object, so it’s suitable that you need to provide the info by setting invertY or vScale or something else.
Hope this helps.
@tanpopo , I think you are correct that UV map is reversed somehow. However, I did some research, and all of my findings show that Blender’s UV (0,0) starts at the bottom left like Babylon.
P.S. my blender has vanilla settings (fresh install on new machine).
I think in your case you need to perform some orientation and model corrections with the help of transform nodes, similar to Sketchfab approach. Below there is screenshot from gltf Sketchfab model.
Transform node only helps with correcting rotation. I remember having to remap UV for Babylon’s Sphere and Cylinder, because it maps UV in clockwise order, and ends up with flipped Texture.
This is definitely either a bug in gltf's plugin, or the core of Babylon’s vertex buffer calculation.
Reading the full thread, I am still entirely sure to get the issue fully (probably the time to ramp up after the break ) @ecoin could you share the PG best highlighting the issue ?
And also the .blend with your cube. By default all works fine when exporting to glTF from Blender, so maybe the issue comes from your Blender scene hierarchy or something like that?
I don’t think so, I’m not a CG artist, never used Blender before, have fresh brew install blender. Just open blender and immediately export the cube as GLTF 2.0.
For example, the chair.glb has correct rotation when uploading to Babylon sandbox, but not the playground.
I guess I wasn’t cleared enough in my description. For the PG, I did not setup proper UV map for the Blender cube to wrap like Babylon cube (that is expected).
The bug is that if you try to read the word Guaranteed, you’ll see that the letter N turns into И - seems likes V coordinates in the UV was reverted.