diff --git a/src/lib/bakingUtils.ts b/src/lib/bakingUtils.ts index 88e7d08..bc6c5ec 100644 --- a/src/lib/bakingUtils.ts +++ b/src/lib/bakingUtils.ts @@ -120,10 +120,8 @@ export function bakeTextureToNewUVs( varying vec2 vOldUV; void main() { vOldUV = uv2; - // The new UVs (uv) range from 0 to 1. - // We map them to clip space: -1 to 1. - // Also flip Y so the texture is right-side up. - gl_Position = vec4(uv.x * 2.0 - 1.0, (uv.y * 2.0 - 1.0), 0.0, 1.0); + // Flip X and Y to fix upside down and reversed texture + gl_Position = vec4(1.0 - uv.x * 2.0, 1.0 - uv.y * 2.0, 0.0, 1.0); } `, fragmentShader: `