X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=shaders%2F3d%2Fvertex.glsl;h=91948c0fb12015efb324cdeab5d6da45cc0b2a4a;hb=c5833cc31379c9d6da114a73b1741736666f3397;hp=5eccd55de0b1dc27a2d720a31f8eef70595ac557;hpb=bca9bcffd12548954d464a7548c88190d51cee10;p=dragonblocks_alpha.git diff --git a/shaders/3d/vertex.glsl b/shaders/3d/vertex.glsl index 5eccd55..91948c0 100755 --- a/shaders/3d/vertex.glsl +++ b/shaders/3d/vertex.glsl @@ -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; }