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 float blend;
|
| 4 | in vec4 u;
|
| 5 | bool p;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 6 |
|
John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 7 | in vec2 t;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 8 |
|
| 9 | void main()
|
| 10 | {
|
| 11 | float blendscale = 1.789;
|
| 12 |
|
| 13 | vec4 w = u;
|
| 14 | vec4 w_undef; // test undef
|
| 15 | vec4 w_dep = u; // test dependent swizzles
|
| 16 | vec4 w_reorder = u; // test reordering
|
| 17 | vec4 w2 = u;
|
| 18 | vec4 w_flow = u; // test flowControl
|
| 19 |
|
| 20 | w_reorder.z = blendscale;
|
| 21 |
|
| 22 | w.wy = t;
|
| 23 |
|
| 24 | w_reorder.x = blendscale;
|
| 25 |
|
| 26 | w2.xyzw = u.zwxy;
|
| 27 |
|
| 28 | w_reorder.y = blendscale;
|
| 29 |
|
| 30 | w_dep.xy = w2.xz;
|
| 31 | w_dep.zw = t;
|
| 32 |
|
| 33 | w_undef.xy = u.zw;
|
| 34 |
|
| 35 | if (p)
|
| 36 | w_flow.x = t.x;
|
| 37 | else
|
| 38 | w_flow.x = t.y;
|
| 39 |
|
| 40 | gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow);
|
| 41 |
|
| 42 | vec2 c = t;
|
| 43 | vec4 rep = vec4(0.0, 0.0, 0.0, 1.0);
|
| 44 |
|
| 45 | if (c.x < 0.0)
|
| 46 | c.x *= -1.0;
|
| 47 |
|
| 48 | if (c.x <= 1.0)
|
| 49 | rep.x = 3.4;
|
| 50 |
|
| 51 | gl_FragColor += rep;
|
| 52 | }
|