]> git.lizzy.rs Git - dragonblocks_alpha.git/blobdiff - shaders/3d/vertex.glsl
Simplify database handling
[dragonblocks_alpha.git] / shaders / 3d / vertex.glsl
index 5eccd55de0b1dc27a2d720a31f8eef70595ac557..91948c0fb12015efb324cdeab5d6da45cc0b2a4a 100755 (executable)
@@ -1,19 +1,21 @@
-#version 330 core
+#version 460 core
 
 layout(location = 0) in vec3 vertexPosition;
-layout(location = 1) in vec2 vertexTextureCoords;
-layout(location = 2) in vec3 vertexColor;
+layout(location = 1) in float vertexTextureIndex;
+layout(location = 2) in vec2 vertexTextureCoords;
+layout(location = 3) in vec3 vertexColor;
 
+out float fragmentTextureIndex;
 out vec2 fragmentTextureCoords;
 out vec3 fragmentColor;
 
-uniform mat4 model;
-uniform mat4 view;
-uniform mat4 projection;
+uniform mat4 MVP;
 
 void main()
 {
-    gl_Position = projection * view * model * vec4(vertexPosition, 1.0);
+    gl_Position = MVP * vec4(vertexPosition, 1.0);
+
+    fragmentTextureIndex = vertexTextureIndex;
     fragmentTextureCoords = vertexTextureCoords;
        fragmentColor = vertexColor;
 }