2013-03-13 16:29:41 +00:00
|
|
|
#version 140
|
|
|
|
|
2015-12-01 08:57:37 +00:00
|
|
|
uniform sampler2D sampler;
|
2013-03-13 16:29:41 +00:00
|
|
|
uniform vec2 offsets[16];
|
|
|
|
uniform vec4 kernel[16];
|
|
|
|
|
2015-12-01 08:57:37 +00:00
|
|
|
in vec2 texcoord0;
|
2013-03-13 16:29:41 +00:00
|
|
|
out vec4 fragColor;
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
2015-12-01 08:57:37 +00:00
|
|
|
vec4 sum = texture(sampler, texcoord0.st) * kernel[0];
|
2013-03-13 16:29:41 +00:00
|
|
|
for (int i = 1; i < 16; i++) {
|
2015-12-01 08:57:37 +00:00
|
|
|
sum += texture(sampler, texcoord0.st - offsets[i]) * kernel[i];
|
|
|
|
sum += texture(sampler, texcoord0.st + offsets[i]) * kernel[i];
|
2013-03-13 16:29:41 +00:00
|
|
|
}
|
|
|
|
fragColor = sum;
|
|
|
|
}
|
|
|
|
|