[require] GLSL >= 1.10 [vertex shader] uniform int n; varying vec4 gl_TexCoord[5]; void main() { for (int i = 0; i < n; i++) { gl_TexCoord[i] = vec4(0.5, 0.5, 0.5, 0.5) * float(i); } gl_Position = gl_Vertex; } [fragment shader] uniform int index; varying vec4 gl_TexCoord[5]; void main() { gl_FragColor = gl_TexCoord[index]; } [test] uniform int index 1 uniform int n 4 draw rect -1 -1 2 2 probe rgba 1 1 0.5 0.5 0.5 0.5