#version 450
#extension GL_ARB_separate_shader_objects : enable

layout(binding = 0) uniform UniformBufferObject {
    mat4 normalMat;
    mat4 view;
    mat4 proj;
} ubo;

layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inNormal;
layout(location = 2) in vec3 inColour;
layout(location = 3) in vec2 inTexCoord;
layout(location = 5) in vec3 extraColour;

layout(location = 0) out vec3 fragColour;
layout(location = 1) out vec2 fragTexCoord;
layout(location = 2) out vec3 fragExtraColour;

out gl_PerVertex {
    vec4 gl_Position;
};

void main() {
    mat4 modelView = ubo.view;
    vec3 vertexPosition = inPosition;
    if (inColour[0] != 0) {
        vertexPosition.y += 0.3;
    }
    gl_Position = ubo.proj * modelView * vec4(vertexPosition, 1.0);
    fragColour = inColour;
    fragTexCoord = inTexCoord;
    fragExtraColour = extraColour;
}