No Description

depthpass.vert 596B

1234567891011121314151617181920212223242526272829
  1. #version 450
  2. layout (location = 0) in vec3 inPos;
  3. layout (location = 1) in vec2 inUV;
  4. // todo: pass via specialization constant
  5. #define SHADOW_MAP_CASCADE_COUNT 4
  6. layout(push_constant) uniform PushConsts {
  7. vec4 position;
  8. uint cascadeIndex;
  9. } pushConsts;
  10. layout (binding = 0) uniform UBO {
  11. mat4[SHADOW_MAP_CASCADE_COUNT] cascadeViewProjMat;
  12. } ubo;
  13. layout (location = 0) out vec2 outUV;
  14. out gl_PerVertex {
  15. vec4 gl_Position;
  16. };
  17. void main()
  18. {
  19. outUV = inUV;
  20. vec3 pos = inPos + pushConsts.position.xyz;
  21. gl_Position = ubo.cascadeViewProjMat[pushConsts.cascadeIndex] * vec4(pos, 1.0);
  22. }