v4k-git-backup/demos/art/fx/fxBlurVertical.fs

16 lines
520 B
Forth
Raw Normal View History

2023-09-27 06:49:59 +00:00
// [ref] https://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
uniform float intensity; /// set:4
void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
vec2 uv = fragCoord.xy / iResolution.xy;
vec4 base = texture(iChannel0, uv), color = vec4(0.0);
vec2 offset = vec2(0,intensity) / iResolution;
color += base * 0.30;
color += texture(iChannel0, uv + offset) * 0.35;
color += texture(iChannel0, uv - offset) * 0.35;
fragColor = vec4( color.rgb, base.a );
}