Created
May 28, 2015 17:57
-
-
Save veeneck/eb5c947bc6d8f1efd598 to your computer and use it in GitHub Desktop.
Shadertoy: Wobble
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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