No Description

pbrtexture.vert 741B

1234567891011121314151617181920212223242526272829303132333435
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (location = 0) in vec3 inPos;
  5. layout (location = 1) in vec3 inNormal;
  6. layout (location = 2) in vec2 inUV;
  7. layout (binding = 0) uniform UBO
  8. {
  9. mat4 projection;
  10. mat4 model;
  11. mat4 view;
  12. vec3 camPos;
  13. } ubo;
  14. layout (location = 0) out vec3 outWorldPos;
  15. layout (location = 1) out vec3 outNormal;
  16. layout (location = 2) out vec2 outUV;
  17. out gl_PerVertex
  18. {
  19. vec4 gl_Position;
  20. };
  21. void main()
  22. {
  23. vec3 locPos = vec3(ubo.model * vec4(inPos, 1.0));
  24. outWorldPos = locPos;
  25. outNormal = mat3(ubo.model) * inNormal;
  26. outUV = inUV;
  27. outUV.t = 1.0 - inUV.t;
  28. gl_Position = ubo.projection * ubo.view * vec4(outWorldPos, 1.0);
  29. }