Lose Mosaikwand
WebGL-Film: Glas und Blattgold, Figuren als Schwärme von Steinchen
- 0–2,4 s Ruhige Wand, ein Glanzzug wandert über das Gold, einzelne Steinchen hüpfen heraus oder rücken sich zurecht
- 2,4–7,3 s Der Fisch hebt sich Steinchen für Steinchen aus dem Meer, Mörtelkrümel springen mit, er schwimmt und wendet
- 7,3–10,2 s Sprung durch den Goldgrund, die Schwalbe löst sich aus der Wand
- 10,2–13,3 s Der Fisch taucht ein, Spritzer fliegen, eine Ringwelle kippender Steinchen läuft durchs Meer
- 13,3–20 s Erst rastet der Fisch ein, dann die Schwalbe — jedes Steinchen klickt in seine eigene Mulde
- Mosaik
- 20 s Loop
- 1080² · 30 fps
- WebGL2
- 4,4 MB
Prompt
Build a 20-second looping animated film, 1080×1080, in WebGL2 and plain JavaScript (no libraries, no image, font or audio files): a wall mosaic of glass and gold-leaf tesserae that were never glued down. Figures are flocks of tiles — they lift out of the wall, flip, fly, and click back into their own sockets.
DESIGN
Every tessera is a real small 3D tile, instanced: about 15.6 px tall, 13–20 px long, 7 px thick, with a narrow bevel, corners slightly irregular, joints of 2.2 px, each tile tilted a few degrees at random (gold tiles more, some steeply, so the ground sparkles).
Layout (generated once from a seeded PRNG): upper two thirds a gold ground in straight rows; the lowest two gold rows follow the sea's wavy edge. Lower third a sea band in wavy parallel rows — a foam row of white and pale aqua on top, then turquoise, cobalt, ultramarine and deep blue bands. Depicted in the wall: a fish in side view in the sea (silver outline row, teal/turquoise back, pearl belly, silver lateral line, coral and orange fins, a black eye tile) and a swallow seen from above in the sky (blue-black outline, cobalt and night-blue rows, red face, white tail prongs). Lay the figures like a mosaicist: compute an exact signed distance field of each silhouette, extract its offset contours with marching squares, and set tiles along them — outline row first, rows inward, then one or two halo rows outside (sea glass around the fish, gold around the swallow). Fill remaining gaps with cut pieces (14 → 6 px) aligned to the nearest contour.
Setting bed: bake a height map from the layout — every tile leaves its own socket, with ridges of squeezed-up mortar between them. Shade it with normals from that map so the ridges catch the raking light and throw a short shadow, add grit in the sockets and slow tonal variation. Seated tiles cast a contact shadow onto the bed, projected from the light: joints go dark, and an empty hole reads as a field of imprints with a shadowed rim.
Materials: gold = metal, eight alloy tones (yellow, red, green and pale gold), about one tile in seven worn and matte, a soft leaf crinkle plus fine scratches in one direction per tile, GGX highlight and an environment reflection with two soft bright "windows", so each tile's tilt decides whether it flashes. Glass = coloured albedo, brighter toward the edges and deeper in the core, small frozen air bubbles, a clear-coat highlight and Fresnel reflection; bevels glow with colour. Silver tiles in the fish. Tile backs pale rough cement — visible whenever a tile flips. Light: one fixed point light high above the upper left of the wall, plus a slow band of brightness that travels diagonally across the wall; outside the band the wall stays pixel-stable. Lifted tiles cast soft shadows projected from the light, softer and lighter the higher they fly. ACES tone mapping, gentle vignette. No text. All micro detail is fixed to the tile or the wall — nothing is re-rolled per frame, so seated tiles stay pixel-stable.
STORYBOARD
0–2.4 Quiet wall; the band of light wanders across the gold. Two gold tiles hop out, flip and click back in; two others only re-seat themselves with a small twist.
2.4–7.3 The fish lifts out of the sea head first: each tile gives a tiny jerk, rises, then flips once it is clear of the wall; mortar crumbs jump with it and come to rest in the open sockets; neighbouring tiles twitch. It swims right, its body undulating, and turns at the right edge by yawing about its vertical axis — head toward us, tail away.
7.3–10.2 It leaps up-left through the gold sky, rising higher off the wall, and comes down in a slanted arc. At 10.0 the swallow lifts off its spot in the wall the same way.
10.2–13.3 The nose goes in: spray tiles are thrown up and outward on parabolas, each with its own height and hang time, and a ring wave runs across the sea at 330 px/s — near the splash the tiles roll right over (pale backs read as foam), farther out they only lean; two weaker rings follow. The swallow flies one wide loop and glides low over the water behind the wave.
13.3–20 The fish glides into its hole and its tiles land from 13.6 to 14.7: each flips once at hover height, drops, clicks into its exact socket with a short glint, and pushes its neighbours aside by a pixel or two. The swallow flies home alone and lands from 17.7 to 18.7. Two more gold tiles hop near the end, then the quiet wall again.
MOTION
Each figure follows a timed Hermite path with zero velocity at its socket; every tile samples the path slightly later the farther it sits from the head, so the body bends through turns while the formation stays tight and the silhouette readable in every frame. Lift and landing are staggered head to tail with a little random offset. Wing beats rotate each wing's tiles about the body axis, more up than down, so no tile sinks into the wall; nothing may pass through the wall or start flipping before it is clear of it. Motion blur: average three samples across a 0.42-frame shutter while holding the light at the frame time. Render 2× supersampled with 4× MSAA, then downsample.
TECHNIQUE
- One self-contained HTML page plus one JS file (no inline script, no libraries, no network requests). Stage exactly 1080×1080 CSS px, or the size named above (1080×1920 for portrait).
- Expose window.MOTION = { duration, fps: 30, width, height, seek(t) } with the stage size in width and height. seek(t) redraws the frame for time t from scratch: no state between frames, no Math.random (seeded PRNG only), no Date, no CSS transitions, no timers.
- Loop: seek(0) and seek(duration) must look identical.
- With ?render=1 the stage sits unscaled at the top left (for frame capture). Without it, scale the stage to fit the window and loop with requestAnimationFrame.
- prefers-reduced-motion: show one representative still, no loop.
CHECK
Render stills at the listed times, look at every one, fix anything that overlaps, is cut off, aliased or unreadable, then render again. Report only when frame 0 equals the last frame.
Stills: every 0.5 s, plus every 0.1 s around 2.4, 6.3, 7.3, 9.3, 10.2, 13.2–15 and 17.5–20. So bauen Sie es nach
-
Prompt in einen Coding-Agenten geben
Einen leeren Ordner anlegen, den Prompt in Claude Code, Codex oder Cursor einfügen. Der Agent schreibt eine HTML-Seite und ein Script — die Animation läuft danach direkt im Browser.
-
Standbilder prüfen lassen
Der Prompt verlangt, dass der Agent Standbilder rendert und selbst ansieht. Schärfen Sie nur nach, was Ihnen am Bild nicht gefällt: „Szene 3 ist zu voll“ wirkt besser als ein neuer Prompt.
-
Zu MP4 rendern
Weil jede Animation über
window.MOTION.seek(t)jedes Bild exakt zeichnen kann, rendert ein kleines Script sie Bild für Bild — ohne Ruckler, ohne Bildschirmaufnahme. Danach setzt ffmpeg die Bilder zum Clip zusammen.
# 1 · Render every frame (Chrome, Node ≥ 22) node render.mjs http://localhost:3000/ \ frames/ frames 30 # 2 · Join the frames into an MP4 ffmpeg -framerate 30 -i frames/%05d.png \ -c:v libx264 -preset slow -crf 22 \ -pix_fmt yuv420p -movflags +faststart \ my-motion.mp4
Hintergrund
Eine Wand aus rund 4.200 Glas- und Blattgold-Steinchen, die nie verklebt wurden: Ein Fisch löst sich aus dem Meer, springt durch den Goldgrund, eine Schwalbe hebt ab, eine Ringwelle kippender Steinchen läuft durchs Wasser — und am Ende rastet jedes Steinchen wieder in seiner eigenen Fuge ein. 20 Sekunden WebGL2, ohne Bibliothek, mit Prompt.
Was ich dabei gelernt habe
Ein Mosaik wirkt erst echt, wenn die Reihen den Konturen folgen. Ich habe deshalb für jede Figur ein Distanzfeld berechnet und die Steinchen entlang seiner Höhenlinien verlegt. Dass Steinchen fehlen, liest man erst, wenn das Setzbett ihre Abdrücke zeigt. Und beim Gold entscheidet nicht die Farbe, sondern die leichte Verkippung jedes einzelnen Steinchens, ob es nach Metall aussieht.
Inspiration
Ausgangspunkt war ein Prompt von @zeezomb ((öffnet in neuem Tab)) auf Skillry. Den Wortlaut finden Sie dort; der Prompt oben ist meine eigene Fassung.
Weitere Motions
-
Eine Agenten-Plattform, vorgestellt UI-Motion 0:15 -
Agenten, die das Modell wählen UI-Motion 0:14 -
Ein Satz wird App UI-Motion 0:15 -
Ein Betriebssystem, vorgestellt UI-Motion 0:47.2 -
Ihr neuer Design-Partner Mit Sprecher 0:54.3 -
Zehn Kilometer, schwebend UGC-Ad 0:12.6 -
Der Weg einer Bestellung Erklärclip 0:34 -
Mach es lebendig Kinetic Typography 0:08 -
Aus Rauschen wird ein Ablauf Partikel 0:14 -
Der Gimli Glider Mit Sprecher 0:19 -
Oszilloskop-Intro Oszilloskop 0:20 -
Ein Tastendruck im Querschnitt Erklärclip 0:20 -
Ein Ring namens Orbit UI-Motion 0:10 -
Der Bug, der bleiben will Kurzfilm 0:20 -
Schienbein, nicht Fuß Mit Sprecher 0:17 -
Quallen im Lichtschacht Organischer Loop 0:18 -
Ein Logo, das lebt Logo-Reveal 0:08 -
Wie aus Kreisen jede Form wird Erklärclip 0:20 -
Pixel-Zauberer Pixel-Art 0:16 -
Der kürzeste Krieg Mit Sprecher 0:16 -
Fast gefallen Physik-Simulation 0:09 -
Negroni als Erklärclip Erklärclip 0:20 -
Wohin das Tankgeld geht Mit Sprecher 0:19.5 -
Ein Abdruck, sonst nichts Vorspann 0:20 -
Endloszoom ins Detail Endloszoom 0:15 -
Würfelturm Kurzfilm 0:07 -
Anfrage um 22:47 Chat-Story 0:17 -
Claude Code in drei Schritten Mit Sprecher 0:17.5 -
Die Posteingangs-Fabrik Isometrischer Loop 0:12 -
Von 0 auf 100 % weich Physik-Simulation 0:10 -
Eine Linie, drei Tinten Showreel 0:20 -
Die Anfrage bricht aus Physik-Simulation 0:15 -
Die Schneidemaschine Isometrischer Loop 0:09 -
Wie Backlinks wirken Erklärclip 0:20 -
Ein Ball, der mit jedem Aufprall wächst Physik-Simulation 0:10 -
Eine Form, vierzehn Zustände UI-Motion 0:14 -
Was ein Zuhause ausmacht Scherenschnitt 0:20 -
Wörter, die tragen Kinetic Typography 0:20 -
Logo-Reveal aus Splittern Logo-Reveal 0:11