blob: 0c9dc029d28fde845d96a529470e2ac860261d96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#version 330 core
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 tex_coords;
out VS_OUT {
vec3 position;
vec3 normal;
vec2 tex_coords;
} vs_out;
uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;
void main()
{
vs_out.position = vec3(model * vec4(position, 1.0));
mat3 normal_matrix = transpose(inverse(mat3(model)));
vs_out.normal = normalize(normal_matrix * normal);
vs_out.tex_coords = tex_coords;
gl_Position = projection * view * model * vec4(position, 1.0);
}
|