From: cloudwalk Date: Wed, 16 Dec 2020 19:20:00 +0000 (+0000) Subject: shader_glsl: Don't apply the fringe effect if it's disabled, it fixes scr_screenshot_... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a43f3de5a66db2b6c75248fe85f5ae1573ad0ee1;p=xonotic%2Fdarkplaces.git shader_glsl: Don't apply the fringe effect if it's disabled, it fixes scr_screenshot_alpha and who knows what else (terencehill) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13068 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/shader_glsl.h b/shader_glsl.h index 11ec83dc..c9d45d66 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -301,10 +301,13 @@ "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",