Advertisement
bigPasteGuy99

shader.vert

Jan 18th, 2022
1,173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 330 core
  2. layout (location = 0) in vec3 aPos;
  3. layout (location = 1) in vec3 aNormal;
  4. layout (location = 2) in vec2 aTexCoords;
  5.  
  6. out vec3 FragPos;
  7. out vec3 Normal;
  8. out vec2 TexCoords;
  9.  
  10. uniform mat4 model;
  11. uniform mat4 view;
  12. uniform mat4 projection;
  13.  
  14. void main()
  15. {
  16.     FragPos = vec3(model * vec4(aPos, 1.0));
  17.     Normal = mat3(transpose(inverse(model))) * normalize(aNormal);  
  18.     TexCoords = aTexCoords;
  19.    
  20.     gl_Position = projection * view * vec4(FragPos, 1.0);
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement