blob: cc304b8effed72a320528254327e480667f372c5 [file] [log] [blame]
John Kessenich6c292d32016-02-15 20:58:50 -07001#version 400
2
John Kessenich55e7d112015-11-15 21:33:39 -07003uniform sampler2D samp2D;
John Kessenichf6eae2a2016-01-22 17:47:22 -07004in vec2 coord;
John Kessenich39374da2015-05-15 21:32:46 +00005
6struct lunarStruct1 {
7 int i;
8 float f;
9};
10
11struct lunarStruct2 {
12 int i;
13 float f;
14 lunarStruct1 s1_1;
15};
16
17struct lunarStruct3 {
18 lunarStruct2 s2_1[3];
19 int i;
20 float f;
21 lunarStruct1 s1_1;
22};
23
24
John Kessenich6c292d32016-02-15 20:58:50 -070025flat in lunarStruct1 foo;
26flat in lunarStruct2 foo2[5];
27flat in lunarStruct3 foo3;
28flat in int Count;
John Kessenich39374da2015-05-15 21:32:46 +000029
30void main()
31{
32 float scale;
33 int iLocal = Count;
34
35 if (foo3.s2_1[1].i > 0)
36 scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f;
37 else
38 scale = foo3.s2_1[0].s1_1.f;
39
40 //for (int i = 0; i < iLocal; ++i) {
41 // scale += foo2[i].f;
42 //}
43
John Kessenich55e7d112015-11-15 21:33:39 -070044 gl_FragColor = scale * texture(samp2D, coord);
John Kessenich39374da2015-05-15 21:32:46 +000045
46 vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0));
47 gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]);
48}
49