From 3fa489aae418051ad8c533ec570eb315a29ba29b Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 27 Oct 2011 21:07:34 +0000 Subject: [PATCH] added USEREFLECTCUBE case to MODE_GENERIC, this disables use of texture alpha on the first texture so that the motion blur compositing works properly regardless of accumulated framebuffer alpha fix USEGAMMARAMPS in HLSL because it was using an undeclared dp_texture2D macro git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11484 d7cf8633-e32d-0410-b094-e92efae38249 --- shader_glsl.h | 5 +++++ shader_hlsl.h | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/shader_glsl.h b/shader_glsl.h index 4e37e273..33cbb95e 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -334,7 +334,12 @@ " dp_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n" "#endif\n" "#ifdef USEDIFFUSE\n" +"# ifdef USEREFLECTCUBE\n" +" // suppress texture alpha\n" +" dp_FragColor.rgb *= dp_texture2D(Texture_First, TexCoord1).rgb;\n" +"# else\n" " dp_FragColor *= dp_texture2D(Texture_First, TexCoord1);\n" +"# endif\n" "#endif\n" "\n" "#ifdef USESPECULAR\n" diff --git a/shader_hlsl.h b/shader_hlsl.h index 4b6da04e..a1d537d4 100644 --- a/shader_hlsl.h +++ b/shader_hlsl.h @@ -307,7 +307,12 @@ " gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n" "#endif\n" "#ifdef USEDIFFUSE\n" +"# ifdef USEREFLECTCUBE\n" +" // suppress texture alpha\n" +" dp_FragColor.rgb *= tex2D(Texture_First, TexCoord1).rgb;\n" +"# else\n" " gl_FragColor *= tex2D(Texture_First, TexCoord1);\n" +"# endif\n" "#endif\n" "\n" "#ifdef USESPECULAR\n" @@ -323,9 +328,9 @@ "# endif\n" "#endif\n" "#ifdef USEGAMMARAMPS\n" -" dp_FragColor.r = dp_texture2D(Texture_GammaRamps, vec2(dp_FragColor.r, 0)).r;\n" -" dp_FragColor.g = dp_texture2D(Texture_GammaRamps, vec2(dp_FragColor.g, 0)).g;\n" -" dp_FragColor.b = dp_texture2D(Texture_GammaRamps, vec2(dp_FragColor.b, 0)).b;\n" +" dp_FragColor.r = tex2D(Texture_GammaRamps, vec2(dp_FragColor.r, 0)).r;\n" +" dp_FragColor.g = tex2D(Texture_GammaRamps, vec2(dp_FragColor.g, 0)).g;\n" +" dp_FragColor.b = tex2D(Texture_GammaRamps, vec2(dp_FragColor.b, 0)).b;\n" "#endif\n" "}\n" "#endif\n" -- 2.39.2