1#version 430 2 3layout(location = 0) in vec4 in_position; 4layout(location = 1) in vec4 in_color; 5layout(location = 2) in int in_refInstanceIndex; 6 7layout(location = 0) out vec4 out_color; 8 9out gl_PerVertex { 10 vec4 gl_Position; 11}; 12 13void main() { 14 gl_Position = in_position; 15 if (gl_InstanceIndex == in_refInstanceIndex) 16 out_color = in_color; 17 else 18 out_color = vec4(1.0, 0.0, 0.0, 1.0); 19}