motion blur for fun

This commit is contained in:
Eduardo Bart
2012-03-28 14:32:34 -03:00
parent 56d6cc2cc0
commit 8c2a84b6be
4 changed files with 3 additions and 20 deletions

View File

@@ -4,25 +4,7 @@ uniform float time; // time in seconds since shader linkage
uniform sampler2D texture; // map texture
varying vec2 textureCoords; // map texture coords
/*
void main()
{
gl_FragColor = texture2D(texture, textureCoords) * color * opacity;
}
*/
void main()
{
vec4 sum = vec4(0);
vec2 texcoord = textureCoords;
int j;
int i;
for( i= -4 ;i < 4; i++)
{
for (j = -4; j < 4; j++)
{
sum += texture2D(texture, texcoord + vec2(j, i)*0.0005) * 0.008;
}
}
gl_FragColor = texture2D(texture, textureCoords) * color * opacity + sum;
}