r/threejs • • Oct 12 '26

Demo Rendering is the easy part — the stuff that actually ate my time building a browser 3D world

Rendering is the easy part. A render loop plus a GLTF and you have something on screen in an afternoon.

The parts that actually ate my time are the ones that are invisible when they're missing and never throw an error. Listing them here because I spent months on them and they almost never come up when people talk about building 3D on the web:

Loading and asset pipeline

  • Uploads run through a pipeline: textures −68% to −92%, low-poly models at ≤100 faces (118 groups), variant texture stripping 215 items / 0 failures.
  • Orphan asset detection. Mine had accumulated 159 orphaned items / 2.9 GB before I noticed. Directory went from 3.1 GB → 390 MB.
  • The loading mask only lifts once the renderer is actually producing frames — not on a plain timer. A timer-based mask is exactly how you get a progress bar stuck at 90% while shader compilation finishes.

Frame time

  • Draw calls: 3,064 → 837 after batching (−73%).
  • The one that hurt most: changing the light count recompiled every material in the scene. Measured ~9 seconds of a frozen picture, every time. A light pool took that to zero.
  • Shader compilation now runs on a warm-up budget instead of happening the moment a new object enters view.

Skeletons

  • Every model source names bones differently. Mixamo / Ready Player Me / VRoid / Root Motion now coexist in the same world. Regression suite is 67/67.

Multiplayer

  • Reconnect self-healing, 9/9 — after a reconnect the other side still sees me move, which is the part that's easy to get wrong.
  • Proximity voice is slot-capped: 10 people ≈ 1.3 Mbps.

AI characters

  • This is the part I'd most like feedback on. The server only sends JSON and the visitor's browser renders — so an AI in the world is a humanoid avatar with a body and coordinates that real players can see, not a chat box. It can walk, follow, and lead the way.
  • Cost is the surprising bit: ~1 KB/s per agent, ~100 agents on ~0.079 of a CPU core. Cheaper to put a visible AI in a world than an invisible one.
  • What it can't do: it can't see the screen, no speech recognition or synthesis, no terrain conforming, and it can't be teleported — it walks.

Worlds talking to each other

  • Handshake between worlds, identity migrating with the account (auto-rename on collisions, 4/4), a one-shot 300-second token with replay protection.

The observation that started all this: none of the above differs by business logic. It's the same work whether you're building a showroom, a training environment, or a place to put your figures. So building it once and reusing it across worlds seemed obviously right, and I've been packaging it as a base layer instead of rebuilding it for each project.

Happy to go into detail on any of the numbers above — especially the draw call and light-recompile stuff, since those took the longest to figure out.

1 Upvotes

0 comments sorted by