]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - shaders/3d/vertex.glsl
Add diffuse lighting, improve skybox and add timelapse
[dragonblocks_alpha.git] / shaders / 3d / vertex.glsl
1 layout(location = 0) in vec3 vertexPosition;
2 layout(location = 1) in vec3 vertexNormal;
3 layout(location = 2) in float vertexTextureIndex;
4 layout(location = 3) in vec2 vertexTextureCoords;
5 layout(location = 4) in vec3 vertexColor;
6
7 out vec3 fragmentNormal;
8 out float fragmentTextureIndex;
9 out vec2 fragmentTextureCoords;
10 out vec3 fragmentColor;
11
12 uniform mat4 MVP;
13
14 void main()
15 {
16         gl_Position = MVP * vec4(vertexPosition, 1.0);
17
18         fragmentNormal = vertexNormal;
19         fragmentTextureIndex = vertexTextureIndex;
20         fragmentTextureCoords = vertexTextureCoords;
21         fragmentColor = vertexColor;
22 }