Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

perf(club): stop drawing the hidden stage behind the alley walk-in

ni3a9aa92378c938
diff --git a/data/changelog.json b/data/changelog.json
index aaa6cdc4e..e36fd17d9 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-09-21",
+ "title": "The club no longer runs your computer hot on the way in",
+ "summary": "While you walked the alley and stood at the door, the club was secretly drawing the whole dance floor behind it at full quality, so your graphics card was rendering two complete 3D scenes at once. The hidden stage now pauses its drawing until the alley fades away, roughly halving the graphics work for the entire walk-in. For a cooler machine inside the club too, turn on Power saver in the club controls.",
+ "tags": [
+ "fix",
+ "improvement"
+ ],
+ "link": "/club"
+ },
{
"date": "2026-09-20",
"title": "Repeat visits stop downloading the app's code twice",
diff --git a/src/club.js b/src/club.js
index 866c1a15b..ad4a70c1e 100644
--- a/src/club.js
+++ b/src/club.js
@@ -2360,9 +2360,28 @@ const governor = createFrameGovernor();
const focusState = trackWindowFocus();
const clock = new Timer();
let rafId = null;
+
+// The alley walk-through (src/club-entrance.js) runs its own full renderer on
+// an opaque canvas stacked over this one until it fades out on arrival. While
+// that canvas fully covers the stage, drawing the club too means two complete
+// post-processed scenes per frame for a picture nobody can see, which is what
+// made /club run the GPU hot through the whole walk-in and cover flow. The
+// stage keeps simulating (at the idle rate) so it is warm on reveal, but only
+// paints once the alley starts to fade (or is gone).
+const doorCanvas = document.getElementById('club-door-canvas');
+function stageCovered() {
+ if (!doorCanvas?.isConnected) return false;
+ const o = doorCanvas.style.opacity;
+ return o === '' || Number(o) >= 0.999;
+}
+// One real draw right after bootstrap, even while covered, so shader compile
+// and texture upload happen behind the alley instead of as a hitch mid-reveal.
+let stageWarmed = false;
+
function animate(frameNow) {
rafId = requestAnimationFrame(animate);
- const fpsCap = powerSaver ? FPS_SAVER : (focusState.focused ? FPS_ACTIVE : FPS_IDLE);
+ const covered = stageWarmed && stageCovered();
+ const fpsCap = powerSaver ? FPS_SAVER : (focusState.focused && !covered ? FPS_ACTIVE : FPS_IDLE);
if (!governor.shouldRun(frameNow ?? performance.now(), fpsCap)) return;
clock.update();
const dt = Math.min(clock.getDelta(), 0.066);
@@ -2427,7 +2446,9 @@ function animate(frameNow) {
// Audio-reactive bloom — pulse intensity with the beat (skip under reduced motion).
if (!prefersReducedMotion) bloomEffect.intensity = 1.0 + peak * 1.5;
+ if (covered) return;
composer.render(dt);
+ stageWarmed = true;
}
renderPoles();