Start writing psychadelic code
This commit is contained in:
parent
e1f1c69824
commit
608e44b82a
@ -11,9 +11,17 @@ out vec4 fragColor;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 uv = gl_FragCoord.xy/vec2(u_canvasWidth, u_canvasHeight);
|
vec2 uv = gl_FragCoord.xy/vec2(u_canvasWidth, u_canvasHeight);
|
||||||
// Example: Create a moving color pattern
|
|
||||||
fragColor = vec4(sin(uv.x + u_time) * 0.5 + 0.5,
|
vec3 red = vec3(1.0, 0.0, 0.0);
|
||||||
sin(uv.y + u_time) * 0.5 + 0.5,
|
vec3 green = vec3(0.0, 1.0, 0.0);
|
||||||
sin(u_time) * 0.5 + 0.5,
|
vec3 blue = vec3(0.0, 0.0, 1.0);
|
||||||
1.0);
|
|
||||||
|
if (uv.x < 0.33) {
|
||||||
|
fragColor = vec4(red, 1.0);
|
||||||
|
} else if (uv.x < 0.66) {
|
||||||
|
fragColor = vec4(green, 1.0);
|
||||||
|
} else {
|
||||||
|
fragColor = vec4(blue, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user