Aucune description

1234567891011121314151617181920212223242526272829303132
  1. #version 450
  2. layout (location = 0) in vec3 inPos;
  3. layout (location = 1) in vec3 inNormal;
  4. layout (binding = 0) uniform UBO
  5. {
  6. mat4 projection;
  7. mat4 model;
  8. mat4 view;
  9. vec3 camPos;
  10. } ubo;
  11. layout (location = 0) out vec3 outWorldPos;
  12. layout (location = 1) out vec3 outNormal;
  13. layout(push_constant) uniform PushConsts {
  14. vec3 objPos;
  15. } pushConsts;
  16. out gl_PerVertex
  17. {
  18. vec4 gl_Position;
  19. };
  20. void main()
  21. {
  22. vec3 locPos = vec3(ubo.model * vec4(inPos, 1.0));
  23. outWorldPos = locPos + pushConsts.objPos;
  24. outNormal = mat3(ubo.model) * inNormal;
  25. gl_Position = ubo.projection * ubo.view * vec4(outWorldPos, 1.0);
  26. }