From a05951efbd997067f9653d2454aa9a750c8fe4d9 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 8 Oct 2026 06:48:10 +0200 Subject: [PATCH] Fix NS mirror: UNPACK_FLIP_Y_WEBGL was double-flipping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the flag on, canvas row Y was uploaded to texture row (H-1-Y). Sampling at V=0.58 then returned canvas row 2688 (in the 'south' half of the corridor), but the shader expected row 3712 (in the 'north' half) for an offset.z=2 sample. So tiles appeared mirrored across the NS axis — every N pointed south, every S north. With the flag off, canvas row Y maps to texture row Y, and the shader's expectation matches the drawing direction. Now N is at the image's actual north, S at the image's actual south. --- vendor/clouds3d.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index b755466..63f4a57 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -447,7 +447,7 @@ function initGroundSystem(glCtx) { groundCtx.fillRect(0, 0, groundCanvas.width, groundCanvas.height); groundTexture = groundGl.createTexture(); groundGl.bindTexture(groundGl.TEXTURE_2D, groundTexture); - groundGl.pixelStorei(groundGl.UNPACK_FLIP_Y_WEBGL, true); + groundGl.pixelStorei(groundGl.UNPACK_FLIP_Y_WEBGL, false); groundGl.texImage2D(groundGl.TEXTURE_2D, 0, groundGl.RGBA, groundGl.RGBA, groundGl.UNSIGNED_BYTE, groundCanvas); groundGl.texParameteri(groundGl.TEXTURE_2D, groundGl.TEXTURE_WRAP_S, groundGl.CLAMP_TO_EDGE); groundGl.texParameteri(groundGl.TEXTURE_2D, groundGl.TEXTURE_WRAP_T, groundGl.CLAMP_TO_EDGE);