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