# brodymontag.com kind .......... project status ........ active checked ....... 2026-10-19 stack ......... typescript · three.js / r3f · glsl · gsap source ........ https://github.com/bmontt/brodymontag-site page .......... https://brodymontag.com/projects/brodymontag-com This site. A three.js scene draws a laser stage, and a GLSL pass turns each 8×22 px cell into a text glyph. A CPU version in a Web Worker draws the same figures. One stage stays on screen across all pages. Every visitor first sees a 2D version that the CPU paints in a Web Worker. A capable device then loads the three.js version and fades to it. GSAP ScrollTrigger is the only code that writes scroll state, so React does not render on each scroll frame. Each page has its own composition, and a page change moves the figures to the new one. On a production build with a 6× CPU throttle, a scripted scroll holds 120 fps (p95 frame 9.3 ms, M4 Pro, 120 Hz display). The first version went live in June 2026, and the 3D stage in October 2026. ## highlights - A GLSL pass: one glyph for each 8×22 px cell - A CPU version in a Web Worker paints first - GSAP is the only writer of scroll state - Figures move to the composition of each new page - Measured: 120 fps at a 6× CPU throttle (2026-10-14) - Static pages, rendered again each hour ## detail updated 2026-10-19 ### how it works figure 1 · from a scene to glyphs · schematic A small network of lines and nodes is sampled into a grid of 8 by 22 pixel cells. Each cell gets a level, and then each cell becomes a glyph. The site mounts one stage in the shared layout, so the stage stays on screen when a visitor changes pages. Every visitor first sees a 2D version that the CPU paints. A capable device then loads the 3D version and fades to it. The 2D version stays for reduced motion, Save-Data, low memory, few CPU cores, or no WebGL2. If the 3D version loses its WebGL context, the 2D version comes back. figure 2 · from scroll to glyphs Scroll input goes to GSAP ScrollTrigger, which writes the journey store. The director reads the store and sets the targets. A tier gate sends the frame to the 2D painter in a Web Worker or to the three.js scene. A GLSL cell pass and a glyph pass turn the scene into text. ```mermaid flowchart TD A[wheel and touch] --> B[GSAP ScrollTrigger] B --> C[journey store] C --> D[director] D --> E{tier} E -->|2D| F[CPU painter in a Web Worker] E -->|3D| G[three.js scene] G --> H[GLSL cell pass] H --> I[glyph atlas pass] ``` the three GPU passes for each frame brodymontag-site@57d2653 · lib/ascii-engine/gl/ascii-renderer.ts:219-243 ```ts render(scene: Scene, camera: PerspectiveCamera): void { const gl = this.gl; const prevTarget = gl.getRenderTarget(); // pass 1 — one fragment per cell, exactly at the cell center: widen the // frustum (top-left anchored) to cols·cellW × rows·cellH css px camera.setViewOffset(this.viewW, this.viewH, 0, 0, this.cols * this.cellW, this.rows * this.cellH); gl.setRenderTarget(this.sceneRT); gl.clear(); gl.render(scene, camera); camera.clearViewOffset(); // pass 2 — per-cell logic (this.composeMat.uniforms.uHue.value as Vector3).set( this.frame.uHuePhase, this.skin.uHueBias.value, this.skin.uSat.value, ); gl.setRenderTarget(this.cellRT); gl.render(this.cellScene, this.quadCam); // pass 3 — glyphs to screen gl.setRenderTarget(prevTarget); gl.render(this.composeScene, this.quadCam); } ``` ### decisions decision: GSAP is the only writer of scroll state (accepted, 2026-09-24) context: A React state update on each scroll frame causes a React render on each frame. The stage must keep its frame budget while the page scrolls. decision: GSAP ScrollTrigger writes scroll values into a plain module object. The render loop reads the object. React gets an update only when the chapter changes. cost: Scroll logic is outside React. A Playwright test must guard the rule. The test allows at most 4 React commits for a full scroll. the test that guards the rule brodymontag-site@57d2653 · e2e/stage.spec.ts:21-37 ```ts test("3D tier: a full scroll of a section page keeps React out of the frame loop", async ({ page }) => { const errors = trackErrors(page); await page.goto("/about?tier=3d&debug"); await waitForStage(page); const commits = () => page.evaluate(() => (window as unknown as { __journeyCommits?: number }).__journeyCommits ?? 0); // let any mount-time commits settle — scrolling must not add per-frame ones let before = -1; for (let now = await commits(); now !== before; now = await commits()) { before = now; await page.waitForTimeout(1500); } await scrollThrough(page); expect((await commits()) - before).toBeLessThanOrEqual(4); const d = await stageDebug(page); expect(d.g).toBeGreaterThan(0.98); expect(errors).toEqual([]); ``` decision: Figures move to the new page, they do not cut (accepted, 2026-10-13) context: Each page has its own composition of figures. A hard cut between two compositions looks like a reload. decision: On each frame, every value moves part of the way to its target. The part depends on the frame time, so the motion is the same at 60 Hz and at 120 Hz. A figure that was invisible takes its place at once. cost: Each value comes close to its target but never reaches it exactly. the step toward the targets brodymontag-site@57d2653 · lib/director/laser.ts:420-431 ```ts // ── damp toward the page's targets ───────────────────────────────── const dt = Math.min(x.delta, 0.1); if (!cur || dt <= 0) cur = { ...tgt }; // first frame / reduced motion: no glide else { const glide = since < 1.1 ? 4 : 14; // arrive slowly, then track anchors closely for (const k of KEYS) { const wk = WEIGHT_OF[k]; // a figure that was invisible takes its place instead of sliding in if (wk && cur[wk] < 0.02) cur[k] = tgt[k]; else cur[k] += (tgt[k] - cur[k]) * (1 - Math.exp(-(SLOW.has(k) ? 5 : glide) * dt)); } } ``` ### results figure kind before after scroll at 6× CPU measured 87 fps, p95 24.6 ms 120 fps, p95 9.3 ms scroll at 4× CPU measured 108 fps, p95 16.7 ms 120 fps, p95 9.2 ms style recalc while scrolling, 6× CPU measured 411 ms per s 69 ms per s 2D tier, frames painted measured 29 per s 110–120 per s method: production build, Chromium, real GPU (ANGLE Metal), M4 Pro, 120 Hz display, 1440×900 at 2×, scripted wheel scroll. 6× CPU is Chromium's CPU throttle. · as of 2026-10-14 ### limits limits: - The frame figures come from one machine. - A 60 Hz display limits the rate to 60 fps. - The CPU throttle slows the CPU only. It does not slow the GPU. - The frame-test scripts are not in the public repo. ### proof - performance notes at 57d2653 - stage tests at 57d2653 - source -- end of page · this page as text: https://brodymontag.com/machine/projects/brodymontag-com · index: https://brodymontag.com/machine · summary: https://brodymontag.com/llms.txt