21 lines
569 B
Text
21 lines
569 B
Text
|
#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;
|
||
|
}
|