Skip to content

Instantly share code, notes, and snippets.

@duskvirkus
Created January 10, 2020 07:00
Show Gist options
  • Save duskvirkus/1cf3ad6fc8153b5cf36c2354a8756f79 to your computer and use it in GitHub Desktop.
Save duskvirkus/1cf3ad6fc8153b5cf36c2354a8756f79 to your computer and use it in GitHub Desktop.
Mouse threashold shader.
// http://editor.thebookofshaders.com/
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
void main() {
vec2 st = gl_FragCoord.xy/u_resolution.xy;
st.x *= u_resolution.x/u_resolution.y;
vec3 color = vec3(step(u_mouse.y/u_resolution.y, st.y));
gl_FragColor = vec4(color,1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment