This repository has been archived on 2022-05-19. You can view files and clone it, but cannot push or open issues or pull requests.
DemoGL4D/shaders/cube.vs

27 lines
501 B
Text
Raw Normal View History

2022-05-16 13:21:07 +02:00
/* TP6 */
#version 330
layout(location = 0) in vec3 position;
layout(location = 1) in vec3 normal;
layout(location = 2) in vec2 texCoord;
uniform mat4 proj;
uniform mat4 modview;
uniform mat4 view;
out vec4 vsoColor;
out float il;
2022-05-16 12:42:53 +02:00
const vec3 Ld = vec3(0., -.7, -.7);
2022-05-17 17:10:41 +02:00
void main(void) {
2022-05-16 12:39:23 +02:00
vec3 n = (transpose(inverse(modview)) * vec4(normal, 0.)).xyz;
il = clamp(dot(n, -Ld), 0., 1.);
2022-05-15 21:09:27 +02:00
gl_Position = proj * view * modview * vec4(position, 1.);
vsoColor = vec4(texCoord, 0.5, 1);
}