New to babylon.Js, I try to migrate the https://github.com/brunosimon/my-room-in-3d project to babylon, after migrate the model texture and shader code, I find the uv cord is Y mirrored(green postion cord to red)
I just mirror the texture in photoshop to solve the problem
. So my question is which is the correct way to solve this problem?
- best to change babylon code to adapt same asset with threejs, but i dont know how to change UV cord in shader? multiply some matrix to uv? or some api to change directly?
- change blender export options? how?
- just use photoshop
Hello and welcome to the Babylon community! That’s a very cute project you’re migrating
Since you already have code to sample the textures, you can just multiply the y coord of the uvs by -1.
You can also pass
false as the
invertY parameter of the
Texture constructor in case you are creating the textures yourself.
Thanks for your replay, awsome community @Evgeni_Popov @carolhmj
Two solution both works very fine！
vec2 newUvCord = vec2(vUv.x, 1.0 - vUv.y);
false, // just invertY to false