shader-crusher 0.1.3

A little helper to optimize glsl shaders for size.
Documentation
#version 410
#pragma 
uniform float iTime;
uniform float splitX;
layout (location = 0) out vec4 co;
layout (location = 0) in vec2 p;
uniform sampler2D textureSampler;
#pragma 
#define TEX(tc) texture(textureSampler,tc)
#define PI 3.1415926536
#define P2 (PI*0.5)
vec4 texRepX(float tx, float ty, float x, float y) {
return TEX(vec2((mod(tx, 0.25))+(x), ((ty)*(0.25))+(y)));
}
vec4 twister(vec2 p) {
vec2 pos = p;
(p).x = mod((p).x, splitX);
vec2 u = (p)*(1.4);
vec4 r = vec4(0.);
float v[4];
for (int i = 0;
(i)<(4); ++(i)) v[i] = ((0.5)*(sin((iTime)+(sin((u).x)))))+((0.25)*(sin(((2.5)*(sin(((u).x)*(cos(iTime)))))+((cos(iTime))+((P2)*(float(i)))))));
for (int i = 0;
(i)<(4); ++(i)) {
float n = v[int(mod((float(i))+(1.), 4.))], p = v[i];
if ((((n)-(p))>(0.))&&((((u).y)<(n))&&(((u).y)>(p)))) {
{
float k = (n)-(p), x = (((u).y)-(p))/(k);
r = TEX(vec2((max(0., min(1.1, mod((u).x, 1.1))))+(0.), (-(x))+(0.)));
}
}
}
return r;
}
void mainImage(out vec4 O, vec2 p) {
(p).x += sin(iTime);
float l = (length(p))*(0.7);
O = vec4(l, 0.2, (0.05)+((0.5)*(sin(iTime))), 1.);
vec4 slave3 = twister(p);
O = mix(O, slave3, (slave3).a);
}
void main() {
vec2 uv = vec2((p).x, ((p).y)*(0.5625));
mainImage(co, uv);
}