2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform vec2 pixel;
|
|
|
|
|
|
|
|
// Gaussian separated blur with radius 6.
|
|
|
|
|
2014-01-19 13:31:00 -05:00
|
|
|
out vec4 FragColor;
|
2014-01-08 18:11:10 -05:00
|
|
|
|
2013-11-30 16:33:06 -05:00
|
|
|
void main()
|
|
|
|
{
|
2014-06-03 13:56:59 -04:00
|
|
|
vec2 uv = gl_FragCoord.xy * pixel;
|
|
|
|
vec4 sum = vec4(0.0);
|
|
|
|
float X = uv.x;
|
|
|
|
float Y = uv.y;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-06-03 13:56:59 -04:00
|
|
|
sum += texture(tex, vec2(X, Y - 5.13333 * pixel.y)) * 0.00640869;
|
|
|
|
sum += texture(tex, vec2(X, Y - 3.26667 * pixel.y)) * 0.083313;
|
|
|
|
sum += texture(tex, vec2(X, Y - 1.4 * pixel.y)) * 0.305481;
|
|
|
|
sum += texture(tex, vec2(X, Y)) * 0.209473;
|
|
|
|
sum += texture(tex, vec2(X, Y + 1.4 * pixel.y)) * 0.305481;
|
|
|
|
sum += texture(tex, vec2(X, Y + 3.26667 * pixel.y)) * 0.083313;
|
|
|
|
sum += texture(tex, vec2(X, Y + 5.13333 * pixel.y)) * 0.00640869;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-06-03 13:56:59 -04:00
|
|
|
FragColor = sum;
|
2013-11-30 16:33:06 -05:00
|
|
|
}
|