aboutsummaryrefslogtreecommitdiff
path: root/resources/shaders/shader.vert
blob: 52b86bae5912cd08c60ff556d53d4ac4e518727f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#version 330 core

layout(location = 0) in vec3 position; // Position of the vertex
layout(location = 1) in vec3 normal;   // Normal of the vertex

uniform mat4 proj;
uniform mat4 view;
uniform mat4 model;

uniform mat3 inverseTransposeModel;

out vec3 normal_cameraSpace;

void main() {
    normal_cameraSpace = normalize(inverse(transpose(mat3(view))) * inverseTransposeModel * normal);

    gl_Position = proj * view * model * vec4(position, 1);
}