From 2474f99071b17bff7cefecf1ade3541b0b6c1adc Mon Sep 17 00:00:00 2001 From: vortex Date: Thu, 16 Dec 2010 17:42:36 +0000 Subject: [PATCH] fix glgl water trick that doesnt work well (it was doing 0.5 alphamod near egges) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10666 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=0d2b3890c8c20bb3c66a1c7fe52f480fc0ba56b2 --- gl_rmain.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 626762f5..f802e64a 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -974,11 +974,11 @@ static const char *builtinshaderstring = " // content.\n" " // Remove this 'ack once we have a better way to stop this thing from\n" " // 'appening.\n" -" float f1 = min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(0.005, 0.01)).rgb) / 0.002);\n" -" f1 *= min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(0.005, -0.01)).rgb) / 0.002);\n" -" f1 *= min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(-0.005, 0.01)).rgb) / 0.002);\n" -" f1 *= min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(-0.005, -0.01)).rgb) / 0.002);\n" -" ScreenTexCoord.xy = mix(SafeScreenTexCoord.xy, ScreenTexCoord.xy, f1);\n" +" float f = min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(0.005, 0.01)).rgb) / 0.002);\n" +" f *= min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(0.005, -0.01)).rgb) / 0.002);\n" +" f *= min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(-0.005, 0.01)).rgb) / 0.002);\n" +" f *= min(1.0, length(texture2D(Texture_Refraction, ScreenTexCoord.xy + vec2(-0.005, -0.01)).rgb) / 0.002);\n" +" ScreenTexCoord.xy = mix(SafeScreenTexCoord.xy, ScreenTexCoord.xy, f);\n" " float f = min(1.0, length(texture2D(Texture_Reflection, ScreenTexCoord.zw + vec2(0.005, 0.005)).rgb) / 0.002);\n" " f *= min(1.0, length(texture2D(Texture_Reflection, ScreenTexCoord.zw + vec2(0.005, -0.005)).rgb) / 0.002);\n" " f *= min(1.0, length(texture2D(Texture_Reflection, ScreenTexCoord.zw + vec2(-0.005, 0.005)).rgb) / 0.002);\n" @@ -986,7 +986,6 @@ static const char *builtinshaderstring = " ScreenTexCoord.zw = mix(SafeScreenTexCoord.zw, ScreenTexCoord.zw, f);\n" " float Fresnel = pow(min(1.0, 1.0 - float(normalize(EyeVector).z)), 2.0) * ReflectFactor + ReflectOffset;\n" " gl_FragColor = mix(vec4(texture2D(Texture_Refraction, ScreenTexCoord.xy).rgb, 1) * RefractColor, vec4(texture2D(Texture_Reflection, ScreenTexCoord.zw).rgb, 1) * ReflectColor, Fresnel);\n" -" gl_FragColor.a = f1 + 0.5;\n" "}\n" "#endif\n" "#else // !MODE_WATER\n" -- 2.39.2