This repository has been archived on 2023-05-27. You can view files and clone it, but cannot push or open issues or pull requests.
api8/shaders/manif.vs

15 lines
366 B
Text
Raw Normal View History

2023-05-01 01:00:50 +02:00
#version 330
layout(location = 0) in vec3 pos;
layout(location = 1) in vec3 normal;
2023-05-08 10:23:45 +02:00
out float il;
uniform mat4 proj, model, view;
2023-05-01 01:00:50 +02:00
void main() {
2023-05-08 10:23:45 +02:00
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);
2023-05-01 01:00:50 +02:00
}