#8dymr411 — this one is kept as-is (links and embeds never break) but no longer shows in browse.
/*{ "DESCRIPTION": "Restroom-sign pictogram: white standing figure on a rounded black tile, with a Motion Mode dropdown: Wave, Walk and Run (the figure turns to a side-view profile), Dance (Groove, Hip-Hop Bounce, Running Man, Robot, Arm Wave, and breaking: Toprock, Six-Step, Windmill, Headspin, Freezes and an auto Breaking Combo), Jumping Jacks and Stand Still. Fully jointed figure (shoulders, elbows, rounded nub ends, knees) with body bounce, sway and head follow. Moves lock to a BPM. Also color cycle, glow, outline and pulse for live use.", "CREDIT": "Craig", "ISFVSN": "2", "CATEGORIES": ["generator"], "INPUTS": [ { "NAME": "motionMode", "LABEL": "Motion Mode", "TYPE": "long", "DEFAULT": 0, "VALUES": [0, 1, 2, 3, 4, 5], "LABELS": ["Wave", "Walk (Side View)", "Run (Side View)", "Dance (see Dance Style)", "Jumping Jacks", "Stand Still"] }, { "NAME": "danceStyle", "LABEL": "Dance Style", "TYPE": "long", "DEFAULT": 0, "VALUES": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "LABELS": ["Groove", "Hip-Hop Bounce", "Running Man", "Robot / Popping", "Arm Wave", "Toprock (Breaking)", "Six-Step (Breaking)", "Windmill (Breaking)", "Headspin (Breaking)", "Freezes (Breaking)", "Breaking Combo (Auto)"] }, { "NAME": "spinSpeed", "LABEL": "Power Move Speed", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.25, "MAX": 3.0 }, { "NAME": "bpm", "LABEL": "Tempo (BPM)", "TYPE": "float", "DEFAULT": 120.0, "MIN": 60.0, "MAX": 200.0 }, { "NAME": "moveAmount", "LABEL": "Move Amount", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "speed", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 4.0 }, { "NAME": "groundDashes","LABEL": "Ground Dashes (Walk/Run)", "TYPE": "bool", "DEFAULT": 0 }, { "NAME": "hue", "TYPE": "float", "DEFAULT": 0.5, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "colorCycle", "LABEL": "Color Cycle", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "figureColor", "LABEL": "Figure Color", "TYPE": "color", "DEFAULT": [1.0, 1.0, 1.0, 1.0] }, { "NAME": "tileColor", "LABEL": "Tile Color", "TYPE": "color", "DEFAULT": [0.0, 0.0, 0.0, 1.0] }, { "NAME": "outerColor", "LABEL": "Outer Color", "TYPE": "color", "DEFAULT": [1.0, 1.0, 1.0, 1.0] }, { "NAME": "showTile", "LABEL": "Show Tile", "TYPE": "bool", "DEFAULT": 1 }, { "NAME": "zoom", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.25, "MAX": 3.0 }, { "NAME": "waveAuto", "LABEL": "Auto Wave Loop", "TYPE": "bool", "DEFAULT": 1 }, { "NAME": "waveStyle", "LABEL": "Wave Style", "TYPE": "long", "DEFAULT": 0, "VALUES": [0, 1, 2], "LABELS": ["Elbow Wave", "Wrist Flick", "Big Wave"] }, { "NAME": "waveRaise", "LABEL": "Arm Raise", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "waveCycle", "LABEL": "Loop Length (s)","TYPE": "float", "DEFAULT": 6.0, "MIN": 2.0, "MAX": 20.0 }, { "NAME": "waveSpeed", "LABEL": "Wave Speed", "TYPE": "float", "DEFAULT": 1.6, "MIN": 0.0, "MAX": 5.0 }, { "NAME": "waveAmount", "LABEL": "Wave Amount", "TYPE": "float", "DEFAULT": 0.6, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "bodyFollow", "LABEL": "Head Follow", "TYPE": "float", "DEFAULT": 0.5, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "waveLeft", "LABEL": "Mirror Figure", "TYPE": "bool", "DEFAULT": 0 }, { "NAME": "pulse", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "glow", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "outlineMix", "LABEL": "Outline Only", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "NAME": "lineWidth", "LABEL": "Line Width", "TYPE": "float", "DEFAULT": 0.3, "MIN": 0.0, "MAX": 1.0 } ] }*/ // All geometry is measured off the 1000x1000 reference, in a y-up pixel frame // (Y = 1000 - imageY), so the numbers map straight back to the photo. // Every motion mode returns to the exact reference silhouette at rest. // "Mirror Figure" flips the sample point about the figure's centre line (x = 491), // which also moves the wave to the other arm, or turns the side-view walker to face left. #define PI 3.14159265 #define HALF_PI 1.5707963 // Reference rest geometry #define PELVIS vec2(491.0, 452.0) #define HIP_L vec2(445.5, 470.0) #define HIP_R vec2(537.0, 470.0) #define FOOT_L vec2(445.5, 153.5) #define FOOT_R vec2(537.0, 153.5) #define LEG_SEG 158.25 // thigh = shin, so the rest leg is exactly straight mat2 rot(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); } // iq rounded box with per-corner radii: r = (topRight, bottomRight, topLeft, bottomLeft) float sdRoundBox(vec2 p, vec2 b, vec4 r) { r.xy = (p.x > 0.0) ? r.xy : r.zw; r.x = (p.y > 0.0) ? r.x : r.y; vec2 q = abs(p) - b + r.x; return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - r.x; } // Box defined by min/max corners float boxMM(vec2 p, vec2 mn, vec2 mx, vec4 r) { vec2 c = 0.5 * (mn + mx); vec2 h = 0.5 * (mx - mn); return sdRoundBox(p - c, h, r); } float sdSeg(vec2 p, vec2 a, vec2 b) { vec2 pa = p - a, ba = b - a; float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0); return length(pa - ba * h); } float dot2(vec2 v) { return dot(v, v); } // iq exact distance to a quadratic Bezier (A -> C, control B) float sdBezier(vec2 pos, vec2 A, vec2 B, vec2 C) { vec2 a = B - A; vec2 b = A - 2.0 * B + C; vec2 c = a * 2.0; vec2 d = A - pos; float kk = 1.0 / dot(b, b); float kx = kk * dot(a, b); float ky = kk * (2.0 * dot(a, a) + dot(d, b)) / 3.0; float kz = kk * dot(d, a); float res; float pp = ky - kx * kx; float p3 = pp * pp * pp; float qq = kx * (2.0 * kx * kx - 3.0 * ky) + kz; float h = qq * qq + 4.0 * p3; if (h >= 0.0) { h = sqrt(h); vec2 x = (vec2(h, -h) - qq) / 2.0; vec2 uv = sign(x) * pow(abs(x), vec2(1.0 / 3.0)); float t = clamp(uv.x + uv.y - kx, 0.0, 1.0); res = dot2(d + (c + b * t) * t); } else { float z = sqrt(-pp); float v = acos(qq / (pp * z * 2.0)) / 3.0; float m = cos(v); float n = sin(v) * 1.732050808; vec3 t = clamp(vec3(m + m, -n - m, n - m) * z - kx, 0.0, 1.0); res = min(dot2(d + (c + b * t.x) * t.x), dot2(d + (c + b * t.y) * t.y)); } return sqrt(res); } float smin(float a, float b, float k) { k = max(k, 0.001); float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0); return mix(b, a, h) - k * h * (1.0 - h); } // Arm angle convention, per side: 0 = pointing outward from the body, // -PI/2 = hanging down, +PI/2 = straight up. sx = +1 screen right, -1 screen left. vec2 aDir(float a, float sx) { return vec2(sx * cos(a), sin(a)); } // How far an arm is lifted (drives the shoulder tuck and joint slide) float liftOf(float upper) { return clamp((upper + HALF_PI) / (HALF_PI + 0.16), 0.0, 1.0); } // Ease with a small late overshoot, so the waving arm "arrives" instead of stopping dead float liftCurve(float x) { x = clamp(x, 0.0, 1.0); return smoothstep(0.0, 0.8, x) + 0.07 * sin(PI * clamp((x - 0.6) / 0.4, 0.0, 1.0)); } // --------------------------------------------------------------------------- // Pose: everything the figure needs for one frame // --------------------------------------------------------------------------- struct Pose { vec2 body; // upper-body offset (bounce / sway) float tilt; // upper-body roll around the pelvis (+ = counter-clockwise) float headTilt; // extra head roll around the neck vec3 armL; // left arm angles: (upper, forearm, nub) vec2 lenL; // left arm lengths: (forearm, nub) vec3 armR; // right arm angles vec2 lenR; // right arm lengths vec2 footL; // foot targets (world space) vec2 footR; float splay; // how far knees bow outward when the legs bend (0..1) // Whole-body transform (power moves, freezes) vec2 gOff; // whole-body offset float gRot; // whole-body rotation around the centre (+ = counter-clockwise) float gScale; // whole-body scale float gSx; // horizontal squash/flip, fakes spinning around the vertical axis float legFront; // +1 right leg drawn in front, -1 left leg in front, 0 none float grounded; // 1 = drop/centre the whole body so its lowest point rests on the floor }; void restPose(inout Pose P) { P.body = vec2(0.0); P.tilt = 0.0; P.headTilt = 0.0; P.armL = vec3(-HALF_PI); P.armR = vec3(-HALF_PI); P.lenL = vec2(103.0, 0.0); P.lenR = vec2(103.0, 0.0); P.footL = FOOT_L; P.footR = FOOT_R; P.splay = 0.45; P.gOff = vec2(0.0); P.gRot = 0.0; P.gScale = 1.0; P.gSx = 1.0; P.legFront = 0.0; P.grounded = 0.0; } Pose mixPose(Pose A, Pose B, float t) { Pose P; P.body = mix(A.body, B.body, t); P.tilt = mix(A.tilt, B.tilt, t); P.headTilt = mix(A.headTilt, B.headTilt, t); P.armL = mix(A.armL, B.armL, t); P.lenL = mix(A.lenL, B.lenL, t); P.armR = mix(A.armR, B.armR, t); P.lenR = mix(A.lenR, B.lenR, t); P.footL = mix(A.footL, B.footL, t); P.footR = mix(A.footR, B.footR, t); P.splay = mix(A.splay, B.splay, t); P.gOff = mix(A.gOff, B.gOff, t); P.gRot = mix(A.gRot, B.gRot, t); P.gScale = mix(A.gScale, B.gScale, t); P.gSx = mix(A.gSx, B.gSx, t); P.legFront = (t < 0.5) ? A.legFront : B.legFront; P.grounded = mix(A.grounded, B.grounded, t); return P; } // Even-width arm tube: straight upper arm, then forearm + rounded nub as one // smooth Bezier curve (so a trailing nub bends the forearm instead of kinking). // With nub length 0 it is a plain straight capsule, identical to the reference arm. float armTube(vec2 p, vec2 S, float sx, float r, vec3 ang, vec2 len) { vec2 E = S + 115.0 * aDir(ang.x, sx); vec2 W = E + len.x * aDir(ang.y, sx); vec2 T = W + len.y * aDir(ang.z, sx); float dU = sdSeg(p, S, E) - r; float dF = sdBezier(p, E, W, T) - r; return smin(dU, dF, 4.0 * clamp(len.y / 30.0, 0.0, 1.0) + 0.001); } // Same arm, also returning just the forearm + nub part (used to carve a thin // black gap where a forearm crosses in front of the body) float armParts(vec2 p, vec2 S, float sx, float r, vec3 ang, vec2 len, out float dFore) { vec2 E = S + 115.0 * aDir(ang.x, sx); vec2 W = E + len.x * aDir(ang.y, sx); vec2 T = W + len.y * aDir(ang.z, sx); float dU = sdSeg(p, S, E) - r; dFore = sdBezier(p, E, W, T) - r; return smin(dU, dFore, 4.0 * clamp(len.y / 30.0, 0.0, 1.0) + 0.001); } // Knee position for the IK leg below (shared with the floor solver) vec2 kneeOf(vec2 H, vec2 F, float side, float splay, out vec2 Fp) { vec2 d = F - H; float len = max(length(d), 0.001); vec2 dir = d / len; float reach = min(len, 2.0 * LEG_SEG); Fp = H + dir * reach; float h = sqrt(max(LEG_SEG * LEG_SEG - 0.25 * reach * reach, 0.0)); vec2 perp = vec2(-dir.y, dir.x); return H + dir * (0.5 * reach) + perp * h * splay * side; } // Two-bone leg with simple IK: hip H reaches for foot target F. // If F is out of reach the leg straightens toward it. side = -1 left, +1 right. float legTube(vec2 p, vec2 H, vec2 F, float r, float side, float splay) { vec2 d = F - H; float len = max(length(d), 0.001); vec2 dir = d / len; float reach = min(len, 2.0 * LEG_SEG); vec2 Fp = H + dir * reach; float h = sqrt(max(LEG_SEG * LEG_SEG - 0.25 * reach * reach, 0.0)); vec2 perp = vec2(-dir.y, dir.x); // pointing +x for a leg hanging down vec2 K = H + dir * (0.5 * reach) + perp * h * splay * side; return min(sdSeg(p, H, K), sdSeg(p, K, Fp)) - r; } float figure(vec2 p, Pose P) { // Upper-body space: undo the bounce/sway and roll around the pelvis vec2 pu = rot(P.tilt) * (p - PELVIS - P.body) + PELVIS; // Head, rolled around the neck vec2 N = vec2(491.0, 772.0); vec2 hp = rot(P.headTilt) * (pu - N) + N; float head = length(hp - vec2(491.0, 854.0)) - 67.0; // Shoulder yoke with rounded top corners. On a lifted side the shoulder cap // tucks in and tightens, so the raised arm becomes the shoulder line. float liftL = liftOf(P.armL.x); float liftR = liftOf(P.armR.x); float xL = mix(333.0, 407.0, liftL), rL = mix(80.0, 34.0, liftL); float xR = mix(648.0, 576.0, liftR), rR = mix(80.0, 34.0, liftR); float yoke = boxMM(pu, vec2(xL, 600.0), vec2(xR, 772.0), vec4(rR, 0.0, rL, 0.0)); // Below the armpit line outside the torso the arms own the space; // the cut rises on a lifted side to make room for a clean armpit. float cutL = boxMM(pu, vec2(-1000.0, -1000.0), vec2(407.0, 668.0 + 40.0 * liftL), vec4(0.0)); float cutR = boxMM(pu, vec2(576.0, -1000.0), vec2(2000.0, 668.0 + 40.0 * liftR), vec4(0.0)); yoke = max(yoke, -min(cutL, cutR)); // Torso block down to the crotch float torso = boxMM(pu, vec2(407.0, 452.0), vec2(576.0, 700.0), vec4(0.0)); float body = min(yoke, torso); // Arms. Shoulder joints slide up and in as each arm lifts, so a raised arm // comes out of the top of the shoulder instead of the armpit. vec2 SL = mix(vec2(363.0, 700.0), vec2(404.0, 744.0), smoothstep(0.0, 0.6, liftL)); vec2 SR = mix(vec2(619.0, 700.0), vec2(578.0, 744.0), smoothstep(0.0, 0.6, liftR)); float foreL, foreR; float armL = armParts(pu, SL, -1.0, 30.0, P.armL, P.lenL, foreL); float armR = armParts(pu, SR, 1.0, 29.0, P.armR, P.lenR, foreR); // Legs: hips ride with the upper body, feet go where the pose puts them mat2 back = rot(-P.tilt); vec2 HL = back * (HIP_L - PELVIS) + PELVIS + P.body; vec2 HR = back * (HIP_R - PELVIS) + PELVIS + P.body; float legL = legTube(p, HL, P.footL, 38.5, -1.0, P.splay); float legR = legTube(p, HR, P.footR, 39.0, 1.0, P.splay); // Pictogram layering: a forearm crossing in front of the chest, head, legs // or the other arm is separated by a thin black gap (no effect at rest). float gap = 10.0; float fore = min(foreL, foreR) - gap; body = max(body, -fore); head = max(head, -fore); legL = max(legL, -fore); legR = max(legR, -fore); armL = max(armL, -(foreR - gap)); // right forearm passes in front of the left arm if (P.legFront > 0.5) legL = max(legL, -(legR - gap)); if (P.legFront < -0.5) legR = max(legR, -(legL - gap)); // Blend lifted arms into the shoulder/armpit; razor sharp at rest float d = smin(body, armR, 0.5 + 24.0 * liftR); d = smin(d, armL, 0.5 + 24.0 * liftL); d = min(d, head); d = min(d, min(legL, legR)); return d; } // Whole-body transform: rotate / scale / squash the figure around its centre #define GPIV vec2(491.0, 500.0) float figureG(vec2 p, Pose P) { float sx = sign(P.gSx) * max(abs(P.gSx), 0.12); vec2 lp = rot(P.gRot) * (p - GPIV - P.gOff); lp.x /= sx; lp = lp / P.gScale + GPIV; return figure(lp, P) * P.gScale * min(abs(sx), 1.0); } // Figure-local point -> world vec2 toWorld(vec2 L, Pose P) { float sx = sign(P.gSx) * max(abs(P.gSx), 0.12); vec2 v = (L - GPIV) * P.gScale; v.x *= sx; return GPIV + P.gOff + rot(-P.gRot) * v; } void addPt(vec2 L, float r, Pose P, inout vec4 box) { vec2 w = toWorld(L, P); float rr = r * P.gScale; box.x = min(box.x, w.x - rr); box.y = min(box.y, w.y - rr); box.z = max(box.z, w.x + rr); box.w = max(box.w, w.y + rr); } // Bounding box of the posed body's key joints (head, hands, elbows, knees, feet) vec4 bodyBox(Pose P) { vec4 box = vec4(1e5, 1e5, -1e5, -1e5); mat2 back = rot(-P.tilt); vec2 N = vec2(491.0, 772.0); vec2 hc = rot(-P.headTilt) * (vec2(491.0, 854.0) - N) + N; addPt(back * (hc - PELVIS) + PELVIS + P.body, 67.0, P, box); float liftL = liftOf(P.armL.x), liftR = liftOf(P.armR.x); vec2 SL = mix(vec2(363.0, 700.0), vec2(404.0, 744.0), smoothstep(0.0, 0.6, liftL)); vec2 SR = mix(vec2(619.0, 700.0), vec2(578.0, 744.0), smoothstep(0.0, 0.6, liftR)); for (int i = 0; i < 2; i++) { float sx = (i == 0) ? -1.0 : 1.0; vec2 S = (i == 0) ? SL : SR; vec3 a = (i == 0) ? P.armL : P.armR; vec2 l = (i == 0) ? P.lenL : P.lenR; vec2 E = S + 115.0 * aDir(a.x, sx); vec2 W = E + l.x * aDir(a.y, sx); vec2 T = W + l.y * aDir(a.z, sx); addPt(back * (E - PELVIS) + PELVIS + P.body, 29.0, P, box); addPt(back * (W - PELVIS) + PELVIS + P.body, 29.0, P, box); addPt(back * (T - PELVIS) + PELVIS + P.body, 29.0, P, box); } vec2 HL = back * (HIP_L - PELVIS) + PELVIS + P.body; vec2 HR = back * (HIP_R - PELVIS) + PELVIS + P.body; vec2 FpL, FpR; vec2 KL = kneeOf(HL, P.footL, -1.0, P.splay, FpL); vec2 KR = kneeOf(HR, P.footR, 1.0, P.splay, FpR); addPt(KL, 38.5, P, box); addPt(FpL, 38.5, P, box); addPt(KR, 39.0, P, box); addPt(FpR, 39.0, P, box); addPt(HL, 38.5, P, box); addPt(HR, 39.0, P, box); return box; } // Floor solver: drop the whole figure so its lowest point rests on the floor // (Y 115), centred in the tile void groundPose(inout Pose P) { if (P.grounded < 0.001) return; vec4 box = bodyBox(P); vec2 shift = vec2(491.0 - 0.5 * (box.x + box.z), 115.0 - box.y); P.gOff += shift * P.grounded; } // Only push the figure back up if a blend has dipped it through the floor void floorClamp(inout Pose P) { vec4 box = bodyBox(P); P.gOff.y += max(0.0, 115.0 - box.y); } // --------------------------------------------------------------------------- // Motion modes // --------------------------------------------------------------------------- // Wave: elbow-led lift, forearm wave with trailing nub, auto loop or manual void poseWave(inout Pose P, float t) { float ph = fract(t / waveCycle); float autoRaise = smoothstep(0.06, 0.24, ph) * (1.0 - smoothstep(0.80, 0.96, ph)); float raise = waveAuto ? autoRaise * waveRaise : waveRaise; float lift = liftCurve(raise); float fold = smoothstep(0.35, 1.0, raise); float env = smoothstep(0.78, 1.0, raise); // Style presets: pose = (upper angle, elbow bend), amp = (forearm, nub flick, shoulder) float style = float(waveStyle); vec2 pose = vec2(0.16, 1.22); vec3 amp = vec3(0.75, 0.30, 0.00); if (style > 0.5 && style < 1.5) { pose = vec2(0.22, 1.12); amp = vec3(0.08, 0.60, 0.00); } else if (style > 1.5) { pose = vec2(0.08, 0.86); amp = vec3(0.10, 0.30, 0.27); } float w = t * waveSpeed * 2.0 * PI; float A = waveAmount * env; float osc = sin(w); float lag = sin(w - 1.1); float upper = mix(-HALF_PI, pose.x, lift) + A * (amp.z - 0.25 * amp.x) * osc; float foreHang = min(upper, -HALF_PI + 0.3); float foreUp = upper + pose.y + A * amp.x * osc; float fore = mix(foreHang, foreUp, fold); float nub = fore - 0.12 * fold + A * amp.y * lag; P.armR = vec3(upper, fore, nub); P.lenR = vec2(mix(103.0, 84.0, fold), 30.0 * fold); P.headTilt = bodyFollow * (0.09 * clamp(lift, 0.0, 1.0) + 0.035 * A * sin(w - 1.8)); } // --------------------------------------------------------------------------- // Side view (Walk / Run): the figure turns to profile, facing screen right. // Angles here are measured from straight down, + = forward (toward +x). // --------------------------------------------------------------------------- struct Side { float lean; // torso lean from the hip (+ = forward) float hipY; // hip joint height (feet are planted from this) float headTilt; // head nod vec3 armN; // near arm: (upper, forearm, nub) angles, relative to the torso vec3 armF; // far arm float nubLen; // trailing nub length (0 = plain round end like the reference) float farBack; // how far back the far shoulder sits vec2 legN; // near leg: (thigh angle, knee bend; + bends the shin back) vec2 legF; // far leg }; vec2 dDown(float a) { return vec2(sin(a), -cos(a)); } // iq uneven capsule: p relative to the bottom centre, axis +y, radii r1 (bottom) / r2 (top) float sdUnevenCapsule(vec2 p, float r1, float r2, float h) { p.x = abs(p.x); float b = (r1 - r2) / h; float a = sqrt(1.0 - b * b); float k = dot(p, vec2(-b, a)); if (k < 0.0) return length(p) - r1; if (k > a * h) return length(p - vec2(0.0, h)) - r2; return dot(p, vec2(a, b)) - r1; } // Vertical reach of a leg from hip to ankle float legDrop(vec2 leg) { return LEG_SEG * (cos(leg.x) + cos(leg.x - leg.y)); } // Profile leg: thigh, shin, and a rounded shoe toe so the foot reads in profile. // The toe sits flush with the sole of the round heel so the outline stays clean. float sideLeg(vec2 p, vec2 H, vec2 leg, float r) { vec2 K = H + LEG_SEG * dDown(leg.x); float shin = leg.x - leg.y; vec2 A = K + LEG_SEG * dDown(shin); vec2 fwd = vec2(cos(shin), sin(shin)); // 90deg forward of the shin vec2 t0 = A + dDown(shin) * (r - 30.0) + fwd * 6.0; // Never let the toe dig into the ground (Y 115): near the floor the foot // pivots flat on its toe as the heel lifts. float minY = (145.0 - t0.y) / 40.0; if (fwd.y < minY) { fwd.y = clamp(minY, -1.0, 1.0); fwd.x = sqrt(max(1.0 - fwd.y * fwd.y, 0.0)); } float d = min(sdSeg(p, H, K), sdSeg(p, K, A)) - r; return smin(d, sdSeg(p, t0, t0 + fwd * 40.0) - 30.0, 16.0); } // Profile arm: same even-width tube and rounded nub as the front-view arm float sideArm(vec2 p, vec2 S, vec3 ang, float nubLen) { vec2 E = S + 115.0 * dDown(ang.x); vec2 W = E + 103.0 * dDown(ang.y); vec2 T = W + nubLen * dDown(ang.z); float dU = sdSeg(p, S, E) - 29.0; float dF = sdBezier(p, E, W, T) - 29.0; return smin(dU, dF, 4.0 * clamp(nubLen / 30.0, 0.0, 1.0) + 0.001); } float figureSide(vec2 p, Side P) { vec2 H = vec2(491.0, P.hipY); vec2 u = vec2(sin(P.lean), cos(P.lean)); // torso axis vec2 n = vec2(u.y, -u.x); // Torso: profile chest/back, a little fuller at the chest than the hips vec2 B = H + u * 30.0; vec2 tp = vec2(dot(p - B, n), dot(p - B, u)); float torso = sdUnevenCapsule(tp, 60.0, 70.0, 210.0); // Head rides the torso, nodding around the neck vec2 neck = H + u * 300.0; vec2 hc = neck + 84.0 * vec2(sin(P.lean * 0.6 + P.headTilt), cos(P.lean * 0.6 + P.headTilt)); float head = length(p - hc) - 67.0; // Limbs. Arm angles are relative to the torso, so a lean carries them forward. // The far shoulder can sit a touch back, so a far arm swung behind shows as a // clear shape instead of slivers along the torso edge. vec2 S = H + u * 236.0; vec2 SF = S - n * P.farBack + u * 6.0; float armN = sideArm(p, S, P.armN + P.lean * 0.6, P.nubLen); float armF = sideArm(p, SF, P.armF + P.lean * 0.6, P.nubLen); float legN = sideLeg(p, H, P.legN, 38.5); float legF = sideLeg(p, H, P.legF, 38.5); // Pictogram layering: far limbs sit behind, separated by a thin black gap float gap = 10.0; float back = min(armF, legF); back = max(back, -(legN - gap)); // near leg in front of far leg back = max(back, -(torso - gap)); // far arm and far hip tuck behind the torso float d = min(min(torso, head), legN); d = smin(d, back, 0.5); // Near arm on top of everything with its own gap d = max(d, -(armN - gap)); d = min(d, armN); return d; } // Walk: profile gait. Thigh swing, knee folds in early swing, a little flex on // landing; the hip height is solved so the standing foot stays on the ground. void poseWalkSide(inout Side P, float beats, float E) { float ph = PI * beats; // one step per beat, stride every 2 for (int i = 0; i < 2; i++) { float f = ph + float(i) * PI; float th = 0.08 + 0.36 * sin(f); float kn = 0.08 + 0.95 * pow(max(0.0, cos(f + 0.35)), 2.0) + 0.18 * pow(max(0.0, cos(f - 2.1)), 4.0); vec2 leg = vec2(th, kn) * E; float sw = -0.38 * sin(f); // arm swings opposite its leg vec3 arm = vec3(sw, sw + 0.22 + 0.25 * max(0.0, -sin(f)), 0.0) * E; arm.z = arm.y; if (i == 0) { P.legN = leg; P.armF = arm; } else { P.legF = leg; P.armN = arm; } } P.hipY = FOOT_L.y + max(legDrop(P.legN), legDrop(P.legF)); P.lean = 0.05 * E; P.headTilt = bodyFollow * 0.05 * E * sin(2.0 * ph + 0.6); P.nubLen = 0.0; P.farBack = 0.0; // far arm hides behind the body at mid-swing } // Run: longer stride, high heel kick, bent pumping arms, forward lean and a // short flight phase as stance switches feet. void poseRunSide(inout Side P, float beats, float E) { float ph = 2.0 * PI * beats; // one stride (two steps) per beat for (int i = 0; i < 2; i++) { float f = ph + float(i) * PI; float th = 0.10 + 0.55 * sin(f) + 0.22 * sin(2.0 * f); float kn = 0.30 + 1.75 * pow(max(0.0, cos(f + 0.45)), 1.6) + 0.35 * pow(max(0.0, cos(f - 2.9)), 2.0); vec2 leg = vec2(th, kn) * E; float sw = -0.80 * sin(f); vec3 arm = vec3(sw, sw + 1.55 + 0.20 * sin(f), 0.0); arm = mix(vec3(0.0), arm, E); arm.z = arm.y + 0.25 * E * cos(f); // nub trails the pump if (i == 0) { P.legN = leg; P.armF = arm; } else { P.legF = leg; P.armN = arm; } } float dn = legDrop(P.legN), df = legDrop(P.legF); float flight = 24.0 * E * pow(clamp(1.0 - abs(dn - df) / 70.0, 0.0, 1.0), 2.0); P.hipY = FOOT_L.y + max(dn, df) + flight; P.lean = 0.20 * E; P.headTilt = bodyFollow * (-0.08 * E + 0.05 * E * sin(2.0 * ph)); P.nubLen = 18.0 * E; P.farBack = 24.0 * E; } // Dance: side-to-side groove, dip on every beat, heel pops, alternating arm raises void poseDance(inout Pose P, float beats, float E) { float ph = PI * beats; // full groove every two beats float s = sin(ph); float dip = 0.5 + 0.5 * cos(2.0 * ph); // 1 on each beat P.body = vec2(24.0 * E * s, -14.0 * E * dip); P.tilt = -0.07 * E * s; // lean into the sway P.headTilt = bodyFollow * 0.12 * E * sin(ph + 0.8); // Slightly wider stance, unweighted heel pops up P.footL = FOOT_L + vec2(-20.0 * E, 18.0 * E * pow(max( s, 0.0), 2.0)); P.footR = FOOT_R + vec2( 20.0 * E, 18.0 * E * pow(max(-s, 0.0), 2.0)); P.splay = 0.6; float upR = smoothstep(0.1, 0.9, 0.5 + 0.5 * s); float upL = smoothstep(0.1, 0.9, 0.5 - 0.5 * s); float pump = 0.15 * (dip - 0.5); float lagR = 0.25 * cos(ph), lagL = -lagR; float uR = mix(-1.25, 0.45, upR), aR = mix(-0.35, 1.35, upR) + pump; float uL = mix(-1.25, 0.45, upL), aL = mix(-0.35, 1.35, upL) + pump; P.armR = mix(vec3(-HALF_PI), vec3(uR, aR, aR - 0.1 * upR + lagR), E); P.armL = mix(vec3(-HALF_PI), vec3(uL, aL, aL - 0.1 * upL + lagL), E); P.lenR = mix(vec2(103.0, 0.0), vec2(mix(95.0, 84.0, upR), mix(16.0, 30.0, upR)), E); P.lenL = mix(vec2(103.0, 0.0), vec2(mix(95.0, 84.0, upL), mix(16.0, 30.0, upL)), E); } // --------------------------------------------------------------------------- // Hip-hop and breaking styles (Dance mode -> Dance Style) // --------------------------------------------------------------------------- float gbump(float x) { return exp(-1.4 * x * x); } float wrapAng(float a) { return mod(a + PI, 2.0 * PI) - PI; } // Blend two poses, taking the short way round for the whole-body rotation Pose blendPose(Pose A, Pose B, float t) { B.gRot = A.gRot + wrapAng(B.gRot - A.gRot); return mixPose(A, B, t); } // Hip-Hop Bounce: knees drop on every beat, shoulders rock, wide stance, // arms swing across the chest one beat at a time void danceBounce(inout Pose P, float b, float E) { float down = pow(abs(cos(PI * b)), 3.0); // 1 on every beat float rock = sin(PI * b); // alternates each beat float s = sin(PI * b * 0.5); // drift side to side over two beats P.body = vec2(26.0 * s, 4.0 - 24.0 * down) * E; P.tilt = 0.08 * E * rock; P.headTilt = bodyFollow * 0.14 * E * sin(PI * b - 0.7); P.footL = FOOT_L + vec2(-32.0 + 18.0 * s, 16.0 * max(0.0, s) * abs(rock)) * E; P.footR = FOOT_R + vec2( 32.0 + 18.0 * s, 16.0 * max(0.0, -s) * abs(rock)) * E; P.splay = 0.75; float x = 0.5 + 0.5 * rock; // right arm crosses on one beat, left on the next vec3 crossA = vec3(-1.40, 2.65, 2.85); vec3 outA = vec3(-0.90, -0.25, -0.45); P.armR = mix(vec3(-HALF_PI), mix(outA, crossA, x), E); P.armL = mix(vec3(-HALF_PI), mix(outA, crossA, 1.0 - x), E); P.lenR = mix(vec2(103.0, 0.0), vec2(mix(100.0, 92.0, x), 16.0), E); P.lenL = mix(vec2(103.0, 0.0), vec2(mix(100.0, 92.0, 1.0 - x), 16.0), E); } // Running Man: knee drives up on each beat while the arms reach forward, // then the foot slides back down and the arms push to the floor void danceRunningMan(inout Pose P, float b, float E) { float k = sin(PI * b); // left knee on one beat, right on the next float a = smoothstep(0.0, 1.0, abs(k)); P.footL += vec2(-10.0, 105.0 * pow(max( k, 0.0), 1.3)) * E; P.footR += vec2( 10.0, 105.0 * pow(max(-k, 0.0), 1.3)) * E; P.splay = 0.35; P.body = vec2(6.0 * k, -16.0 * (1.0 - abs(k))) * E; P.tilt = -0.03 * E * k; P.headTilt = bodyFollow * 0.08 * E * k; vec3 up = vec3(-1.10, 2.10, 2.30); vec3 down = vec3(-1.45, -1.55, -1.55); P.armR = mix(vec3(-HALF_PI), mix(down, up, a), E); P.armL = P.armR; P.lenR = mix(vec2(103.0, 0.0), mix(vec2(103.0, 0.0), vec2(58.0, 18.0), a), E); P.lenL = P.lenR; } // Robot key poses: hard right angles, held between hits void robotKey(float i, inout Pose P) { i = mod(i, 6.0); if (i < 0.5) { P.armR = vec3(0.0, HALF_PI, HALF_PI); P.armL = vec3(-HALF_PI, 0.0, 0.0); P.headTilt = 0.12; } else if (i < 1.5) { P.armR = vec3(-HALF_PI, 0.0, 0.0); P.armL = vec3(0.0, HALF_PI, HALF_PI); P.headTilt = -0.12; } else if (i < 2.5) { P.armR = vec3(0.0, -HALF_PI, -HALF_PI); P.armL = P.armR; P.tilt = 0.05; P.footR.x += 30.0; } else if (i < 3.5) { P.armR = vec3(0.0, HALF_PI, HALF_PI); P.armL = P.armR; P.tilt = -0.05; P.footL.x -= 30.0; } else if (i < 4.5) { P.armR = vec3(-0.75, 2.45, 2.45); P.armL = vec3(-HALF_PI); P.tilt = -0.08; P.headTilt = 0.22; } else { P.armL = vec3(-0.75, 2.45, 2.45); P.armR = vec3(-HALF_PI); P.tilt = 0.08; P.headTilt = -0.22; } } // Robot / Popping: snaps into a new key pose right on each beat, with a small // 'pop' jitter and dip on the hit, then holds still void danceRobot(inout Pose P, float b, float E) { float k = floor(b), f = fract(b); Pose A = P, B = P; robotKey(k - 1.0, A); robotKey(k, B); Pose R = mixPose(A, B, smoothstep(0.0, 0.16, f)); float hit = exp(-f * 12.0); float buzz = 0.05 * sin(f * 70.0) * hit; R.tilt += buzz; R.headTilt += buzz * 1.5; R.body.y -= 10.0 * hit; P = mixPose(P, R, E); } // Arm Wave: a wave rolls from the left nub through the elbows and shoulders to // the right nub, then back, with the shoulders popping as it passes the chest void danceArmWave(inout Pose P, float b, float E) { float u = fract(b / 4.0) * 2.0; // across in 2 beats, back in 2 float c = (u < 1.0) ? mix(-1.0, 7.0, u) : mix(7.0, -1.0, u - 1.0); float A = 85.0; float hLT = A * gbump(c - 0.0), hLW = A * gbump(c - 0.9), hLE = A * gbump(c - 1.8), hLS = A * gbump(c - 2.7); float hRS = A * gbump(c - 3.3), hRE = A * gbump(c - 4.2), hRW = A * gbump(c - 5.1), hRT = A * gbump(c - 6.0); vec3 aL = vec3(atan(hLE - hLS, 115.0), atan(hLW - hLE, 90.0), atan(hLT - hLW, 30.0)); vec3 aR = vec3(atan(hRE - hRS, 115.0), atan(hRW - hRE, 90.0), atan(hRT - hRW, 30.0)); P.armL = mix(vec3(-HALF_PI), aL, E); P.armR = mix(vec3(-HALF_PI), aR, E); P.lenL = mix(vec2(103.0, 0.0), vec2(90.0, 30.0), E); P.lenR = P.lenL; float pop = gbump(c - 3.3) - gbump(c - 2.7); P.tilt = 0.10 * E * pop; P.headTilt = bodyFollow * 0.10 * E * pop; P.body = vec2(0.0, -8.0 * pow(abs(cos(PI * b)), 2.0) + 12.0 * gbump(c - 3.0)) * E; P.splay = 0.6; } // Toprock (Indian step): the right foot kicks across in front, arms open wide, // back to centre with the arms folded, then the left foot crosses void danceToprock(inout Pose P, float b, float E) { float s = sin(PI * b * 0.5); float cR = smoothstep(0.0, 1.0, max( s, 0.0)); float cL = smoothstep(0.0, 1.0, max(-s, 0.0)); float bounce = pow(abs(cos(PI * b)), 2.0); P.body = vec2(-30.0 * cR + 30.0 * cL, 6.0 - 14.0 * bounce) * E; P.tilt = (0.12 * cR - 0.12 * cL) * E; // the kicking foot crosses well past the standing one, which steps out a touch P.footR = FOOT_R + vec2(10.0 - 230.0 * cR + 30.0 * cL, 30.0 * cR * (1.0 - bounce)) * E; P.footL = FOOT_L + vec2(230.0 * cL - 10.0 - 30.0 * cR, 30.0 * cL * (1.0 - bounce)) * E; P.legFront = (s > 0.0) ? 1.0 : -1.0; P.splay = 0.4; P.headTilt = bodyFollow * 0.10 * E * s; float o = max(cR, cL); vec3 arm = mix(vec3(-1.25, 2.55, 2.75), vec3(0.25, 0.65, 0.85), o); P.armR = mix(vec3(-HALF_PI), arm, E); P.armL = P.armR; P.lenR = mix(vec2(103.0, 0.0), vec2(95.0, 26.0), E); P.lenL = P.lenR; } // Six-Step: dropped low on the floor, one hand planted, the feet circling // around and crossing through; the planted hand switches as the feet come round void danceSixStep(inout Pose P, float b, float E) { float a = PI * b * 0.5 * spinSpeed; // one circuit every 4 beats float c = cos(a), s = sin(a); float tau = 0.52 * c; // lean onto the planted hand P.body = vec2(0.0, -250.0) * E; P.tilt = tau * E; vec2 fl = vec2(491.0 - 210.0 * c + 60.0 * s, 158.0 + 55.0 * max(0.0, s)); vec2 fr = vec2(491.0 + 210.0 * c + 60.0 * s, 158.0 + 55.0 * max(0.0, -s)); P.footL = mix(FOOT_L, fl, E); P.footR = mix(FOOT_R, fr, E); P.legFront = (s > 0.0) ? -1.0 : 1.0; P.splay = 0.9; float plantL = smoothstep(-0.35, 0.35, c); // left hand down while leaning left vec3 plant = vec3(-HALF_PI + abs(tau)); // straight down to the floor once leaning vec3 free = vec3(0.25, 1.45, 1.75); P.armL = mix(vec3(-HALF_PI), mix(free, plant, plantL), E); P.armR = mix(vec3(-HALF_PI), mix(plant, free, plantL), E); P.lenL = mix(vec2(103.0, 0.0), vec2(103.0, mix(24.0, 0.0, plantL)), E); P.lenR = mix(vec2(103.0, 0.0), vec2(103.0, mix(0.0, 24.0, plantL)), E); P.headTilt = bodyFollow * 0.12 * E * c; P.grounded = E; } // Windmill: the body rolls around on the floor with the legs out in a wide V, // scissoring open and closed, one arm tucked across the chest void danceWindmill(inout Pose P, float b, float E) { float ang = -PI * b * spinSpeed; // one full roll every 2 beats float v = 1.0 + 0.25 * sin(2.0 * ang); P.footL = mix(FOOT_L, vec2(491.0 - 230.0 * v, 205.0), E); P.footR = mix(FOOT_R, vec2(491.0 + 230.0 * v, 205.0), E); P.splay = 0.2; P.armR = mix(vec3(-HALF_PI), vec3(-1.25, 2.50, 2.70), E); P.armL = mix(vec3(-HALF_PI), vec3(-0.20, 0.60, 0.90), E); P.lenR = mix(vec2(103.0, 0.0), vec2(85.0, 20.0), E); P.lenL = P.lenR; P.gRot = wrapAng(ang) * E; P.gScale = mix(1.0, 0.70, E); P.grounded = E; } // Headspin: upside down on the head, arms out for balance, one leg out and // one tucked so the spin reads as the figure flips round void danceHeadspin(inout Pose P, float b, float E) { float spin = 2.0 * PI * b * spinSpeed; // one revolution per beat P.gRot = PI * E; P.gSx = mix(1.0, cos(spin), E); P.gScale = mix(1.0, 0.78, E); P.footL = mix(FOOT_L, vec2(250.0, 225.0), E); P.footR = mix(FOOT_R, vec2(560.0, 330.0), E); P.splay = 0.9; P.legFront = 1.0; P.armR = mix(vec3(-HALF_PI), vec3(0.05, 0.25, 0.35), E); P.armL = mix(vec3(-HALF_PI), vec3(0.05, 0.25, 0.35), E); P.lenR = mix(vec2(103.0, 0.0), vec2(95.0, 20.0), E); P.lenL = P.lenR; P.tilt = 0.05 * E * sin(spin); P.grounded = E; } // Freeze key poses (held, the floor solver plants whichever part is lowest) void freezeKey(float i, inout Pose P) { i = mod(i, 4.0); P.grounded = 1.0; P.gScale = 0.78; if (i < 0.5) { // handstand split P.gRot = PI; P.armR = vec3(HALF_PI - 0.15); P.armL = P.armR; P.lenR = vec2(103.0, 0.0); P.lenL = P.lenR; P.footL = vec2(230.0, 260.0); P.footR = vec2(752.0, 260.0); P.splay = 0.0; } else if (i < 1.5) { // chair freeze: tipped onto one straight arm, knees tucked P.gRot = -1.15; P.armR = vec3(-0.15); P.armL = vec3(0.9, 1.9, 2.1); P.lenL = vec2(90.0, 24.0); P.footL = vec2(400.0, 330.0); P.footR = vec2(600.0, 360.0); P.splay = 1.0; P.headTilt = 0.25; } else if (i < 2.5) { // baby freeze: on its side, knees tucked, one leg out P.gRot = 1.95; P.armL = vec3(0.2); P.armR = vec3(-1.3, 2.4, 2.6); P.lenR = vec2(85.0, 20.0); P.footL = vec2(330.0, 230.0); P.footR = vec2(560.0, 360.0); P.splay = 0.8; P.headTilt = -0.2; } else { // one-arm pike hold: inverted, legs together and angled P.gRot = PI - 0.45; P.armR = vec3(HALF_PI - 0.1); P.armL = vec3(0.3, 0.9, 1.0); P.lenL = vec2(95.0, 26.0); P.footL = vec2(470.0, 150.0); P.footR = vec2(520.0, 150.0); P.legFront = 1.0; P.splay = 0.2; } } // Freezes: hit a new freeze every two beats and hold it, with a little pop on the hit void danceFreezes(inout Pose P, float b, float E) { float k = floor(b * 0.5), f = fract(b * 0.5); Pose A = P, B = P; freezeKey(k - 1.0, A); freezeKey(k, B); Pose R = blendPose(A, B, smoothstep(0.0, 0.14, f)); R.gScale *= 1.0 + 0.04 * exp(-f * 14.0) * sin(f * 40.0); P = blendPose(P, R, E); } void danceStyleN(float st, inout Pose P, float b, float E) { if (st < 0.5) poseDance(P, b, E); else if (st < 1.5) danceBounce(P, b, E); else if (st < 2.5) danceRunningMan(P, b, E); else if (st < 3.5) danceRobot(P, b, E); else if (st < 4.5) danceArmWave(P, b, E); else if (st < 5.5) danceToprock(P, b, E); else if (st < 6.5) danceSixStep(P, b, E); else if (st < 7.5) danceWindmill(P, b, E); else if (st < 8.5) danceHeadspin(P, b, E); else danceFreezes(P, b, E); } // Breaking Combo: a 16-beat routine that flows Toprock (8) -> drop into // Six-Step (4) -> Windmill (2) -> hit a freeze (2), then back up to Toprock void danceCombo(inout Pose P, float b, float E) { float c = mod(b, 16.0); float cur = 5.0, prev = 9.0, t0 = 0.0; if (c >= 8.0 && c < 12.0) { cur = 6.0; prev = 5.0; t0 = 8.0; } else if (c >= 12.0 && c < 14.0) { cur = 7.0; prev = 6.0; t0 = 12.0; } else if (c >= 14.0) { cur = 9.0; prev = 7.0; t0 = 14.0; } Pose A = P, B = P; if (prev > 8.5) { freezeKey(3.0, A); A = mixPose(P, A, E); } else danceStyleN(prev, A, b, E); if (cur > 8.5) { freezeKey(3.0, B); B = mixPose(P, B, E); } else danceStyleN(cur, B, b, E); groundPose(A); groundPose(B); A.grounded = 0.0; // already planted B.grounded = 0.0; P = blendPose(A, B, smoothstep(t0, t0 + 0.6, c)); floorClamp(P); } void poseDanceStyle(inout Pose P, float b, float E) { float st = float(danceStyle); if (st > 9.5) danceCombo(P, b, E); else danceStyleN(st, P, b, E); } // Jumping jacks: hop on each switch, land open (arms up, feet wide) then closed void poseJacks(inout Pose P, float beats, float E) { float ph = PI * beats; // open on one beat, closed on the next float j = (0.5 - 0.5 * cos(ph)) * E; // 0 closed .. 1 open float hop = 24.0 * E * abs(sin(ph)); // airborne between positions P.body = vec2(0.0, hop - 9.0 * j); // sink a touch when landing wide P.footL = FOOT_L + vec2(-75.0 * j, hop); P.footR = FOOT_R + vec2( 75.0 * j, hop); P.splay = 0.3; float u = mix(-HALF_PI, 0.85, j); float a = mix(-HALF_PI, 0.95, j); float trail = 0.15 * E * sin(ph); P.armR = vec3(u, a, a - trail); P.armL = vec3(u, a, a - trail); P.lenR = vec2(mix(103.0, 84.0, j), 30.0 * j); P.lenL = P.lenR; } // Stand still: just a slow breath void poseStand(inout Pose P, float t, float E) { P.body = vec2(0.0, 2.5 * E * sin(t * 1.3)); } void main() { float t = TIME * speed; float beats = t * bpm / 60.0; float E = moveAmount; // Aspect-correct coords, mapped into the reference's 1000-unit frame vec2 p = isf_FragNormCoord - 0.5; p.x *= RENDERSIZE.x / RENDERSIZE.y; float upp = 1000.0 / (RENDERSIZE.y * zoom); // reference units per screen pixel (for AA) vec2 q = p * 1000.0 / zoom + 500.0; // Rounded black tile float dTile = sdRoundBox(q - vec2(500.0), vec2(468.0), vec4(95.0)); float tileM = showTile ? clamp(0.5 - dTile / upp, 0.0, 1.0) : 1.0; // ---------------- Pose for the selected motion ---------------- float mode = float(motionMode); bool sideView = mode > 0.5 && mode < 2.5; // Walk and Run turn to profile Pose P; restPose(P); if (mode < 0.5) poseWave(P, t); else if (mode < 3.5) poseDanceStyle(P, beats, E); else if (mode < 4.5) poseJacks(P, beats, E); else poseStand(P, t, E); groundPose(P); // power moves / freezes rest on the floor Side SP; SP.lean = 0.0; SP.hipY = HIP_L.y; SP.headTilt = 0.0; SP.nubLen = 0.0; SP.farBack = 0.0; SP.armN = vec3(0.0); SP.armF = vec3(0.0); SP.legN = vec2(0.0); SP.legF = vec2(0.0); if (mode > 0.5 && mode < 1.5) poseWalkSide(SP, beats, E); else if (mode > 1.5 && mode < 2.5) poseRunSide(SP, beats, E); // ---------------- Figure ---------------- float s = 1.0 + pulse * 0.08 * sin(t * 3.0); vec2 c = vec2(491.0, 500.0); vec2 fq = (q - c) / s + c; if (waveLeft) fq.x = 982.0 - fq.x; // mirror about the figure's centre line float dFig = (sideView ? figureSide(fq, SP) : figureG(fq, P)) * s; // Optional ground dashes that scroll under the feet in Walk / Run if (sideView && groundDashes) { float scroll = beats * (mode < 1.5 ? 210.0 : 470.0); float gx = mod(fq.x + scroll, 110.0) - 55.0; float dash = boxMM(vec2(gx, fq.y), vec2(-30.0, 92.0), vec2(30.0, 102.0), vec4(5.0)); dash = max(dash, abs(fq.x - 491.0) - 380.0); dFig = min(dFig, dash * s); } // Fill vs outline float lw = mix(3.0, 40.0, lineWidth); float mFill = clamp(0.5 - dFig / upp, 0.0, 1.0); float mLine = clamp(0.5 - (abs(dFig) - lw * 0.5) / upp, 0.0, 1.0); float m = mix(mFill, mLine, outlineMix); // Color: solid figure color blended toward the reference cosine palette vec3 pal = 0.5 + 0.5 * cos(t + q.y * 0.006 + q.x * 0.002 + vec3(0.0, 2.0, 4.0) + hue * 6.2831); vec3 fig = mix(figureColor.rgb, pal, colorCycle); // Soft halo around the figure float g = glow * exp(-max(dFig, 0.0) / 60.0) * 0.8; vec3 inside = tileColor.rgb + fig * g; inside = mix(inside, fig, m); vec3 col = mix(outerColor.rgb, inside, tileM); gl_FragColor = vec4(col, 1.0); }
Restroom-sign pictogram: white standing figure on a rounded black tile, with a Motion Mode dropdown: Wave, Walk and Run (the figure turns to a side-view profile), Dance (Groove, Hip-Hop Bounce, Running Man, Robot, Arm Wave, and breaking: Toprock, Six-Step, Windmill, Headspin, Freezes and an auto Breaking Combo), Jumping Jacks and Stand Still. Fully jointed figure (shoulders, elbows, rounded nub ends, knees) with body bounce, sway and head follow. Moves lock to a BPM. Also color cycle, glow, outline and pulse for live use.
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).