Skip to content

Instantly share code, notes, and snippets.

@McZonk
Last active January 2, 2016 01:09
Show Gist options
  • Save McZonk/8228033 to your computer and use it in GitHub Desktop.
Save McZonk/8228033 to your computer and use it in GitHub Desktop.
// vertex shader
attribute vec4 a_position;
attribute vec2 a_tex_coord;
varying mediump vec2 v_tex_coord;
void main() {
v_tex_coord = a_tex_coord;
gl_Position = a_position;
}
// fragment shader
uniform lowp sampler2D u_texture;
varying mediump vec2 v_tex_coord;
void main() {
if (texture2D(u_texture, v_tex_coord).a <= 0.05) {
discard;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment