Last active
September 5, 2021 18:13
-
-
Save CharStiles/e2c31bf39f441cea7fe277aaa109d2e5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void main() { | |
vec2 pos = uv(); // origin is in center | |
float r = sin(time + pos.x); | |
// x is left to right, why we see red moving from right to left think about us as a camera moving around | |
// sin returns a number from -1 to 1, and colors are from 0 to 1, so it clips to no red half the time | |
float g = sin(-time + pos.y * 20.); // higher frequency green stripes | |
float b = mod(pos.x / pos.y,1.0); | |
// when x is eual to y the colors will be brighter, mod repeats the space | |
// mod is like a sawtooth function | |
vec4 color = vec4(r,g,b,1); | |
gl_FragColor = color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment