2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform vec2 pixel;
|
|
|
|
|
|
|
|
// Gaussian separated blur with radius 3.
|
|
|
|
|
2014-02-28 11:29:05 -05:00
|
|
|
#if __VERSION__ >= 130
|
2014-01-08 18:11:10 -05:00
|
|
|
in vec2 uv;
|
2014-01-19 13:31:00 -05:00
|
|
|
out vec4 FragColor;
|
2014-02-28 11:29:05 -05:00
|
|
|
#else
|
|
|
|
varying vec2 uv;
|
|
|
|
#define FragColor gl_FragColor
|
|
|
|
#endif
|
2014-01-08 18:11:10 -05:00
|
|
|
|
2013-11-30 16:33:06 -05:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec4 sum = vec4(0.0);
|
2014-01-08 18:11:10 -05:00
|
|
|
float X = uv.x;
|
|
|
|
float Y = uv.y;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-01-19 12:53:35 -05:00
|
|
|
sum += texture(tex, vec2(X - 3.0 * pixel.x, Y)) * 0.03125;
|
|
|
|
sum += texture(tex, vec2(X - 1.3333 * pixel.x, Y)) * 0.328125;
|
|
|
|
sum += texture(tex, vec2(X, Y)) * 0.273438;
|
|
|
|
sum += texture(tex, vec2(X + 1.3333 * pixel.x, Y)) * 0.328125;
|
|
|
|
sum += texture(tex, vec2(X + 3.0 * pixel.x, Y)) * 0.03125;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-01-19 13:31:00 -05:00
|
|
|
FragColor = sum;
|
2013-11-30 16:33:06 -05:00
|
|
|
}
|