John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 1 | #version 140
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 2 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 3 | in vec4 bigColor;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 4 | in vec4 BaseColor;
|
| 5 | in float f;
|
| 6 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 7 | flat in int Count;
|
| 8 | flat in uvec4 v4;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 9 |
|
| 10 | void main()
|
| 11 | {
|
| 12 | vec4 color = BaseColor;
|
| 13 |
|
| 14 | for (int i = 0; i < Count; ++i) {
|
| 15 | color += bigColor;
|
| 16 | }
|
| 17 |
|
| 18 | gl_FragColor = color;
|
| 19 |
|
| 20 | float sum = 0.0;
|
| 21 | for (int i = 0; i < 4; ++i)
|
| 22 | sum += v4[i];
|
| 23 |
|
| 24 | vec4 tv4;
|
| 25 |
|
| 26 | for (int i = 0; i < 4; ++i)
|
| 27 | tv4[i] = v4[i] * 4u;
|
| 28 |
|
| 29 | gl_FragColor += vec4(sum) + tv4;
|
| 30 |
|
| 31 | vec4 r;
|
| 32 | r.xyz = BaseColor.xyz;
|
| 33 |
|
| 34 | for (int i = 0; i < Count; ++i)
|
| 35 | r.w = f;
|
| 36 |
|
| 37 | gl_FragColor.xyz += r.xyz;
|
| 38 |
|
| 39 | for (int i = 0; i < 16; i += 4)
|
| 40 | gl_FragColor *= f;
|
| 41 | }
|