John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 1 | #version 130
|
| 2 |
|
| 3 | uniform ivec4 uiv4;
|
| 4 | uniform vec4 uv4;
|
| 5 | uniform bool ub;
|
| 6 | uniform bvec4 ub41, ub42;
|
| 7 | uniform float uf;
|
| 8 | uniform int ui;
|
| 9 |
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 10 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 11 | uniform uvec4 uuv4;
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 12 | uniform uint uui;
|
| 13 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 14 |
|
| 15 | void main()
|
| 16 | {
|
| 17 | vec4 v;
|
| 18 | float f;
|
| 19 | bool b;
|
| 20 | bvec4 bv4;
|
| 21 | int i;
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 22 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 23 | uint u;
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 24 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 25 |
|
| 26 | // floating point
|
| 27 | v = radians(uv4);
|
| 28 | v += degrees(v);
|
| 29 | v += (i = ui*ui, sin(v));
|
| 30 | v += cos(v);
|
| 31 | v += tan(v);
|
| 32 | v += asin(v);
|
| 33 | v += acos(v);
|
| 34 |
|
| 35 | v += atan(v);
|
| 36 | v += sinh(v);
|
| 37 | v += cosh(v);
|
| 38 | v += tanh(v);
|
| 39 | v += asinh(v);
|
| 40 | v += acosh(v);
|
| 41 | v += atanh(v);
|
| 42 |
|
| 43 | v += pow(v, v);
|
| 44 | v += exp(v);
|
| 45 | v += log(v);
|
| 46 | v += exp2(v);
|
| 47 | v += log2(v);
|
| 48 | v += sqrt(v);
|
| 49 | v += inversesqrt(v);
|
| 50 | v += abs(v);
|
| 51 | v += sign(v);
|
| 52 | v += floor(v);
|
| 53 |
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 54 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 55 | v += trunc(v);
|
| 56 | v += round(v);
|
| 57 | v += roundEven(v);
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 58 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 59 |
|
| 60 | v += ceil(v);
|
| 61 | v += fract(v);
|
| 62 | v += mod(v, v);
|
| 63 | v += mod(v, v.x);
|
| 64 |
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 65 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 66 | v += modf(v, v);
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 67 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 68 |
|
| 69 | v += min(v, uv4);
|
| 70 | v += max(v, uv4);
|
| 71 | v += clamp(v, uv4, uv4);
|
| 72 | v += mix(v,v,v);
|
| 73 |
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 74 |
|
| 75 | v += mix(v,v,bv4);
|
| 76 | v += intBitsToFloat(ivec4(i));
|
| 77 | v += uintBitsToFloat(uv4);
|
| 78 | v += fma(v,v,v);
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 79 | v += frexp(v);
|
| 80 | v += ldexp(v);
|
| 81 | v += unpackUnorm2x16(v);
|
| 82 | v += unpackUnorm4x8(v);
|
| 83 | v += unpackSnorm4x8(v);
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 84 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 85 |
|
| 86 | v += step(v,v);
|
| 87 | v += smoothstep(v,v,v);
|
| 88 | v += step(uf,v);
|
| 89 | v += smoothstep(uf,uf,v);
|
| 90 | v += normalize(v);
|
| 91 | v += faceforward(v, v, v);
|
| 92 | v += reflect(v, v);
|
| 93 | v += refract(v, v, uf);
|
| 94 | v += dFdx(v);
|
| 95 | v += dFdy(v);
|
| 96 | v += fwidth(v);
|
| 97 | //noise*(v);
|
| 98 |
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 99 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 100 | // signed integer
|
| 101 | i += abs(ui);
|
| 102 | i += sign(i);
|
| 103 | i += min(i, ui);
|
| 104 | i += max(i, ui);
|
| 105 | i += clamp(i, ui, ui);
|
| 106 |
|
| 107 | floatsBitsToInt(v);
|
| 108 | packUnorm2x16(v);
|
| 109 | packUnorm4x8(v);
|
| 110 | packSnorm4x8(v);
|
| 111 |
|
| 112 | // unsigned integer
|
| 113 | u = abs(uui);
|
| 114 | u += sign(u);
|
| 115 | u += min(u, uui);
|
| 116 | u += max(u, uui);
|
| 117 | u += clamp(u, uui, uui);
|
| 118 | u += floatsBitToInt(v);
|
| 119 | u += packUnorm2x16(v);
|
| 120 | u += packUnorm4x8(v);
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 121 | i += uui & i; // ERRORs, no int/uint conversions before 400
|
| 122 | i += uui ^ i;
|
| 123 | i += i | uui;
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 124 |
|
| 125 | // bool
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 126 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 127 | b = isnan(uf);
|
John Kessenich | 4bfeed5 | 2016-01-22 15:40:24 -0700 | [diff] [blame] | 128 | b = isinf(v.y);
|
| 129 |
|
John Kessenich | 2f21fcc | 2015-06-17 16:15:09 +0000 | [diff] [blame] | 130 | b = any(lessThan(v, uv4));
|
| 131 | b = (b && any(lessThanEqual(v, uv4)));
|
| 132 | b = (b && any(greaterThan(v, uv4)));
|
| 133 | b = (b && any(greaterThanEqual(v, uv4)));
|
| 134 | b = (b && any(equal(ub41, ub42)));
|
| 135 | b = (b && any(notEqual(ub41, ub42)));
|
| 136 | b = (b && any(ub41));
|
| 137 | b = (b && all(ub41));
|
| 138 | b = (b && any(not(ub41)));
|
| 139 |
|
| 140 | i = ((i + ui) * i - ui) / i;
|
| 141 | i = i % ui;
|
| 142 | if (i == ui || i != ui && i == ui ^^ i != 2)
|
| 143 | ++i;
|
| 144 |
|
| 145 | f = ((uf + uf) * uf - uf) / uf;
|
| 146 |
|
| 147 | f += length(v);
|
| 148 | f += distance(v, v);
|
| 149 | f += dot(v, v);
|
| 150 | f += dot(f, uf);
|
| 151 | f += cross(v.xyz, v.xyz).x;
|
| 152 |
|
| 153 | if (f == uf || f != uf && f != 2.0)
|
| 154 | ++f;
|
| 155 |
|
| 156 | i &= ui;
|
| 157 | i |= 0x42;
|
| 158 | i ^= ui;
|
| 159 | i %= 17;
|
| 160 | i >>= 2;
|
| 161 | i <<= ui;
|
| 162 | i = ~i;
|
| 163 | b = !b;
|
| 164 |
|
| 165 | gl_FragColor = b ? vec4(i) + vec4(f) + v : v;
|
| 166 | }
|