Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #ifdef GL_ES
  2. precision mediump float;
  3. #endif
  4.  
  5. uniform sampler2D u_texture;
  6.  
  7. varying vec4 v_color;
  8. varying vec2 v_texCoord;
  9.  
  10. const float smoothing = 0.25f/48.0f;
  11.  
  12. void main() {
  13. float distance = texture2D(u_texture, v_texCoord).a;
  14. float alpha = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
  15. gl_FragColor = vec4(v_color.rgb, alpha);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement