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
28
29
30
31
32
33
|
[require]
GLSL >= 1.10
[vertex shader]
varying vec4 color;
void main()
{
gl_Position = gl_Vertex;
color = vec4(gl_Vertex.xy, -gl_Vertex.xy);
}
[fragment shader]
varying vec4 color;
void main()
{
vec4 rgba = abs(color);
gl_FragColor = vec4(rgba.rgb, 1.0 - rgba.a);
}
[test]
draw rect -1 -1 2 2
relative probe rgba (0.0, 0.0) (1.0, 1.0, 1.0, 0.0)
relative probe rgba (0.1, 0.1) (0.8, 0.8, 0.8, 0.2)
relative probe rgba (0.2, 0.2) (0.6, 0.6, 0.6, 0.4)
relative probe rgba (0.3, 0.3) (0.4, 0.4, 0.4, 0.6)
relative probe rgba (0.4, 0.4) (0.2, 0.2, 0.2, 0.8)
relative probe rgba (0.5, 0.5) (0.0, 0.0, 0.0, 1.0)
relative probe rgba (0.6, 0.6) (0.2, 0.2, 0.2, 0.8)
relative probe rgba (0.7, 0.7) (0.4, 0.4, 0.4, 0.6)
relative probe rgba (0.8, 0.8) (0.6, 0.6, 0.6, 0.4)
relative probe rgba (0.9, 0.9) (0.8, 0.8, 0.8, 0.2)
relative probe rgba (1.0, 1.0) (1.0, 1.0, 1.0, 0.0)
|