]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
patch from graphitemaster that changes r_fxaa use of texture2D in
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 9 Apr 2014 04:35:09 +0000 (04:35 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 8 May 2014 11:36:41 +0000 (13:36 +0200)
default.glsl to use dp_texture2D instead (which resolves to the correct
texture function on later GL versions)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12061 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=f6dad5a1884f3d5e6c20ad378af8899bb01e7aba

shader_glsl.h

index cb839f108821691eb84b067f8f7ac3e226762736..3e150a2291cf47e4bdb144c8fc4a6a6d7d867630 100644 (file)
 "      float minreduct = (1.0 / 128.0);\n",
 "\n",
 "      // directions\n",
-"      vec3 NW = texture2D(Texture_First, TexCoord1 + (vec2(-1.0, -1.0) * PixelSize)).xyz;\n",
-"      vec3 NE = texture2D(Texture_First, TexCoord1 + (vec2(+1.0, -1.0) * PixelSize)).xyz;\n",
-"      vec3 SW = texture2D(Texture_First, TexCoord1 + (vec2(-1.0, +1.0) * PixelSize)).xyz;\n",
-"      vec3 SE = texture2D(Texture_First, TexCoord1 + (vec2(+1.0, +1.0) * PixelSize)).xyz;\n",
-"      vec3 M = texture2D(Texture_First, TexCoord1).xyz;\n",
+"      vec3 NW = dp_texture2D(Texture_First, TexCoord1 + (vec2(-1.0, -1.0) * PixelSize)).xyz;\n",
+"      vec3 NE = dp_texture2D(Texture_First, TexCoord1 + (vec2(+1.0, -1.0) * PixelSize)).xyz;\n",
+"      vec3 SW = dp_texture2D(Texture_First, TexCoord1 + (vec2(-1.0, +1.0) * PixelSize)).xyz;\n",
+"      vec3 SE = dp_texture2D(Texture_First, TexCoord1 + (vec2(+1.0, +1.0) * PixelSize)).xyz;\n",
+"      vec3 M = dp_texture2D(Texture_First, TexCoord1).xyz;\n",
 "\n",
 "      // luminance directions\n",
 "      vec3 luma = vec3(0.299, 0.587, 0.114);\n",
 "      dir = min(vec2(maxspan, maxspan), max(vec2(-maxspan, -maxspan), dir * rcp)) * PixelSize;\n",
 "\n",
 "      vec3 rA = (1.0/2.0) * (\n",
-"              texture2D(Texture_First, TexCoord1 + dir * (1.0/3.0 - 0.5)).xyz +\n",
-"              texture2D(Texture_First, TexCoord1 + dir * (2.0/3.0 - 0.5)).xyz);\n",
+"              dp_texture2D(Texture_First, TexCoord1 + dir * (1.0/3.0 - 0.5)).xyz +\n",
+"              dp_texture2D(Texture_First, TexCoord1 + dir * (2.0/3.0 - 0.5)).xyz);\n",
 "      vec3 rB = rA * (1.0/2.0) + (1.0/4.0) * (\n",
-"              texture2D(Texture_First, TexCoord1 + dir * (0.0/3.0 - 0.5)).xyz +\n",
-"              texture2D(Texture_First, TexCoord1 + dir * (3.0/3.0 - 0.5)).xyz);\n",
+"              dp_texture2D(Texture_First, TexCoord1 + dir * (0.0/3.0 - 0.5)).xyz +\n",
+"              dp_texture2D(Texture_First, TexCoord1 + dir * (3.0/3.0 - 0.5)).xyz);\n",
 "      float lB = dot(rB, luma);\n",
 "\n",
 "      ret.xyz = ((lB < lMin) || (lB > lMax)) ? rA : rB;\n",