Skip to content

Instantly share code, notes, and snippets.

@veeneck
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veeneck/8181776f76a112dce239 to your computer and use it in GitHub Desktop.
Save veeneck/8181776f76a112dce239 to your computer and use it in GitHub Desktop.
Shadertoy: Bullseye
// https://www.shadertoy.com/view/Xtl3Dj
void main() {
vec4 val = texture2D(u_texture, v_tex_coord);
vec4 grad = texture2D(u_gradient, v_tex_coord);
if (val.a < 0.1 && grad.r < 1.0 && grad.a > 0.8) {
vec2 uv = gl_FragCoord.xy / u_sprite_size.xy*2.0-1.0;
float len = sin(16.*length(uv)-u_time*4.)*0.5+0.5 ;
vec3 col = vec3(len)*vec3(0.,0.98,.0);
gl_FragColor = vec4(col,1);
} else {
gl_FragColor = val;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment