Code: Select all
--- a/files/shaders/water_fragment.glsl
+++ b/files/shaders/water_fragment.glsl
@@ -34,7 +34,8 @@ const float SPEC_HARDNESS = 256.0; // specular highlights hardne
const vec2 WIND_DIR = vec2(0.5f, -0.8f);
const float WIND_SPEED = 0.2f;
-const vec3 WATER_COLOR = vec3(0.090195, 0.115685, 0.12745);
+// const vec3 WATER_COLOR = vec3(0.090195, 0.115685, 0.12745);
+const vec3 WATER_COLOR = vec3(0.25, 0.25, 0.1) * 0.8;
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
@@ -174,7 +175,7 @@ void main(void)
float waterDepth = refractionDepth - depth;
if (cameraPos.z > 0.0)
- refraction = mix(refraction, waterColor, clamp(waterDepth/VISIBILITY, 0.0, 1.0));
+ refraction = mix(refraction, waterColor, 1 - exp(-waterDepth * 0.015));
gl_FragData[0].xyz = mix( mix(refraction, scatterColour, lightScatter), reflection, fresnel) + specular * gl_LightSource[0].specular.xyz;
#else