audio-vis/shaders/sphere.frag

17 lines
331 B
GLSL
Raw Normal View History

2020-04-05 15:28:22 +02:00
#version 300 es
precision highp float;
2020-04-07 21:44:46 +02:00
in vec4 fragNormal;
2020-04-05 15:28:22 +02:00
in vec3 v_surfaceToLight;
uniform vec4 u_color;
2020-04-07 21:44:46 +02:00
uniform vec3 u_light;
2020-04-05 15:28:22 +02:00
uniform vec3 u_lightPos;
out vec4 outColor;
void main() {
2020-04-07 21:44:46 +02:00
float light = max(dot(fragNormal.xyz, normalize(v_surfaceToLight).xyz), u_light.x);
2020-04-05 15:28:22 +02:00
outColor = u_color;
2020-04-07 21:44:46 +02:00
outColor.rgb *= light;
2020-04-05 15:28:22 +02:00
}