Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform sampler2D texture;
  2. uniform float blur_radius;
  3.  
  4. void main()
  5. {
  6.     vec2 offx = vec2(blur_radius, 0.0);
  7.     vec2 offy = vec2(0.0, blur_radius);
  8.  
  9.     vec4 pixel = texture2D(texture, gl_TexCoord[0].xy)               * 4.0 +
  10.                  texture2D(texture, gl_TexCoord[0].xy - offx)        * 2.0 +
  11.                  texture2D(texture, gl_TexCoord[0].xy + offx)        * 2.0 +
  12.                  texture2D(texture, gl_TexCoord[0].xy - offy)        * 2.0 +
  13.                  texture2D(texture, gl_TexCoord[0].xy + offy)        * 2.0 +
  14.                  texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 +
  15.                  texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 +
  16.                  texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
  17.                  texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
  18.  
  19.     gl_FragColor =  gl_Color * (pixel / 16.0);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement