shadow_grass.vert 684 B

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