GameEngineJava/TestGame/res/dev/euph/game/shader/default.vs.glsl

21 lines
569 B
Text
Raw Normal View History

2023-11-13 21:31:36 +00:00
#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;
}