[require] GL >= 3.1 GLSL >= 1.40 [vertex shader passthrough] [fragment shader] #version 140 struct Set { vec3 color; float arr[3]; }; uniform Set u_s; void main () { gl_FragColor = vec4(u_s.color * u_s.arr[0], 1.0); // gl_FragColor = vec4(u_s.color * vec3(1.0, 0.0, 0.0), 1.0); } [test] uniform float u_s.arr[0] 1 uniform float u_s.arr[1] 0.8 uniform float u_s.arr[2] 0.6 uniform vec3 u_s.color 1 1 1 draw rect -1 -1 2 2