slicedscreenquad.vert 272 B

12345678910111213141516171819
  1. in vec2 Position;
  2. in vec2 Texcoord;
  3. #ifndef VSLayer
  4. out int layer;
  5. #else
  6. flat out int slice;
  7. #endif
  8. void main() {
  9. #ifdef VSLayer
  10. gl_Layer = gl_InstanceID;
  11. slice = gl_InstanceID;
  12. #else
  13. layer = gl_InstanceID;
  14. #endif
  15. gl_Position = vec4(Position, 0., 1.);
  16. }