Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef GL_ES
- precision mediump float;
- #endif
- uniform sampler2D u_texture;
- varying vec4 v_color;
- varying vec2 v_texCoord;
- const float smoothing = 0.25f/48.0f;
- void main() {
- float distance = texture2D(u_texture, v_texCoord).a;
- float alpha = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance);
- gl_FragColor = vec4(v_color.rgb, alpha);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement