]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix glgl water trick that doesnt work well (it was doing 0.5 alphamod near egges)
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Dec 2010 17:42:36 +0000 (17:42 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 16 Dec 2010 18:42:06 +0000 (19:42 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10666 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=0d2b3890c8c20bb3c66a1c7fe52f480fc0ba56b2

gl_rmain.c

index 626762f51ddc91735eeaaecdf1e3ce03200cb73e..f802e64a04a6ca4353f55abbb85b89209d72261d 100644 (file)
@@ -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"