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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(ar): light AR Studio models by the real room — presence, not stickers
nirholase8ef47adb15e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2e3bc00c6..00e8117fb 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,7 +8,8 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **AR Studio** (`/ar/studio`) — A live multi-model AR scene through your camera: place any number of 3D models and avatars in your real space, pull in your forge creations, community models, or any GLB link, and generate new models by prompt without leaving the view.- **Image to 3D — Turn a Photo into a 3D Model** (`/image-to-3d`) — Upload a photo (or up to 4 angles) and get a downloadable textured 3D model (GLB). The Forge's photo lane, opened directly — for objects and props; for faces, use Selfie to Avatar.-- **AR Studio: fill your room with 3D models, and forge new ones without leaving the camera** — Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model. On Android each model gets its own world anchor in immersive AR; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition. (`/ar/studio`) `[feature]`+- **A new way to generate avatars: modular, and no two look alike** — The studio avatar generator used to recolor one of five fixed body meshes, so a whole gallery of them read as the same handful of people in different colors. It now composes each avatar from modular parts: a hairstyle, top, bottom, footwear, and glasses mixed across the base bodies onto one shared skeleton, then recolored per part and scaled for height. This is the same one-skeleton-many-parts approach the best avatar platforms use, built in-house with no external service. Every generated avatar is fully rigged and carries facial expression blendshapes, and two of them almost never look the same. All platform-generated avatars continue to appear across the galleries. (`/gallery`) `[feature, improvement]`+- **AR Studio: fill your room with 3D models, and forge new ones without leaving the camera** — Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model, with keyboard shortcuts on desktop. The models look like they belong: on supported Android phones they are lit by your actual room light and reflect it on metal and glass, and they hide correctly behind your real furniture; on every phone the lighting matches your room's brightness and colour. On Android each model also gets its own world anchor; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code that carries the exact arrangement, not just the model list. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition. (`/ar/studio`) `[feature]`- **Avatar gallery previews now read clearly at a glance** — Gallery previews used to be shot dead-on against a near-black background, so dark models vanished and every card looked the same. Previews are now framed from a natural three-quarter angle, fill the card, and stand on a subtly tinted stage unique to each avatar. Prompt-created avatars also got more distinctive: sparse prompts like 'a knight' now commit to a specific look (age, build, hairstyle, palette, one signature detail) instead of converging on the same generic person. Every platform-generated avatar still appears in the galleries. (`/gallery`) `[improvement, fix]`- **Avatars you generate now come out truly animation-ready** — We rebuilt the auto-rigging engine that turns a generated 3D character into a living avatar. Rigging now finishes in seconds instead of stalling for 20 minutes, produces a full standard skeleton with fingers that our entire animation library (walk, wave, dance, emotes) can drive immediately, keeps the model's original textures perfectly intact, and adds the 52 facial expression shapes used for emotions and lip-sync. Every piece of the new pipeline is MIT-licensed open source, so it works for everyone, everywhere. (`/forge`) `[feature, improvement, fix]`- **Community feed hover previews no longer blend into the photo underneath** — Hovering a card in the Fresh from the Forge strip spins the actual 3D model in place. The spinning model used to render on a nearly transparent background, so it visually collided with the card's photo thumbnail and looked broken, with a stray browser tooltip on top. The preview now draws on a solid backdrop, the redundant tooltip is gone, image-to-3D cards are labeled with their engine name (Hunyuan3D) instead of an internal id, and every card can now be opened from the keyboard. (`/forge`) `[fix, improvement]`diff --git a/STRUCTURE.md b/STRUCTURE.mdindex 968c702ea..fd22bbd87 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -46,7 +46,7 @@ bottom.| Spatial MCP (3D as a native response type) | Spec [specs/SPATIAL_MCP.md](specs/SPATIAL_MCP.md), pure validator/builder [api/_lib/spatial-mcp.js](api/_lib/spatial-mcp.js), validator tool [api/_mcp3d/tools/spatial.js](api/_mcp3d/tools/spatial.js) (`validate_spatial_response`, free), reference renderer [public/spatial-mcp/spatial-renderer.js](public/spatial-mcp/spatial-renderer.js) + demo [public/spatial-mcp/index.html](public/spatial-mcp/index.html) `→ /spatial-mcp`, docs [docs/spatial-mcp.md](docs/spatial-mcp.md). | Live · both stores | Open (CC0) shape for returning a live, interactive 3D scene as a first-class MCP tool result (scene GLB, camera, environment, animation, AR handoff, affordances) instead of a URL. Every three.ws 3D generator emits a conformant artifact under `structuredContent.spatial`; the validator returns actionable errors, not a boolean; the framework-free reference renderer displays any conformant payload — including one transformed from a foreign tool result (portability proof at `/spatial-mcp`). Zero coin surface — reusable in the OpenAI free app. Tests: [tests/spatial-mcp.test.js](tests/spatial-mcp.test.js). Evidence: [prompts/store-submissions/_generated/spatial-mcp/](prompts/store-submissions/_generated/spatial-mcp/). Store-submission prompt 20. || AR-ready exports ("View in your space") | Device-routing core [api/_lib/ar-launch.js](api/_lib/ar-launch.js), UA-branched launch endpoint [api/ar.js](api/ar.js) `→ /api/ar`, MCP tool [api/_mcp3d/tools/ar.js](api/_mcp3d/tools/ar.js) (`export_ar`, free), in-viewer AR button [public/viewer.html](public/viewer.html), docs [docs/ar.md](docs/ar.md). | Live · both stores | `GET /api/ar?src=<glb>` branches on the request User-Agent server-side: iOS → Apple Quick Look (USDZ generated from the GLB on the fly by model-viewer's three.js USDZExporter — real conversion, no server USD tooling), Android → 302 Google Scene Viewer ARCore intent with browser fallback, desktop → WebGL viewer. Bad input rejected at the boundary with a designed error page. `export_ar` returns the AR launch link + a conformant Spatial-MCP artifact; response is OpenAI-clean (no ids/coin surface). `kind=avatar` is the living-agent lane: the launch page leads with a "Bring it to life" handoff into `/irl?avatar=<glb>` (avatar-producing tools return `irlUrl` automatically), and Android serves the launch page instead of the blind Scene Viewer redirect so the living path stays visible. Shared links unfurl: the launch page's `og:image` points at `GET /api/render/glb?glbUrl=` ([api/render/glb.js](api/render/glb.js), server-side PNG of the actual model, CDN-cached a day) and the page carries "Create your own" → `/ar` conversion CTAs. Tests: [tests/ar-export.test.js](tests/ar-export.test.js). Evidence: [prompts/store-submissions/_generated/ar/](prompts/store-submissions/_generated/ar/). Store-submission prompt 21. || AR Forge (prompt → model → your room) | [public/ar-forge.html](public/ar-forge.html) `→ /ar` (self-contained page, CDN model-viewer + local meshopt decoder, no Vite registration needed; vercel route sets `xr-spatial-tracking` permissions-policy) | Live | Mobile-first app: one prompt hits the free NVIDIA lane (`POST /api/forge {backend:"nvidia"}`, poll `?job=`), the result renders in an AR-capable `<model-viewer>` with "View in your space" (WebXR / Scene Viewer / Quick Look). Non-AR devices get a QR handoff to `GET /api/ar?src=` (server-side UA routing) plus a copyable `/viewer?src=` share link. Deep link `/ar?src=<glb>&title=` reopens any shared model; recent forges persist in localStorage. Designed idle/working/failed/result states; https-only GLB guard. |-| AR Studio (multi-model live camera scene) | [pages/ar-studio.html](pages/ar-studio.html) `→ /ar/studio` + [src/ar-studio.js](src/ar-studio.js), multi-anchor WebXR session [src/ar/multi-place.js](src/ar/multi-place.js), pure scene math [src/ar/studio-scene.js](src/ar/studio-scene.js) | Live | The standalone multi-model AR surface: place ANY number of models/avatars into one live camera view (every earlier AR lane was single-model). Model sources: in-view forge (`POST /api/forge {backend:"nvidia"}` runs behind the live camera, result drops into the room), the forge gallery (`/api/forge-gallery` — yours + community tabs), recent forges (localStorage, shared with `/ar`), a pasted GLB link, or repeatable `?src=` deep links (https/relative only). Rendering ladder: WebXR immersive-ar with one XRAnchor per placed model + always-armed reticle (Android), getUserMedia passthrough + gyro world-lock (iOS/everywhere), grid preview + drag-look + QR handoff (desktop). Gestures: tap select, drag move, pinch resize, two-finger twist rotate; per-model duplicate/rotate/remove, clear-with-undo. Humanoids with no baked clips idle via the universal retarget ([src/irl/pin-idle.js](src/irl/pin-idle.js)); scene persists in localStorage and round-trips through the QR share URL. Photo capture composites camera + WebGL ([src/irl/share-frame.js](src/irl/share-frame.js)). Tests: [tests/ar-studio-scene.test.js](tests/ar-studio-scene.test.js). |+| AR Studio (multi-model live camera scene) | [pages/ar-studio.html](pages/ar-studio.html) `→ /ar/studio` + [src/ar-studio.js](src/ar-studio.js), multi-anchor WebXR session [src/ar/multi-place.js](src/ar/multi-place.js), pure scene math [src/ar/studio-scene.js](src/ar/studio-scene.js) | Live | The standalone multi-model AR surface: place ANY number of models/avatars into one live camera view (every earlier AR lane was single-model). Model sources: in-view forge (`POST /api/forge {backend:"nvidia"}` runs behind the live camera, result drops into the room), the forge gallery (`/api/forge-gallery` — yours + community tabs), recent forges (localStorage, shared with `/ar`), a pasted GLB link, or repeatable `?src=` deep links (https/relative only). Rendering ladder: WebXR immersive-ar with one XRAnchor per placed model + always-armed reticle (Android), getUserMedia passthrough + gyro world-lock (iOS/everywhere), grid preview + drag-look + QR handoff (desktop). Gestures: tap select, drag move, pinch resize, two-finger twist rotate; per-model duplicate/rotate/remove, clear-with-undo. Humanoids with no baked clips idle via the universal retarget ([src/irl/pin-idle.js](src/irl/pin-idle.js)); scene persists in localStorage and the whole ARRANGEMENT (models + transforms) round-trips through a base64url `#s=` hash on the share/QR URL, so a composed scene reopens exactly on any device. **Presence realism:** WebXR placements are lit by the real room via lighting-estimation ([src/ar/estimated-lighting.js](src/ar/estimated-lighting.js), three's `XREstimatedLight` — real primary-light direction/colour + a live environment cube map so metal/glass reflect the actual room, reverting to baked lights when the device isn't estimating) and occluded by real geometry via depth-sensing ([src/ar/depth-occlusion.js](src/ar/depth-occlusion.js)); the passthrough path matches room brightness AND colour by sampling the camera feed. Desktop keyboard controls (arrows nudge / R rotate / D duplicate / Delete). Photo capture composites camera + WebGL ([src/irl/share-frame.js](src/irl/share-frame.js)). Reachable from `/ar`, the forge AR panel, and the `/viewer` action sheet. Tests: [tests/ar-studio-scene.test.js](tests/ar-studio-scene.test.js), [tests/ar-estimated-lighting.test.js](tests/ar-estimated-lighting.test.js). || IRL (agents in the real world) | [pages/irl.html](pages/irl.html) `→ /irl` + [src/irl.js](src/irl.js), WebXR placement [src/ar/webxr.js](src/ar/webxr.js) + pinch [src/ar/pinch-scale.js](src/ar/pinch-scale.js), animated Quick Look bake [src/usdz-animated.js](src/usdz-animated.js) (static fallback [src/usdz-pipeline.js](src/usdz-pipeline.js)), backend [api/irl/](api/irl) | Live | Pin an agent at a real GPS spot; discovery is presence-proof-gated ([docs/irl/THREAT-MODEL.md](docs/irl/THREAT-MODEL.md)). **Place in AR** leads the dock on AR-capable devices: WebXR hit-test anchoring on Android with two-finger pinch resize (25%..400%) persisted to the pin (`anchor_scale`; the pinch lands as a follow-up `PATCH /api/irl/pins {id, scale}` after the placement tap), and ARKit Quick Look on iOS with the idle clip baked into the USDZ so the agent moves instead of standing in a T-pose. Discovered pins are equally alive in the in-page camera view: every mounted humanoid GLB plays the retargeted idle clip via a per-pin mixer ([src/irl/pin-idle.js](src/irl/pin-idle.js), phase-randomized, LOD-bounded), camera-aware gaze composes on top of the running animation, and the scene renders with ACES tone mapping + IBL + soft shadows (e2e: [tests/e2e/irl-pin-idle.spec.js](tests/e2e/irl-pin-idle.spec.js)). Inbound `/irl?avatar=<glb>` is the living-agent handoff from `GET /api/ar?…&kind=avatar` (explicit `?avatar=` wins over a saved session). Money Drops and World Lines: [docs/irl.md](docs/irl.md). SDK: [packages/irl/](packages/irl). **Share** ([src/irl/share-frame.js](src/irl/share-frame.js), [api/irl/share.js](api/irl/share.js), [api/irl/share/[token].js](api/irl/share/%5Btoken%5D.js)) mints a permanent, unfurlable `/irl/s/:token` link from the captured AR photo for the pin you just placed — never a coordinate, owner-gated, falls back to the plain native share sheet with no active pin. **Analytics** ([api/_lib/irl-analytics.js](api/_lib/irl-analytics.js), [api/irl/analytics.js](api/irl/analytics.js)) is the first site-wide usage rollup for the feature — pins placed, nearby reads, placement method, shares, drop claims — rendered at [/admin/irl-analytics](pages/admin/irl-analytics.html), aged out by the existing hourly reaper. || Verifiable 3D provenance (content credentials) | Spec [specs/PROVENANCE_3D.md](specs/PROVENANCE_3D.md), pure core [api/_lib/provenance-3d.js](api/_lib/provenance-3d.js), Solana anchor [api/_lib/provenance-anchor.js](api/_lib/provenance-anchor.js), MCP tools [api/_mcp3d/tools/provenance.js](api/_mcp3d/tools/provenance.js) (`verify_provenance` free, `anchor_provenance` paid $0.05), free REST verify [api/provenance.js](api/provenance.js) `→ /api/provenance`, viewer badge [public/viewer.html](public/viewer.html), docs [docs/provenance.md](docs/provenance.md). | Live (verify) · anchor gated on issuer key + devnet funds | C2PA-style signed content credentials for AI 3D: creator, prompt, model/provider, lineage, timestamp, and the GLB's sha256, ed25519-signed by the three.ws issuer with the credential hash anchored on Solana. Free public `verify_provenance` / `GET /api/provenance?src=…` recompute the hash and return `verified | tampered | unknown` (a single changed byte → tampered); the verify path and response are coin-clean (both stores). `anchor_provenance` signs + writes the SPL Memo anchor + stores the credential in R2. Tests: [tests/provenance-3d.test.js](tests/provenance-3d.test.js). Evidence: [prompts/store-submissions/_generated/provenance/](prompts/store-submissions/_generated/provenance/). Store-submission prompt 19. || Sperax partnership + SperaxOS plugin | [pages/sperax.html](pages/sperax.html) `→ /sperax`, plugin [public/sperax/](public/sperax/README.md), manifest `→ /.well-known/sperax-plugin.json`, tools [api/chat-plugin/[tool].js](api/chat-plugin/%5Btool%5D.js) `→ /api/chat-plugin/*`, panel `→ /sperax/iframe/` | In-repo · Live | Partnership landing for the SperaxOS integration: three.ws ships as a standalone `plugin.delivery` plugin that gives a SperaxOS agent an embodied 3D avatar (speak/gesture/emote/render_agent), bound to an ERC-8004 identity, settling over Base x402. Launch offer: free AI credits for three.ws users on [chat.sperax.io](https://chat.sperax.io) — page explains what it is and how to claim. Blog: [/blog/three-ws-speraxusd-integration](blog/three-ws-speraxusd-integration.html) |@@ -67,6 +67,7 @@ bottom.| Agent-native 3D + embeddable distribution | MCP tool [api/_mcp/tools/agents.js](api/_mcp/tools/agents.js) (`attach_avatar_to_agent`); shared oEmbed provider [api/agent-oembed.js](api/agent-oembed.js) `→ /api/oembed` + builder [api/_lib/embed.js](api/_lib/embed.js) (`forgeEmbedTarget`, shared by `get_embed_code` in [api/_mcp/tools/embed.js](api/_mcp/tools/embed.js)); Forge share page oEmbed discovery [api/forge-share.js](api/forge-share.js) `→ /forge/share/:id`; distribution snippet builders [src/forge-embed-snippets.js](src/forge-embed-snippets.js) + panel [src/forge-embed-panel.js](src/forge-embed-panel.js); autonomous demo [examples/agent-native-3d/](examples/agent-native-3d) | In-repo | Closes the loop: create → own → discover/remix → **use everywhere**. `attach_avatar_to_agent` gives a registered agent identity a persistent body (chains into `register_agent` for on-chain identity + `anchor_provenance` for a signed authenticity credential). Any Forge creation now unfurls via real oEmbed (paste `/forge/share/:id` into Notion/Discord/Slack) with the same `type:rich` iframe payload `get_embed_code` returns via MCP. The Forge "Embed this model" panel hands out five real distribution flavours from one GLB — iframe, `<model-viewer>`, `<agent-3d>`, a `@three-ws/page-agent` talking guide, and a `@three-ws/walk` companion — all built from one shared, pure snippet module so every surface stays byte-identical. `examples/agent-native-3d/run.mjs` drives the full agent-native chain live against `/api/mcp-studio` (mesh_forge → rig_mesh → create_agent_persona → persona_say → get_agent_persona → every distribution snippet) with zero mocks and a documented, logged fallback if the shared free-tier generation lane is rate-limited at run time. Spec: [specs/EMBED_SPEC.md](specs/EMBED_SPEC.md#share-routes-on-chain-agents). Docs: [docs/mcp.md#attach_avatar_to_agent](docs/mcp.md#attach_avatar_to_agent). Roadmap prompt 10 (closes the roadmap campaign). || Animation pipeline | [public/animations/](public/animations) + [scripts/build-animations.mjs](scripts/build-animations.mjs) | In-repo | Mixamo source FBX + GLB retargeting pipeline · see [docs/3d-asset-pipeline.md](docs/3d-asset-pipeline.md) || Self-hosted 3D GPU fleet (the engines behind the Forge) | [workers/model-trellis/](workers/model-trellis), [workers/model-hunyuan3d/](workers/model-hunyuan3d) (2.0 + 2.1 PBR + 2.1 RTX), [workers/model-triposg/](workers/model-triposg), [workers/model-triposr/](workers/model-triposr), [workers/unirig/](workers/unirig), [workers/avatar-reconstruction/](workers/avatar-reconstruction), CPU stages [workers/rembg/](workers/rembg) · [workers/remesh/](workers/remesh) · [workers/segment/](workers/segment) · [workers/stylize/](workers/stylize) | Live · Cloud Run GPU (us-central1 + trellis/hunyuan replicas in us-east4) | Every generation engine the Forge dispatches to, each with its own `cloudbuild.yaml`. L4 services share a 3-GPU regional quota (increase to 16 pending); the Hunyuan3D-2.1 PBR realism lane also ships an RTX PRO 6000 build (`model-hunyuan3d-21-rtx`, quota granted 1000) as the warm primary. Ops map: [docs/ops/gcp-credits-plan.md](docs/ops/gcp-credits-plan.md) |+| Avatar Composer (modular studio generation) | [api/_lib/avatar-composer/](api/_lib/avatar-composer) | In-repo · wired into the studio seed lane | Assembles a rigged, ARKit-expression-ready GLB by mixing skinned parts (hair / top / bottom / footwear / glasses) across the RPM base bodies onto **one shared 67-joint skeleton**, then recolors each part and scales the rig — the Ready-Player-Me / Avaturn "one skeleton, many parts" architecture in pure JS on `@gltf-transform`, no GPU or external service. Replaces the recolor-one-of-five-bodies studio lane so two draws almost never look alike. Borrowed parts keep their own inverse binds but remap onto the identity skeleton; mixing is restricted to a base's rest-pose group so parts always fit. Consumed by [api/cron/avaturn-seed-cron.js](api/cron/avaturn-seed-cron.js) (legacy [studio-avatar.js](api/_lib/studio-avatar.js) recolor is the fallback). Docs: [api/_lib/avatar-composer/README.md](api/_lib/avatar-composer/README.md). Tests: [tests/avatar-composer.test.js](tests/avatar-composer.test.js) || Auto-rigging worker (Mixamo skeleton + ARKit-52 blendshapes) | [workers/rig/](workers/rig) | Code-complete · deploy pending (asset staging + Cloud Build, see its README) | Make-It-Animatable engine (MIT) predicts the 52-bone Mixamo skeleton + weights; [workers/rig/rig_glb.py](workers/rig/rig_glb.py) grafts them into the original GLB (textures untouched); ICT-FaceKit (MIT) ARKit-52 expression transfer for emotions/lipsync. Contract-compatible replacement for the retired `unirig` service behind `GCP_UNIRIG_URL`; cutover is one env-var update. Canonicalization proof: `rig worker skeleton` cases in [tests/glb-canonicalize.test.js](tests/glb-canonicalize.test.js) || Animation gallery | [pages/animations.html](pages/animations.html) + [src/animations-gallery.js](src/animations-gallery.js) | Live at `/animations` | 2,100+ clips with poster thumbnails ([scripts/build-animation-thumbnails.mjs](scripts/build-animation-thumbnails.mjs)), derived categories ([src/animation-categories.js](src/animation-categories.js)), shared live-preview engine ([src/animations-live-preview.js](src/animations-live-preview.js)) · see [docs/animations.md](docs/animations.md) || Avatar thumbnail coverage | [api/_lib/avatar-thumbs.js](api/_lib/avatar-thumbs.js) + crons [api/cron/avatar-thumbnail-backfill.js](api/cron/avatar-thumbnail-backfill.js) (absent thumbnails, `*/5`) and [api/cron/avatar-thumbnail-render.js](api/cron/avatar-thumbnail-render.js) (stale marketplace thumbnails, `*/10`) | Live | The single owner of `avatars.thumbnail_key`. Enforces the invariant that a thumbnail key is persisted **only after** its R2 object is confirmed to exist — a key pointing at a missing object makes R2 return 404 `text/plain`, which Chrome blocks as `ERR_BLOCKED_BY_ORB` inside an `<img>`. Fills coverage cheapest-first: zero-copy adoption of `forge_creations.preview_key`, then a headless-chromium GLB→PNG render to `thumb/<avatarId>.png` ([api/_lib/render-glb.js](api/_lib/render-glb.js)). Bounded retries via the `avatar_thumbnail_backfill` claim ledger ([migration](api/_lib/migrations/20260709120000_avatar_thumbnail_backfill.sql)), with `isBrowserInfrastructureError()` separating an OOM-killed browser from a genuinely broken model so a crash never retires healthy avatars. Bulk runner: [scripts/backfill-avatar-thumbnails.mjs](scripts/backfill-avatar-thumbnails.mjs) (`--status`, `--adopt-only`, `--loop`, `--reset-infra`). Docs: [docs/avatar-thumbnails.md](docs/avatar-thumbnails.md). Tests: [tests/avatar-thumbs.test.js](tests/avatar-thumbs.test.js), [tests/home-thumbnail-orb.test.js](tests/home-thumbnail-orb.test.js) |diff --git a/data/changelog.json b/data/changelog.jsonindex 70a8969a0..f9836ec1d 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -29,7 +29,7 @@{"date": "2026-07-17","title": "AR Studio: fill your room with 3D models, and forge new ones without leaving the camera",- "summary": "Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model. On Android each model gets its own world anchor in immersive AR; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition.",+ "summary": "Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model, with keyboard shortcuts on desktop. The models look like they belong: on supported Android phones they are lit by your actual room light and reflect it on metal and glass, and they hide correctly behind your real furniture; on every phone the lighting matches your room's brightness and colour. On Android each model also gets its own world anchor; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code that carries the exact arrangement, not just the model list. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition.","tags": ["feature"],@@ -14227,6 +14227,16 @@"fix"],"link": "/gallery"+ },+ {+ "date": "2026-07-17",+ "title": "A new way to generate avatars: modular, and no two look alike",+ "summary": "The studio avatar generator used to recolor one of five fixed body meshes, so a whole gallery of them read as the same handful of people in different colors. It now composes each avatar from modular parts: a hairstyle, top, bottom, footwear, and glasses mixed across the base bodies onto one shared skeleton, then recolored per part and scaled for height. This is the same one-skeleton-many-parts approach the best avatar platforms use, built in-house with no external service. Every generated avatar is fully rigged and carries facial expression blendshapes, and two of them almost never look the same. All platform-generated avatars continue to appear across the galleries.",+ "tags": [+ "feature",+ "improvement"+ ],+ "link": "/gallery"}]}diff --git a/public/changelog.json b/public/changelog.jsonindex ebae353a6..9a9bbc2cf 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-17T10:23:33.686Z",+ "generated_at": "2026-07-17T10:51:25.010Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -26,11 +26,22 @@"launch"]},+ {+ "date": "2026-07-17",+ "type": "update",+ "title": "A new way to generate avatars: modular, and no two look alike",+ "summary": "The studio avatar generator used to recolor one of five fixed body meshes, so a whole gallery of them read as the same handful of people in different colors. It now composes each avatar from modular parts: a hairstyle, top, bottom, footwear, and glasses mixed across the base bodies onto one shared skeleton, then recolored per part and scaled for height. This is the same one-skeleton-many-parts approach the best avatar platforms use, built in-house with no external service. Every generated avatar is fully rigged and carries facial expression blendshapes, and two of them almost never look the same. All platform-generated avatars continue to appear across the galleries.",+ "link": "/gallery",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-07-17","type": "update","title": "AR Studio: fill your room with 3D models, and forge new ones without leaving the camera",- "summary": "Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model. On Android each model gets its own world anchor in immersive AR; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition.",+ "summary": "Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model, with keyboard shortcuts on desktop. The models look like they belong: on supported Android phones they are lit by your actual room light and reflect it on metal and glass, and they hide correctly behind your real furniture; on every phone the lighting matches your room's brightness and colour. On Android each model also gets its own world anchor; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code that carries the exact arrangement, not just the model list. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition.","link": "/ar/studio","tags": ["feature"diff --git a/public/changelog.xml b/public/changelog.xmlindex 88ec95b3f..9b4c3de99 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -22,13 +22,21 @@<category>launch</category><description>Upload a photo (or up to 4 angles) and get a downloadable textured 3D model (GLB). The Forge's photo lane, opened directly — for objects and props; for faces, use Selfie to Avatar.</description></item>+ <item>+ <title>A new way to generate avatars: modular, and no two look alike</title>+ <link>https://three.ws/gallery</link>+ <guid isPermaLink="false">2026-07-17:A new way to generate avatars: modular, and no two look alike</guid>+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The studio avatar generator used to recolor one of five fixed body meshes, so a whole gallery of them read as the same handful of people in different colors. It now composes each avatar from modular parts: a hairstyle, top, bottom, footwear, and glasses mixed across the base bodies onto one shared skeleton, then recolored per part and scaled for height. This is the same one-skeleton-many-parts approach the best avatar platforms use, built in-house with no external service. Every generated avatar is fully rigged and carries facial expression blendshapes, and two of them almost never look the same. All platform-generated avatars continue to appear across the galleries.</description>+ </item><item><title>AR Studio: fill your room with 3D models, and forge new ones without leaving the camera</title><link>https://three.ws/ar/studio</link><guid isPermaLink="false">2026-07-17:AR Studio: fill your room with 3D models, and forge new ones without leaving the camera</guid><pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate><category>feature</category>- <description>Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model. On Android each model gets its own world anchor in immersive AR; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition.</description>+ <description>Until now AR on three.ws was one model at a time: generate, view, exit. The new AR Studio at three.ws/ar/studio is a live scene through your camera where you can place as many models and avatars as you like together in your real space. Pull in your own forge creations, the community feed, or any GLB link; type a prompt and a brand-new model is generated behind the live view and drops into the room when ready. Drag to move, pinch to resize, twist to rotate, duplicate or remove any model, with keyboard shortcuts on desktop. The models look like they belong: on supported Android phones they are lit by your actual room light and reflect it on metal and glass, and they hide correctly behind your real furniture; on every phone the lighting matches your room's brightness and colour. On Android each model also gets its own world anchor; on iPhone the camera view with gyro look works out of the box; on desktop you arrange the scene and send it to your phone with a QR code that carries the exact arrangement, not just the model list. Your scene survives a refresh, humanoid avatars idle naturally instead of standing frozen, and a photo button captures the whole composition.</description></item><item><title>Avatar gallery previews now read clearly at a glance</title>diff --git a/public/features.json b/public/features.jsonindex 46236f101..5be7a0bad 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-17T10:23:33.670Z",+ "generated_at": "2026-07-17T10:51:24.996Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/ar-studio.js b/src/ar-studio.jsindex 52863d0fb..1c7cbbf50 100644--- a/src/ar-studio.js+++ b/src/ar-studio.js@@ -24,13 +24,14 @@// round-trips through ?src= links, so a desktop arrangement reopens on a phone.import {- AnimationMixer, Box3, CanvasTexture, DirectionalLight, GridHelper, Group,+ AnimationMixer, Box3, CanvasTexture, Color, DirectionalLight, GridHelper, Group,HemisphereLight, Mesh, MeshBasicMaterial, PerspectiveCamera, PlaneGeometry,PMREMGenerator, Raycaster, RingGeometry, Scene, Vector2, Vector3, WebGLRenderer,} from 'three';import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';import { clone as cloneSkinnedScene } from 'three/addons/utils/SkeletonUtils.js';+import { EstimatedLighting } from './ar/estimated-lighting.js';import { MultiPlaceSession } from './ar/multi-place.js';import {createPinchState, pinchEnd, pinchMove, pinchStart, touchDist,@@ -219,6 +220,7 @@ let arActive = false;let mediaStream = null;let arTransitioning = false;let xrSession = null;+let estimatedLight = null;let arTrackW = 0;let arTrackH = 0;let statusTimer = null;@@ -576,6 +578,7 @@ function applyCameraFov() {// ease the scene lights toward it, so a model placed in a dim bedroom doesn't// glow like it's under studio lights (and one on a sunny balcony isn't muddy).let lightTimer = null;+const roomTint = new Color(); // reused scratch — no per-sample allocationconst lightProbe = (() => {try {const cnv = document.createElement('canvas');@@ -586,6 +589,11 @@ const lightProbe = (() => {}})();+// Passthrough (iOS / no-WebXR) has no lighting-estimation API, so we read the+// room ourselves: mean brightness AND mean colour of the camera feed. Brightness+// drives light intensity (a dim room dims the model); colour drives a gentle+// white-balance tint (a warm-lamp room warms the model's whites, a daylight room+// cools them) so the model belongs to the room instead of glowing neutral on it.function sampleCameraLight() {if (!arActive || !lightProbe?.ctx || !videoEl?.videoWidth) return;let data;@@ -595,15 +603,30 @@ function sampleCameraLight() {} catch {return; // frame not readable yet — try again next tick}- let sum = 0;+ let rSum = 0, gSum = 0, bSum = 0, lumaSum = 0;+ const px = data.length / 4;for (let i = 0; i < data.length; i += 4) {- sum += 0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2];+ const r = data[i], g = data[i + 1], b = data[i + 2];+ rSum += r; gSum += g; bSum += b;+ lumaSum += 0.2126 * r + 0.7152 * g + 0.0722 * b;}- const luma = sum / (data.length / 4) / 255; // 0 (black room) → 1 (blown out)+ const luma = lumaSum / px / 255; // 0 (black room) → 1 (blown out)const target = Math.min(1.35, Math.max(0.4, 0.35 + luma * 1.25));- // Ease 40% per sample: adapts within a few seconds, never visibly pops.hemi.intensity += (target * HEMI_BASE - hemi.intensity) * 0.4;sun.intensity += (target * SUN_BASE - sun.intensity) * 0.4;++ // White-balance tint: normalize the mean colour to its own brightness, then+ // pull it a third of the way toward the room's cast (never a full tint — the+ // PBR albedo should still read as itself). Guard a black frame (mean ~0).+ const mean = (rSum + gSum + bSum) / (px * 3);+ if (mean > 6) {+ const tr = 1 + ((rSum / px / mean) - 1) * 0.33;+ const tg = 1 + ((gSum / px / mean) - 1) * 0.33;+ const tb = 1 + ((bSum / px / mean) - 1) * 0.33;+ roomTint.setRGB(tr, tg, tb);+ hemi.color.lerp(roomTint, 0.4);+ sun.color.lerp(roomTint, 0.4);+ }}function startLightMatching() {@@ -617,6 +640,8 @@ function stopLightMatching() {lightTimer = null;hemi.intensity = HEMI_BASE;sun.intensity = SUN_BASE;+ hemi.color.setHex(0xffffff);+ sun.color.setHex(0xffffff);}async function startCamera() {@@ -1333,6 +1358,8 @@ xrBtn?.addEventListener('click', async () => {},onEnd: () => {xrSession = null;+ estimatedLight?.dispose();+ estimatedLight = null;document.body.classList.remove('is-xr', 'xr-has-floor');xrBtn.classList.remove('is-active');xrBtn.setAttribute('aria-pressed', 'false');@@ -1354,6 +1381,18 @@ xrBtn?.addEventListener('click', async () => {stopLoop();await session.start();xrSession = session;+ // Real-world lighting + reflections: replaces the baked hemi/sun with the+ // room's actual light the moment the device starts estimating it. Created+ // after start() so the addon's sessionstart listener requests the probe.+ estimatedLight = new EstimatedLighting({+ renderer,+ scene,+ baseLights: [hemi, sun],+ onChange: (on) => {+ if (on) setStatus('Lit by your room — reflections and shadows match the real light.');+ },+ });+ estimatedLight.start();document.body.classList.add('is-xr');grid.visible = false;selRing.visible = false;@@ -1365,6 +1404,8 @@ xrBtn?.addEventListener('click', async () => {setStatus('Point at the floor, then tap to place. Every tap adds another model.');} catch (err) {log.warn('XR session failed', err);+ estimatedLight?.dispose();+ estimatedLight = null;startLoop();setStatus('Couldn’t start immersive AR on this device. Camera mode still works.', { warn: true });} finally {diff --git a/src/ar/estimated-lighting.js b/src/ar/estimated-lighting.jsnew file mode 100644index 000000000..50f9b47ec--- /dev/null+++ b/src/ar/estimated-lighting.js@@ -0,0 +1,104 @@+// Real-world lighting for WebXR placements, via the WebXR Lighting Estimation+// API (three's XREstimatedLight addon).+//+// A model lit by fixed studio lights always reads as pasted onto the camera+// feed: its highlights point the wrong way, its whites are the wrong colour,+// and a chrome surface reflects a room that isn't there. This wrapper replaces+// the studio's baked lights with the room's ACTUAL light the moment the device+// starts estimating it:+//+// • a LightProbe carrying the room's ambient spherical harmonics (soft fill+// from every direction, the real colour of the space),+// • a DirectionalLight aimed along the room's primary light with its measured+// colour + intensity (a warm lamp vs cool daylight lands correctly), and+// • a live environment cube map so metal/glass models reflect the real room.+//+// The swap is reversible and self-healing: until estimation actually starts the+// baked lights stay on (no dark flash), and on session end — or if the device+// never estimates — everything is restored byte-for-byte. Depends only on a+// three.js addon; no new package, no custom shader.++import { XREstimatedLight } from 'three/addons/webxr/XREstimatedLight.js';++/**+ * @param {object} opts+ * @param {import('three').WebGLRenderer} opts.renderer Active XR renderer.+ * @param {import('three').Scene} opts.scene+ * @param {import('three').Light[]} opts.baseLights The studio's own lights,+ * dimmed to zero while real estimation drives the scene and restored on end.+ * @param {(active: boolean) => void} [opts.onChange] Fired true when real+ * estimation takes over, false when it reverts — drives a "lit by your room"+ * status line, purely informational.+ */+export class EstimatedLighting {+ constructor({ renderer, scene, baseLights = [], onChange }) {+ this._renderer = renderer;+ this._scene = scene;+ this._baseLights = baseLights;+ this._onChange = onChange;++ this._xrLight = null;+ this._active = false;+ this._savedEnv = scene.environment;+ this._savedIntensities = baseLights.map((l) => l.intensity);++ this._onEstimationStart = this._onEstimationStart.bind(this);+ this._onEstimationEnd = this._onEstimationEnd.bind(this);+ }++ /**+ * Stand up the estimated light. Call AFTER `renderer.xr.setSession` so the+ * addon's own `sessionstart` listener fires and requests the light probe.+ * A no-op-safe call: if the UA never delivers an estimate, the baked lights+ * simply stay on and nothing here ever activates.+ */+ start() {+ if (this._xrLight) return;+ // environmentEstimation:true → also request the reflection cube map.+ const xrLight = new XREstimatedLight(this._renderer, true);+ xrLight.addEventListener('estimationstart', this._onEstimationStart);+ xrLight.addEventListener('estimationend', this._onEstimationEnd);+ this._scene.add(xrLight);+ this._xrLight = xrLight;+ }++ get active() {+ return this._active;+ }++ _onEstimationStart() {+ if (!this._xrLight) return;+ this._active = true;+ // Hand the scene over to the real room: kill the baked lights so they+ // don't double-expose, and reflect the real environment on PBR surfaces.+ for (const l of this._baseLights) l.intensity = 0;+ if (this._xrLight.environment) this._scene.environment = this._xrLight.environment;+ this._onChange?.(true);+ }++ _onEstimationEnd() {+ // The device stopped estimating (walked into the dark, lost tracking):+ // fall back to the baked look rather than an unlit scene.+ this._active = false;+ this._restoreBase();+ this._onChange?.(false);+ }++ _restoreBase() {+ this._baseLights.forEach((l, i) => { l.intensity = this._savedIntensities[i]; });+ this._scene.environment = this._savedEnv;+ }++ /** Tear down on session end. Restores the baked lights + environment. */+ dispose() {+ if (this._xrLight) {+ this._xrLight.removeEventListener('estimationstart', this._onEstimationStart);+ this._xrLight.removeEventListener('estimationend', this._onEstimationEnd);+ this._scene.remove(this._xrLight);+ this._xrLight.dispose?.();+ this._xrLight = null;+ }+ this._restoreBase();+ this._active = false;+ }+}diff --git a/src/ar/multi-place.js b/src/ar/multi-place.jsindex ecd44e7d2..140619bbc 100644--- a/src/ar/multi-place.js+++ b/src/ar/multi-place.js@@ -153,7 +153,10 @@ export class MultiPlaceSession {const sessionInit = {requiredFeatures: ['hit-test'],- optionalFeatures: ['anchors', 'local-floor', 'depth-sensing'],+ // `light-estimation` unlocks real-world lighting + reflections+ // (src/ar/estimated-lighting.js); optional so devices without it fall+ // back to the baked studio lights, exactly as before.+ optionalFeatures: ['anchors', 'local-floor', 'depth-sensing', 'light-estimation'],depthSensing: {usagePreference: ['gpu-optimized', 'cpu-optimized'],dataFormatPreference: ['luminance-alpha', 'float32'],diff --git a/tests/ar-estimated-lighting.test.js b/tests/ar-estimated-lighting.test.jsnew file mode 100644index 000000000..1ca552d96--- /dev/null+++ b/tests/ar-estimated-lighting.test.js@@ -0,0 +1,122 @@+// EstimatedLighting swap/restore state machine (src/ar/estimated-lighting.js).+//+// The contract: the studio's baked lights and environment are handed to the+// real-world estimate ONLY while the device is actually estimating, and are+// restored byte-for-byte on estimationend and on dispose — a device that never+// estimates, or a session that ends mid-estimate, must never leave the scene+// unlit or double-lit. XREstimatedLight is mocked to a controllable fake so the+// machine is tested without a live WebXR session.++import { beforeEach, describe, expect, it, vi } from 'vitest';++// A minimal stand-in for three's XREstimatedLight: an event target that also+// carries an `environment` texture, exactly the surface the wrapper touches.+class FakeXRLight {+ constructor() {+ this._listeners = {};+ this.environment = { id: 'room-cubemap' };+ this.disposed = false;+ }+ addEventListener(type, fn) { (this._listeners[type] ||= []).push(fn); }+ removeEventListener(type, fn) {+ this._listeners[type] = (this._listeners[type] || []).filter((f) => f !== fn);+ }+ emit(type) { for (const fn of this._listeners[type] || []) fn(); }+ dispose() { this.disposed = true; }+}++let lastLight = null;+vi.mock('three/addons/webxr/XREstimatedLight.js', () => ({+ XREstimatedLight: class {+ constructor() {+ lastLight = new FakeXRLight();+ return lastLight;+ }+ },+}));++const { EstimatedLighting } = await import('../src/ar/estimated-lighting.js');++function makeScene() {+ const added = new Set();+ return {+ environment: { id: 'baked-env' },+ add(o) { added.add(o); },+ remove(o) { added.delete(o); },+ _added: added,+ };+}+const makeLight = (intensity) => ({ intensity, color: { setHex() {} } });+const renderer = { xr: { addEventListener() {} } };++describe('EstimatedLighting', () => {+ beforeEach(() => { lastLight = null; });++ it('leaves the baked lights untouched until estimation starts', () => {+ const scene = makeScene();+ const lights = [makeLight(1), makeLight(1.15)];+ const el = new EstimatedLighting({ renderer, scene, baseLights: lights });+ el.start();+ expect(el.active).toBe(false);+ expect(lights.map((l) => l.intensity)).toEqual([1, 1.15]);+ expect(scene.environment).toEqual({ id: 'baked-env' });+ expect(scene._added.has(lastLight)).toBe(true);+ });++ it('hands the scene to the room on estimationstart', () => {+ const scene = makeScene();+ const lights = [makeLight(1), makeLight(1.15)];+ const el = new EstimatedLighting({ renderer, scene, baseLights: lights });+ el.start();+ lastLight.emit('estimationstart');+ expect(el.active).toBe(true);+ expect(lights.map((l) => l.intensity)).toEqual([0, 0]); // baked lights off+ expect(scene.environment).toEqual({ id: 'room-cubemap' }); // real reflections+ });++ it('fires onChange only on real transitions', () => {+ const scene = makeScene();+ const onChange = vi.fn();+ const el = new EstimatedLighting({ renderer, scene, baseLights: [makeLight(1)], onChange });+ el.start();+ lastLight.emit('estimationstart');+ lastLight.emit('estimationend');+ expect(onChange.mock.calls.map((c) => c[0])).toEqual([true, false]);+ });++ it('restores lights + environment on estimationend', () => {+ const scene = makeScene();+ const lights = [makeLight(1), makeLight(1.15)];+ const el = new EstimatedLighting({ renderer, scene, baseLights: lights });+ el.start();+ lastLight.emit('estimationstart');+ lastLight.emit('estimationend');+ expect(el.active).toBe(false);+ expect(lights.map((l) => l.intensity)).toEqual([1, 1.15]);+ expect(scene.environment).toEqual({ id: 'baked-env' });+ });++ it('restores byte-for-byte on dispose mid-estimate (session ended while lit)', () => {+ const scene = makeScene();+ const lights = [makeLight(1), makeLight(1.15)];+ const el = new EstimatedLighting({ renderer, scene, baseLights: lights });+ el.start();+ lastLight.emit('estimationstart');+ const light = lastLight;+ el.dispose();+ expect(lights.map((l) => l.intensity)).toEqual([1, 1.15]);+ expect(scene.environment).toEqual({ id: 'baked-env' });+ expect(scene._added.has(light)).toBe(false); // removed from scene graph+ expect(light.disposed).toBe(true);+ });++ it('start() is idempotent — a second call adds no second light', () => {+ const scene = makeScene();+ const el = new EstimatedLighting({ renderer, scene, baseLights: [makeLight(1)] });+ el.start();+ const first = lastLight;+ el.start();+ expect(lastLight).toBe(first);+ expect(scene._added.size).toBe(1);+ });+});