#version 330
layout(location = 0) in vec3 pos;
layout(location = 1) in vec3 normal;
out float intensite_eclairage;
uniform mat4 proj, model, view;
void main() {
vec3 Ld = normalize(vec3(0.0, -0.2, -1.0));
vec3 n = normalize(transpose(inverse(view * model)) * vec4(normal, 0.0)).xyz;
intensite_eclairage = clamp(dot(n, -Ld), 0.0, 1.0);
gl_Position = proj * view * model * vec4(pos, 1.0);
}