From: divverent Date: Sat, 26 Mar 2011 19:12:04 +0000 (+0000) Subject: last commit was a bad fix - fix it correctly, preventing reliefmapping artifacts... X-Git-Tag: xonotic-v0.6.0~163^2~577 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=52b8812faa9c358731b61899cc994bcce9849ca6;p=xonotic%2Fdarkplaces.git last commit was a bad fix - fix it correctly, preventing reliefmapping artifacts on these pesky reflections git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10969 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/shader_glsl.h b/shader_glsl.h index 2883a4c1..fd94cbcc 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -1300,11 +1300,15 @@ " //vec4 ScreenTexCoord = (ModelViewProjectionPosition.xyxy + normalize(myhalf3(offsetMappedTexture2D(Texture_Normal)) - myhalf3(0.5)).xyxy * DistortScaleRefractReflect * 100) * ScreenScaleRefractReflectIW + ScreenCenterRefractReflect;\n" " vec2 SafeScreenTexCoord = ModelViewProjectionPosition.xy * ScreenScaleRefractReflectIW.zw + ScreenCenterRefractReflect.zw;\n" " #ifdef USENORMALMAPSCROLLBLEND\n" +"# ifdef USEOFFSETMAPPING\n" +" vec3 normal = dp_textureGrad(Texture_Normal, (TexCoord + vec2(0.08, 0.08)*ClientTime*NormalmapScrollBlend.x*0.5)*NormalmapScrollBlend.y, dPdx*NormalmapScrollBlend.y, dPdy*NormalmapScrollBlend.y).rgb - vec3(1.0);\n" +"# else\n" " vec3 normal = dp_texture2D(Texture_Normal, (TexCoord + vec2(0.08, 0.08)*ClientTime*NormalmapScrollBlend.x*0.5)*NormalmapScrollBlend.y).rgb - vec3(1.0);\n" +"# endif\n" " normal += dp_texture2D(Texture_Normal, (TexCoord + vec2(-0.06, -0.09)*ClientTime*NormalmapScrollBlend.x)*NormalmapScrollBlend.y*0.75).rgb;\n" " vec2 ScreenTexCoord = SafeScreenTexCoord + vec3(normalize(myhalf3(normal))).xy * DistortScaleRefractReflect.zw;\n" " #else\n" -" vec2 ScreenTexCoord = SafeScreenTexCoord + vec3(normalize(myhalf3(dp_texture2D(Texture_Normal, TexCoord)) - myhalf3(0.5))).xy * DistortScaleRefractReflect.zw;\n" +" vec2 ScreenTexCoord = SafeScreenTexCoord + vec3(normalize(myhalf3(offsetMappedTexture2D(Texture_Normal)) - myhalf3(0.5))).xy * DistortScaleRefractReflect.zw;\n" " #endif\n" " // FIXME temporary hack to detect the case that the reflection\n" " // gets blackened at edges due to leaving the area that contains actual\n"