From 043d2b689ed341986701aabcde08f0bc3693c8fc Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Wed, 7 Oct 2026 20:53:59 +0200 Subject: [PATCH] Fix distorted ground: bigger mosaic + stronger atmospheric fog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GROUND_MOSAIC_SIZE 9 -> 16 (16x16 = 256 tiles, covers 16 world units instead of 9 — wider safety margin at the mosaic edge) - Fog: tGround / 30 -> tGround / 12 with full mix (was 75% mix) so distant ground fully fades to sky instead of staying visible with wrong UVs (which was the source of the striped look) - Result: visible ground content matches mosaic; far ground cleanly fades to sky, close ground shows clear satellite tiles --- vendor/clouds3d.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/clouds3d.js b/vendor/clouds3d.js index d4f2de0..2ad500b 100644 --- a/vendor/clouds3d.js +++ b/vendor/clouds3d.js @@ -205,8 +205,8 @@ var FRAG_SRC = [ 'vec2 gUv = vec2(hitPoint.x, hitPoint.z);', 'gUv = (gUv - uGroundCenter) / uGroundSize + 0.5;', 'vec3 groundCol = texture2D(uGround, gUv).rgb;', - 'float fogAmount = clamp(tGround / 30.0, 0.0, 1.0);', - 'groundCol = mix(groundCol, uBg, fogAmount * 0.75);', + 'float fogAmount = clamp(tGround / 12.0, 0.0, 1.0);', + 'groundCol = mix(groundCol, uBg, fogAmount);', // Ground mask: full ground when looking down, none when up. 'float gmask = (tGround > 0.0) ? smoothstep(0.0, -0.30, rd.y) : 0.0;', 'col = mix(col, groundCol, gmask);', @@ -269,7 +269,7 @@ function init(canvas) { var GROUND_TILE_URL = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/'; var GROUND_TILE_Z = 11; var GROUND_TILE_SIZE = 256; -var GROUND_MOSAIC_SIZE = 9; // 9x9 tiles around the camera +var GROUND_MOSAIC_SIZE = 16; // 16x16 tiles around the camera var GROUND_BUFFER_TILES = 2; // refetch when this close to edge // Passau tile at zoom 11 var GROUND_BASE_X = 1102;