shadow.vert 571 B

12345678910111213141516171819202122232425262728293031
  1. uniform int layer;
  2. uniform mat4 ModelMatrix;
  3. #if __VERSION__ >= 330
  4. layout(location = 0) in vec3 Position;
  5. layout(location = 3) in vec2 Texcoord;
  6. #else
  7. in vec3 Position;
  8. in vec2 Texcoord;
  9. #endif
  10. #ifdef VSLayer
  11. out vec2 uv;
  12. #else
  13. out vec2 tc;
  14. out int layerId;
  15. #endif
  16. void main(void)
  17. {
  18. #ifdef VSLayer
  19. gl_Layer = layer;
  20. uv = Texcoord;
  21. gl_Position = ShadowViewProjMatrixes[gl_Layer] * ModelMatrix * vec4(Position, 1.);
  22. #else
  23. layerId = layer;
  24. tc = Texcoord;
  25. gl_Position = ShadowViewProjMatrixes[layerId] * ModelMatrix * vec4(Position, 1.);
  26. #endif
  27. }