Skip to content
Back to skills

Threejs Worlds

ASecurity

Build polished three.js / WebGL 3D scenes, worlds and procedural models, verified with a QA hook and multi-state screenshots.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added December 1, 2026
ai-agentspythonapi

Works with

  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Omerfaruk-aydn/Atlas-Agent --skill threejs-worlds --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Threejs Worlds?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Threejs Worlds
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/omerfaruk-aydn-threejs-worlds/badge)](https://www.skillsdirectory.com/skills/omerfaruk-aydn-threejs-worlds)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: threejs-worlds
description: Build polished three.js / WebGL 3D scenes, worlds and procedural models, verified with a QA hook and multi-state screenshots.
compatibility: Atlas native tools; browser tool for rendering and screenshots. CDN modules need network access.
metadata:
  provenance: atlas-authored-adaptation
  reviewed-sources: mrdoob/three.js r187 examples and migration guide (MIT), MengTo/Skills 3d and threejs skills (MIT), majidmanzarpour/threejs-game-skills (MIT), scottstts/Threejs-Awesome-Graphics-Agent-Skills (MIT), CloudAI-X/threejs-skills (MIT), N8python/n8ao (CC0), pmndrs/postprocessing (Zlib)
  pinned-three: "0.187.0"
---

# threejs-worlds

A method for 3D work that looks authored, not like programmer art: a world,
a scene, a procedural model, a game level or a product viewer in three.js.
The user's request sets the bar; this guide sets the craft. When they
disagree, the request wins. If this is not 3D work, unload this guide.

## 1. Brief before code (write it in the plan or a short comment block)

- **Thesis:** one sentence on the look (for example "warm dusk miniature city,
  muted limestone with saturated cabs and windows").
- **Spec in real units (meters):** every object class with its dimensions,
  parts and counts. A floor is about 3.3 m, a door 2.1 m, a car 4.5 x 1.8 x
  1.5 m, a person 1.75 m, a lane 3.5 m, a street tree 6-10 m. Wrong
  proportions are the most common failure. See `references/modeling.md`.
- **Palette:** one dominant hue family, one accent, a ground set; written as
  hex values. Low saturation on large surfaces; saturation only on small things.
- **Light plan:** key, fill, environment, and how they change over time.
- **States to verify:** list every visual state the request implies (start,
  growing, finished, day, dusk, night, close-up, each UI mode). These become
  the screenshot matrix in section 5.
- **Measurable checks:** turn each testable clause of the request into a
  check function (same seed gives the same world, counts grow over time,
  windows lit at night, nothing below the ground). Section 4.

## 2. Build in this order, and finish each layer before the next

1. **Forms.** Silhouettes must read as flat dark shapes. Use massing (base,
   body, crown), setbacks, bevels (`RoundedBoxGeometry`), lathe, extrude and
   tube shapes instead of bare boxes and spheres. One function per part,
   placed relative to its parent; named groups; pivots at joints.
2. **Variation.** Seeded PRNG (mulberry32) for everything; no `Math.random()`
   in generation. Height and density follow a distribution (falloff from a
   centre, lognormal sizes), never uniform noise on a perfect grid. Per-instance
   colour from the palette, brightness x0.94-1.06.
3. **Materials.** `MeshStandardMaterial`; roughness 0.75-0.9 for masonry,
   0.2-0.35 for glass. Named material roles shared across objects (body, trim,
   glass, emissive, ground). Canvas-drawn textures for windows and signs, UVs
   scaled to world size so they never stretch.
4. **Light.** Environment map first (`PMREMGenerator` + `RoomEnvironment` or
   a baked sky), then a warm directional key and a cool `HemisphereLight` fill
   at about 3:1. Never a lone `AmbientLight`. Tight shadow camera fitted to the
   scene, `normalBias` 0.02-0.05.
5. **Atmosphere and finish.** Fog colour equal to the horizon colour; one
   time-of-day keyframe table drives sky, fog, lights, exposure and bloom.
   Post only as finish: bloom on emissive above threshold, optional AO, SMAA,
   vignette. Check the frame with post on and off.

Glow, fog and darkness never stand in for missing geometry. If a shape only
reads because it glows, build the shape.

Exact values, code and the full checklist: `references/polish.md`.
Procedural layouts (roads, parcels, terrain, scatter, growth animation,
day/night): `references/worlds.md`.

## 3. Baseline that is right by default (three r187)

```html
<script type="importmap">
{ "imports": {
  "three": "https://cdn.jsdelivr.net/npm/three@0.187.0/build/three.module.js",
  "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.187.0/examples/jsm/"
}}
</script>
```

- Pin exact versions on one CDN; never `@latest`; never two copies of three.
- `renderer.outputColorSpace` stays sRGB; colour canvas textures get
  `colorSpace = THREE.SRGBColorSpace`; exactly one tone-mapping stage
  (`AgXToneMapping` for emissive-heavy night scenes, `ACESFilmicToneMapping`
  for contrast); with an `EffectComposer` end with `OutputPass`.
- `renderer.setPixelRatio(Math.min(devicePixelRatio, 2))`, `setAnimationLoop`,
  `THREE.Timer` (not `Clock`), `PCFShadowMap` with `shadow.radius` (not
  `PCFSoftShadowMap`), `scene.environmentIntensity` (not `envMapIntensity`).
- Instancing for repeated objects (`InstancedMesh`, `setColorAt` for every
  instance before the first render). Budget: under about 100 draw calls and
  300k triangles for headless capture; read `renderer.info` to prove it.
- URL parameters for reproducible captures: `?seed=`, `?t=` or `?tod=`
  (time), `?static=1` (skip animation), `?view=` (camera preset).

Outdated APIs and the mistakes that make generated scenes look bad:
`references/mistakes.md`. Read it before writing the first file.

## 4. QA hook (required for a browser scene)

Inline the hook from `assets/atlas3d-qa.js` (view it, copy it verbatim into
the page's module script) and call it once the scene exists:

```js
installAtlas3D({ THREE, renderer, scene, camera, // camera may be a function
  budget: { calls: 150, triangles: 1500000 },      // optional overrides
  render: () => composer ? composer.render() : renderer.render(scene, camera),
  setState: (s) => { /* apply only the keys present: s.seed, s.time, s.view, ... */ },
  checks: { sameSeedSameWorld: () => ..., /* one per testable clause */ },
});
```

`window.__atlas3d.report()` renders a frame and returns
`{"atlas3d":1,"ok":...,"failed":[...],...}`: blank canvas, broken (NaN)
geometry, nothing in view, console errors, colour pipeline, missing light,
a stretched or overflowing canvas (`viewport_fit`), render budget, plus your
project checks. A check returns `true`, or
`{ ok, detail }`. Atlas reads this report from the browser eval output: after
the last change to the scene, a passing report is part of done.

## 5. Verify like a reviewer, then improve

1. Open the page with the browser tool (a `file://` path in the project or a
   local server). Wait for `window.__atlas3d.ready`.
2. Eval `window.__atlas3d.report()` and return the report as is. Atlas
   recognizes it by its `atlas3d` field; to add your own values, spread it:
   `({ ...window.__atlas3d.report(), buildings: n })`. A hand-made summary
   is not evidence. Fix every failed check first.
3. For each state from the brief: `window.__atlas3d.setState({...})`, then a
   screenshot. At least two distinct states or views; a single frame proves
   nothing about time, growth or night.
4. Critique each screenshot against the brief with yes/no questions: do the
   forms read as silhouettes; are proportions right next to a known object;
   is there visible variation; key/fill/shadow present; colours neither washed
   out nor crushed; horizon seamless; every requested element visible; no
   z-fighting, black materials, stretched textures, floating or sunk objects.
5. Fix the worst finding, recapture the same state, and compare. Keep the
   better version; revert a change that made it worse. Repeat until the
   critique has no material finding. One improvement pass after the first
   working version is the minimum, not an option.
6. Report which states and checks actually ran, with their results.

Details, pixel metrics and the evidence matrix: `references/qa.md`.

## 6. Detailed models

Every model is built to hold up in a close-up from every side, like a
dedicated 3D generator's output. Follow `references/modeling.md` step by step:
part tree in three detail levels (primary forms, secondary parts, tertiary
surface detail), measured plan, block-out checked in silhouette, refined
forms (bevels, fillets, lathes, tubes; no bare boxes), secondary parts that
explain function, procedural surfaces (albedo, roughness and normal maps),
material roles, studio light, then six framed views and model checks.

Copy `assets/model-kit.js` verbatim for this: `kit.bevelBox`, `kit.lathe`,
`kit.panel`, `kit.tube`, `kit.ring`, `kit.array`, `kit.merge`, `kit.surface`,
`kit.material`, `kit.bakeAO`, `kit.ground`, `kit.studio`, `kit.views` and
`kit.checks` (connected parts, nothing sunk, clean geometry, size against
the plan, detail target). External models only when the user allows them
(section 9 of the modelling reference).

Files in this skill

  • SKILL.md8.5 KB
  • assets/atlas3d-qa.js9.3 KB
  • assets/model-kit.js22.9 KB
  • references/mistakes.md3.7 KB
  • references/modeling.md9.1 KB
  • references/polish.md8.3 KB
  • references/qa.md4 KB
  • references/worlds.md4.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.