Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform sampler2D u_tex;
  2. uniform vec2 u_invRes;
  3.  
  4. varying vec2 v_uv;
  5.  
  6. float offset[3];
  7. float weight[3];
  8.  
  9. void main() {
  10.     offset[0] = 0.0; offset[1] = 1.3846153846; offset[2] = 3.2307692308;
  11.     weight[0] = 0.2270270270; weight[1] = 0.3162162162; weight[2] = 0.0702702703;
  12.  
  13.     vec3 tc = texture2D(u_tex, v_uv).rgb * weight[0] * 2.0;
  14.     for (int i = 1; i < 3; i++) {
  15.         tc += weight[i] * texture2D(u_tex, v_uv + vec2(0.0, u_invRes.y * offset[i])).rgb;
  16.         tc += weight[i] * texture2D(u_tex, v_uv - vec2(0.0, u_invRes.y * offset[i])).rgb;
  17.     }
  18.  
  19.     gl_FragColor = vec4(tc, 1.0);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement