2015-12-01 08:57:37 +00:00
|
|
|
uniform sampler2D sampler;
|
2011-01-18 22:43:08 +00:00
|
|
|
uniform vec2 offsets[16];
|
|
|
|
uniform vec4 kernel[16];
|
2010-05-11 22:05:00 +00:00
|
|
|
|
2015-12-01 08:57:37 +00:00
|
|
|
varying vec2 texcoord0;
|
2011-01-02 20:28:07 +00:00
|
|
|
|
2010-05-11 22:05:00 +00:00
|
|
|
void main(void)
|
|
|
|
{
|
2015-12-01 08:57:37 +00:00
|
|
|
vec4 sum = texture2D(sampler, texcoord0.st) * kernel[0];
|
2011-01-18 22:43:08 +00:00
|
|
|
for (int i = 1; i < 16; i++) {
|
2015-12-01 08:57:37 +00:00
|
|
|
sum += texture2D(sampler, texcoord0.st - offsets[i]) * kernel[i];
|
|
|
|
sum += texture2D(sampler, texcoord0.st + offsets[i]) * kernel[i];
|
2010-05-11 22:05:00 +00:00
|
|
|
}
|
|
|
|
gl_FragColor = sum;
|
|
|
|
}
|
|
|
|
|