Create Wiki/Prompts/AI games

Three.js scene starter: a clean skeleton in one prompt

From the OpenDrama Create Wiki

Prompt9 min readLast edited October 14, 2026

This prompt gets an AI coding model to write the dull, load-bearing part of a Three.js game first: renderer, light, camera rig, loader, resize handling and a perf HUD, split into small files that use current APIs. Every later prompt then edits a clean structure instead of one ever-growing main.js. All your project details go in one block at the top, so reusing it for the next game takes two minutes.

What it's for

Use it at the start of any browser game or 3D scene, before the first gameplay prompt. Ask a model for "a Three.js scene" without a spec and you usually get the same set of defects:

  • Old colour and light code. outputEncoding, sRGBEncoding, or intensities tuned for the pre-r155 legacy units, so the image is dim or washed out from day one.
  • An uncapped pixel ratio. A DPR 3 phone renders 2.25× the pixels of DPR 2, which is often the difference between 60 and 30 fps.
  • Resize on window only. The canvas blurs or stretches inside an iframe, a split layout, or after the phone rotates.
  • A black screen while a 20 MB GLB downloads. No progress, and no error when a Draco decoder path returns 404.
  • A raw requestAnimationFrame loop with an unclamped delta. Switch tabs and the player teleports.
  • No numbers. You can't see draw calls or frame time, so you can't tell why it's slow.

The prompt removes each of these by spec and ends with checks you can verify in two minutes. It sets the look to a sane baseline (tone mapping, one shadowed key light, fog); the full treatment is in the cinematic look skill. Once the skeleton runs, describe the game itself with the game design brief.

Not for: react-three-fiber projects (a different structure), other engines, or a single-file toy (see the compact variant under Tuning).

Members read on

The rest of this page is for members

  • 5 more steps
  • 3 copy-ready prompts
  • 1 reference tables
  • 6 more sections

Create a free account, top up once — from $0.99 — and the whole wiki is yours.

  • Every breakdown, Skill and Prompt
  • New pages every day
  • Prompts copy in one tap

See also

Breakdowns that use this

More in AI games

View all →