2014-09-30 16:07:25 +02:00
|
|
|
uniform sampler2D texture;
|
|
|
|
uniform float blur_radius;
|
|
|
|
|
2018-05-20 14:06:24 +02:00
|
|
|
varying vec4 texCoord;
|
|
|
|
varying vec4 frontColor;
|
|
|
|
|
2014-09-30 16:07:25 +02:00
|
|
|
void main()
|
|
|
|
{
|
2015-04-01 04:08:23 +02:00
|
|
|
vec2 offx = vec2(blur_radius, 0.0);
|
|
|
|
vec2 offy = vec2(0.0, blur_radius);
|
2014-09-30 16:07:25 +02:00
|
|
|
|
2018-05-20 14:06:24 +02:00
|
|
|
vec4 pixel = texture2D(texture, texCoord.xy) * 4.0 +
|
|
|
|
texture2D(texture, texCoord.xy - offx) * 2.0 +
|
|
|
|
texture2D(texture, texCoord.xy + offx) * 2.0 +
|
|
|
|
texture2D(texture, texCoord.xy - offy) * 2.0 +
|
|
|
|
texture2D(texture, texCoord.xy + offy) * 2.0 +
|
|
|
|
texture2D(texture, texCoord.xy - offx - offy) * 1.0 +
|
|
|
|
texture2D(texture, texCoord.xy - offx + offy) * 1.0 +
|
|
|
|
texture2D(texture, texCoord.xy + offx - offy) * 1.0 +
|
|
|
|
texture2D(texture, texCoord.xy + offx + offy) * 1.0;
|
2014-09-30 16:07:25 +02:00
|
|
|
|
2018-05-20 14:06:24 +02:00
|
|
|
gl_FragColor = frontColor * (pixel / 16.0);
|
2014-09-30 16:07:25 +02:00
|
|
|
}
|