Spazer/src/psychadelic-graphics/psychadelicColors.frag.glsl

28 lines
526 B
Plaintext
Raw Normal View History

2025-02-12 03:17:45 -08:00
#version 300 es
precision highp float;
uniform float u_time;
uniform float u_canvasWidth;
uniform float u_canvasHeight;
out vec4 fragColor;
void main() {
vec2 uv = gl_FragCoord.xy/vec2(u_canvasWidth, u_canvasHeight);
2025-02-13 03:24:51 -08:00
vec3 red = vec3(1.0, 0.0, 0.0);
vec3 green = vec3(0.0, 1.0, 0.0);
vec3 blue = vec3(0.0, 0.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);
}
2025-02-12 03:17:45 -08:00
}