A rebuild of the light that crosses the “relay” card on opentunnel.xyz. Every control below changes the real effect live. Pause it, slow it down, switch layers off one at a time, and read the notes under the bench.
The card is ordinary HTML: a black box, two borders and the word “relay”. Sitting exactly on top of it is a transparent <canvas>. Each frame, a small program on the graphics card, called a shader, decides the colour and see-through amount of every pixel of that canvas, about 60 times per second.
Wherever the shader says “fully see-through”, you see the card underneath. Wherever it says “a bit of light”, it paints warm off-white on top. That is the whole trick: there is no video and no image, just one formula run on every pixel.
Every layer below is built from one of those two numbers. The first question gives the edge. The second gives the trail.
trySet playback speed to 0.1 and press “Send a message”. Watch the edge cross slowly, and watch the strip under the bench light up behind it.
The shader computes each layer as a brightness number, adds them together, and that sum becomes how opaque the pixel is.
| layer | what it does | how, in words |
|---|---|---|
| line | The razor-thin bright edge. | A bell curve centred on the front that drops off very fast. The “edge sharpness” slider sets how fast. At 700 the edge is a couple of pixels wide; at 60 it turns into a soft beam. |
| glow | The faint haze spreading either side of the edge. | The same idea with a much slower drop-off, kept dim. Sharp line plus wide glow is what makes it read as light, not as a drawn line. |
| wobble | The edge is never quite straight, and it shimmers. | Before measuring “how far am I from the front”, each pixel is nudged left or right by a slowly drifting smoke pattern (see “noise” below). Neighbouring rows get nudged differently, so the edge waves. |
| afterburn | The grey smoky trail left behind. | Reads “how long since the front passed” from the memory strip and fades it with time. It's multiplied by another smoke pattern so it looks like cooling haze, not a flat grey. A small extra-hot band sits right behind the edge. |
| hatch | The fine diagonal stripes inside the trail. | Diagonal stripes, shown only where the trail is still warm. On the real site they stand for the encrypted data passing through: you see that something is there, never what it says. Very fine stripes on a screen create the shimmering wave pattern (moiré) you noticed. |
| lane | Brighter along the middle, dimmer at the top and bottom. | Multiplies everything by a gentle curve that peaks at mid-height, as if the data travels down the centre of the card. |
trySwitch off everything except “line”. Then add “glow”, then “wobble”, one at a time. You will see the effect assemble itself.
A shader has no memory. Every frame it starts from zero, so on its own it cannot know that the front crossed this spot a second ago. The trail needs that knowledge.
The fix lives in JavaScript. It keeps a row of 256 numbers, one for each thin vertical slice of the card. Think of 256 kitchen timers in a row. Whenever the front sweeps over a slice, that slice's timer is reset to “now”. Each frame, the row is handed to the graphics card as a tiny image, 256 pixels wide and 1 pixel tall, and the shader reads it to learn “how long since the front passed me”.
The strip on the bench above shows those 256 timers live: bright amber means “just crossed”, fading to black as it cools.
tryPause, then hover the strip. Each column tells you how many seconds ago a message crossed it. Then move the “cooling speed” slider and watch the trail shorten or stretch without anything moving.
The original paints every layer in one warm off-white. The Siri version keeps the exact same shapes and only changes the colour each layer is painted in.
trySwitch off everything except “line” and “glow”, then drag “colour bands” from low to high.
Without randomness, the edge would be a perfect line and the trail a flat grey. The shader uses fbm noise (“fractal Brownian motion”). It is a recipe for smoke-like patterns: take a blurry random pattern, add a smaller, fainter copy on top, then a smaller one again, four times. Big soft shapes with finer detail inside them, like clouds. Sliding that pattern over time makes it drift, which is what you see as shimmer.
Up to four messages can be on the card at once, which is why rapid clicks on “Send a message” give you several fronts chasing each other.
This is the exact code running on this page. Greyed lines are comments.