2014-10-08 12:55:05 +00:00
|
|
|
#define nsamples 5
|
|
|
|
extern number blurstart = 1.0; // 0 to 1
|
|
|
|
extern number blurwidth = -0.02; // -1 to 1
|
|
|
|
|
|
|
|
|
|
|
|
vec4 effect(vec4 vcolor, Image texture, vec2 texture_coords, vec2 pixel_coords)
|
|
|
|
{
|
|
|
|
vec4 c = vec4(0.0, 0.0, 0.0, 1.0);
|
2017-07-17 21:01:13 +00:00
|
|
|
|
2014-10-08 12:55:05 +00:00
|
|
|
int i;
|
|
|
|
for (i = 0; i < nsamples; i++)
|
|
|
|
{
|
2017-07-17 21:01:13 +00:00
|
|
|
number scale = blurstart + blurwidth * (float(i) / float(nsamples-1));
|
2014-10-08 12:55:05 +00:00
|
|
|
c.rgb += Texel(texture, texture_coords * scale).rgb;
|
|
|
|
}
|
2017-07-17 21:01:13 +00:00
|
|
|
|
|
|
|
c.rgb /= float(nsamples);
|
|
|
|
|
2014-10-08 12:55:05 +00:00
|
|
|
return c;
|
|
|
|
}
|