From 1bacd830c022e0b484df40f0e2f0a272ff36d06f Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 15 Oct 2026 19:15:39 +0200 Subject: [PATCH] Avoid division by zero in the first water normal layer --- files/shaders/compatibility/water.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/shaders/compatibility/water.frag b/files/shaders/compatibility/water.frag index e202c3b5bc..2d63dd03ad 100644 --- a/files/shaders/compatibility/water.frag +++ b/files/shaders/compatibility/water.frag @@ -110,7 +110,7 @@ void main(void) #define waterTimer osg_SimulationTime - vec3 normal0 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.05, 0.04, waterTimer, -0.015, -0.005, vec3(0.0,0.0,0.0))).rgb - 1.0; + vec3 normal0 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.05, 0.04, waterTimer, -0.015, -0.005, vec3(0.0,0.0,1.0))).rgb - 1.0; vec3 normal1 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.1, 0.08, waterTimer, 0.02, 0.015, normal0)).rgb - 1.0; vec3 normal2 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.25, 0.07, waterTimer, -0.04, -0.03, normal1)).rgb - 1.0; vec3 normal3 = 2.0 * texture2D(normalMap,normalCoords(UV, 0.5, 0.09, waterTimer, 0.03, 0.04, normal2)).rgb - 1.0;