No Description

outline.vert 405B

123456789101112131415161718192021222324
  1. #version 450
  2. layout (location = 0) in vec4 inPos;
  3. layout (location = 2) in vec3 inNormal;
  4. layout (binding = 0) uniform UBO
  5. {
  6. mat4 projection;
  7. mat4 model;
  8. vec4 lightPos;
  9. float outlineWidth;
  10. } ubo;
  11. out gl_PerVertex
  12. {
  13. vec4 gl_Position;
  14. };
  15. void main()
  16. {
  17. // Extrude along normal
  18. vec4 pos = vec4(inPos.xyz + inNormal * ubo.outlineWidth, inPos.w);
  19. gl_Position = ubo.projection * ubo.model * pos;
  20. }