testing bloom and motion blur

This commit is contained in:
Eduardo Bart
2012-03-28 14:18:21 -03:00
parent 81dcd42fd1
commit 56d6cc2cc0
3 changed files with 25 additions and 4 deletions

View File

@@ -4,7 +4,25 @@ 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;
}