Created
November 14, 2023 22:32
-
-
Save bytesbysophie/3dce8842b87e524d706ceaa76b199570 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 () { | |
// SHADER EXPERIMENT @bytesbysophie | |
// PIXELS ON THE SCREEN | |
vec2 uv = uv(); | |
vec2 uv1 = uv; | |
// GROUP OF SQUARES | |
uv1= rotate(uv1, | |
vec2(0., 0.), | |
time * 0.1); | |
float squares = fract( | |
max( | |
abs(uv1.x), | |
abs(uv1.y) | |
) * 2.0 | |
); | |
squares = step(squares, 0.4); | |
// GROUP OF TRIANGLES | |
float triangles = fract( | |
max( | |
abs(uv.x) + uv.y * 0.5, | |
uv.y * (0.5 * 2.0) * -1.0 | |
) * 5.0 | |
); | |
// GROUP OF LINES | |
float lines = fract(uv.y * 5.0); | |
lines = step(lines, 2.); | |
// COLORS | |
vec3 red = vec3(1.0, 0.0, 0.0); | |
vec3 blue = vec3(0.3, 0.1, 0.3); | |
vec3 color = vec3(0.0, 0.0, 0.0); | |
// ADD DRAWN ELEMENTS | |
color = mix(color, white, squares); | |
color = mix(color, purple, triangles); | |
gl_FragColor = vec4(color, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment