1 uniform sampler2D inputTex;
3 varying vec2 samplePos1;
4 varying vec2 samplePos2;
5 varying vec2 samplePos3;
6 varying vec2 samplePos4;
7 varying vec2 samplePos5;
10 // If defined, use five samples (blur radius = 5), otherwise 3 samples (radius = 3)
14 vec3 blurTex(vec2 pos, float strength)
16 return texture2D(inputTex, pos).rgb * strength;
21 // Do the gaussian blur
22 // This blur actually has a radius of 4, but we take advantage of gpu's
23 // linear texture filtering, so e.g. 1.5 actually gives us both texels
26 vec3 tex = blurTex(samplePos1, 0.30);
27 tex += blurTex(samplePos2, 0.25);
28 tex += blurTex(samplePos3, 0.25);
29 tex += blurTex(samplePos4, 0.1);
30 tex += blurTex(samplePos5, 0.1);
32 vec3 tex = blurTex(samplePos1, 0.40);
33 tex += blurTex(samplePos2, 0.30);
34 tex += blurTex(samplePos3, 0.30);
37 gl_FragColor = vec4(tex, 1.0);