blob: 1e825c830729b65f5de4ac1b587342a762041887 (
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 vert_t {
vec3 position;
vec3 normal;
vec2 tex_coords;
} vert;
uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;
void main()
{
vert.position = vec3(model * vec4(position, 1.0));
mat3 matrix_normal = transpose(inverse(mat3(model)));
vert.normal = matrix_normal * normal;
vert.tex_coords = tex_coords;
gl_Position = projection * view * model * vec4(position, 1.0);
}
|