GameEngineJava/TestGame/res/dev/euph/game/shader/default.vs.glsl
2024-08-28 21:39:49 +02:00

20 lines
569 B
GLSL

#version 330 core
layout (location = 0) in vec3 vertexPositions;
layout (location = 1) in vec2 textureCoords;
layout (location = 2) in vec3 normals;
uniform mat4 transformationMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
out vec2 passTextureCoords;
out vec3 passNormals;
void main() {
vec4 worldPosition = transformationMatrix * vec4(vertexPositions, 1.0);
gl_Position = projectionMatrix * (viewMatrix * worldPosition);
passTextureCoords = textureCoords;
passNormals = mat3(transpose(inverse(transformationMatrix))) * normals;
}