Back to the loop

Echo Explained

A man in a room of black marble and gold throws a glowing ball up and catches it. His reflection does the same, a little late. He goes to the glass, puts his palm on it and waits for the other palm; he leaves just before it comes. Then he turns and throws the ball through the glass. It hits his reflection in the back, and the reflection, still walking away, being late, stumbles, picks the ball up, and the whole thing goes on, a room further on, for ever. This page describes how that 34.5 second loop is made to close, how the man in it was made, rigged and acted, and how every frame of it is traced.

A man in a white T-shirt with his left palm on a pane of glass in a gold arch; on the other side his reflection presses its palm against his; a glowing ball in his other hand lights the black marble room
Loop
34.5 s, closes on itself
The reflection
3.67 s late, a room on
The man
from one photo, 31,289 triangles, 65 bones
Acting
41 s from phone video, no suit
Rays
up to 12 glasses deep, one a pixel
Frame
12 to 13 ms on an M1 Max

A window a loop late

The glass in front of him looks like a mirror and is not one. It is a window into the next room, and the next room is this same room moved one room along, and a whole loop late. The glass behind him is the other way: the room behind is the same room a loop early. So through the glass he sees himself, the same man, but in that room it is 34.5 seconds earlier.

That alone would show him from behind, walking away. What makes it read as a reflection is the past: for every moment before the loop begins, the room is the mirror image (z to −z, left for right) of the room 3.67 seconds before the loop ends. The man through the glass is then, exactly, his own mirror image delayed by 3.67 seconds, and stays so until the ball goes through the glass. That is the one thing a mirror cannot do, and it is what the story is about.

the room behind: t + T his room: t the room in front: t − T he throws his reflection,walking away, is hit the man who willthrow it at him glassglass
From above. Each glass leads to the same room a loop away in time. The ball he throws at 33.5 s goes through and hits the man in front, who is living 34.5 seconds earlier, at his own beginning: the hit that starts the loop. Since the man behind does the same to him, he is hit at the start of his own loop by himself.

For the loop to close exactly, the hit has to happen to a reflection, and a reflection is the past mirrored. So at the start of the loop he must stand where his own mirror image stands at the moment he is hit, 3.67 seconds before the end: walking away from the glass, back turned, at the same distance from the far glass as he is then from the near one. Everything else follows from that one condition. The ball he threw comes in from the room behind; the ball his reflection was holding goes out with a flash as the past becomes real.

room(t)            = his life at t                                   0 ≤ t
room(t)            = mirror( room(t + T − d) )                       t < 0
through the glass  = room(t − T),  moved one room on                 T = 34.5 s,  d = 3.67 s
start of the loop  = mirror( where he is at T − d )                  so the hit is on his back

The delay is how long he holds his palm on the glass, and 0.3 seconds more, so that he leaves just before his reflection’s palm arrives. The ball is in the air for one second. Both are taken from the acting, not chosen.

Six later mirrors

The room is an octagon 8 metres across. Two of its sides are the glasses; the six others are real mirrors in gold frames, tinted, and each shows the room later than the last. A ray that bounces off one carries its own time: it goes on in the room as it was that many seconds ago, so the man it finds is earlier in his life. The six delays step by 1.7 seconds, 1.7 to 5.95, and they grow toward the front glass, so that the mirrors on either side of it, which are always in view, toss the ball only after the reflection in the glass has caught its own.

A ray may go through many glasses and mirrors. Each one changes its time, and the man is posed again at that time. Twelve are allowed. The further in, the smaller he is, and the cheaper he is drawn: past four, without shadows, and past eight, as capsules (see the tracer).

The man

He is the author, made from a single photo by an image-to-3D model (Meshy): 31,289 triangles with their own colour. He was rigged from scratch: 65 bones of the usual Mixamo names, the joints of the arms, legs and wrists placed at the middle of the mesh’s cross-sections and the shoulders, neck and head by landmarks on its surface; each finger traced back from its tip, the point of the hand farthest from the wrist, along rings of equal distance over the surface, its knuckles placed by the proportions of a hand. The weights are painted by bone heat on a copy of the mesh with its seams welded shut, mapped back, smoothed and kept to four bones a corner. Of the bones, 52 move him: 22 for the body and 30 for the fingers.

He is skinned on the GPU every frame, the usual way: each corner of each triangle follows up to four bones, by its weights. A compute pass does it nine times a frame, once for the moment the eye is at and once for each of the eight glasses and mirrors, since each shows him at another time. The tracer needs a tree of boxes to find him fast; it is built once, at rest, by surface area, 21,467 boxes in 21 levels, and after skinning each box is refitted round what it holds, level by level from the leaves, in nine more passes.

Deeper than one glass, where he is small, he is not skinned at all. Up to eight glasses in, he is cut into 22 rigid pieces, a piece for each body bone, with its own tree of boxes, and a ray is turned into each piece’s own frame instead. The joints overlap a little so that nothing cracks.

His shadows and the shade under him come from 17 capsules laid along his bones, not from the mesh: a ray to a light is tested against capsules, a tenth of the cost of testing it against triangles, with a soft edge by how wide the light is from there.

Acting it

He is acted by the author, filmed on a phone in a corridor and at home, with no suit or markers. The story was cut into takes that each end and begin in a held pose. Each take is run through GVHMR, which finds a whole body’s pose, and its path over the floor, for every frame of one ordinary video; it has to be told the lens’s real focal length (26 mm for the main camera, 13 for the wide one), or the walks come out a third too long. Takes are joined where two poses match best, as he stops on his spot and inside the palm hold: the next take is turned and moved onto the last, a little more turn chosen so that the loop closes, and the two are blended over 0.8 seconds. The joined motion is carried onto his own skeleton and cleaned: the floor levelled, every step heel, flat, toe-off with the foot on the floor pinned by leg IK, the palm locked to the glass for the whole press. The result is one 41 second animation with the moments of the story marked in it: the hit, the pick-up, the toss and the catch, the palm on the glass, the throw.

The viewer the rigging was done in, live: he plays a take on his own skeleton, the phone video it came from in the corner, and beside him, in yellow, the joints GVHMR found before any cleaning. Turn and zoom it; click him to see which bone moves the skin there. The take list has the leave, glance and throw (IMG_0876, the kitchen) and the whole joined performance. On its own page.
The opening of the loop, as filmed (left) and as it plays (right): hit in the back, a stumble, a glance back at the glass behind, the walk to the ball, the pick-up, and the toss.

The page plays that animation as it is. A few things are laid over it, all small:

  • the right hand reaches the last few centimetres to the ball as he picks it up;
  • the left palm is held flat on the glass from the moment he touches it until he leaves;
  • his head is turned, at 60 per cent, toward what the story wants him to look at, his reflection or the ball, except while he looks back over his shoulder;
  • his fingers curl round the ball and lie flat on the glass, since the video gives no fingers;
  • for a quarter of a second at the start of the loop his pose is blended from his mirror image’s.

The ball is not acted, only imagined, so it is placed. Its bounce and roll after the hit are searched for so that it comes to rest exactly under his right hand when it goes down for it; it leaves his hand when he tosses it and falls back into the hand where it is when he catches; it is thrown from his hand at the release and goes, in one second, to his reflection’s back.

Fitting the room

The take is put down once. It is turned and moved so that his left palm is on the glass at the moment he touches it, and turned, within 30 degrees of facing the glass square, so that where he stands at the hit is nearest the mirror of where he is a loop later. The floor marks for the filming came from the same rule, worked backwards: in a room of 4 metres from the middle to each glass, the hit had to be 6.9 metres from the glass, on the line he walks back on, so the opening was shot in a corridor. It lands 0.42 metres from where the loop needs it; that difference is faded out during the stumble after the hit, before he walks anywhere.

Two things made the first takes play worse than they were acted, and both were in the page, not in the takes:

  • His size. Characters on the page were scaled so that their legs were 0.9 metres long, the size the story was first laid out for. His are 0.72, so he stood 2.15 metres tall and every step he took was 21 per cent longer than he took it. A character made at life size, in metres, is now kept at its size.
  • His rest pose. Clips are given as turns from a T pose. The page made its own T of him, straightening the legs and the forearms its own way; the animation was made from a slightly different T, so every pose was 5 to 12 degrees off at the legs and arms. An animation made on this very skeleton is now played from that skeleton’s own rest. With that, the page reproduces the animation file bone for bone, within half a degree.

The tracer

Nothing is rasterised. Every pixel is a ray, written straight in WGSL on WebGPU, traced the old way, a chain: it hits something, the surface is lit there with rays to the lights, and if the surface is glass, a mirror, polished gold or polished marble, the ray goes on, its colour carried down by how much each surface passes on. three.js only loads the files.

A ray meetsWhat it does
the glass in front or behindgoes straight on into the next room, one room along and a loop late or early; leaves a little light on the glass for a palm print or a ripple
a side mirrorreflects, tinted, and goes back in time by that mirror’s delay; he is posed again for it
a gold frame or a marble wallis lit there, and reflects once or twice more, then stops
the flooris lit, and reflects by how polished it is and the angle
himis lit and stops: the skinned mesh up to one glass deep, rigid pieces up to eight, capsules beyond
a balltakes its glow and stops

The marble’s veins were sixteen noise lookups per hit; they are worked out once into textures at load. Each pixel is traced at 0.85 of screen resolution, smoothed (FXAA) and brought up with a sharp cubic filter that is kept from ringing. The biggest win was not any of these but one line: lists of capsules and bones kept in a private array in the shader cost a third of the frame on Apple’s GPUs; read where they are used instead, they cost nothing.

Light

There are three lights: the skylight, a disc in the ceiling whose shaft is drawn through dusty air; the ball; and, through the glasses, the balls in the rooms on either side. The marble, black with gold veins, needs a lot of light to be seen at all, and that much light on a white T-shirt is several times white, so a few things are made to suit the picture rather than physics:

He holds the glowing ball at his hip; the whole side of his shirt next to it is flat white
The ball, before: as bright on him as on the marble, and a point. The side of the shirt is one white.
The same moment: the shirt keeps its folds, brightest next to the ball and falling off from it
Now: a round light, and four tenths as strong on him. The shirt keeps its folds.
From behind: a grey band runs down the middle of his white shirt
His back, before: the capsule of his trunk stood out through the shirt and shaded it.
From behind: the shirt is evenly lit
Now: a capsule does not shade the skin it stands for.
  • The ball is a round light. Close to it, it is wide in the sky of whatever it lights, so its light comes round a curve instead of stopping at a hard edge (the cosine over a sphere, in Karis’s fit). On him, it gives four tenths of what it gives the room.
  • His own capsules do not shade him. The capsule for his trunk lies along joints that sit near his back, and stood out through the shirt; any point inside a capsule is now not shadowed by it.
  • The floor gives the ball back. A copy of each ball under the polished floor lights him and the walls from below, at the floor’s reflectance, a quarter.
  • A palm print is mist. It is lit from all round, so his body passing between it and the ball does not shadow it, and it fades over five seconds once the hand is off.
  • The air can glow. The ball’s light scattered by the room’s haze along each ray is an arctangent, so it costs nothing to add; it is a switch in the panel, off.

The picture is drawn in linear light and brought down by the usual filmic curve (Narkowicz’s fit of ACES), with a little bloom, grain and vignette.

One frame, timed

At 1512 × 900 at twice the pixel density, on an M1 Max, the best of three runs over eight moments of the loop. Each line is the frame with that one thing taken away.

WithoutSaves
The whole frame11.4 to 12.3 ms
Pixels at 1.0 of the screen instead of 0.85costs 3.1 ms
The skylight’s shaft0.6 ms
The side mirrors mirroring0.5 ms
The mesh two glasses deep instead of onecosts 0.2 ms
The ball in the air, the floor’s bounce0.1 ms each
Skinning (rigid pieces everywhere instead)costs 3.3 ms

Skinning is cheaper than the rigid pieces up close: one tree of boxes for the whole man is quicker to go through than twenty-two.

How it is checked

  • Against the file. The lean of his trunk in every walk, read from the animation file by three.js’s own player and from the page, is compared; they agree within half a degree.
  • His feet. How fast the slower foot moves, every half second; in a walk one foot is still. What is left is the video’s own.
  • Pops. Every bone’s angular acceleration over the loop, to find a frame where something jumps.
  • The seam. The last frame of the loop against the first.
  • The picture, before the number. Every change is looked at, close up, before its time is believed.

What is not real

  • The glass in front is not a mirror, and the man in it is not a reflection until the ball goes through; nor after.
  • The ball was not there when it was filmed. Its path is placed so his hands meet it.
  • He was made from one photo, so his back and the soles of his shoes are the model’s guess.
  • His fingers are posed, not acted.
  • His shadows are capsules, not his shape.
  • He is rigid pieces from two glasses in, and capsules from nine.
  • The ball gives him less light than it gives the room.
  • One ray a pixel; no light bounces but off the glass, the mirrors, the gold and the floor.

Made with: Meshy, for the character from a photo; GVHMR, Shen, Pan, Yu, Wang, Bao, Zhou and Peng, World-Grounded Human Motion Recovery via Gravity-View Coordinates (2024), for the motion from video; SMPL, Loper, Mahmood, Romero, Pons-Moll and Black (2015), the body it recovers; three.js, for loading the files; Turner Whitted, An Improved Illumination Model for Shaded Display (1980), the kind of tracer; Brian Karis, Real Shading in Unreal Engine 4 (2013), for a round light’s wrap; Krzysztof Narkowicz’s fit of ACES; Timothy Lottes, FXAA.