summaryrefslogtreecommitdiff
path: root/advanced_lighting/9.ssao/gbuffer.vert
blob: 81ab9518fa77baf0e00324555eb4b51bbc07a5f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#version 330 core

layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;

out vert_t {
    vec3 position;
    vec3 normal;
} vert;

uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;

void main()
{
    vert.position = vec3(view * model * vec4(position, 1.0));
    mat3 matrix_normal = transpose(inverse(mat3(view * model)));
    vert.normal = matrix_normal * normal;
    gl_Position = projection * view * model * vec4(position, 1.0);
}