Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef GL_ES
- #define LOWP lowp
- precision mediump float;
- #else
- #define LOWP
- #endif
- varying LOWP vec4 v_color;
- varying vec2 v_texCoords;
- varying vec4 glPos;
- uniform sampler2D u_texture;
- varying float v_radius;
- void main(){
- float dist = distance(glPos.xy, v_texCoords.xy) / 1.0;
- gl_FragColor = texture2D(u_texture, v_texCoords.xy);
- gl_FragColor.rgb = v_color.rgb;
- float res = v_color.a * gl_FragColor.a;
- gl_FragColor.a = 1.0 * (1.0 - max(smoothstep(v_radius - 5.0 * res, v_radius , dist),
- min(smoothstep(v_radius - 7.0 * res, v_radius - 12.0 * res, dist),
- 0.88)));
- }
Add Comment
Please, Sign In to add comment