summaryrefslogtreecommitdiff
path: root/pbr/1.2.textured/pbr.vert
blob: 0ff1bdbd0702b17ade187e26d51c916bbd37829a (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(void)
{
	gl_Position = projection * view * model * vec4(position, 1.0);

	vert.position = vec3(model * vec4(position, 1.0));
	vert.normal = normalize(mat3(transpose(inverse(model))) * normal);
	vert.tex_coords = tex_coords;
}