LearnOpenGL/shader.vs

20 lines
378 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-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-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-11 21:24:15 +00:00
}