Nessuna descrizione

scene.vert 859B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #version 450
  2. layout (location = 0) in vec3 inPos;
  3. layout (location = 1) in vec2 inUV;
  4. layout (location = 2) in vec3 inColor;
  5. layout (location = 3) in vec3 inNormal;
  6. layout (binding = 0) uniform UBO {
  7. mat4 projection;
  8. mat4 view;
  9. mat4 model;
  10. } ubo;
  11. layout (location = 0) out vec3 outNormal;
  12. layout (location = 1) out vec3 outColor;
  13. layout (location = 2) out vec3 outViewPos;
  14. layout (location = 3) out vec3 outPos;
  15. layout (location = 4) out vec2 outUV;
  16. layout(push_constant) uniform PushConsts {
  17. vec4 position;
  18. uint cascadeIndex;
  19. } pushConsts;
  20. out gl_PerVertex {
  21. vec4 gl_Position;
  22. };
  23. void main()
  24. {
  25. outColor = inColor;
  26. outNormal = inNormal;
  27. outUV = inUV;
  28. vec3 pos = inPos + pushConsts.position.xyz;
  29. outPos = pos;
  30. outViewPos = (ubo.view * vec4(pos.xyz, 1.0)).xyz;
  31. gl_Position = ubo.projection * ubo.view * ubo.model * vec4(pos.xyz, 1.0);
  32. }