Skip to content

0005. 3D rendering: Three.js (provisional)

  • Status: Accepted (confirmed by the owner 2026-11-29 at the start of Phase 5)
  • Date: 2026-11-26
  • Phase: 5

The 3D template needs glTF models, lighting and materials, wrapped so it can be swapped.

Use Three.js behind @ludrel/render-3d, exposing ECS components (Mesh, Model (glTF), Light, Material, Camera3D). WebGL 2 by default; WebGPU renderer when available. Re-evaluate at the start of Phase 5.

  • Babylon.js: batteries-included (physics, inspector, GUI), excellent docs; heavier and engine-like, overlaps with our own loop/ECS the same way Phaser would in 2D.
  • PlayCanvas engine: strong, but optimised for its own editor workflow.
  • Hand-written WebGL: not justified.

Three.js is a renderer, not an engine, which fits our “we own loop and ECS” design. Its API is very well known to AI models, which helps generated code. Bundle cost only applies to 3D games (separate package).