sdrblurtest

view sdr/hblur.glsl @ 1:e8fc0c9754c9

added fps counter
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Oct 2015 17:46:02 +0300
parents 26513fdda566
children
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 pixw = 1.0 / texsize.x;
11 vec2 maxuv = size / texsize;
13 vec3 texel = vec3(0.0, 0.0, 0.0);
14 for(int i=0; i<KSZ; i++) {
15 float x = float(i - HALF_KSZ) * pixw;
16 vec2 uv = gl_TexCoord[0].st + vec2(x, 0.0);
17 texel += texture2D(tex, min(uv, maxuv)).rgb;
18 }
20 gl_FragColor.rgb = texel / SCALE;
21 gl_FragColor.a = 1.0;
22 }