From 906ce17389dc9bf0c52bbc41783bc8a420b3adc6 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 8 May 2013 10:41:01 +0000 Subject: [PATCH] order postprocess code properly (so blur does not cancel bloom) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11949 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=62bfc1df52ea36f582e336efed674885dec74d7b --- shader_glsl.h | 14 ++++++++------ shader_hlsl.h | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/shader_glsl.h b/shader_glsl.h index 63540fc8..b8a441b0 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -248,12 +248,6 @@ "void main(void)\n", "{\n", " dp_FragColor = dp_texture2D(Texture_First, TexCoord1);\n", -"#ifdef USEBLOOM\n", -" dp_FragColor += max(vec4(0,0,0,0), dp_texture2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n", -"#endif\n", -"#ifdef USEVIEWTINT\n", -" dp_FragColor = mix(dp_FragColor, ViewTintColor, ViewTintColor.a);\n", -"#endif\n", "\n", "#ifdef USEPOSTPROCESSING\n", "// do r_glsl_dumpshader, edit glsl/default.glsl, and replace this by your own postprocessing if you want\n", @@ -296,6 +290,14 @@ " dp_FragColor.rgb = dp_FragColor.rgb * (1.0 + UserVec2.x) + vec3(max(0.0, sobel - UserVec2.z))*UserVec2.y;\n", "#endif\n", "\n", +"#ifdef USEBLOOM\n", +" dp_FragColor += max(vec4(0,0,0,0), dp_texture2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n", +"#endif\n", +"\n", +"#ifdef USEVIEWTINT\n", +" dp_FragColor = mix(dp_FragColor, ViewTintColor, ViewTintColor.a);\n", +"#endif\n", +"\n", "#ifdef USESATURATION\n", " //apply saturation BEFORE gamma ramps, so v_glslgamma value does not matter\n", " float y = dot(dp_FragColor.rgb, vec3(0.299, 0.587, 0.114));\n", diff --git a/shader_hlsl.h b/shader_hlsl.h index 3e6324d6..7881aa6a 100644 --- a/shader_hlsl.h +++ b/shader_hlsl.h @@ -141,12 +141,6 @@ ")\n", "{\n", " dp_FragColor = tex2D(Texture_First, TexCoord1);\n", -"#ifdef USEBLOOM\n", -" dp_FragColor += max(float4(0,0,0,0), tex2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n", -"#endif\n", -"#ifdef USEVIEWTINT\n", -" dp_FragColor = lerp(dp_FragColor, ViewTintColor, ViewTintColor.a);\n", -"#endif\n", "\n", "#ifdef USEPOSTPROCESSING\n", "// do r_glsl_dumpshader, edit glsl/default.glsl, and replace this by your own postprocessing if you want\n", @@ -189,6 +183,14 @@ " dp_FragColor.rgb = dp_FragColor.rgb * (1.0 + UserVec2.x) + float3(1,1,1)*max(0.0, sobel - UserVec2.z)*UserVec2.y;\n", "#endif\n", "\n", +"#ifdef USEBLOOM\n", +" dp_FragColor += max(float4(0,0,0,0), tex2D(Texture_Second, TexCoord2) - BloomColorSubtract);\n", +"#endif\n", +"\n", +"#ifdef USEVIEWTINT\n", +" dp_FragColor = lerp(dp_FragColor, ViewTintColor, ViewTintColor.a);\n", +"#endif\n", +"\n", "#ifdef USESATURATION\n", " //apply saturation BEFORE gamma ramps, so v_glslgamma value does not matter\n", " float y = dot(dp_FragColor.rgb, float3(0.299, 0.587, 0.114));\n", -- 2.39.2