From b54637ad4822343fcf8ec8ddd05db96e46b61968 Mon Sep 17 00:00:00 2001 From: simien Date: Sun, 13 Sep 2026 17:25:48 -0400 Subject: [PATCH 1/2] perf: build a shape mask once per composition, and give Motion its own section A layer's mask is a pure function of the shape, its direction, the grid size and the layer's seed; nothing in it moves with the phase. It was recomputed for every cell on every frame, for both layers, and for the radial shapes each cell allocated a corner list and took four square roots. On the default canvas that doubled an animated frame, from 103ms to 220ms with a vignette. The mask is now built once as a keep/drop byte per cell and cached the way the field is, and a masked frame costs what an unmasked one does. The random stream is read in the same cell order as before, so the output is unchanged: 1620 generate() calls across twelve mask and direction pairs, three sizes, three texture pairings, five motions and three phases hash identically against the previous generator. Motion moves out from under Settings into its own section, second in the General tab. It is what the site leads with, so it should be findable as a heading, and it is one of the four controls that drive animation rather than a canvas setting. Second rather than first because size, colors and mask come before how it moves, a still is the default, and the flash warning should not be the first line a new visitor reads. The guide's tab table says where it sits. Co-Authored-By: Claude Fable 5.1 --- animated-backgrounds/index.html | 2 +- flow-fields/index.html | 2 +- generator.js | 43 +++++++++++++++++++++++++++++---- guide/index.html | 2 +- index.html | 17 ++++++++++--- seamless-backgrounds/index.html | 2 +- 6 files changed, 55 insertions(+), 13 deletions(-) diff --git a/animated-backgrounds/index.html b/animated-backgrounds/index.html index 5753943..0ae292e 100644 --- a/animated-backgrounds/index.html +++ b/animated-backgrounds/index.html @@ -258,7 +258,7 @@

Try it

- + + - + +