Senbon is a stylised winter walk inspired by Fushimi Inari Taisha in Kyoto, not a replica of it. Everything is made in code: no model files, images or audio files are downloaded.
The scene
- One scroll value drives the walk. GSAP ScrollTrigger maps the page to a progress from 0 to 1; each of the six chapters takes an equal share and maps to its own stretch of a Catmull–Rom path up the mountain, so the camera never jumps.
- The light and weather are keyframes per chapter (sky, fog, hemisphere and key light, snow amount, wind, lantern strength, exposure) blended across each chapter boundary; the story module is plain TypeScript and unit-tested.
- The torii follow the myōjin form used at Inari shrines: black bases, vermilion pillars with rings under the lintel, the tie beam with wedges, the central strut, the vermilion lintel and the black top lintel swept up at its ends, with snow on top. One merged geometry with vertex colours is drawn as a single instanced mesh for about a thousand gates: two tunnels along the path, the parallel second tunnel, gate paths wandering over the mountain, and the large gates at the foot and before the lookout.
- The inscriptions on the backs of the pillars are a canvas texture atlas of generic votive wording; an instance attribute picks the column in the shader.
- Every gate's lacquer is shaded per instance: an age from fresh vermilion to sun-faded orange, a fine wood grain that also varies the gloss, grime above the black base, rain streaks under the beams and, on old gates, flakes of bare wood.
- Props near the path are modelled in detail: Kasuga-style stone lanterns (lotus collar, ringed shaft, fire box with lit windows, curled roof corners, jewel finial, snow cap), cedars with whorls of drooping snow-laden branches (the far forest uses a lighter version), stone monuments with crowds of miniature gates and small foxes, and at the fox shrine an offering box, a bell rope and an ema rack of votive plaques.
- The walk opens with a camera glide from above the forest down to the great gate, and each chapter's ema plaque drops in on its cord and swings to rest.
- The ground is a heightfield shaped around the path (flat along it, rising into the hillside, falling to the valley), with a trodden-snow ribbon and stone steps in the tunnels. Cedars, rocks and the town's houses are instanced.
- Snow is one particle field that follows the camera and wraps in a box in the vertex shader; in the finale the same particles turn into tumbling sakura petals in the fragment shader.
- Lanterns light up ahead of the visitor one by one; a few point lights move to the nearest lanterns each frame, and every flame gets an additive glow halo that widens in the falling snow.
- The atmosphere is layered: two sheets of slow noise mist drift just above the ground around the walker, three ink-wash mountain ridges ring the horizon and take on the sky's colour, the sky shader adds stars and a hazy moon on the clear nights, and the snow on the ground glitters with pinpoints that flash as the view moves.
- In the blizzard the flakes stretch into slanted streaks, the finishing pass adds driving snow in front of the lens and whiteout gusts that sweep across, and the camera shakes slightly. At dawn the last chapter turns to face the valley town (instanced houses, temple halls, a five-storey pagoda and a river), an old plum tree reaches across the view and its blossoms open one by one.
- The key light throws real shadows: the low sun behind the walker at the foot, the moon ahead in the tunnels (its light falls between the gates in stripes across the steps) and the rising sun over the valley at the end. The shadow box follows the walker, is snapped to whole texels so edges do not crawl, and widens at the lookout so the roofs' long shadows fall across the town. Trees cast only at the foot and at dawn; in the tunnels their canopy would swallow the moonlight.
- At dawn a sea of clouds (layered sheets of warped noise, sunlit on the side facing the sun) fills the valley, and a flock of birds crosses below the sun, each beating its wings at its own pace and gliding now and then.
- Each chapter brushes its word in vertical calligraphy beside the card (稲荷 Inari, 千本鳥居 thousand torii, 奉納 dedication, 狐 fox, 朱 vermilion, 梅 plum), with a red seal holding the chapter numeral. The characters are SVG outlines taken once from the Yuji Syuku brush font (SIL Open Font License), so the page loads no Japanese font; a mask wipes each one in from the top like a stroke.
- Red markers follow objects in the scene (projected from 3D to the screen every frame and written straight to the DOM) and open notes with checked facts: the foxes, the Kasuga lantern, how to pray at the offering box, ema, otsuka, the plum and the view over Kyoto from Yotsutsuji. At the fox shrine you can draw an omikuji (the slip's rank is brushed with the same glyph outlines) and tie it to the rack, where a new white knot appears, or make a wish and lift an omokaru-ishi stone by holding the button. The second chapter lets you dedicate a gate: your name is drawn into a canvas texture in vertical setting with 奉納 above it, the other pillar gets today's date in the Reiwa era ending in 吉日, the gate's lacquer turns fresh, and the name is kept in this browser only.
- A small hanging-scroll map in the corner shows the real route on Mount Inari (Rōmon gate, the Senbon torii, the inner shrine, the Yotsutsuji intersection and the summit loop beyond it, 233 m); a vermilion line follows the walk and each station jumps to its chapter.
- The valley town is laid out like old Kyoto (
town.ts): a grid of streets in trodden snow, blocks lined with rows of townhouses facing the street (gabled tile roofs under thick snow, plaster gables, lattice fronts, pent roofs), storehouses and garden pines in the courtyards, temple compounds behind plastered walls with halls and two pagodas, a wide avenue with stone lanterns up to a great torii at the foot of the mountain, bridges over the river and thin smoke from a few chimneys. Buildings are instanced in 30 m tiles so culling works, and the town is drawn only when it can be seen (the opening glide and the summit). - The old plum at the lookout is grown in code (
plum.ts): roots gripping a snowy rock outcrop at the cliff edge, a short gnarled trunk, three limbs that branch in the zigzag of plum wood, short flowering spurs all along the older wood, snow along the tops of the boughs, and about two thousand blossoms set against the wood that open twig by twig; fallen petals lie on the snow. The walk stops at the lookout, so the tree frames the view instead of being walked into. - The high tier adds ambient occlusion (GTAO, with the mist, sky and glows kept out of its depth pass), UnrealBloom and a finishing pass with god rays (a radial blur of the bright sky toward the sun's screen position), a cool-shadow and warm-light grade, a vignette and film grain.
The music
The Web Audio API synthesises everything live once you press the bell. The music is written, not random: a 66 bpm sequencer plays two themes, a sixteen-bar tune where the koto states the melody and the shakuhachi answers, and an eight-bar dawn theme in the brighter yo scale. The arrangement thickens with the climb (a quiet koto ostinato from the tunnel on, the tune two steps lower at the foxes, a taiko heartbeat in the storm, a shimmer of high fifths at dawn) and changes only at the top of a phrase. The koto is a Karplus–Strong string with pressed-string bends, played through a body resonance and a little air; the shakuhachi is a sine and triangle with breath noise and growing vibrato. Wind follows the weather, footsteps in the snow follow the scroll speed, suzu bells ring at the foxes, a taiko marks each chapter and a temple bell built from inharmonic partials sounds at the summit. A shō, the mouth organ of gagaku court music, holds a cluster chord of six reed voices that breathes in and out and retunes for the foxes and the storm and again at dawn; a koto glissando sweeps up the scale into each new chapter, and the shakuhachi and koto sit in a ping-pong echo. A generated impulse response gives the reverb.
Performance
Phones get a lighter tier: no bloom, fewer trees, houses and snowflakes, a lower pixel ratio and 30 frames a second. Rendering pauses when the scene is off screen or the tab is hidden, and sound suspends with the tab. Under reduced motion the chapters change in one cut and the camera does not sway.