Açıklama Yok

shadow.geom 710B

1234567891011121314151617181920212223242526272829303132333435
  1. #version 420
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. #define LIGHT_COUNT 3
  5. layout (triangles, invocations = LIGHT_COUNT) in;
  6. layout (triangle_strip, max_vertices = 3) out;
  7. layout (binding = 0) uniform UBO
  8. {
  9. mat4 mvp[LIGHT_COUNT];
  10. vec4 instancePos[3];
  11. } ubo;
  12. layout (location = 0) in int inInstanceIndex[];
  13. out gl_PerVertex
  14. {
  15. vec4 gl_Position;
  16. };
  17. void main()
  18. {
  19. vec4 instancedPos = ubo.instancePos[inInstanceIndex[0]];
  20. for (int i = 0; i < gl_in.length(); i++)
  21. {
  22. gl_Layer = gl_InvocationID;
  23. vec4 tmpPos = gl_in[i].gl_Position + instancedPos;
  24. gl_Position = ubo.mvp[gl_InvocationID] * tmpPos;
  25. EmitVertex();
  26. }
  27. EndPrimitive();
  28. }