blob: 1d55f24cdeae6efb33d7894eb86d8676c55a53cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
[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
|