vertex.vert 539 Bytes
Newer Older
Matthias Betz's avatar
Matthias Betz committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#version 330


// Incoming vertex position, Model Space.
layout (location = 0) in vec3 position;

// Incoming vertex color.
layout (location = 1) in vec3 color;

// Projection, view and model matrix.
uniform mat4 projViewModel;


// Outgoing color.
out vec3 interpolatedColor;


void main() {

    // Normally gl_Position is in Clip Space and we calculate it by multiplying together all the matrices
    gl_Position = projViewModel * vec4(position, 1);

    // We assign the color to the outgoing variable.
    interpolatedColor = color;
}