Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Living Rorschach

A purely generative browser app that produces an endlessly evolving, symmetrical inkblot. No camera, no input, no two frames alike. Open the HTML file and it runs forever.


Demo

Open index.html in any modern browser. No interaction required.

Controls appear on hover at the bottom of the screen.


Features

  • Continuous generative animation — never loops, never stops
  • Three reflection modes: Y-axis, X-axis, and full XY quad symmetry
  • Invert mode — flips the composition to ink-on-black
  • 43 blobs across three tiers with independent lifecycles
  • Four shape types: round, elongated, irregular, and bone
  • Per-blob size breathing, continuous spin, and noise-driven drift
  • Four gradient types: radial, side-lit, dark-light-dark, and light-dark
  • Per-blob glow aura with three color variants
  • Socket blobs that punch negative space through the ink layer
  • Multiply blend mode compositing for ink-pooling depth
  • Fully responsive — fills any window size

How It Works

Architecture Overview

Blob population → offscreen half-canvas → stamp + mirror → main canvas

All drawing happens on an offscreen canvas covering the left half of the screen. Each frame, that half is stamped onto the main canvas with horizontal, vertical, or both reflections applied — producing the symmetrical inkblot effect.

Blob Population

The composition is built from 43 blobs across three tiers:

Tier Count Role
Marrow 5 Large, slow-moving forms that establish the compositional mass
Fronds 14 Mid-scale shapes that build density and variety, including socket shapes
Organelle 24 Small, fast-moving shapes that add edge complexity and surface noise

Blobs are drawn in tier order — marrow first, then non-socket fronds, then organelles, then socket fronds on top — so sockets always cut through the layers beneath them.

Shape Types

Each blob is assigned one of four shape characters at birth, sampled from per-tier probability weights:

Round — low aspect ratio, gentle per-node variation. Convex, smooth, blob-like.

Elongated — high aspect ratio (3.8–6.0×) with an elevated node count to maintain smooth closure at the poles. Low radial variation and tight warp amplitude produce a clean blade or stick form — unmistakably linear, distinct from all other shape types.

Irregular — large per-node radial variation produces kidneys, crescents, and concave lobes. The most unpredictable shape type.

Bone — built in explicit local space rather than polar coordinates. Two rounded lobes connected by a cosine-profiled waist. Nodes are placed along a long axis with rounded caps and wavering sides.

Node Distribution

For round, elongated, and irregular shapes, nodes are distributed by ellipse arc length rather than uniform angular spacing. Uniform spacing under-samples the poles of an ellipse, producing single-node tips that bezier curves cannot round correctly. The arc-length method concentrates more nodes at high-curvature poles and fewer along the flatter sides, ensuring smooth closure at any aspect ratio.

Bezier Path

Shapes are traced as smooth closed cubic bezier curves. At each node, the tangent is computed as the normalized average of the incoming and outgoing chord directions. Control point distances are scaled by chord length and a per-node noise weight, giving each edge segment a slightly different tightness — the organic membrane quality.

Motion

Each blob has three layers of motion applied simultaneously:

  1. Noise drift — position, rotation, and aspect ratio are all driven by Perlin noise with independent seeds and speeds per blob. Blobs drift continuously across the canvas, with drift ranges wide enough to bleed off the edges.

  2. Size breathing — a sine wave oscillates each blob's scale between roughly 0.3× and 2.0× its birth size. Blobs are assigned one of three breathing speeds (fast ~22s cycle, slow ~45s cycle, or static) at birth.

  3. Continuous spin — a constant angular velocity is layered on top of the noise-driven rotation. Each blob independently rolls fast (~40s full rotation), slow (~80s), or static.

Gradients

Each blob renders its fill as one of four gradient types, assigned at birth:

  • Radial — tight dark core fading to a pale halo, following the blob's ellipse shape. The classic ink-pooling look.
  • Side-lit — linear gradient raking across the shape, dark on one side, fading to transparent on the other.
  • Dark-light-dark — a bright band through the middle with dark edges, giving a backlit feel.
  • Light-dark — transparent leading edge pooling to dense ink at the trailing edge, watercolor wash effect.

All gradients use multiply blend mode against the offscreen canvas, so overlapping blobs deepen in tone the way real ink would.

Aura

Each blob has an optional soft glow rendered as a blurred fill drawn before the gradient pass. Aura color is one of gray (multiply), white (source-over), or none. Marrow blobs get the largest blurs (10–22px), organelles the smallest (0–6px).

Socket Blobs

A subset of frond-tier blobs are designated sockets. Instead of adding ink, they fill with the background color, punching holes through everything beneath them. Each socket also has an optional aura pass — gray, white, or background bleed — that softens the socket edge. Elongated shapes are excluded from socket assignment.

Lifecycle

Every blob runs through a four-state lifecycle: born → alive → dying → dead. Blobs fade in on birth and fade out on death. While alive, each blob has a small random probability of dying each frame. When a blob reaches the dead state it is immediately replaced with a freshly generated blob at the same tier, keeping the population count constant. Blobs are staggered at startup with individual fade delays so the composition fills in gradually rather than all at once.

Reflection

The offscreen half-canvas is stamped onto the main canvas using ctx.scale(-1,1) and ctx.scale(1,-1) transforms to produce mirror copies. Three modes are available:

  • Y — left half mirrored to right (vertical axis symmetry)
  • X — top half mirrored to bottom (horizontal axis symmetry)
  • XY — all four quadrants mirrored from a single quarter (full quad symmetry)

Controls

Controls are hidden by default and appear on hover.

Control Action
Reflect: Y / X / XY Cycle through reflection modes
Invert Toggle ink-on-paper vs ink-on-black

Requirements

Any modern browser with HTML5 Canvas support. No external scripts, libraries, or CDN dependencies.


License

MIT


Notes for Modification

Arc-length node distribution is not cosmetic — do not revert to uniform angular spacing

The makeNodes() function distributes nodes by ellipse arc length using a precomputed LUT. This replaced uniform angular spacing after extensive debugging. The problem with uniform spacing: on any ellipse with aspect ratio > 1, the poles (tips at angle 0 and π) are sampled by at most one node regardless of total node count, because they fall at single angular values. A single-node tip gives the bezier path nothing to curve around — it produces a flat chord that closes as a straight edge, creating rectangular tombstone shapes. Arc-length distribution puts more nodes where the ellipse has the highest curvature (the poles) and fewer where it's flat (the sides). If you change the node distribution method, tombstones will reappear at any aspect ratio above ~1.5.

Elongated shapes require a high node count — do not reduce it

The elongated shape type runs at aspect ratios of 3.8–6.0×, far beyond the range of round or irregular. At these ratios the arc-length rule (asp × 1/nodeCount < ~0.7) demands 18–24 nodes minimum. Reducing node count below this threshold reintroduces tombstone caps at the poles. The low radVar (0.08) and tight warpAmp are also load-bearing — they keep the blade form clean and distinct from irregular. Do not raise either without also raising node count.

Socket blobs must be drawn last, after all other tiers

The render loop draws blobs in a specific order: marrow → non-socket fronds → organelles → socket fronds. Sockets must go last because they use source-over with background fill color to punch holes through ink. If you draw them earlier, subsequent tiers paint back over the holes. The draw order is not arbitrary — changing it breaks sockets silently with no error.

The bone shape uses a completely different geometry pipeline

bone blobs bypass the entire makeNodes() / bakeAngle / aspect ratio pipeline. They are built in local Cartesian space by makeBoneNodes() using explicit ux/uy node coordinates, and the isBone: true flag on each node routes them through a separate branch in blobGeom() that does local→world transform (scale by R, rotate by rot, translate to center) rather than ellipse-polar math. If you modify blobGeom() and only update the polar branch, bone shapes will break. If you add new node properties, add them to both makeNodes() and makeBoneNodes().

Aspect ratio noise applies differently for bone shapes

baseAsp on a bone blob stores the half-length of the bone (in units of R), not a true aspect ratio. The aspNoise field is set to 0 for bones in CHARS, so the aspect ratio noise branch in blobGeom() has no effect — bone length is fixed at birth. Do not assume baseAsp means the same thing across all shape types.

Adding new shape types requires updates in four places

CHARS (node config), CHAR_WEIGHTS (per-tier probabilities), makeBlob() (factory branching), and blobGeom() (geometry computation). Missing any one of them will either never spawn the new type or crash silently when it tries to compute geometry with missing properties.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages