2009-11-03 17:04:40 +08:00
|
|
|
uniform sampler2D texture;
|
2011-12-10 20:02:38 +08:00
|
|
|
uniform float blur_radius;
|
2009-11-03 17:04:40 +08:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2011-12-10 20:02:38 +08:00
|
|
|
vec2 offx = vec2(blur_radius, 0.0);
|
|
|
|
vec2 offy = vec2(0.0, blur_radius);
|
2009-11-03 17:04:40 +08:00
|
|
|
|
2011-12-10 20:02:38 +08:00
|
|
|
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 4.0 +
|
2011-05-15 19:36:13 +08:00
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offx) * 2.0 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offy) * 2.0 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offy) * 2.0 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
|
2009-11-03 17:04:40 +08:00
|
|
|
|
2011-12-10 20:02:38 +08:00
|
|
|
gl_FragColor = gl_Color * (pixel / 16.0);
|
2009-11-03 17:04:40 +08:00
|
|
|
}
|