From ccb468e3379eb4d044e643114618f2c4d4e874dd Mon Sep 17 00:00:00 2001 From: Matei Date: Wed, 31 May 2006 22:39:29 +0000 Subject: [PATCH] Small updates to the water shader: Refractions will now be less wavy than reflections, which makes it slightly easier to look through the water, and the water will get less transparent faster at low view angles (my project used different scale so this wasn't happening as fast as it should). This was SVN commit r3920. --- binaries/data/mods/official/shaders/water_high.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/official/shaders/water_high.fs b/binaries/data/mods/official/shaders/water_high.fs index c7325e246c..06ae3534c9 100644 --- a/binaries/data/mods/official/shaders/water_high.fs +++ b/binaries/data/mods/official/shaders/water_high.fs @@ -39,7 +39,7 @@ void main() reflCoords += waviness * n.xz / w; refrCoords = 0.5 * (gl_TexCoord[2].xy / gl_TexCoord[2].w) + 0.5; // Unbias texture coords - refrCoords -= waviness * n.xz / w; + refrCoords -= 0.8 * waviness * n.xz / w; // Refractions can be slightly less wavy reflColor = texture2D(reflectionMap, reflCoords).rgb; @@ -51,6 +51,6 @@ void main() // Make alpha vary based on both depth (so it blends with the shore) and view angle (make it // become opaque faster at lower view angles so we can't look "underneath" the water plane) - t = 8.0 * max(0.0, 0.7 - v.y); + t = 18.0 * max(0.0, 0.7 - v.y); gl_FragColor.a = 0.15 * waterDepth * (1.2 + t + fresnel); }