blur.frag 346 B

12345678910111213141516171819
  1. uniform sampler2D tex0;
  2. uniform vec2 distance;
  3. uniform vec2 TX;
  4. void main (void)
  5. {
  6. vec2 texcoord = (gl_TextureMatrix[0] * gl_TexCoord[0]).st;
  7. vec4 sample = 0.5 * texture2D(tex0, texcoord - distance);
  8. sample += texture2D(tex0, texcoord);
  9. sample += 0.5 * texture2D(tex0, texcoord + distance);
  10. sample /= 2.;
  11. gl_FragColor = sample;
  12. }