18 lines
294 B
GLSL
18 lines
294 B
GLSL
#version 300 es
|
|
precision mediump float;
|
|
|
|
in vec4 pos;
|
|
|
|
uniform vec3 u_baseColor;
|
|
uniform vec3 u_maxColor;
|
|
|
|
out vec4 outColor;
|
|
|
|
void main() {
|
|
float y = pos.z;
|
|
if (y < 0.0) {
|
|
y = y * -1.0;
|
|
}
|
|
vec3 color = mix(u_baseColor, u_maxColor, y);
|
|
outColor = vec4(color, 1.0);
|
|
} |