Guest User

Untitled

a guest
Oct 20th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #ifdef GL_ES
  2. #define LOWP lowp
  3. precision mediump float;
  4. #else
  5. #define LOWP
  6. #endif
  7.  
  8. varying LOWP vec4 v_color;
  9. varying vec2 v_texCoords;
  10. varying vec4 glPos;
  11.  
  12. uniform sampler2D u_texture;
  13.  
  14. varying float v_radius;
  15.  
  16. void main(){
  17. float dist = distance(glPos.xy, v_texCoords.xy) / 1.0;
  18.  
  19. gl_FragColor = texture2D(u_texture, v_texCoords.xy);
  20. gl_FragColor.rgb = v_color.rgb;
  21. float res = v_color.a * gl_FragColor.a;
  22. gl_FragColor.a = 1.0 * (1.0 - max(smoothstep(v_radius - 5.0 * res, v_radius , dist),
  23. min(smoothstep(v_radius - 7.0 * res, v_radius - 12.0 * res, dist),
  24. 0.88)));
  25. }
Add Comment
Please, Sign In to add comment