Projekt-Grafika-Komputerowa/cw 6/shaders/shader_color.frag

18 lines
348 B
GLSL
Raw Normal View History

2022-01-23 19:43:27 +01:00
#version 410 core
uniform vec3 objectColor;
2022-02-10 16:21:08 +01:00
uniform vec4 objectColorTransparent;
2022-01-23 19:43:27 +01:00
uniform vec3 lightDir;
in vec3 interpNormal;
2022-02-10 16:21:08 +01:00
out vec4 Color;
2022-01-23 19:43:27 +01:00
void main()
{
vec3 normal = normalize(interpNormal);
float diffuse = max(dot(normal, -lightDir), 0.0);
2022-02-10 16:21:08 +01:00
//gl_FragColor = vec4(objectColor * diffuse, 1.0);
Color = objectColorTransparent * diffuse;
2022-01-23 19:43:27 +01:00
}