1#version 100
2
3// Copyright Alastair F. Donaldson and Hugues Evrard, Imperial College London, 2017
4
5#ifdef GL_ES
6#ifdef GL_FRAGMENT_PRECISION_HIGH
7precision highp float;
8precision highp int;
9#else
10precision mediump float;
11precision mediump int;
12#endif
13#endif
14
15uniform vec2 injectionSwitch;
16
17void main()
18{
19    int r;
20    int g;
21    int b;
22    int a;
23    r = 100 * int(injectionSwitch.y);
24    g = int(injectionSwitch.x) * int(injectionSwitch.y);
25    b = 2 * int(injectionSwitch.x);
26    a = g - int(injectionSwitch.x);
27    for(
28        int i = 0;
29        i < 10;
30        i ++
31    )
32        {
33            r --;
34            g ++;
35            b ++;
36            a ++;
37            for(
38                int j = 1;
39                j < 10;
40                j ++
41            )
42                {
43                    a ++;
44                    b ++;
45                    g ++;
46                    r --;
47                }
48        }
49    float fr;
50    float fg;
51    float fb;
52    float fa;
53    fr = float(r / 100);
54    fg = float(g / 100);
55    fb = float(b / 100);
56    fa = float(a / 100);
57    gl_FragColor = vec4(r, g, b, a);
58}
59