Maze generation
p.x + p.y * sign(texture(iChannel0,ceil(p)/2e1 ).r - .5)
で、 p.x + p.y
と p.x - p.y
をランダムに切り替えているLog-polarも使ってる
Mebius transformation
//Rotated coordinates
c = mat2(9,1,-1,9) * (I+I-r),
パースつけるのも簡単
// rot
p *= mat2(3, -1, 1, 3);
// Perspective
p /= (1. - p.y * 0.1) * 2.;
// Scroll
p.y += iTime;
整形済みコード
void mainImage(out vec4 O, vec2 I)
{
//Noise macro
#define N(x) texture(iChannel0,(x)/64.).r
//Res for scaling, position and scaled coordinates
vec2 r = iResolution.xy, c;
float steps = 10.;
//Iterate from -1 to +1 in 100 steps
for(float i=-1.; i<1.; i += 2. / steps) {
//Compute centered position with aberation scaling
c = (I+I-r)/r.y;
c /= .4;
c /= (1.0 + i / steps * .3); // aberation
c /= (.2 + N(c)); // noise
//Generate random frequency stripes
float n = N(N(c) + ceil(c) + iTime);
//Pick aberration color (starting red, ending in blue)
vec4 aber = vec4(1. + i, 2. - abs(i+i), 1.-i, 1);
//Generate random glitchy pattern (rotate in 45 degree increments)
O += ceil(
cos(
(c * mat2(cos(
ceil(N(c) * 8.) * .785 + vec4(0,33,11,0)
))).x / n
)
) * aber;
}
O /= steps;
}