2009-11-03 17:04:40 +08:00
|
|
|
uniform sampler2D texture;
|
|
|
|
uniform float offset;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec2 offx = vec2(offset, 0.0);
|
|
|
|
vec2 offy = vec2(0.0, offset);
|
|
|
|
|
2009-11-11 19:53:20 +08:00
|
|
|
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 1 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offx) * 2 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offx) * 2 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offy) * 2 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offy) * 2 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1 +
|
|
|
|
texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1;
|
2009-11-03 17:04:40 +08:00
|
|
|
|
2009-11-11 19:53:20 +08:00
|
|
|
gl_FragColor = gl_Color * (pixel / 13.0);
|
2009-11-03 17:04:40 +08:00
|
|
|
}
|