#version 460 core
layout(location = 0) in vec3 position;
layout(location = 1) in vec3 normal;
layout(location = 2) in vec2 textureCoords;

uniform mat4 transformationMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;

out vec2 pass_textureCoords;
out vec3 surfaceNormal;
out vec3 worldPos;

void main() {
    vec4 worldPosition = transformationMatrix * vec4(position, 1.0f);
    gl_Position = projectionMatrix * viewMatrix * worldPosition;
    pass_textureCoords = textureCoords;

    surfaceNormal = mat3(transpose(inverse(transformationMatrix))) * normal;
    worldPos = worldPosition.xyz;

}