From a43f3de5a66db2b6c75248fe85f5ae1573ad0ee1 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Wed, 16 Dec 2020 19:20:00 +0000 Subject: [PATCH] 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 --- shader_glsl.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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", -- 2.39.2