22 lines
293 B
GLSL
22 lines
293 B
GLSL
|
#version 430 core
|
||
|
|
||
|
uniform vec3 objectColor;
|
||
|
|
||
|
uniform vec3 lightDir;
|
||
|
|
||
|
in vec3 interpNormal;
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
|
||
|
normalize(interpNormal);
|
||
|
vec3 intensity = vec3(dot(interpNormal, 1 - lightDir));
|
||
|
|
||
|
normalize(intensity);
|
||
|
|
||
|
vec3 color = objectColor * intensity;
|
||
|
|
||
|
gl_FragColor = vec4(color, 1.0);
|
||
|
|
||
|
}
|