Created
December 20, 2019 17:01
-
-
Save julien/dac11f4fd2aaf751fbab993defc87a20 to your computer and use it in GitHub Desktop.
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
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 u_resolution; | |
uniform float u_time; | |
float draw_circle(vec2 position, float radius) { | |
return step(radius, length(position - vec2(.5))); | |
} | |
void main() { | |
vec2 position = gl_FragCoord.xy / u_resolution; | |
float r = abs(.5 + cos(u_time * .9)); | |
r *= .4; | |
position.x += .2 * cos(u_time * .8) * .2; | |
position.y += .4 * sin(u_time * .4 * sin(u_time * .01)) * .4; | |
float circle = draw_circle(position, .02 + r); | |
gl_FragColor = vec4(vec3(circle), 1.); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment