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.

3.9 KB
Raw Blame

best3d 08: Opt-in WebGPU renderer with TSL materials

How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now, no gate.

Operating clause (binding)

  • Read CLAUDE.md first, then _context/best3d-00-CONTEXT.md. CLAUDE.md overrides everything, including this file.
  • Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan. A judgment call goes in one line of the final report.
  • The only permitted stops are the CLAUDE.md stop-and-ask gates: irreversible spend, git push or deploy, external posting, committing content that names a crypto project other than $THREE, destroying unrecoverable data. Batch every such ask into ONE message at the end.
  • Commercial vendors are "Vendor A, B..." in every committed file. Open-source projects are named and credited.
  • Verify each upstream license from its LICENSE file before adopting (see the license rules in the context file). Reference-only means build our own, never copy code.
  • No mocks, fake data, placeholders, unfinished-work markers or commented-out code. The em-dash and en-dash characters are banned.
  • Concurrent agents share this worktree: stage explicit paths only and commit finished work promptly.
  • Before committing, run npm run check:rules -- --paths <files you touched>. It must exit 0.

Why this matters

three.js r186 treats WebGPURenderer and TSL as primary; we use WebGL everywhere and run r184.

Source of the finding: docs/research/3d-landscape-2026-10.md.

Step 0: re-derive the current state

grep -n '"three"' package.json; grep -rln "WebGPU" src | head

Tasks

  1. Bump three to the latest stable that the dependency audit allows, verify the viewer and Scene Studio.
  2. Add a renderer factory: WebGPU when supported and opted in (?renderer=webgpu and an agent-3d attribute), WebGL2 fallback otherwise. Same visual output on both.
  3. Move Restyle material effects to TSL node materials behind the factory; adopt native GaussianSplat and three-mesh-bvh/webgpu where they exist.
  4. Perf numbers measured on both paths and recorded in docs; changelog.

Definition of done

  • Viewer renders the same model on both paths with no console errors.
  • Fallback proven by forcing WebGPU unavailable.
  • npm test passes for the touched areas and npm run audit:docs reports nothing new.
  • Docs, STRUCTURE.md row where a surface or directory landed, and a data/changelog.json entry (then npm run build:pages).

Never blocked

Blocker Resolution (act, do not ask)
Missing credential or env var Follow the credential row of the CLAUDE.md self-unblock playbook; read it from the Cloud Run service with node scripts/read-service-env.mjs.
GPU quota File the increase, route to another region or class, continue.
Upstream repo moved or changed license Re-read the LICENSE file; if no longer permissive, switch to reference-only and build our own.
Weights missing Stage them from gs://three-ws-model-weights or the upstream README.

Close out (required)

  1. Verify every Definition of done line with the actual command output in front of you. Never claim a line you did not verify.
  2. Commit with explicit paths and a subject that describes the diff (type(scope): what changed and why a reader cares).
  3. If every line passes, delete this file in that commit (git rm prompts/finish/074-best3d-08-webgpu-tsl-path.md) and append a dated entry to _context/best3d-PROGRESS.md with the commit SHAs. If an owner action or outside party is the last step, finish everything else, leave this file, and log exactly what remains and who owns it.
  4. Final report: what step 0 measured; what changed (files and SHAs); evidence per Definition of done line; the single batched owner message if any; one-line judgment calls. No trailing questions.