Here is an example: Babylon.js Playground
When I apply a normal rectangular texture to a sphere, it get mirror flipped.
I need to set frontUVs: new BABYLON.Vector4(1, 1, 0, 0)
as line 20 in the playground to make it right.
I’m wondering what caused this issue. Is this a bug? Big thanks.
This is how the UV have been layout by default and it would be a breaking change to fix it now
In your case it is simple enough to not flip the texture I guess https://playground.babylonjs.com/#K6M44R#2521
1 Like
Thank you for responding.
The texture is not y-flipped, but mirror-flipped. So invertY only is not enough, you should also make it left-right flip. That why I said it’s wired. You must set the frontUVs.
I know that it’s because the uv unwrapping makes it work like this. What I want to know is whether you set UV coordinate like this deliberately. Thank you.
The backwards compatibility is such a big thing, huge legacy
As this would go back in history a lot, let me summon @Deltakosh the babylon.js daddy
1 Like
It came from initial implementation which was aligned with my old Nova exporter for max And it was using Max way of doing thing at that time
1 Like
Thank you so much for your reply. I got it.
Do you think there need an option to make the texture be unwrapped in a right direction, like the wrap
option in MeshBuilder.CreateBox
@Deltakosh
I do not think so as we can already pass the UVs in. There are too many ways to layout.
1 Like
Hi, may I ask more about the ways to layout? As I only figured out one way, which is using the frontUVs
.
1 Like
I have seen some trying to see the sphere as a blown up cube so with faces for instance or only 4 repeats quarter like for instance.