"# else\n"
"# define texval(x, y) texture4(Texture_ShadowMap2D, center + vec2(x, y)*ShadowMap_TextureScale)\n"
"# endif\n"
-" vec2 center = shadowmaptc.xy - 0.5, offset = fract(center);\n"
-" center *= ShadowMap_TextureScale;\n"
-" vec4 group1 = step(shadowmaptc.z, texval(-1.0, -1.0));\n"
-" vec4 group2 = step(shadowmaptc.z, texval( 1.0, -1.0));\n"
-" vec4 group3 = step(shadowmaptc.z, texval(-1.0, 1.0));\n"
-" vec4 group4 = step(shadowmaptc.z, texval( 1.0, 1.0));\n"
+" vec2 center = shadowmaptc.xy - 1.5, offset = fract(center);\n"
+" center = (center - offset)*ShadowMap_TextureScale;\n"
+" vec4 group1 = step(shadowmaptc.z, texval(0.0, 0.0));\n"
+" vec4 group2 = step(shadowmaptc.z, texval(2.0, 0.0));\n"
+" vec4 group3 = step(shadowmaptc.z, texval(0.0, 2.0));\n"
+" vec4 group4 = step(shadowmaptc.z, texval(2.0, 2.0));\n"
" vec4 cols = vec4(group1.rg, group2.rg) + vec4(group3.ab, group4.ab) +\n"
" mix(vec4(group1.ab, group2.ab), vec4(group3.rg, group4.rg), offset.y);\n"
" f = dot(mix(cols.xyz, cols.yzw, offset.x), vec3(1.0/9.0));\n"
"# ifdef USESHADOWMAPPCF\n"
"# if defined(GL_ARB_texture_gather) || defined(GL_AMD_texture_texture4)\n"
"# ifdef GL_ARB_texture_gather\n"
-"# define texval(x, y) textureGatherOffset(Texture_ShadowMap2D, center, ivec(x, y))\n"
+"# define texval(x, y) textureGatherOffset(Texture_ShadowMap2D, center, ivec2(x, y))\n"
"# else\n"
-"# define texval(x, y) texture4(Texture_ShadowMap2D, center + float2(x,y)*ShadowMap_TextureScale)\n"
+"# define texval(x, y) texture4(Texture_ShadowMap2D, center + float2(x, y)*ShadowMap_TextureScale)\n"
"# endif\n"
-" float2 center = shadowmaptc.xy - 0.5, offset = frac(center);\n"
-" center *= ShadowMap_TextureScale;\n"
-" float4 group1 = step(shadowmaptc.z, texval(-1.0, -1.0));\n"
-" float4 group2 = step(shadowmaptc.z, texval( 1.0, -1.0));\n"
-" float4 group3 = step(shadowmaptc.z, texval(-1.0, 1.0));\n"
-" float4 group4 = step(shadowmaptc.z, texval( 1.0, 1.0));\n"
+" float2 center = shadowmaptc.xy - 1.5, offset = fract(center);\n"
+" center = (center - offset)*ShadowMap_TextureScale;\n"
+" float4 group1 = step(shadowmaptc.z, texval(0.0, 0.0));\n"
+" float4 group2 = step(shadowmaptc.z, texval(2.0, 0.0));\n"
+" float4 group3 = step(shadowmaptc.z, texval(0.0, 2.0));\n"
+" float4 group4 = step(shadowmaptc.z, texval(2.0, 2.0));\n"
" float4 cols = float4(group1.rg, group2.rg) + float4(group3.ab, group4.ab) +\n"
" lerp(float4(group1.ab, group2.ab), float4(group3.rg, group4.rg), offset.y);\n"
" f = dot(lerp(cols.xyz, cols.yzw, offset.x), float3(1.0/9.0));\n"