Projekt-Grafika-Komputerowa/cw 6/shaders/shader_color.frag
2022-02-10 16:21:08 +01:00

18 lines
348 B
GLSL

#version 410 core
uniform vec3 objectColor;
uniform vec4 objectColorTransparent;
uniform vec3 lightDir;
in vec3 interpNormal;
out vec4 Color;
void main()
{
vec3 normal = normalize(interpNormal);
float diffuse = max(dot(normal, -lightDir), 0.0);
//gl_FragColor = vec4(objectColor * diffuse, 1.0);
Color = objectColorTransparent * diffuse;
}