14 lines
366 B
GLSL
14 lines
366 B
GLSL
#version 330
|
|
|
|
layout(location = 0) in vec3 pos;
|
|
layout(location = 1) in vec3 normal;
|
|
|
|
out float il;
|
|
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;
|
|
il = clamp(dot(n, -Ld), 0.0, 1.0);
|
|
gl_Position = proj * view * model * vec4(pos, 1.0);
|
|
}
|