opengl-stuff/shaders/lighting_vertex.glsl

24 lines
504 B
Text
Raw Permalink Normal View History

2023-08-30 05:59:37 +03:00
#version 430 core
2023-07-25 11:52:12 +03:00
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aNormal;
layout (location = 2) in vec2 aTexCoords;
out vec3 Normal;
out vec3 FragPos;
out vec2 TexCoords;
2023-09-02 02:39:46 +03:00
layout(std140, binding = 0) uniform Matrices
{
mat4 projection;
mat4 view;
};
2023-07-25 11:52:12 +03:00
uniform mat4 model;
void main()
{
gl_Position = projection * view * model * vec4(aPos, 1.0);
FragPos = vec3(model * vec4(aPos, 1.0));
Normal = mat3(transpose(inverse(model))) * aNormal;
TexCoords = aTexCoords;
}