Last active
November 14, 2023 22:35
-
-
Save bytesbysophie/de9a1e19aae316072a9019381413ad0e to your computer and use it in GitHub Desktop.
GLSL Workshop Creative Coding Cooking Club
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
void main () { | |
// PIXELS ON THE SCREEN | |
vec2 uv = uv(); | |
vec2 uv2 = uv; | |
vec2 uv1 = uv; | |
// GROUP OF SQUARES | |
uv1 = rotate(uv1, | |
vec2(0., 0.), | |
0.8 * -time * 0.1); | |
uv1 += noise(uv1 * time / 100.); | |
float squares1 = fract( | |
max( | |
abs(uv1.x), | |
abs(uv1.y) | |
) * 2.0 | |
); | |
squares1 = step(squares1, 0.7); | |
uv2 = rotate(uv2, | |
vec2(0., 0.), | |
time * 0.1); | |
float squares2 = fract( | |
max( | |
abs(uv2.x), | |
abs(uv2.y) | |
) * 2.0 | |
); | |
squares2 = step(squares2, 0.2); | |
// GROUP OF TRIANGLES | |
float triangles = fract( | |
max( | |
abs(uv.x) + uv.y * 0.5, | |
uv.y * (0.5 * 2.0) * -1.0 | |
) * 5.0 | |
); | |
triangles = step(triangles, 0.9); | |
// GROUP OF LINES | |
float lines = fract(uv.y * 5.0); | |
lines = step(lines, 0.3); | |
// COLORS | |
vec3 color = vec3(0.0, 0.0, 0.0); | |
vec3 red = vec3(1.0, 0.0, 0.0); | |
vec3 blue = vec3(0.5, 0.3, 0.8); | |
// ADD DRAWN ELEMENTS | |
color = vec3(squares2); | |
color = mix(color, blue, squares1); | |
gl_FragColor = vec4(color, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment