Skip to content

Instantly share code, notes, and snippets.

@McZonk
Last active January 2, 2016 01:09
Show Gist options
  • Save McZonk/8228124 to your computer and use it in GitHub Desktop.
Save McZonk/8228124 to your computer and use it in GitHub Desktop.
// vertex shader
uniform float u_selected;
attribute vec4 a_position;
attribute vec4 a_color;
varying lowp vec4 v_color;
void main() {
if (u_selected > 0.0) {
v_color = vec4(0.5, 1.0, 1.0, 1.0);
} else {
v_color = a_color;
}
gl_Position = vec4(a_position.xy, 0, 1.0);
}
// fragment shader
varying lowp vec4 v_color;
void main() {
gl_FragColor = v_color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment