fix another dp_shadow2D call
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Mar 2011 21:39:02 +0000 (21:39 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Mar 2011 21:39:02 +0000 (21:39 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10967 d7cf8633-e32d-0410-b094-e92efae38249

shader_glsl.h

index b9f5abf..8748c5e 100644 (file)
@@ -25,7 +25,7 @@
 "# define dp_texture2D texture\n"
 "# define dp_texture3D texture\n"
 "# define dp_textureCube texture\n"
-"# define dp_shadow2D texture\n"
+"# define dp_shadow2D(a,b) texture(a,b)\n"
 "#else\n"
 "# ifdef FRAGMENT_SHADER\n"
 "#  define dp_FragColor gl_FragColor\n"
@@ -38,7 +38,7 @@
 "# define dp_texture2D texture2D\n"
 "# define dp_texture3D texture3D\n"
 "# define dp_textureCube textureCube\n"
-"# define dp_shadow2D shadow2D\n"
+"# define dp_shadow2D(a,b) float(shadow2D(a,b))\n"
 "#endif\n"
 "\n"
 "#ifdef VERTEX_SHADER\n"
 "\n"
 "#  ifdef USESHADOWSAMPLER\n"
 "#    ifdef USESHADOWMAPPCF\n"
-"#      define texval(x, y) float(dp_shadow2D(Texture_ShadowMap2D, vec3(center + vec2(x, y)*ShadowMap_TextureScale, shadowmaptc.z)))  \n"
+"#      define texval(x, y) dp_shadow2D(Texture_ShadowMap2D, vec3(center + vec2(x, y)*ShadowMap_TextureScale, shadowmaptc.z))  \n"
 "      vec2 center = shadowmaptc.xy*ShadowMap_TextureScale;\n"
 "      f = dot(vec4(0.25), vec4(texval(-0.4, 1.0), texval(-1.0, -0.4), texval(0.4, -1.0), texval(1.0, 0.4)));\n"
 "#    else\n"
-"      f = dp_shadow2D(Texture_ShadowMap2D, vec3(shadowmaptc.xy*ShadowMap_TextureScale, shadowmaptc.z)).r;\n"
+"      f = dp_shadow2D(Texture_ShadowMap2D, vec3(shadowmaptc.xy*ShadowMap_TextureScale, shadowmaptc.z));\n"
 "#    endif\n"
 "#  else\n"
 "#    ifdef USESHADOWMAPPCF\n"