audio-vis/shaders/sphere.frag
VersusTune d1ae2059f7 WIP
2020-04-07 21:44:46 +02:00

19 lines
464 B
GLSL

#version 300 es
// fragment shaders don't have a default precision so we need
// to pick one. mediump is a good default. It means "medium precision"
precision highp float;
in vec4 fragNormal;
in vec3 v_surfaceToLight;
uniform vec4 u_color;
uniform vec3 u_light;
uniform vec3 u_lightPos;
out vec4 outColor;
void main() {
float light = max(dot(fragNormal.xyz, normalize(v_surfaceToLight).xyz), u_light.x);
outColor = u_color;
outColor.rgb *= light;
}