]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
slightly cheaper linear PCF sequence
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 May 2012 14:24:52 +0000 (14:24 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 May 2012 14:24:52 +0000 (14:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11821 d7cf8633-e32d-0410-b094-e92efae38249

shader_glsl.h

index dbc19d5747620ff649f7bc23bf1016c6e26cbaea..b47f7609a601810a371580bdceba1a314c8579d1 100644 (file)
 "#  else\n"
 "#   ifdef USESHADOWSAMPLER\n"
 "#     ifdef USESHADOWMAPPCF\n"
-"#       define texval(off) dp_shadow2D(Texture_ShadowMap2D, vec3((center + off)*ShadowMap_TextureScale, shadowmaptc.z))  \n"
-"      vec2 offset = fract(shadowmaptc.xy - 0.5), center = shadowmaptc.xy - offset;\n"
-"      vec4 size = vec4(offset + 1.0, 2.0 - offset), weight = vec4(2.0 - 1.0 / size.xy, 1.0 / size.zw - 1.0);\n"
+"#       define texval(off) dp_shadow2D(Texture_ShadowMap2D, vec3(off, shadowmaptc.z))  \n"
+"      vec2 offset = fract(shadowmaptc.xy - 0.5);\n"
+"      vec4 size = vec4(offset + 1.0, 2.0 - offset), weight = (vec4(2.0 - 1.0 / size.xy, 1.0 / size.zw - 1.0) + (shadowmaptc.xy - offset).xyxy)*ShadowMap_TextureScale.xyxy;\n"
 "      f = (1.0/9.0)*dot(size.zxzx*size.wwyy, vec4(texval(weight.zw), texval(weight.xw), texval(weight.zy), texval(weight.xy)));\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"