Ticket #1738: shadow_filter_nodiv.diff
File shadow_filter_nodiv.diff, 5.9 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/shaders/glsl/model_waterfall.fs
41 41 #if USE_SHADOW_PCF 42 42 vec2 offset = fract(v_shadow.xy - 0.5); 43 43 vec4 size = vec4(offset + 1.0, 2.0 - offset); 44 vec4 weight = (vec4( 2.0 - 1.0 / size.xy, 1.0 / size.zw - 1.0) + (v_shadow.xy -offset).xyxy) * shadowScale.zwzw;44 vec4 weight = (vec4(1.0, 1.0, -0.5, -0.5) + (v_shadow.xy - 0.5*offset).xyxy) * shadowScale.zwzw; 45 45 return (1.0/9.0)*dot(size.zxzx*size.wwyy, 46 46 vec4(shadow2D(shadowTex, vec3(weight.zw, v_shadow.z)).r, 47 47 shadow2D(shadowTex, vec3(weight.xw, v_shadow.z)).r, -
binaries/data/mods/public/shaders/glsl/terrain_common.fs
76 76 #if USE_SHADOW_PCF 77 77 vec2 offset = fract(v_shadow.xy - 0.5); 78 78 vec4 size = vec4(offset + 1.0, 2.0 - offset); 79 vec4 weight = (vec4( 2.0 - 1.0 / size.xy, 1.0 / size.zw - 1.0) + (v_shadow.xy -offset).xyxy) * shadowScale.zwzw;79 vec4 weight = (vec4(1.0, 1.0, -0.5, -0.5) + (v_shadow.xy - 0.5*offset).xyxy) * shadowScale.zwzw; 80 80 return (1.0/9.0)*dot(size.zxzx*size.wwyy, 81 81 vec4(shadow2D(shadowTex, vec3(weight.zw, biasedShdwZ)).r, 82 82 shadow2D(shadowTex, vec3(weight.xw, biasedShdwZ)).r, -
binaries/data/mods/public/shaders/glsl/model_water.fs
61 61 #if USE_SHADOW_PCF 62 62 vec2 offset = fract(coords.xy - 0.5); 63 63 vec4 size = vec4(offset + 1.0, 2.0 - offset); 64 vec4 weight = (vec4(2.0 - 1.0 / size.xy, 1.0 / size.zw - 1.0) + (coords.xy -offset).xyxy) * shadowScale.zwzw;64 vec4 weight = (vec4(1.0, 1.0, -0.5, -0.5) + (coords.xy - 0.5*offset).xyxy) * shadowScale.zwzw; 65 65 return (1.0/9.0)*dot(size.zxzx*size.wwyy, 66 66 vec4(shadow2D(shadowTex, vec3(weight.zw, coords.z)).r, 67 67 shadow2D(shadowTex, vec3(weight.xw, coords.z)).r, -
binaries/data/mods/public/shaders/glsl/model_common.fs
74 74 #if USE_SHADOW_PCF 75 75 vec2 offset = fract(v_shadow.xy - 0.5); 76 76 vec4 size = vec4(offset + 1.0, 2.0 - offset); 77 vec4 weight = (vec4( 2.0 - 1.0 / size.xy, 1.0 / size.zw - 1.0) + (v_shadow.xy -offset).xyxy) * shadowScale.zwzw;77 vec4 weight = (vec4(1.0, 1.0, -0.5, -0.5) + (v_shadow.xy - 0.5*offset).xyxy) * shadowScale.zwzw; 78 78 return (1.0/9.0)*dot(size.zxzx*size.wwyy, 79 79 vec4(shadow2D(shadowTex, vec3(weight.zw, biasedShdwZ)).r, 80 80 shadow2D(shadowTex, vec3(weight.xw, biasedShdwZ)).r, -
binaries/data/mods/public/shaders/glsl/water_high.fs
58 58 #if USE_SHADOW_PCF 59 59 vec2 offset = fract(coords.xy - 0.5); 60 60 vec4 size = vec4(offset + 1.0, 2.0 - offset); 61 vec4 weight = (vec4( 2.0 - 1.0 / size.xy, 1.0 / size.zw - 1.0) + (coords.xy -offset).xyxy) * shadowScale.zwzw;61 vec4 weight = (vec4(1.0, 1.0, -0.5, -0.5) + (coords.xy - 0.5*offset).xyxy) * shadowScale.zwzw; 62 62 return (1.0/9.0)*dot(size.zxzx*size.wwyy, 63 63 vec4(shadow2D(shadowTex, vec3(weight.zw, coords.z)).r, 64 64 shadow2D(shadowTex, vec3(weight.xw, coords.z)).r, -
binaries/data/mods/public/shaders/arb/model_common.fp
94 94 FRC offset.xy, offset; 95 95 ADD size.xy, offset, 1.0; 96 96 SUB size.zw, 2.0, offset.xyxy; 97 RCP weight.x, size.x;98 RCP weight.y, size.y;99 RCP weight.z, size.z;100 RCP weight.w, size.w;101 SUB weight.xy, 2.0, weight;102 SUB weight.zw, weight, 1.0;103 97 104 SUB offset.xy, v_shadow, offset;98 MAD offset.xy, -0.5, offset, v_shadow; 105 99 MOV offset.z, biasedShdw.z; 106 ADD weight, weight, offset.xyxy;100 ADD weight, { 1.0, 1.0, -0.5, -0.5 }, offset.xyxy; 107 101 MUL weight, weight, shadowScale.zwzw; 108 102 109 103 MOV offset.xy, weight.zwww; -
binaries/data/mods/public/shaders/arb/terrain_common.fp
48 48 FRC offset.xy, offset; 49 49 ADD size.xy, offset, 1.0; 50 50 SUB size.zw, 2.0, offset.xyxy; 51 RCP weight.x, size.x;52 RCP weight.y, size.y;53 RCP weight.z, size.z;54 RCP weight.w, size.w;55 SUB weight.xy, 2.0, weight;56 SUB weight.zw, weight, 1.0;57 51 58 SUB offset.xy, fragment.texcoord[2], offset;59 MOV offset.z, biasedShdw ;60 ADD weight, weight, offset.xyxy;52 MAD offset.xy, -0.5, offset, fragment.texcoord[2]; 53 MOV offset.z, biasedShdw.z; 54 ADD weight, { 1.0, 1.0, -0.5, -0.5 }, offset.xyxy; 61 55 MUL weight, weight, shadowScale.zwzw; 62 56 63 57 MOV offset.xy, weight.zwww;