zeroed-some/dougk / 2633708

Browse files

replace cross-wave pattern with 2 overlapping concntric ripples in effortrs to remove x artifact

Authored by espadonne
SHA
2633708935243ec30da27c187101c66ce8444d07
Parents
b334448
Tree
7f06f2f

1 changed file

StatusFile+-
M src/renderers/three/pond.js 5 4
src/renderers/three/pond.jsmodified
@@ -443,10 +443,11 @@ export function createPond(scene, gradientMap) {
443
       const z = waterPositions[i + 2]
443
       const z = waterPositions[i + 2]
444
       const dist = Math.sqrt(x * x + z * z)
444
       const dist = Math.sqrt(x * x + z * z)
445
 
445
 
446
-      // Gentle concentric waves from center
446
+      // Gentle concentric waves from center (main ripple)
447
-      const wave1 = Math.sin(dist * 1.5 - elapsed * 2) * 0.03
447
+      const wave1 = Math.sin(dist * 1.2 - elapsed * 1.5) * 0.025
448
-      // Cross-wave pattern
448
+      // Secondary offset ripple (different origin point for natural look)
449
-      const wave2 = Math.sin(x * 0.8 + elapsed * 1.5) * Math.cos(z * 0.8 + elapsed * 1.2) * 0.02
449
+      const dist2 = Math.sqrt((x - 1) * (x - 1) + (z + 0.5) * (z + 0.5))
450
+      const wave2 = Math.sin(dist2 * 1.4 - elapsed * 1.8) * 0.015
450
 
451
 
451
       positions[i + 1] = waterPositions[i + 1] + wave1 + wave2
452
       positions[i + 1] = waterPositions[i + 1] + wave1 + wave2
452
     }
453
     }