Created
February 2, 2016 12:33
-
-
Save co3moz/c224c4f84e4348975a3f to your computer and use it in GitHub Desktop.
Another Fragment :)
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
//co3moz | |
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform float time; | |
uniform vec2 resolution; | |
vec2 center = vec2(0.5, 0.5); | |
#define silindir(dis, ic) if(distance(pos, center) < dis && distance(pos, center) > ic) | |
#define silindir_cap(dis, genislik) silindir(dis, dis - genislik) | |
#define dondur(neyi, nekadar) temp = neyi.x; neyi.x = neyi.x * cos(nekadar) - neyi.y * sin(nekadar); neyi.y = temp * sin(nekadar) + neyi.y * cos(nekadar) | |
#define dongu(i, start, step, max) for(float i = start; i<max; i+=step) | |
void main() { | |
float temp; | |
vec2 pos = (gl_FragCoord.xy / resolution.xy); | |
vec3 color; | |
pos /= normalize(pos); | |
dondur(pos, sin(time)/10.); | |
color.x = sin(pos.x); | |
color.y = cos(pos.y); | |
color.z = cos(pos.x/pos.y); | |
dongu(i, 0.01, 0.01, 0.1) { | |
silindir_cap(0.4 - i * (8. * abs(sin(time) + 2.) / 2.), i) { | |
color = vec3(1); | |
} | |
} | |
color *= vec3(normalize(pos), 1); | |
gl_FragColor = vec4(color, 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment