@@ -276,13 +276,13 @@ vec3 applyWaterEffects(vec3 baseColor, float waterMask, vec2 worldPos) {
276276
277277float pcf_shadow(int layer, vec2 coords, float compare, vec2 texel_size) {
278278 float result = 0.0 ;
279- for ( int x = - 1 ; x <= 1 ; ++ x) {
280- for ( int y = - 1 ; y <= 1 ; ++ y) {
281- result += texture(shadow_map, vec4 (coords + vec2 (x, y) * texel_size,
282- float (layer), compare));
283- }
284- }
285- return result / 9 .0 ;
279+ // 5-tap Cross Pattern (Center + 4 neighbors) - Faster than 9-tap box
280+ result += texture(shadow_map, vec4 (coords, float (layer), compare));
281+ result += texture(shadow_map, vec4 (coords + vec2 (texel_size. x, 0 ), float (layer), compare));
282+ result += texture(shadow_map, vec4 (coords - vec2 (texel_size.x, 0 ), float (layer), compare));
283+ result += texture(shadow_map, vec4 (coords + vec2 ( 0 , texel_size.y), float (layer), compare));
284+ result += texture(shadow_map, vec4 (coords - vec2 ( 0 , texel_size.y), float (layer), compare));
285+ return result / 5 .0 ;
286286}
287287
288288// ========== Main ==========
0 commit comments