From 7361ef722ae35673b69d7e60f816ba609dd4f584 Mon Sep 17 00:00:00 2001 From: "gral@who.net" Date: Sun, 5 Sep 2010 22:45:43 +0200 Subject: [PATCH] new water --- Shaders/landmass.frag | 2 +- Shaders/water.frag | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Shaders/landmass.frag b/Shaders/landmass.frag index 91448690b..f74c6ffb9 100644 --- a/Shaders/landmass.frag +++ b/Shaders/landmass.frag @@ -126,7 +126,7 @@ void main (void) } // end shadow - vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * shadow_factor * vec4(diffuse, 1.0); + vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * shadow_factor * vec4(diffuse, -1.0); c1 *= ambient_light; vec4 finalColor = c1; diff --git a/Shaders/water.frag b/Shaders/water.frag index 9e8a514d3..8a0b6b603 100644 --- a/Shaders/water.frag +++ b/Shaders/water.frag @@ -93,5 +93,14 @@ if(gl_Fog.density == 1.0) vec4 finalColor = tmp + specular; +vec4 constantColor = vec4(1.0,1.0,1.0,1.0); + +vec4 ambient_light = gl_LightSource[0].diffuse * constantColor + constantColor; + + finalColor *= ambient_light; + + if(gl_Fog.density == 1.0) + fogFactor=1.0; + gl_FragColor = mix(gl_Fog.color,finalColor, fogFactor); }