]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added USEREFLECTCUBE case to MODE_GENERIC, this disables use of texture
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Oct 2011 21:07:34 +0000 (21:07 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Oct 2011 21:07:34 +0000 (21:07 +0000)
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
shader_hlsl.h

index 4e37e273f7feecbf4156cb08e695e8603c70a582..33cbb95e9587f651ded24ad4f8c0146532198c43 100644 (file)
 "      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"
index 4b6da04ed694702a5f0433cb26c2d8f03e4f920b..a1d537d4bc3faeb358e40961eedcca577fe50eba 100644 (file)
 "      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"
 "# 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"