Skip to content

Instantly share code, notes, and snippets.

@veeneck
Created May 28, 2015 17:57
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/eb5c947bc6d8f1efd598 to your computer and use it in GitHub Desktop.
Save veeneck/eb5c947bc6d8f1efd598 to your computer and use it in GitHub Desktop.
Shadertoy: Wobble
// https://www.shadertoy.com/view/XtsGDj
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 < 0.65 && grad.a > 0.8) {
float t = u_time;
vec2 uv = (gl_FragCoord.xy / u_sprite_size.xy)*2.0-1.0;
float angle = atan(uv.y,uv.x) + t;
float k = true ? sin(t)*2.0 : 1.0;
angle -= length(uv) * k;
vec3 gold = vec3(.0, 0.94, 0.0);
gl_FragColor = vec4(gold*vec3(cos(8.*angle)),1.0);
} else {
gl_FragColor = val;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment