LearnOpenGL/shader.vs

22 lines
465 B
Plaintext
Raw Normal View History

2022-02-11 21:24:15 +00:00
#version 460 core
layout (location=0) in vec3 aPos;
layout (location=1) in vec3 aNormal;
2022-02-16 18:46:19 +00:00
layout (location=2) in vec2 aTexCoords;
2022-02-11 21:24:15 +00:00
2022-02-12 20:38:31 +00:00
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
out vec3 FragPos;
out vec3 Normal;
2022-02-16 18:46:19 +00:00
out vec2 TexCoords;
2022-02-11 21:24:15 +00:00
void main(){
2022-02-12 20:38:31 +00:00
gl_Position = projection * view * model * vec4(aPos , 1.0);
FragPos = vec3(model * vec4(aPos, 1.0));
Normal = mat3(transpose(inverse(model))) * aNormal;
2022-02-16 18:46:19 +00:00
TexCoords = aTexCoords;
2022-02-11 21:24:15 +00:00
}