John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 1 | #version 400
|
| 2 |
|
John Kessenich | 55e7d11 | 2015-11-15 21:33:39 -0700 | [diff] [blame] | 3 | uniform sampler2D samp2D;
|
John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 4 | in vec2 coord;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 5 |
|
| 6 | struct lunarStruct1 {
|
| 7 | int i;
|
| 8 | float f;
|
| 9 | };
|
| 10 |
|
| 11 | struct lunarStruct2 {
|
| 12 | int i;
|
| 13 | float f;
|
| 14 | lunarStruct1 s1_1;
|
| 15 | };
|
| 16 |
|
| 17 | struct lunarStruct3 {
|
| 18 | lunarStruct2 s2_1[3];
|
| 19 | int i;
|
| 20 | float f;
|
| 21 | lunarStruct1 s1_1;
|
| 22 | };
|
| 23 |
|
| 24 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 25 | flat in lunarStruct1 foo;
|
| 26 | flat in lunarStruct2 foo2[5];
|
| 27 | flat in lunarStruct3 foo3;
|
| 28 | flat in int Count;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 29 |
|
| 30 | void 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 Kessenich | 55e7d11 | 2015-11-15 21:33:39 -0700 | [diff] [blame] | 44 | gl_FragColor = scale * texture(samp2D, coord);
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 45 |
|
| 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 |
|