audio-vis/shaders/wave2d.frag

18 lines
294 B
GLSL
Raw Normal View History

2020-08-06 23:44:37 +02:00
#version 300 es
precision mediump float;
in vec4 pos;
2020-08-07 19:31:30 +02:00
uniform vec3 u_baseColor;
uniform vec3 u_maxColor;
2020-08-06 23:44:37 +02:00
out vec4 outColor;
void main() {
float y = pos.z;
if (y < 0.0) {
y = y * -1.0;
}
2020-08-07 19:31:30 +02:00
vec3 color = mix(u_baseColor, u_maxColor, y);
2020-08-06 23:44:37 +02:00
outColor = vec4(color, 1.0);
}