/*{ "DESCRIPTION": "Digital microscope micro-ecosystem. Fourteen large organisms — amoeba host, flagellates, ciliates, jellies, digital diatoms, darter symbiote, paramecia, volvox colony, a lobed medusa, a second amoeba and a giant drifting jelly — swim through multicolored plankton with streamlining bodies, bow waves and fluid wakes. Membranes warp constantly with traveling waves, breathing harmonics and drifting noise. A swarm of ten micro-fauna and eight round spike-protein viruses (15s infection cycle with green glitch corruption) fill the medium. Every 20s the host slowly stalks a victim, absorbs and dissolves it, and later the victim glides back out reborn. Diatom and darter live in symbiosis; others wrestle gently on contact. All under a lens with reticle, scanlines and barrel distortion.", "CREDIT": "CC0", "CATEGORIES": ["generator"], "INPUTS": [ {"NAME":"speed","TYPE":"float","DEFAULT":1.0,"MIN":0.0,"MAX":3.0}, {"NAME":"grain","TYPE":"float","DEFAULT":0.6,"MIN":0.4,"MAX":2.5}, {"NAME":"emit","TYPE":"float","DEFAULT":1.0,"MIN":0.0,"MAX":2.0}, {"NAME":"warpAmt","TYPE":"float","DEFAULT":1.0,"MIN":0.0,"MAX":2.5}, {"NAME":"wiggle","TYPE":"float","DEFAULT":1.0,"MIN":0.0,"MAX":2.5}, {"NAME":"hueShift","TYPE":"float","DEFAULT":0.0,"MIN":0.0,"MAX":1.0} ] }*/ #define TAU 6.28318530718 float h11(float n){ return fract(sin(n*127.1)*43758.5453123); } float h21(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7)))*43758.5453123); } vec2 h22(vec2 p){ p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3))); return fract(sin(p)*43758.5453123); } float vnoise(vec2 p){ vec2 i = floor(p), f = fract(p); vec2 u = f*f*(3.0-2.0*f); float a = h21(i); float b = h21(i+vec2(1.0,0.0)); float c = h21(i+vec2(0.0,1.0)); float d = h21(i+vec2(1.0,1.0)); return mix(mix(a,b,u.x), mix(c,d,u.x), u.y); } vec2 rot(vec2 v, float a){ float c = cos(a), s = sin(a); return vec2(c*v.x - s*v.y, s*v.x + c*v.y); } vec3 sandColor(float h){ h = fract(h + hueShift); float s = h*5.0; vec3 c = vec3(0.86, 0.64, 0.36); c = mix(c, vec3(0.79, 0.37, 0.24), step(1.0, s)); c = mix(c, vec3(0.25, 0.66, 0.62), step(2.0, s)); c = mix(c, vec3(0.56, 0.41, 0.76), step(3.0, s)); c = mix(c, vec3(0.93, 0.87, 0.70), step(4.0, s)); return c; } float seg(float k, float f, float o){ return mix(h11(k*13.73 + o*57.19), h11((k+1.0)*13.73 + o*57.19), f); } // silhouette: harmonics + FOUR traveling membrane waves (constant fluid // warping) + per-type noise + optional hex facet float shapeR(float a, vec3 amp, vec3 ph, float wob, float wA, float hexA, float flu, float tw){ float r = 1.0 + 0.35*amp.x*sin(2.0*a + ph.x) + 0.30*amp.y*sin(3.0*a + ph.y) + 0.22*amp.z*sin(5.0*a + ph.z) + hexA*cos(6.0*a + ph.x); r += flu*(0.08*sin(a - tw*0.55) + 0.13*sin(2.0*a - tw*1.1) + 0.10*sin(3.0*a + tw*0.8) + 0.07*sin(4.0*a - tw*1.5)); r += wA*(vnoise(vec2(cos(a), sin(a))*2.2 + wob) - 0.5); return 0.17*max(r, 0.15); } vec2 targ(float k, float o){ return (h22(vec2(k*1.111 + 4.7 + o, k*2.313 + 9.1 + o*1.7)) - 0.5)*vec2(1.50, 1.20); } float segd(vec2 p, vec2 a, vec2 b){ vec2 ab = b - a, ap = p - a; float h = clamp(dot(ap, ab)/(dot(ab, ab) + 1e-5), 0.0, 1.0); return length(ap - ab*h); } // paths for nine organisms: 0 amoeba host, 1 flagellate, 2 ciliate, 3 jelly // (orbiters), 4 diatom + 5 darter (symbiotic pair), 6 paramecium, // 7 volvox colony, 8 lobed medusa (independent rovers) vec2 orgCenterBase(float fi, float t){ float mtt = t/5.0; float kk = floor(mtt); float ff = fract(mtt); ff = ff*ff*ff*(ff*(ff*6.0 - 15.0) + 10.0); vec2 c0 = mix(targ(kk, 0.0), targ(kk+1.0, 0.0), ff) + 0.03*vec2(sin(t*1.2), cos(t*0.9)); vec2 c = c0; if (fi >= 0.5 && fi < 3.5){ float dir = mix(-1.0, 1.0, step(0.5, h11(fi*5.9))); float oa = dir*t*(0.28 + 0.20*h11(fi*5.1)) + TAU*h11(fi*9.2); float mrg = seg(kk, ff, 40.0 + fi*3.0); float orad = (0.26 + 0.09*fi)*smoothstep(0.18, 0.55, mrg) + 0.03 + 0.04*sin(t*0.5 + fi*2.1); c = c0 + max(orad, 0.02)*vec2(cos(oa), sin(oa)); } else if (fi >= 3.5 && fi < 5.5){ vec2 c4 = mix(targ(kk, 148.0), targ(kk+1.0, 148.0), ff) + 0.04*vec2(sin(t*1.0), cos(t*1.2)); c = c4; if (fi >= 4.5){ float sa = t*0.7 + 2.0; c = c4 + (0.15 + 0.04*sin(t*0.8))*vec2(cos(sa), sin(sa)); } } else if (fi >= 5.5){ c = mix(targ(kk, fi*53.0), targ(kk+1.0, fi*53.0), ff) + 0.05*vec2(sin(t*0.8 + fi), cos(t*0.9 + fi*1.3)); } // absorption: this epoch's victim sinks into the host, later re-emerges float E = floor(t/20.0); float e = fract(t/20.0); float vic = 1.0 + floor(h11(E*3.77 + 5.0)*12.999); if (abs(fi - vic) < 0.5){ float pull = smoothstep(0.38, 0.52, e)*(1.0 - smoothstep(0.86, 0.96, e)); c = mix(c, c0, pull); } return c; } vec2 orgPos(float fi, float t){ vec2 c = orgCenterBase(fi, t); if (fi < 0.5){ float E = floor(t/20.0); float e = fract(t/20.0); float vic = 1.0 + floor(h11(E*3.77 + 5.0)*12.999); float lw = smoothstep(0.25, 0.40, e)*(1.0 - smoothstep(0.55, 0.68, e)); vec2 cp = orgCenterBase(vic, t); c += (cp - c)*0.50*lw; } return c; } // budding daughter cell: born by division from one organism, drifts free, // then merges into a different organism (25s divide-recombine cycle) vec2 daughterPos(float t){ float Ed = floor(t/25.0 + 0.4); float ph2 = fract(t/25.0 + 0.4); float divF = 1.0 + floor(h11(Ed*9.31 + 7.0)*12.999); float accF = 1.0 + floor(h11(Ed*4.57 + 11.0)*12.999); if (abs(accF - divF) < 0.5) accF = mod(accF, 13.0) + 1.0; vec2 dc = orgPos(divF, t); vec2 ac = orgPos(accF, t); float budv = smoothstep(0.25, 0.45, ph2); float mrgv = smoothstep(0.75, 0.95, ph2); float sa = t*0.35 + Ed*2.7; return mix(dc + 0.32*budv*vec2(cos(sa), sin(sa)), ac, mrgv); } // wandering path for robotic bug creatures vec2 bugPath(float id, float t){ vec2 s = h22(vec2(id*7.3 + 3.0, id*2.1 + 9.0)); vec2 c = vec2((s.x - 0.5)*1.55, (s.y - 0.5)*1.20); c += 0.40*vec2(sin(t*(0.22 + 0.10*s.x) + id*2.0), cos(t*(0.18 + 0.10*s.y) + id*3.0)); return c; } // neon digital / alien palette (cosine gradient) vec3 digiColor(float h){ return 0.55 + 0.45*cos(TAU*(h + vec3(0.0, 0.33, 0.67))); } // wandering path for the digital alien organisms vec2 digiPath(float id, float t){ vec2 s = h22(vec2(id*5.7 + 2.0, id*3.3 + 6.0)); vec2 c = vec2((s.x - 0.5)*1.45, (s.y - 0.5)*1.10); c += 0.30*vec2(sin(t*(0.18 + 0.12*s.x) + id*1.7), cos(t*(0.15 + 0.10*s.y) + id*2.3)); return c; } vec2 microPos(float fm, float t){ vec2 s1 = h22(vec2(fm*3.1 + 7.0, fm*5.7 + 2.0)); vec2 s2 = h22(vec2(fm*9.3 + 1.0, fm*2.9 + 8.0)); vec2 c = vec2((s1.x - 0.5)*1.6, (s1.y - 0.5)*1.2); c += 0.32*vec2(sin(t*(0.15 + 0.25*s2.x) + fm*2.0), cos(t*(0.12 + 0.22*s2.y) + fm*4.0)); return c; } vec3 idColor(float fi){ return sandColor(h11(fi*2.71) + 0.03*fi); } // per-organism spin speed (rad/s), each its own direction float rotSpd(float fi){ return (h11(fi*4.91 + 2.0) - 0.5)*0.5; } void main(){ vec2 uv = gl_FragCoord.xy / RENDERSIZE; float asp = RENDERSIZE.x / RENDERSIZE.y; vec2 pl = (uv*2.0 - 1.0)*vec2(asp, 1.0); vec2 p = pl*(1.0 + 0.06*dot(pl, pl)); float tt = TIME*speed; p = rot(p, tt*0.02); // slow microscope-stage rotation (lens stays fixed) float mt = tt/5.0; float k = floor(mt); float sf = fract(mt); sf = sf*sf*sf*(sf*(sf*6.0 - 15.0) + 10.0); // === hero cast (14) + slot 14 = the budding daughter cell === vec2 cs[15]; vec3 amps[15]; vec3 phs[15]; float scl[15]; float wobA[15]; float wspd[15]; float hexA[15]; float ampM[15]; float flu[15]; float el[15]; wobA[0]=0.22; wspd[0]=0.42; hexA[0]=0.00; ampM[0]=1.00; flu[0]=1.00; el[0]=0.00; // amoeba wobA[1]=0.08; wspd[1]=0.50; hexA[1]=0.00; ampM[1]=0.50; flu[1]=0.60; el[1]=0.00; // flagellate wobA[2]=0.12; wspd[2]=0.55; hexA[2]=0.00; ampM[2]=0.80; flu[2]=0.80; el[2]=0.00; // ciliate wobA[3]=0.30; wspd[3]=0.20; hexA[3]=0.00; ampM[3]=0.60; flu[3]=1.20; el[3]=0.00; // jelly wobA[4]=0.05; wspd[4]=0.25; hexA[4]=0.14; ampM[4]=0.40; flu[4]=0.25; el[4]=0.00; // diatom wobA[5]=0.08; wspd[5]=0.60; hexA[5]=0.00; ampM[5]=0.50; flu[5]=0.60; el[5]=0.00; // darter wobA[6]=0.10; wspd[6]=0.45; hexA[6]=0.00; ampM[6]=0.35; flu[6]=0.70; el[6]=0.35; // paramecium wobA[7]=0.06; wspd[7]=0.18; hexA[7]=0.00; ampM[7]=0.25; flu[7]=0.45; el[7]=0.00; // volvox wobA[8]=0.28; wspd[8]=0.28; hexA[8]=0.00; ampM[8]=1.20; flu[8]=1.40; el[8]=0.00; // medusa wobA[9]=0.24; wspd[9]=0.35; hexA[9]=0.00; ampM[9]=1.10; flu[9]=1.10; el[9]=0.00; // amoeba II wobA[10]=0.05; wspd[10]=0.22; hexA[10]=0.12; ampM[10]=0.45; flu[10]=0.30; el[10]=0.15; // diatom II wobA[11]=0.26; wspd[11]=0.15; hexA[11]=0.00; ampM[11]=0.70; flu[11]=1.50; el[11]=0.00; // giant jelly wobA[12]=0.10; wspd[12]=0.48; hexA[12]=0.00; ampM[12]=0.40; flu[12]=0.75; el[12]=0.45; // paramecium II wobA[13]=0.08; wspd[13]=0.52; hexA[13]=0.00; ampM[13]=0.55; flu[13]=0.65; el[13]=0.00; // flagellate II for (int i = 0; i < 14; i++){ float fi = float(i); float o = fi*11.0; // breathing harmonics: each weight swells and relaxes continuously vec3 br = vec3(0.70) + 0.45*vec3(sin(tt*0.43 + fi), sin(tt*0.57 + fi*1.7), sin(tt*0.37 + fi*2.9)); amps[i] = vec3(seg(k, sf, 1.0+o), seg(k, sf, 2.0+o), seg(k, sf, 3.0+o))*ampM[i]*br; phs[i] = TAU*vec3(seg(k, sf, 4.0+o), seg(k, sf, 5.0+o), seg(k, sf, 6.0+o)) + tt*vec3(0.26, -0.19, 0.15)*(1.0 + 0.3*h11(fi+0.7)); cs[i] = orgPos(fi, tt); if (i == 0) scl[i] = 0.95; else if (i < 4) scl[i] = 0.32 + 0.10*h11(fi*3.3); else if (i == 4) scl[i] = 0.60; else if (i == 5) scl[i] = 0.42; else if (i == 6) scl[i] = 0.62; else if (i == 7) scl[i] = 0.78; else if (i == 8) scl[i] = 0.70; else if (i == 9) scl[i] = 0.80; else if (i == 10) scl[i] = 0.55; else if (i == 11) scl[i] = 0.85; else if (i == 12) scl[i] = 0.50; else scl[i] = 0.55; } scl[3] *= 1.0 + 0.07*sin(tt*1.2); scl[7] *= 1.0 + 0.04*sin(tt*0.7); // volvox slow swell // === division & recombination: daughter buds off divF, merges into accF === float Ed = floor(tt/25.0 + 0.4); float dphase = fract(tt/25.0 + 0.4); float divF = 1.0 + floor(h11(Ed*9.31 + 7.0)*12.999); float accF = 1.0 + floor(h11(Ed*4.57 + 11.0)*12.999); if (abs(accF - divF) < 0.5) accF = mod(accF, 13.0) + 1.0; float bud = smoothstep(0.25, 0.45, dphase); float mrg2 = smoothstep(0.75, 0.95, dphase); float dScl = smoothstep(0.25, 0.42, dphase)*(1.0 - smoothstep(0.88, 0.97, dphase)); float sDiv = 0.5; for (int i = 1; i < 14; i++){ float fi2 = float(i); if (abs(fi2 - divF) < 0.5){ sDiv = scl[i]; wobA[14] = wobA[i]; wspd[14] = wspd[i]; hexA[14] = hexA[i]; ampM[14] = ampM[i]; flu[14] = flu[i]; el[14] = el[i]; scl[i] *= 1.0 - 0.15*bud*(1.0 - mrg2); // parent thins while budding } if (abs(fi2 - accF) < 0.5){ scl[i] *= 1.0 + 0.10*smoothstep(0.85, 0.95, dphase) *(1.0 - smoothstep(0.98, 1.0, dphase)); // acceptor swells on merge } } { float o14 = divF*11.0 + 0.5; vec3 br14 = vec3(0.70) + 0.45*vec3(sin(tt*0.43 + 14.0), sin(tt*0.57 + 23.8), sin(tt*0.37 + 40.6)); amps[14] = vec3(seg(k, sf, 1.0+o14), seg(k, sf, 2.0+o14), seg(k, sf, 3.0+o14))*ampM[14]*br14; phs[14] = TAU*vec3(seg(k, sf, 4.0+o14), seg(k, sf, 5.0+o14), seg(k, sf, 6.0+o14)) + tt*vec3(0.26, -0.19, 0.15); cs[14] = daughterPos(tt); scl[14] = sDiv*0.60*max(dScl, 0.02); } vec2 vel[15]; for (int i = 0; i < 14; i++){ vel[i] = (cs[i] - orgPos(float(i), tt - 0.25))*4.0; } vel[14] = (cs[14] - daughterPos(tt - 0.25))*4.0; // === predation epoch === float E = floor(tt/20.0); float e = fract(tt/20.0); float vic = 1.0 + floor(h11(E*3.77 + 5.0)*12.999); float vicScale = 1.0 - smoothstep(0.40, 0.56, e) + smoothstep(0.88, 1.0, e); vec2 vicC = cs[1]; for (int i = 1; i < 14; i++){ if (abs(float(i) - vic) < 0.5){ vicC = cs[i]; scl[i] *= max(vicScale, 0.02); } } scl[0] *= 1.0 + 0.15*smoothstep(0.46, 0.56, e)*(1.0 - smoothstep(0.85, 1.0, e)); float feedW = smoothstep(0.36, 0.44, e)*(1.0 - smoothstep(0.54, 0.62, e)); // === virus infection cycle === float Ei = floor(tt/15.0); float ei = fract(tt/15.0); float tOrg = floor(h11(Ei*7.13 + 3.0)*13.999); float infW = smoothstep(0.15, 0.30, ei)*(1.0 - smoothstep(0.75, 0.90, ei)); // === contacts: wrestling + collision + top-2 contact points, ONE pass === vec2 adj[15]; float wsn[15]; for (int i = 0; i < 15; i++){ adj[i] = vec2(0.0); wsn[i] = sin(tt*3.0 + float(i)*7.0); // wrestle phase, hoisted from pair loop } float pr1 = 0.0, pr2 = 0.0; vec2 mid1 = vec2(0.0), mid2 = vec2(0.0); // collision only among the 10 core organisms (45 pairs, not 105); // the smaller/secondary swimmers and the transient daughter pass through for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ if (j > i){ vec2 d = cs[i] - cs[j]; float d2 = dot(d, d); float rrW = 0.22*(scl[i] + scl[j]) + 0.10; // daughter passes freely through its parent and its acceptor bool dau = (j == 14 && (abs(float(i) - divF) < 0.5 || abs(float(i) - accF) < 0.5)); if (d2 < rrW*rrW && !dau){ float dl = sqrt(d2) + 1e-4; vec2 dn = d/dl; float rrC = 0.20*(scl[i] + scl[j]) + 0.04; float ov = max(rrC - dl, 0.0); vec2 pushv = dn*(ov*ov/rrC)*0.55; adj[i] += pushv; adj[j] -= pushv; bool symb = (i == 4 && j == 5); bool feed = (i == 0 && abs(float(j) - vic) < 0.5 && e > 0.25 && e < 0.65); if (!symb && !feed){ float pr = 1.0 - smoothstep(rrW*0.55, rrW, dl); vec2 sh = pr*0.007*vec2(wsn[i], wsn[j]); adj[i] += sh; adj[j] -= sh; vec2 cm = 0.5*(cs[i] + cs[j]); if (pr > pr1){ pr2 = pr1; mid2 = mid1; pr1 = pr; mid1 = cm; } else if (pr > pr2){ pr2 = pr; mid2 = cm; } } } } } } for (int i = 0; i < 15; i++){ cs[i] += adj[i]; } vec2 tCen = cs[0]; float tScl = scl[0]; for (int i = 0; i < 14; i++){ if (abs(float(i) - tOrg) < 0.5){ tCen = cs[i]; tScl = scl[i]; } } // === distance + fluid field === float sds[15]; float minSd = 9.0; vec2 warp = vec2(0.0); for (int i = 0; i < 15; i++){ float fi = float(i); vec2 pd = p - cs[i]; float lp = length(pd); // cheap far-cull: skip the expensive silhouette+warp for distant organisms // (their membrane detail and fluid influence are both ~0 out here) if (lp - 0.28*scl[i] > 0.16){ float sdA = lp - 0.17*scl[i]; // conservative circular distance sds[i] = sdA; minSd = min(minSd, sdA); continue; } float a = atan(pd.y, pd.x); float ms = clamp(length(vel[i])*3.0, 0.0, 0.85); float va = atan(vel[i].y, vel[i].x + 1e-5); // body spin: whole silhouette rotates (diatoms spin double, rigid rotors) float rotO = tt*rotSpd(fi)*((i == 4 || i == 10) ? 2.0 : 1.0); float R = shapeR(a - rotO, amps[i], phs[i], fi*7.0 + tt*wspd[i], wobA[i]*min(wiggle, 1.5), hexA[i], flu[i]*wiggle, tt*(0.9 + 0.2*h11(fi*1.3)))*scl[i]; R *= 1.0 + 0.22*ms*cos(2.0*(a - va)) + 0.16*ms*max(0.0, -cos(a - va)); // paramecium: slipper elongation along a slowly turning axis R *= 1.0 + el[i]*cos(2.0*(a - (tt*0.15 + fi*2.0))); float sd = lp - R; sds[i] = sd; minSd = min(minSd, sd); float infl = exp(-max(sd, 0.0)*5.0); vec2 push = pd/(lp + 1e-4); warp += (push*0.20 + vec2(-push.y, push.x)*0.10*sin(tt*0.5 + fi*1.3))*infl; warp += vel[i]*0.30*infl; } // shockwaves/flashes only from the two strongest contacts (heavy math ×2, // not ×91) float flash = 0.0; for (int cI = 0; cI < 2; cI++){ float prS = (cI == 0) ? pr1 : pr2; vec2 midS = (cI == 0) ? mid1 : mid2; if (prS > 0.001){ vec2 dm = p - midS; float dd = length(dm) + 1e-3; warp += prS * 0.03*sin(dd*16.0 - tt*3.5) * dm/dd * exp(-dd*3.5); flash += prS * exp(-dd*6.0); } } warp += 0.10*vec2(vnoise(p*2.1 + tt*0.20) - 0.5, vnoise(p*2.6 - tt*0.17) - 0.5); vec2 q = p - warp*warpAmt; // === medium === vec3 col = mix(vec3(0.012, 0.030, 0.034), vec3(0.028, 0.058, 0.060), uv.y); col += 0.030*vnoise(p*3.0 + tt*0.05); for (int m = 0; m < 2; m++){ float fm = float(m); vec2 bp = vec2(sin(tt*0.07 + fm*2.1)*0.8*asp, cos(tt*0.05 + fm*1.3)*0.7); col += vec3(0.035, 0.085, 0.080)*exp(-dot(p - bp, p - bp)*(5.0 + fm*3.0)); } // === plankton === float inflAll = exp(-max(minSd, 0.0)*5.0); for (int i = 0; i < 2; i++){ float fi = float(i); float dep = fi; float sc = mix(16.0, 46.0, h11(fi*3.17 + 0.5))*grain; float rotA = h11(fi*7.77)*TAU; vec2 flow = vec2((h11(fi*5.13) - 0.5)*0.05, 0.030 + 0.040*h11(fi*9.31))*tt; vec2 w = vec2(vnoise(q*1.8 + fi*11.0 + tt*0.10), vnoise(q*1.8 - fi*7.0 - tt*0.12)) - 0.5; vec2 jig2 = inflAll*0.008*vec2(sin(tt*6.0 + fi*2.0), cos(tt*5.0 + fi*3.0)); vec2 g = rot(q + flow + w*0.14 + jig2, rotA)*sc; vec2 cellId = floor(g); vec2 rnd = h22(cellId + fi*37.0); vec2 gp = cellId + 0.5 + (rnd - 0.5)*0.9; float ddg = length(g - gp); float grad = 0.10 + 0.16*h21(cellId*1.31 + fi); float m = 1.0 - smoothstep(grad*0.4, grad, ddg); m *= smoothstep(-0.01, 0.08, minSd); m *= 0.35 + 0.65*dep; float tw2 = 0.75 + 0.25*sin(tt*(0.5 + 1.5*rnd.x) + rnd.y*TAU); vec3 gc = sandColor(h21(cellId*0.73 + fi*0.19))*mix(0.50, 0.95, dep); col = mix(col, gc*tw2, m); } // === micro-fauna swarm (skipped entirely when the pixel is far away) === for (int mI = 0; mI < 6; mI++){ float fm2 = float(mI); vec2 mc = microPos(fm2, tt); vec2 md0 = p - mc; if (dot(md0, md0) < 0.06){ vec2 mv = (mc - microPos(fm2, tt - 0.3))*3.33; vec2 md = md0; float variant = mod(fm2, 3.0); float rm = 0.028 + 0.030*h11(fm2*6.3); float mvl = length(mv) + 1e-4; vec2 vn2 = mv/mvl; if (variant > 0.5 && variant < 1.5){ vec2 lp = vec2(dot(md, vn2), dot(md, vec2(-vn2.y, vn2.x))); md = vec2(lp.x*0.55, lp.y*1.4); } // variant 2 = oblong noisy blob (stretched along a per-cell axis) if (variant > 1.5){ float ma = h11(fm2*4.1)*TAU + tt*0.25; vec2 me = vec2(cos(ma), sin(ma)); vec2 lp2 = vec2(dot(md, me)/0.65, dot(md, vec2(-me.y, me.x))); md = lp2; } float mr = length(md); float mang = atan(md.y, md.x); float rr2 = rm*(1.0 + 0.28*sin(3.0*mang - tt*2.2 + fm2)); if (variant > 1.5) rr2 = rm*(1.0 + 0.16*sin(2.0*mang + fm2) + 0.14*sin(3.0*mang - tt*0.6) + 0.20*(vnoise(vec2(cos(mang), sin(mang))*2.2 + fm2*3.0 + tt*0.3) - 0.5)); float bodyM = 1.0 - smoothstep(rr2*0.7, rr2, mr); vec3 mcol = sandColor(h11(fm2*1.7) + 0.05); col = mix(col, mcol*0.85, bodyM*0.8); col += (1.0 - smoothstep(0.0, rr2*0.45, mr))*mcol*0.5; vec2 w1p = mc - mv*0.25; col += mcol*exp(-dot(p - w1p, p - w1p)*8000.0)*0.25; vec2 w2p = mc - mv*0.5; col += mcol*exp(-dot(p - w2p, p - w2p)*8000.0)*0.12; } } // === hero wakes: back-projected along swim velocity (cheap), only when // the pixel is near this organism === for (int i = 0; i < 15; i++){ vec2 pdw = p - cs[i]; if (dot(pdw, pdw) < 0.30){ float fi = float(i); vec3 tc = idColor(i == 14 ? divF : fi); // daughter keeps parent color vec2 lat = vec2(-vel[i].y, vel[i].x); for (int m = 1; m <= 4; m++){ float fm = float(m); vec2 ct = cs[i] - vel[i]*(0.20*fm) + lat*0.06*sin(tt*2.0 + fm*1.3 + fi); float fadeM = 1.0 - fm/5.0; float dd2 = dot(p - ct, p - ct); col += tc*exp(-dd2*(500.0 + 300.0*fm))*fadeM*0.22; vec2 bo = (h22(vec2(fi*17.0 + fm*3.0, floor((tt - 0.20*fm)*3.0))) - 0.5)*0.07; float db = dot(p - ct - bo, p - ct - bo); col += tc*exp(-db*6000.0)*fadeM*0.45; } } } // === colored sand emission: four organisms spray bunches of tiny grains === for (int ec = 0; ec < 4; ec++){ vec2 ecC; float ecR; float ecHue; if (ec == 0) { ecC = cs[0]; ecR = scl[0]; ecHue = 0.00; } else if (ec == 1) { ecC = cs[2]; ecR = scl[2]; ecHue = 0.35; } else if (ec == 2) { ecC = cs[8]; ecR = scl[8]; ecHue = 0.66; } else { ecC = cs[11]; ecR = scl[11]; ecHue = 0.18; } vec2 pde = p - ecC; if (dot(pde, pde) > 0.30) continue; // reach cull float fec = float(ec); float baseR = 0.14*ecR; for (int gi = 0; gi < 22; gi++){ // grains streaming from this organism float fg = float(gi); float seed = h11(fg*17.3 + fec*31.7); float rate = 0.18 + 0.24*h11(fg*5.1 + fec*2.3); float lt = fract(tt*rate + seed); float ang = fg/22.0*TAU + 0.4*(h11(fg*3.3 + fec) - 0.5) + lt*0.5*(seed - 0.5) + 0.10*sin(tt*1.2 + fg); // wander as it flies float rad = baseR + lt*(0.12 + 0.28*h11(fg*7.1 + fec)); // streams outward vec2 gp = ecC + rad*vec2(cos(ang), sin(ang)); float ddp = length(p - gp); float sz = (0.0038 + 0.0050*h11(fg*9.7 + fec))*(1.0 - 0.35*lt); // tiny grain float fade = (1.0 - lt)*smoothstep(0.0, 0.10, lt)*emit; float core = 1.0 - smoothstep(sz*0.4, sz, ddp); float halo = exp(-ddp*ddp*6000.0); // glow so specks read vec3 gcol = sandColor(h11(fg*1.9 + fec*0.7) + ecHue)*1.7; // varied colors col += gcol*(core*0.95 + halo*0.40)*fade; // additive glow } } // === hero bodies (each pixel only pays for organisms near it) === for (int i = 0; i < 15; i++){ float fi = float(i); float sd = sds[i]; if (sd > 0.45) continue; vec2 pd = p - cs[i]; vec3 idc = idColor(i == 14 ? divF : fi); // daughter keeps parent color float inside = 1.0 - smoothstep(-0.008, 0.008, sd); float bodyA = (i == 3 || i == 8 || i == 11) ? 0.62 : 0.94; // jellies + medusa translucent // interior texture rotates with the body's spin float rotB = tt*rotSpd(fi)*((i == 4 || i == 10) ? 2.0 : 1.0); vec2 pdr = rot(pd, -rotB); vec2 icell = floor(pdr*(60.0 + 25.0*h11(fi*1.9))*grain + vec2(0.0, -tt*(3.0 + 3.0*h11(fi*2.3)))); vec3 cyto = idc*0.30 + sandColor(h21(icell) + fi*0.13)*0.22; if (i == 4 || i == 10){ cyto = idc*0.22 + sandColor(h21(floor(icell/2.0)) + 0.1)*0.40; cyto *= 0.75 + 0.25*step(0.5, fract((icell.x + icell.y)*0.5)); } if (abs(fi - tOrg) < 0.5 && infW > 0.01){ float gl = step(0.6, h21(floor(icell/3.0) + floor(tt*9.0))); cyto = mix(cyto, vec3(0.35, 1.0, 0.45)*0.8, infW*gl*0.5); } cyto += idc*0.55*exp(sd*9.0); float sparkle = 0.87 + 0.13*sin(tt*2.0 + h21(icell*1.7)*TAU + fi); col = mix(col, cyto*sparkle, inside*bodyA); // interior anatomy only matters inside the membrane if (sd < 0.02){ vec2 nuc = cs[i] + 0.05*scl[i]*vec2(sin(tt*0.6 + fi*2.0), cos(tt*0.75 + fi)); float nr = 0.055*scl[i]*(1.0 + 0.12*sin(tt*1.8 + fi*1.7)); float nm = 1.0 - smoothstep(nr*0.5, nr, length(p - nuc)); col = mix(col, idc*1.55, inside*nm*0.9); for (int m = 0; m < 2; m++){ float fm = float(m); float orr = (0.35 + 0.40*h11(fi*9.0 + fm*3.0))*0.17*scl[i]; float oaa = TAU*h11(fi*5.0 + fm*7.0) + tt*(0.2 + 0.2*h11(fi + fm))*mix(-1.0, 1.0, step(0.5, h11(fm*2.9 + fi))); vec2 op = cs[i] + orr*vec2(cos(oaa), sin(oaa)); float orad2 = 0.016*scl[i]*(1.0 + 0.25*sin(tt*2.5 + fm*2.0 + fi)); float om = 1.0 - smoothstep(orad2*0.4, orad2, length(p - op)); col = mix(col, sandColor(h11(fi*3.1 + fm) + 0.4)*1.35, inside*om); } // volvox: colony of daughter cells rotating inside if (i == 7){ for (int m2 = 0; m2 < 5; m2++){ float fm3 = float(m2); float dr = (0.30 + 0.30*h11(fm3*3.7))*0.17*scl[i]; float da = TAU*fm3/5.0 + tt*0.15; vec2 dp2 = cs[i] + dr*vec2(cos(da), sin(da)); float drr = 0.035*scl[i]*(1.0 + 0.1*sin(tt*1.5 + fm3)); float dmm = length(p - dp2); float dcell = 1.0 - smoothstep(drr*0.7, drr, dmm); float dring = clamp((1.0 - smoothstep(drr, drr*1.35, dmm)) - dcell, 0.0, 1.0); col = mix(col, idc*1.25, inside*dcell*0.7); col = mix(col, idc*0.45, inside*dring*0.6); } } } // end interior-anatomy guard float rimW = (i == 3 || i == 8 || i == 11) ? 0.020 : 0.010 + 0.008*scl[i]; float rim = 1.0 - smoothstep(0.0, rimW, abs(sd)); col += rim*(idc*0.9 + 0.25)*((i == 3 || i == 8 || i == 11) ? 0.35 : 0.55); col += exp(-max(sd, 0.0)*9.0)*0.06*idc; // wiggling tentacles + finger flanges (not on the rigid diatoms) if (i != 4 && i != 10 && sd > 0.0 && sd < 0.14*scl[i] + 0.02){ float pr_ = length(pd); float pa = atan(pd.y, pd.x); float NT = 11.0; float taf = (pa/TAU + 0.5)*NT; for (int kk = -1; kk <= 1; kk++){ float tid = mod(floor(taf) + float(kk), NT); float baseA = ((tid + 0.5)/NT - 0.5)*TAU; // same [-PI,PI] frame as pa float isLong = step(0.45, h11(tid*1.3 + fi*2.1)); // long tentacle vs short finger float tLen = mix(0.030, 0.11, isLong)*scl[i]*(0.8 + 0.4*h11(tid*3.7 + fi)); if (sd < tLen){ float ph = sd/tLen; // 0 base .. 1 tip float wamp = mix(0.06, 0.18, isLong)*wiggle; float wig = (0.02 + wamp*ph) * sin(ph*mix(10.0, 6.0, isLong) - tt*mix(6.5, 4.0, isLong) + tid*1.9 + fi); float arc = (pa - baseA - wig)*pr_; // lateral distance to centerline float tw = (mix(0.007, 0.011, isLong) - 0.004*ph)*(0.6 + scl[i]); float m = (1.0 - smoothstep(tw*0.5, tw, abs(arc)))*(1.0 - smoothstep(0.90, 1.0, ph)); vec3 tcol = idc*1.25 + 0.18; // brighter than the body col = mix(col, tcol, clamp(m, 0.0, 1.0)*0.92); col += tcol*(1.0 - smoothstep(0.0, tw*1.6, abs(arc)))*0.45*(1.0 - 0.6*ph); // glow // glowing tip node on the long tentacles col += idc*1.4*isLong*(1.0 - smoothstep(0.90, 1.0, ph))*(1.0 - smoothstep(0.0, tw*1.4, abs(arc)))*ph*ph*0.6; } } } // ciliates + paramecia: beating hair fringe if (i == 2 || i == 6 || i == 12){ float a2 = atan(pd.y, pd.x) - rotB; float fr = (1.0 - smoothstep(0.004, 0.035, abs(sd))) * (0.5 + 0.5*sin(a2*26.0 + tt*2.5)); col += fr*idc*0.35; } if (i == 1 || i == 5 || i == 13){ vec2 vn = vel[i]/(length(vel[i]) + 1e-4); vec2 vp = vec2(-vn.y, vn.x); float bodyR = 0.17*scl[i]; for (int s = 1; s <= 5; s++){ float fs = float(s)/5.0; vec2 tp2 = cs[i] - vn*(bodyR*0.8 + fs*0.45*scl[i]) + vp*0.05*scl[i]*sin(fs*9.0 - tt*7.0)*fs; float td2 = dot(p - tp2, p - tp2); col += idc*exp(-td2*9000.0)*(1.0 - fs)*0.8*max(scl[i], 0.0); } } } // === offspring: small children trailing the largest organisms === for (int ps = 0; ps < 5; ps++){ vec2 pC; vec2 pV; float pScl; vec3 pcol; if (ps == 0) { pC = cs[0]; pV = vel[0]; pScl = scl[0]; pcol = idColor(0.0); } else if (ps == 1) { pC = cs[7]; pV = vel[7]; pScl = scl[7]; pcol = idColor(7.0); } else if (ps == 2) { pC = cs[8]; pV = vel[8]; pScl = scl[8]; pcol = idColor(8.0); } else if (ps == 3) { pC = cs[9]; pV = vel[9]; pScl = scl[9]; pcol = idColor(9.0); } else { pC = cs[11]; pV = vel[11]; pScl = scl[11]; pcol = idColor(11.0); } float fps = float(ps); vec2 pn = pV/(length(pV) + 1e-4); // parent heading vec2 pp = vec2(-pn.y, pn.x); for (int ch = 0; ch < 3; ch++){ float fch = float(ch); float trail = (0.14 + fch*0.075)*(0.55 + pScl); // strung out behind parent vec2 cc = pC - pn*trail + pp*0.06*(0.55 + pScl)*sin(fch*2.1 - tt*1.6) // weaving follow + 0.018*vec2(sin(tt*2.0 + fch*3.0 + fps), cos(tt*1.7 + fch + fps)); vec2 dch = p - cc; float dch2 = dot(dch, dch); if (dch2 > 0.045) continue; // group guard (child + grandchildren) float rch = (0.045 + 0.016*h11(fch + fps*3.0))*(0.5 + pScl); // small vec3 childCol = pcol; // inherits parent color if (dch2 < 0.020){ // oblong, noisy irregular blob (not a clean rounded star) float chAng = h11(fch*1.7 + fps*3.0)*TAU + tt*0.3; // slowly turning long axis vec2 e1 = vec2(cos(chAng), sin(chAng)); vec2 lp = vec2(dot(dch, e1)/0.68, dot(dch, vec2(-e1.y, e1.x))); // stretch = oblong float a = atan(lp.y, lp.x); float r = length(lp); float wob = rch*(0.13*sin(a*3.0 + tt*1.2 + fch) + 0.18*(vnoise(vec2(cos(a), sin(a))*2.3 + fch*4.0 + fps*2.0 + tt*0.5) - 0.5)); float sdc = r - (rch + wob); float ins = 1.0 - smoothstep(-0.004, 0.004, sdc); col = mix(col, childCol*0.45 + 0.10, ins*0.85); // translucent cytoplasm float nm = 1.0 - smoothstep(0.0, rch*0.38, length(dch)); // tiny nucleus col = mix(col, childCol*1.5, ins*nm*0.85); float rim = 1.0 - smoothstep(0.0, 0.006, abs(sdc)); // membrane col += rim*(childCol*0.9 + 0.2)*0.5; col += exp(-max(sdc, 0.0)*13.0)*0.05*childCol; // halo // children emit tiny colored sand grains too (same FX as parents) for (int gi = 0; gi < 6; gi++){ float fg = float(gi); float seed = h11(fg*13.1 + fch*4.0 + fps*9.0); float rate = 0.28 + 0.30*h11(fg*3.1 + fps); float lt = fract(tt*rate + seed); float ang = fg/6.0*TAU + lt*0.6*(seed - 0.5) + 0.12*sin(tt*1.3 + fg); float rad = rch*0.85 + lt*(0.05 + 0.04*h11(fg*7.1 + fps)); vec2 gp = cc + rad*vec2(cos(ang), sin(ang)); float dd = length(p - gp); float sz = (0.0022 + 0.0026*h11(fg*9.7 + fps))*(1.0 - 0.4*lt); float fade = (1.0 - lt)*smoothstep(0.0, 0.12, lt)*emit; float core = 1.0 - smoothstep(sz*0.4, sz, dd); float halo = exp(-dd*dd*9000.0); col += sandColor(h11(fg*1.9 + fps*0.7) + 0.05*fch + 0.2)*1.5 * (core*0.9 + halo*0.35)*fade; } } // grandchildren: two even-smaller cells trailing each child for (int g2 = 0; g2 < 2; g2++){ float fg2 = float(g2); float gtrail = rch*(1.7 + fg2*1.15); vec2 gcc = cc - pn*gtrail + pp*rch*0.7*sin(fg2*2.3 - tt*2.2 + fch); vec2 dg = p - gcc; float rg = rch*0.42; if (dot(dg, dg) < rg*rg*4.5){ float ag = atan(dg.y, dg.x); float wg = rg*(0.18*sin(ag*3.0 + tt*1.5 + fg2) + 0.16*(vnoise(vec2(cos(ag), sin(ag))*2.5 + fg2*7.0 + fch*3.0 + tt*0.6) - 0.5)); float sdg = length(dg) - (rg + wg); float insg = 1.0 - smoothstep(-0.003, 0.003, sdg); col = mix(col, childCol*0.5 + 0.10, insg*0.8); float nmg = 1.0 - smoothstep(0.0, rg*0.45, length(dg)); col = mix(col, childCol*1.5, insg*nmg*0.8); float rimg = 1.0 - smoothstep(0.0, 0.0045, abs(sdg)); col += rimg*(childCol*0.85 + 0.2)*0.45; } } } } // === digital alien organisms: blocky glitch cells that continuously // diffuse shrinking mini-copies of themselves === for (int di = 0; di < 6; di++){ float fdi = float(di); vec2 dc = digiPath(fdi + 60.0, tt); vec2 ddp = p - dc; if (dot(ddp, ddp) > 0.055) continue; // group guard (body + spores) float dscl = 0.055 + 0.035*h11(fdi*3.1); // small organisms vec3 dcol = digiColor(h11(fdi*1.9) + tt*0.02); // shifting neon color // --- body: rotating pixelated glitch cell with circuit traces --- if (dot(ddp, ddp) < dscl*dscl*3.2){ float rspin = tt*0.4*(h11(fdi*7.0) - 0.5)*2.0; vec2 q2 = rot(ddp, rspin); float a2 = atan(q2.y, q2.x); // horizontal glitch displacement bands float band = floor(q2.y*90.0); q2.x += (step(0.82, h21(vec2(band, floor(tt*9.0)))) - 0.5)*dscl*0.28; // squarish silhouette (digital), slightly noisy float rr = dscl*(0.82 + 0.10*sin(a2*4.0 - rspin*2.0) + 0.06*(vnoise(vec2(cos(a2), sin(a2))*3.0 + fdi + tt*0.4) - 0.5)); float sd2 = length(q2) - rr; float ins2 = 1.0 - smoothstep(-0.003, 0.003, sd2); // voxel blocks + circuit-trace grid vec2 vox = floor(q2/(dscl*0.24)); vec3 fill = dcol*(0.28 + 0.22*step(0.5, h21(vox))); float trace = max(step(0.86, fract((q2.x/dscl)*4.0)), step(0.86, fract((q2.y/dscl)*4.0))); fill += dcol*trace*0.5; float scan = 0.8 + 0.2*step(0.5, fract(q2.y*140.0 - tt*6.0)); col = mix(col, fill*scan, ins2*0.92); col += dcol*(1.0 - smoothstep(0.0, dscl*0.30, length(ddp)))*0.9; // data core float rim2 = 1.0 - smoothstep(0.0, 0.004, abs(sd2)); // wireframe rim col += rim2*(dcol + 0.15)*0.75; } // --- diffusion: shed mini-copies that drift out, shrink, vanish --- for (int sp = 0; sp < 5; sp++){ float fsp = float(sp); float seed = h11(fsp*7.3 + fdi*4.0); float lt = fract(tt*(0.28 + 0.20*seed) + seed); float ang = fsp/5.0*TAU + seed*TAU + lt*0.5*(seed - 0.5); float rad = dscl*1.1 + lt*(0.06 + 0.05*h11(fsp*3.1 + fdi)); vec2 spc = dc + rad*vec2(cos(ang), sin(ang)); vec2 dsp = p - spc; float rsp = dscl*0.42*(1.0 - lt)*(1.0 - lt); // scale tiny → gone if (dot(dsp, dsp) < rsp*rsp*5.0 && rsp > 0.0015){ float a3 = atan(dsp.y, dsp.x); float sd3 = length(dsp) - rsp*(0.85 + 0.15*sin(a3*4.0 + tt*3.0)); float in3 = 1.0 - smoothstep(-0.002, 0.002, sd3); col = mix(col, dcol*0.4, in3*0.8); // mini blocky body col += dcol*(1.0 - smoothstep(0.0, rsp*0.55, length(dsp)))*0.7*(1.0 - lt); // core col += (1.0 - smoothstep(0.0, 0.0035, abs(sd3)))*dcol*0.5*(1.0 - lt); // rim } } } // === digital viruses === for (int v = 0; v < 8; v++){ float fv = float(v); vec2 drift = vec2((h11(fv*3.7 + 11.0) - 0.5)*1.7, (h11(fv*8.1 + 4.0) - 0.5)*1.3) + 0.30*vec2(sin(tt*0.20 + fv*2.6), cos(tt*0.17 + fv*1.9)); float aa = tt*(0.3 + 0.2*h11(fv*5.5)) + fv*TAU/8.0; vec2 attach = tCen + (0.17*tScl + 0.06 + 0.02*sin(tt*1.5 + fv))*vec2(cos(aa), sin(aa)); vec2 vp2 = mix(drift, attach, infW); vec2 vd = p - vp2; if (dot(vd, vd) > 0.0014) continue; float spin = tt*(0.6 + 0.4*h11(fv*9.1))*mix(-1.0, 1.0, step(0.5, h11(fv*3.3))); vec2 vdr = rot(vd, spin); // internal structure counter-rotates float vr = length(vdr); float vang = atan(vdr.y, vdr.x); vec3 vc = mix(vec3(0.20, 1.00, 0.45), vec3(1.00, 0.22, 0.85), step(0.5, h11(fv*1.3))); vec3 hot = mix(vc, vec3(1.0), 0.65); // hot highlight tint vec3 acc = mix(vc.zxy, vec3(0.6, 0.9, 1.0), 0.4); // cyan/opposing accent // ---- realistic + sci-fi virion ---- float pulseV = 1.0 + 0.06*sin(tt*3.0 + fv*2.2); float rCap = 0.011*pulseV; // 12 receptor spikes: thin stem + bulbed glycoprotein head float NA = 12.0; float sid = floor((vang/TAU + 0.5)*NA); float scen = (sid + 0.5)/NA*TAU; vec2 sdir = vec2(cos(scen), sin(scen)); float along = dot(vdr, sdir); float across = dot(vdr, vec2(-sdir.y, sdir.x)); float stem = (1.0 - smoothstep(0.0018, 0.0040, abs(across))) * smoothstep(rCap*0.80, rCap*1.0, along) * (1.0 - smoothstep(rCap*1.46, rCap*1.66, along)); float hd = length(vdr - sdir*rCap*1.62); float head = 1.0 - smoothstep(0.0038, 0.0072, hd); // receptor bulb float headGlow = exp(-hd*hd*22000.0); // soft halo per knob // icosahedral capsid: filled disc, faceted shading, capsomere knobs float capMask = 1.0 - smoothstep(rCap*0.88, rCap, vr); float shell = 1.0 - smoothstep(0.0016, 0.0040, abs(vr - rCap)); float facet = 0.62 + 0.38*cos(5.0*vang); // 5-fold facets float capsomere = 0.62 + 0.38*sin(vang*11.0)*sin(vr*300.0 - spin*2.0); // coiled genome strand + bright nucleoid core float genome = capMask*(0.5 + 0.5*sin(vr*240.0 - tt*3.0)) *(1.0 - smoothstep(rCap*0.48, rCap*0.72, vr)); float core = 1.0 - smoothstep(0.0, rCap*0.26, vr); // sci-fi: energy corona, holo scan-ring, digital scanlines float corona = exp(-vr*vr*1500.0)*(0.55 + 0.45*sin(tt*4.0 + fv*2.0)); float holo = (1.0 - smoothstep(0.0009, 0.0024, abs(vr - rCap*1.95))) * (0.5 + 0.5*cos(vang*24.0 - tt*3.0)); float scan = 0.86 + 0.14*sin(vdr.y*820.0 - tt*8.0); col = mix(col, vec3(0.02, 0.05, 0.03), (1.0 - smoothstep(rCap*1.0, rCap*1.22, vr))*(1.0 - capMask)*0.45); col = mix(col, vc*facet*capsomere*scan, capMask*0.90); col = mix(col, acc*0.55, genome*0.60); col += hot*core*0.85; col = mix(col, hot, clamp(shell*facet, 0.0, 1.0)*0.95); col += vc*stem*0.90; col += vc*headGlow*0.55; col += hot*head*1.40; col += acc*holo*0.38; col += vc*corona*0.45; col += vec3(1.0)*core*(1.0 - smoothstep(0.0, rCap*0.12, vr))*0.9; } // === evil sharp mecha-centipedes (half size, five of them) === for (int b = 0; b < 5; b++){ float fb = float(b) + 30.0; vec2 head = bugPath(fb, tt); vec2 hn = (head - bugPath(fb, tt - 0.2)); hn = hn/(length(hn) + 1e-4); // heading vec2 hp = vec2(-hn.y, hn.x); // lateral float SP = 0.031; // segment spacing (half) vec2 mid = head - hn*(4.5*SP); if (dot(p - mid, p - mid) > 0.045) continue; // body bounding cull // colorful alloy: varied palette per centipede (like the organisms), bright spine vec3 bc = sandColor(h11(fb*2.3) + 0.13)*1.05; vec3 hotc = mix(bc, vec3(1.0), 0.55); // bright emissive spine for (int s = 0; s < 9; s++){ float fs = float(s); vec2 seg = head - hn*(fs*SP) + hp*0.018*sin(fs*0.75 - tt*4.0); vec2 ps = p - seg; if (dot(ps, ps) < 0.0020){ float rseg = 0.019*(1.0 - 0.5*fs/9.0); // taper to tail // SHARP angular segment: elongated rhombus (diamond), not a disc vec2 bf = vec2(dot(ps, hn), dot(ps, hp)); float dia = abs(bf.x)*0.65 + abs(bf.y); float body = 1.0 - smoothstep(rseg*0.78, rseg, dia); float plate = 0.55 + 0.45*sin(fs*1.7 + tt*2.0); col = mix(col, bc*plate, body*0.95); // pulsing iridescent alien node in each segment (shifting color) vec3 alienCore = digiColor(fs*0.12 + tt*0.5 + fb); col += alienCore*(1.0 - smoothstep(0.0, rseg*0.42, dia))*0.90; col = mix(col, vec3(0.02,0.0,0.03), (1.0 - smoothstep(rseg*0.90, rseg*1.10, dia))*(1.0 - body)*0.6); // dark rim // jointed, curved alien legs with glowing feet (asymmetric sweep) float legph = sin(fs*0.75 - tt*6.0); vec2 k1 = seg + hp*(rseg + 0.012) - hn*0.002 + hn*legph*0.010; vec2 t1 = k1 + hp*0.014 - hn*(0.012 - legph*0.008); vec2 k2 = seg - hp*(rseg + 0.012) - hn*0.002 - hn*legph*0.010; vec2 t2 = k2 - hp*0.014 - hn*(0.012 + legph*0.008); float lw = 0.0012; col += bc*0.85*(1.0 - smoothstep(lw, lw*2.0, min(segd(p, seg + hp*rseg*0.5, k1), segd(p, k1, t1)))); col += bc*0.85*(1.0 - smoothstep(lw, lw*2.0, min(segd(p, seg - hp*rseg*0.5, k2), segd(p, k2, t2)))); col += alienCore*(1.0 - smoothstep(0.0, 0.0024, length(p - t1)))*0.7; // glowing foot col += alienCore*(1.0 - smoothstep(0.0, 0.0024, length(p - t2)))*0.7; } } // tail stinger: sharp spike off the last segment vec2 tb = head - hn*(8.0*SP); vec2 tt2 = head - hn*(8.0*SP) - hn*0.022; col += hotc*(1.0 - smoothstep(0.0010, 0.0028, segd(p, tb, tt2))); col += vec3(1.0,0.3,0.15)*(1.0 - smoothstep(0.0, 0.003, length(p - tt2)))*0.7; // menacing head: armor + two red eyes + sharp mandible fangs float dh = length(p - head); if (dh < 0.055){ float rH = 0.020; vec2 bfh = vec2(dot(p - head, hn), dot(p - head, hp)); float diaH = abs(bfh.x)*0.7 + abs(bfh.y); // angular head col = mix(col, bc*1.15, (1.0 - smoothstep(rH*0.85, rH, diaH))*0.95); vec3 alienEye = digiColor(tt*0.4 + fb*1.3); // iridescent alien eyes col += alienEye*(1.0 - smoothstep(0.0, rH*0.5, diaH))*0.35; // alien three-eye cluster col += alienEye*(1.0 - smoothstep(0.0, 0.006, length(p - head - hn*0.006 - hp*0.007)))*1.3; col += alienEye*(1.0 - smoothstep(0.0, 0.006, length(p - head - hn*0.006 + hp*0.007)))*1.3; col += alienEye*(1.0 - smoothstep(0.0, 0.005, length(p - head - hn*0.014)))*1.1; // front eye // two curved feelers sweeping back + two forward mandibles for (int fl = 0; fl < 2; fl++){ float sd2 = (fl == 0) ? 1.0 : -1.0; vec2 f0 = head + hp*sd2*rH*0.6; vec2 fk = head + hp*sd2*rH*1.3 - hn*0.006 + hn*sin(tt*3.0 + sd2)*0.005; vec2 ft = fk + hp*sd2*rH*0.6 + hn*0.012; col += bc*0.7*(1.0 - smoothstep(0.0010, 0.0026, min(segd(p, f0, fk), segd(p, fk, ft)))); col += alienEye*(1.0 - smoothstep(0.0, 0.003, length(p - ft)))*0.6; // feeler tip vec2 mb = head + hn*rH*0.7 + hp*sd2*rH*0.55; vec2 mt = head + hn*rH*2.1 + hp*sd2*rH*0.15; col += vec3(0.9, 0.95, 0.95)*(1.0 - smoothstep(0.0011, 0.0026, segd(p, mb, mt)))*0.85; col += vec3(0.9,1.0,1.0)*(1.0 - smoothstep(0.0, 0.0022, length(p - mt)))*0.6; // fang tip } } vec2 wk = head - hn*(9.5*SP); col += bc*exp(-dot(p - wk, p - wk)*9000.0)*0.12; } // === feeding stream (slow siphon) === if (feedW > 0.001 && segd(p, vicC, cs[0]) < 0.10){ vec3 pcol = idColor(vic); vec2 fdir = cs[0] - vicC; vec2 fperp = vec2(-fdir.y, fdir.x)/(length(fdir) + 1e-4); for (int n = 0; n < 6; n++){ float s = fract(tt*0.9 + float(n)/6.0); vec2 sp2 = mix(vicC, cs[0], s) + fperp*0.02*sin(s*18.0 + tt*2.0); float dd = dot(p - sp2, p - sp2); col += pcol*exp(-dd*4500.0)*feedW*(1.0 - s)*1.3; } col += pcol*exp(-segd(p, vicC, cs[0])*segd(p, vicC, cs[0])*2500.0)*feedW*0.25; } // === symbiosis link === { float linkM = clamp(scl[4]/0.60, 0.0, 1.0)*clamp(scl[5]/0.42, 0.0, 1.0); float ld = segd(p, cs[4], cs[5]); if (ld < 0.10 && linkM > 0.001){ col += vec3(0.30, 0.90, 0.60)*exp(-ld*ld*3000.0)*(0.30 + 0.20*sin(tt*5.0))*linkM; vec2 sdir = cs[5] - cs[4]; vec2 sperp = vec2(-sdir.y, sdir.x)/(length(sdir) + 1e-4); for (int n = 0; n < 4; n++){ float fn = float(n); float s1 = fract(tt*0.9 + fn*0.25); vec2 g1 = mix(cs[4], cs[5], s1) + sperp*0.015*sin(s1*15.0 + tt*4.0); col += idColor(4.0)*exp(-dot(p - g1, p - g1)*7000.0)*0.8*linkM; float s2 = fract(-tt*0.8 + fn*0.25 + 0.12); vec2 g2 = mix(cs[4], cs[5], s2) - sperp*0.015*sin(s2*15.0 + tt*4.0); col += idColor(5.0)*exp(-dot(p - g2, p - g2)*7000.0)*0.8*linkM; } } // end link proximity guard } // division bridge (cytokinesis): glowing strand between parent and daughter { float bw = smoothstep(0.22, 0.32, dphase)*(1.0 - smoothstep(0.50, 0.62, dphase)); if (bw > 0.001){ vec2 dvC = cs[1]; for (int i = 1; i < 14; i++){ if (abs(float(i) - divF) < 0.5) dvC = cs[i]; } float bd2 = segd(p, dvC, cs[14]); if (bd2 < 0.08){ col += idColor(divF)*exp(-bd2*bd2*4000.0)*bw*0.7; } } } col += flash*0.22*vec3(1.0, 0.88, 0.60); // === full-screen digital overlay (no lens circle) === float ret = 0.0; ret = max(ret, (1.0 - smoothstep(0.0012, 0.0030, abs(pl.x)))*0.30); // crosshair ret = max(ret, (1.0 - smoothstep(0.0012, 0.0030, abs(pl.y)))*0.30); vec2 gcell = abs(fract(pl/0.15) - 0.5)*0.15; // fine grid ret = max(ret, (1.0 - smoothstep(0.0006, 0.0018, min(gcell.x, gcell.y)))*0.10); col += vec3(0.35, 0.95, 0.75)*ret*0.10; col *= 0.97 + 0.03*sin(uv.y*RENDERSIZE.y*3.14159); // scanlines col *= 1.0 + 0.01*(h11(floor(TIME*12.0)) - 0.5); // sensor flicker col *= 1.0 - 0.10*dot(pl*0.42, pl*0.42); // very mild vignette col += (h21(gl_FragCoord.xy + fract(tt)) - 0.5)*0.02; // sensor grain gl_FragColor = vec4(col, 1.0); }
Digital microscope micro-ecosystem. Fourteen large organisms — amoeba host, flagellates, ciliates, jellies, digital diatoms, darter symbiote, paramecia, volvox colony, a lobed medusa, a second amoeba and a giant drifting jelly — swim through multicolored plankton with streamlining bodies, bow waves and fluid wakes. Membranes warp constantly with traveling waves, breathing harmonics and drifting noise. A swarm of ten micro-fauna and eight round spike-protein viruses (15s infection cycle with green glitch corruption) fill the medium. Every 20s the host slowly stalks a victim, absorbs and dissolves it, and later the victim glides back out reborn. Diatom and darter live in symbiosis; others wrestle gently on contact. All under a lens with reticle, scanlines and barrel distortion.
export clip · render a video in your browser
Renders to video in your browser (no upload), stepping the real renderer frame by frame so multipass + feedback come out right. motion auto-animates the shader's own knobs — each export rolls a fresh take (🎲 re-roll, 🔒 to pin one you like). GIF is slower with a tighter length cap; MP4/WebM are faster. Some devices record in real time (noted below if so) — keep the tab visible.
embed · drop this shader into any page
Renders client-side in the reader's browser (CC0 — no attribution required, but the backlink is appreciated).