• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 130
2uniform sampler2D sampler;
3varying vec2 coord;
4
5struct lunarStruct1 {
6    int i;
7    float f;
8};
9
10struct lunarStruct2 {
11    int i;
12    float f;
13    lunarStruct1 s1_1;
14};
15
16struct lunarStruct3 {
17    lunarStruct2 s2_1[3];
18    int i;
19    float f;
20    lunarStruct1 s1_1;
21};
22
23
24uniform lunarStruct1 foo;
25uniform lunarStruct2 foo2[5];
26uniform lunarStruct3 foo3;
27uniform int Count;
28
29void main()
30{
31    float scale;
32    int iLocal = Count;
33
34    if (foo3.s2_1[1].i > 0)
35        scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f;
36    else
37        scale = foo3.s2_1[0].s1_1.f;
38
39    //for (int i = 0; i < iLocal; ++i) {
40    //	scale += foo2[i].f;
41    //}
42
43    gl_FragColor =  scale * texture2D(sampler, coord);
44
45    vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0));
46    gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]);
47}
48
49