Skip to content

Instantly share code, notes, and snippets.

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