1#version 450 2layout(triangles) in; 3layout(triangle_strip, max_vertices = 3) out; 4 5in gl_PerVertex { vec4 gl_Position; } gl_in[]; 6out gl_PerVertex { vec4 gl_Position; }; 7layout(location = 0) in vec4 in_color[]; 8layout(location = 0) out vec4 out_color; 9 10void main() { 11 for (int i=0; i<gl_in.length(); ++i) { 12 gl_Position = gl_in[i].gl_Position; 13 gl_ViewportIndex = int(round(gl_in[i].gl_Position.z * 3.0)); 14 out_color = in_color[i]; 15 EmitVertex(); 16 } 17 EndPrimitive(); 18} 19