vertex.vert 500 Bytes
Newer Older
1
#version 150 core
Matthias Betz's avatar
Matthias Betz committed
2
3
4


// Incoming vertex position, Model Space.
5
in vec3 position;
Matthias Betz's avatar
Matthias Betz committed
6
7

// Incoming vertex color.
8
in vec3 color;
Matthias Betz's avatar
Matthias Betz committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

// 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;
}