What went wrong
This site's homepage has an animated figureThe Tesseract Memory · The public siteHomepage figureOne animated figure. On a computer it changes pose as you pass each section. On a phone it breathes in place.See it in the The Tesseract Memory build made of particles, which are tiny dots. It changes pose as you scroll and breathes when idle. The figure followed scrolling correctly and still split where the head meets the neck. As it breathed, particles side by side there moved apart.
More scroll smoothing couldn't fix that, because two separate things are involved. Scrolling decides which pose the figure is showing. The shader, the small program that moves each particle, decides how particles next to each other move. The scrolling side was already simple. The homepage measures its four sections, from Hero and Notes down to Builds and Now. Each measured position is an anchor. Progress between two anchors is just how far the scroll position is through that gap.
return index +
(scrollY - anchors[index]) /
(anchors[index + 1] - anchors[index]);Why it happened
The cause was in the shader's rules for movement. Each particle in the figure's data has a body-part label, such as head. The old shader, shown below, used a hard switch to turn the head label into a face setting. That setting was either on or off, with nothing in between. The neck fell on the other side of that switch, so it got the torso's movement rules.
float face = 1.0 - step(0.5, aRegion);
float torso = (1.0 - face) * (1.0 - atmosphere);
offset += vec2(
(point.x - 0.75) * 6.0 * torso,
-1.15 * torso - 0.25 * face
) * breath;The numbers show the jump. A head particle got a breathing height of 0.25, which sets how far it rises. The neck particle next to it got 1.15, plus a sideways movement meant only for the torso. In the source data I found 171 pairs of head and neck particles side by side. For each pair, the distance breathing moves them jumped by about 0.90 to 1.02 pixels. That is in the unit the shader works in. The response to the mouse or a finger had the same kind of jump. Its strength was 4 on the face and 18 on the neck and body.
What I changed
I replaced the switch with one smooth movement field. It is a single rule, centred on the chest, for how far each point moves. Around the head and hands the field has smooth protection, and the edges of that protection are called collars. The collars are C1, which means the value and how fast it changes both stay smooth across the edge. Every point follows the same 5.2-second breathing value. The response to the mouse or a finger also fades out smoothly through the same collars. The input images, particle IDs and source see-through levels are unchanged. Only the way the particles move is different.
How I know it works
I checked the new field against the same 171 pairs. I replayed them in reference checks on the main processor, not the graphics chip. Their largest difference in movement fell below 0.000054 pixels, in the shader's unit. Later a visible wave was reported in the figure. A change on 12 September removed the idle motion that was left besides breathing. That was a flow that moved points together, and a separate sway. Its tests check that sampled idle movements all follow one shared breathing phase.