]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
shader_glsl: Don't apply the fringe effect if it's disabled, it fixes scr_screenshot_...
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 16 Dec 2020 19:20:00 +0000 (19:20 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 16 Dec 2020 19:20:00 +0000 (19:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13068 d7cf8633-e32d-0410-b094-e92efae38249

shader_glsl.h

index 11ec83dcde56c6c7ce93e78cd9f536f9e1bb6e80..c9d45d660caab009496cfb94b09c67ff939036d2 100644 (file)
 "void main(void)\n",
 "{\n",
 "      float fringe = ColorFringe;//.0033f;\n",
-"      float amount = distance(TexCoord1, vec2(.5f,.5f));\n",
-"      vec2 offset = vec2(amount*fringe,amount*fringe);\n",
-"      dp_FragColor.xy = texture(Texture_First, TexCoord1-offset).xy;\n",
-"      dp_FragColor.z = texture(Texture_First, TexCoord1+offset).z;\n",
+"      if (fringe) {\n",
+"              float amount = distance(TexCoord1, vec2(.5f,.5f));\n",
+"              vec2 offset = vec2(amount*fringe,amount*fringe);\n",
+"              dp_FragColor.xy = dp_texture2D(Texture_First, TexCoord1-offset).xy;\n",
+"              dp_FragColor.z = dp_texture2D(Texture_First, TexCoord1+offset).z;\n",
+"      } else\n",
+"              dp_FragColor = dp_texture2D(Texture_First, TexCoord1);\n",
 "\n",
 "#ifdef USEFXAA\n",
 "      dp_FragColor = fxaa(dp_FragColor, 8.0); // 8.0 can be changed for larger span\n",