1#version 450 2 3layout (location = 0) out vec4 color; 4 5layout (location = 0) uniform struct { 6 float r; 7 float g; 8 float b; 9} parts[2] = { { 1.0, 1.0, 1.0}, { 0.0, 1.0, 0.0 } }; 10 11void main() { 12 color = vec4(0.0, 0.0, 0.0, 1.0); 13 14 for (int i = 0; i < 2; i++) { 15 color.r += parts[i].r; 16 color.g += parts[i].g; 17 color.b += parts[i].b; 18 } 19} 20