sdrblurtest

view sdr/vblur.glsl @ 0:26513fdda566

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 17 Oct 2013 08:19:56 +0300
parents
children e8fc0c9754c9
line source
1 uniform sampler2D tex;
2 uniform vec2 size, texsize;
4 #define KSZ 31
5 #define HALF_KSZ 15
6 #define SCALE float(KSZ)
8 void main()
9 {
10 float pixh = 1.0 / texsize.y;
12 vec3 texel = vec3(0.0, 0.0, 0.0);
13 for(int i=0; i<KSZ; i++) {
14 float y = float(i - HALF_KSZ) * pixh;
15 vec2 uv = gl_TexCoord[0].st + vec2(0.0, y);
16 texel += texture2D(tex, uv).rgb;
17 }
19 gl_FragColor.rgb = texel / SCALE;
20 gl_FragColor.a = 1.0;
21 }