threedog 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/CHANGELOG.md +893 -798
  2. package/README.md +1 -1
  3. package/core/assets/Animator.js +41 -3
  4. package/core/assets/Assets.js +100 -24
  5. package/core/assets/assetEntry.js +73 -20
  6. package/core/assets/assetHot.js +68 -16
  7. package/core/assets/assetLoad.js +6 -6
  8. package/core/assets/assetLod.js +9 -2
  9. package/core/assets/assetManifest.js +12 -2
  10. package/core/assets/assetPart.js +54 -0
  11. package/core/assets/ik.js +271 -0
  12. package/core/assets/modelNeeds.js +37 -0
  13. package/core/assets/namedModel.js +102 -29
  14. package/core/assets/nodeVisibility.js +15 -0
  15. package/core/audio/Audio.js +36 -4
  16. package/core/audio/audioReverb.js +99 -0
  17. package/core/audio/audioRules.js +1 -1
  18. package/core/audio/audioVoice.js +1 -1
  19. package/core/base/Events.js +14 -4
  20. package/core/base/Random.js +1 -1
  21. package/core/base/Vars.js +1 -1
  22. package/core/base/docRef.js +51 -0
  23. package/core/base/errorCodes.js +187 -126
  24. package/core/base/errorHints.js +9 -7
  25. package/core/base/errors.js +25 -10
  26. package/core/base/events.generated.js +2 -0
  27. package/core/base/freeParts.js +76 -0
  28. package/core/base/math.js +28 -0
  29. package/core/base/sections.js +5 -5
  30. package/core/base/validate.js +31 -3
  31. package/core/engine/Engine.js +17 -7
  32. package/core/engine/Loading.js +5 -3
  33. package/core/engine/copies.js +1 -1
  34. package/core/engine/headlessLoad.js +4 -1
  35. package/core/engine/lifecycle.js +32 -16
  36. package/core/engine/loop.js +71 -27
  37. package/core/engine/moduleSlots.js +2 -2
  38. package/core/engine/moduleTypes.js +3 -3
  39. package/core/engine/modules.js +65 -39
  40. package/core/engine/page.js +6 -3
  41. package/core/engine/services.js +6 -5
  42. package/core/engine/startup.js +8 -7
  43. package/core/input/Input.js +28 -14
  44. package/core/input/inputContext.js +28 -16
  45. package/core/input/inputKeyboard.js +31 -3
  46. package/core/input/inputPad.js +4 -0
  47. package/core/input/inputPointer.js +2 -1
  48. package/core/input/inputSeat.js +1 -1
  49. package/core/inspect/Budget.js +109 -19
  50. package/core/inspect/DebugOverrides.js +28 -4
  51. package/core/inspect/Describe.js +17 -9
  52. package/core/inspect/Inspect.js +4 -2
  53. package/core/inspect/InspectMaterials.js +3 -1
  54. package/core/inspect/InspectPerf.js +19 -9
  55. package/core/inspect/InspectScene.js +32 -7
  56. package/core/inspect/MaterialInfo.js +19 -2
  57. package/core/inspect/UrlState.js +50 -28
  58. package/core/inspect/catalog.js +28 -9
  59. package/core/inspect/debugView.js +2 -1
  60. package/core/inspect/describeRender.js +25 -13
  61. package/core/inspect/describeText.js +14 -6
  62. package/core/inspect/lightWatch.js +1 -1
  63. package/core/inspect/metadata.generated.js +35 -17
  64. package/core/inspect/pictureChecks.js +148 -0
  65. package/core/inspect/pictureMenu.js +84 -0
  66. package/core/inspect/pictureWriters.js +26 -6
  67. package/core/inspect/textureBytes.js +12 -2
  68. package/core/inspect/toolDoor.js +2 -4
  69. package/core/ops/Ops.js +11 -4
  70. package/core/ops/holds.js +27 -10
  71. package/core/ops/opsAtomic.js +15 -7
  72. package/core/ops/opsGuard.js +2 -2
  73. package/core/ops/opsRun.js +8 -7
  74. package/core/ops/sharedPoint.js +72 -21
  75. package/core/ops/stacks.js +56 -16
  76. package/core/saves/SaveStore.js +9 -3
  77. package/core/saves/Saves.js +32 -23
  78. package/core/saves/saveApply.js +96 -44
  79. package/core/saves/saveIds.js +1 -1
  80. package/core/saves/saveVersions.js +7 -5
  81. package/core/saves/session.js +17 -8
  82. package/core/saves/stateReplace.js +34 -15
  83. package/core/scene/Rays.js +52 -10
  84. package/core/scene/Views.js +36 -15
  85. package/core/scene/adaptive.js +144 -21
  86. package/core/scene/drawOnly.js +17 -0
  87. package/core/scene/gameLights.js +47 -4
  88. package/core/scene/sceneMethods.js +13 -11
  89. package/core/scene/stepPoses.js +11 -3
  90. package/core/scene/targeting.js +5 -3
  91. package/core/scene/thingOps.js +1 -1
  92. package/core/scene/tier.js +15 -0
  93. package/core/stream/Batching.js +30 -7
  94. package/core/stream/Stream.js +26 -7
  95. package/core/stream/batchGroups.js +2 -2
  96. package/core/stream/chunkStream.js +7 -5
  97. package/core/stream/prepare.js +77 -0
  98. package/core/time/skip.js +3 -1
  99. package/core/time/time.js +4 -2
  100. package/docs/AI.md +82 -83
  101. package/docs/API.md +16 -16
  102. package/docs/CODEMAP.md +17 -11
  103. package/docs/COMMANDS.md +139 -142
  104. package/docs/CONVENTIONS.md +37 -49
  105. package/docs/MIGRATING-0.8.md +2 -2
  106. package/docs/MIGRATING-1.0.md +2 -2
  107. package/docs/THREE.md +30 -35
  108. package/docs/api/assets.md +3 -1
  109. package/docs/api/audio.md +4 -2
  110. package/docs/api/budget.md +5 -0
  111. package/docs/api/characters.md +10 -8
  112. package/docs/api/collision.md +6 -4
  113. package/docs/api/engine.md +16 -16
  114. package/docs/api/events.md +3 -2
  115. package/docs/api/ground.md +6 -5
  116. package/docs/api/hud.md +4 -2
  117. package/docs/api/input.md +5 -5
  118. package/docs/api/particles.md +2 -1
  119. package/docs/api/photo.md +3 -0
  120. package/docs/api/post.md +7 -4
  121. package/docs/api/quests.md +2 -2
  122. package/docs/api/rays.md +1 -2
  123. package/docs/api/saves.md +7 -7
  124. package/docs/api/settings.md +2 -2
  125. package/docs/api/tools.md +3 -1
  126. package/docs/api/vars.md +1 -1
  127. package/docs/api/vegetation.md +4 -2
  128. package/docs/api/world.md +1 -1
  129. package/docs/recipes/01-new-game.md +16 -17
  130. package/docs/recipes/02-npc.md +22 -18
  131. package/docs/recipes/03-items-pickups.md +37 -35
  132. package/docs/recipes/04-quests.md +15 -10
  133. package/docs/recipes/05-props-bake.md +101 -95
  134. package/docs/recipes/06-clock-events.md +28 -28
  135. package/docs/recipes/07-flow-scenes-pause.md +29 -26
  136. package/docs/recipes/08-weather-sky.md +52 -64
  137. package/docs/recipes/09-materials-lights-models.md +26 -17
  138. package/docs/recipes/10-blender-level.md +15 -10
  139. package/docs/recipes/11-vehicles.md +12 -7
  140. package/docs/recipes/12-navmesh.md +44 -26
  141. package/docs/recipes/13-animation.md +56 -45
  142. package/docs/recipes/14-custom-module.md +21 -18
  143. package/docs/recipes/15-perf.md +61 -55
  144. package/docs/recipes/16-dev-bridge.md +24 -33
  145. package/docs/recipes/18-world.md +36 -42
  146. package/docs/recipes/19-shooting-picking.md +20 -15
  147. package/docs/recipes/20-content-actions-save.md +48 -56
  148. package/docs/recipes/21-camera.md +45 -54
  149. package/docs/recipes/22-shop-gold.md +12 -7
  150. package/docs/recipes/23-ops.md +25 -23
  151. package/docs/recipes/26-ui-parts.md +67 -47
  152. package/docs/recipes/27-net.md +12 -7
  153. package/docs/recipes/28-terrain.md +24 -21
  154. package/docs/recipes/29-grid.md +32 -27
  155. package/docs/recipes/30-templates.md +21 -20
  156. package/docs/recipes/31-audio.md +39 -22
  157. package/docs/recipes/32-action-game.md +19 -14
  158. package/docs/recipes/33-stream-sources.md +15 -11
  159. package/docs/recipes/34-environment-lighting.md +126 -70
  160. package/docs/recipes/35-picture-from-reference.md +8 -8
  161. package/docs/recipes/36-ground-plants.md +27 -21
  162. package/docs/recipes/40-scene.md +19 -28
  163. package/docs/recipes/43-shader-patches-surfaces.md +15 -12
  164. package/docs/recipes/44-water-weather-hooks.md +34 -31
  165. package/docs/recipes/45-cascaded-shadows.md +35 -26
  166. package/docs/recipes/46-blender-art-route.md +7 -2
  167. package/docs/recipes/49-game-module-contract.md +13 -8
  168. package/docs/recipes/50-own-renderer.md +6 -2
  169. package/docs/recipes/51-capability-catalog.md +15 -8
  170. package/docs/recipes/52-around-the-picture.md +34 -32
  171. package/docs/recipes/53-ground-up-close.md +6 -1
  172. package/docs/recipes/55-mods-time-wrap.md +27 -19
  173. package/docs/recipes/56-webgpu-tsl.md +75 -43
  174. package/docs/recipes/57-control.md +18 -13
  175. package/docs/recipes/58-input.md +26 -16
  176. package/docs/recipes/59-depth-post-effects.md +8 -3
  177. package/docs/recipes/60-judge-the-picture.md +10 -9
  178. package/docs/recipes/61-deploy.md +5 -0
  179. package/docs/recipes/62-picture-code.md +72 -79
  180. package/docs/recipes/63-third-person-start.md +48 -45
  181. package/docs/recipes/64-particles.md +22 -10
  182. package/docs/recipes/65-swarm.md +18 -13
  183. package/docs/recipes/66-common-tasks.md +38 -35
  184. package/examples/action/.threedog/content-index.json +1 -1
  185. package/examples/action/GAMEMAP.md +2 -3
  186. package/examples/action/main.js +3 -3
  187. package/examples/action/picture/lights.js +3 -1
  188. package/examples/perf-island/.threedog/content-index.json +1 -1
  189. package/examples/perf-island/GAMEMAP.md +3 -3
  190. package/examples/perf-island/picture/lights.js +2 -1
  191. package/examples/plain-picture/GAMEMAP.md +1 -1
  192. package/examples/rc2d/GAMEMAP.md +1 -1
  193. package/examples/styletest/.threedog/content-index.json +1 -1
  194. package/examples/styletest/GAMEMAP.md +2 -2
  195. package/examples/styletest/main.js +1 -1
  196. package/examples/techniques/interior-light/README.md +3 -3
  197. package/examples/techniques/interior-light/interiorLight.js +2 -4
  198. package/examples/techniques/interior-light/picture/lights.js +2 -1
  199. package/examples/techniques/modular-building/picture/lights.js +3 -1
  200. package/examples/techniques/outlines-and-rim/picture/lights.js +3 -1
  201. package/examples/techniques/procedural-animation/README.md +1 -1
  202. package/examples/techniques/procedural-animation/main.js +1 -1
  203. package/examples/webgpu-tsl/GAMEMAP.md +1 -1
  204. package/examples/world/.threedog/content-index.json +1 -1
  205. package/examples/world/GAMEMAP.md +2 -3
  206. package/examples/world/art/humanoid.js +1 -1
  207. package/examples/world/main.js +6 -3
  208. package/index.d.ts +2 -2
  209. package/llms.txt +101 -0
  210. package/modules/ambience/Ambience.js +21 -5
  211. package/modules/calendar/index.js +9 -5
  212. package/modules/calendar/schedule.js +23 -8
  213. package/modules/camera/FirstPersonCamera.js +3 -1
  214. package/modules/camera/FollowCamera.js +10 -5
  215. package/modules/camera/RtsCamera.js +4 -3
  216. package/modules/camera/common.js +70 -8
  217. package/modules/camera/contract.js +1 -1
  218. package/modules/characters/Character.js +16 -10
  219. package/modules/characters/NPC.js +31 -19
  220. package/modules/characters/assetModel.js +14 -9
  221. package/modules/characters/astar.js +6 -1
  222. package/modules/characters/contract.js +2 -2
  223. package/modules/characters/index.js +34 -22
  224. package/modules/characters/movers/manual.js +1 -1
  225. package/modules/characters/movers/rapier.js +17 -2
  226. package/modules/characters/movers/simple.js +1 -1
  227. package/modules/characters/movers/support.js +16 -7
  228. package/modules/characters/npcAvoid.js +2 -2
  229. package/modules/characters/npcSim.js +3 -2
  230. package/modules/characters/pathAsync.js +24 -8
  231. package/modules/characters/pathJob.js +1 -1
  232. package/modules/characters/player.js +10 -9
  233. package/modules/characters/playerStrings.js +5 -5
  234. package/modules/characters/proceduralRig.js +5 -5
  235. package/modules/characters/useModel.js +6 -0
  236. package/modules/characters/walkTo.js +1 -1
  237. package/modules/collision/Collision.js +29 -18
  238. package/modules/collision/grid.js +22 -4
  239. package/modules/content/index.js +3 -1
  240. package/modules/content/loader.js +1 -1
  241. package/modules/content/models.js +82 -33
  242. package/modules/content/props.js +2 -1
  243. package/modules/content/rules.js +11 -5
  244. package/modules/content/templates.js +3 -3
  245. package/modules/content/words.js +2 -2
  246. package/modules/debug/DebugPanel.js +9 -9
  247. package/modules/flow/index.js +9 -6
  248. package/modules/gameplay/Dialogue.js +34 -20
  249. package/modules/gameplay/Interactions.js +19 -15
  250. package/modules/gameplay/Inventory.js +9 -4
  251. package/modules/gameplay/Quests.js +12 -10
  252. package/modules/gameplay/pickups.js +23 -11
  253. package/modules/grid/index.js +1 -1
  254. package/modules/grid/preview.js +2 -2
  255. package/modules/grid/tiles.js +1 -1
  256. package/modules/hlod/index.js +4 -1
  257. package/modules/hud/index.js +47 -10
  258. package/modules/hud/parts.js +28 -9
  259. package/modules/level/geometry.js +8 -3
  260. package/modules/level/index.js +10 -5
  261. package/modules/level/load.js +4 -2
  262. package/modules/lights/sources.js +1 -1
  263. package/modules/music/Music.js +22 -4
  264. package/modules/nav/index.js +20 -10
  265. package/modules/particles/Particles.js +31 -14
  266. package/modules/particles/effect.js +20 -5
  267. package/modules/particles/lit.js +72 -0
  268. package/modules/photo/Photo.js +72 -28
  269. package/modules/photo/pathTrace.js +106 -0
  270. package/modules/rigid/RigidBodies.js +23 -14
  271. package/modules/rigid/Vehicles.js +3 -13
  272. package/modules/rigid/sync.js +2 -1
  273. package/modules/settings/Settings.js +52 -20
  274. package/modules/settings/apply.js +23 -9
  275. package/modules/settings/sections.js +39 -6
  276. package/modules/settings/strings.js +2 -0
  277. package/modules/settings/view.js +19 -3
  278. package/modules/sky/dome.js +15 -3
  279. package/modules/sky/environment.js +28 -12
  280. package/modules/sky/fog.js +1 -1
  281. package/modules/sky/frame.js +6 -1
  282. package/modules/sky/shader.js +4 -3
  283. package/modules/sky/skyModule.js +8 -4
  284. package/modules/swarm/Swarm.js +1 -1
  285. package/modules/terrain/ChunkManager.js +61 -15
  286. package/modules/terrain/chunkJob.js +2 -2
  287. package/modules/terrain/index.js +20 -5
  288. package/modules/terrain/terrainEdit.js +8 -4
  289. package/modules/terrain/terrainTexture.js +4 -2
  290. package/modules/timeline/Timeline.js +4 -3
  291. package/modules/timeline/Tween.js +3 -0
  292. package/modules/timeline/letterbox.js +1 -0
  293. package/modules/triggers/index.js +36 -17
  294. package/modules/vegetation/Vegetation.js +81 -19
  295. package/modules/vegetation/densityMap.js +13 -8
  296. package/modules/vegetation/draw.js +147 -24
  297. package/modules/vegetation/groundChunks.js +20 -5
  298. package/modules/vegetation/index.js +3 -3
  299. package/modules/vegetation/modelGeometry.js +9 -4
  300. package/modules/water/Water.js +11 -8
  301. package/modules/weather/Weather.js +7 -2
  302. package/modules/weather/shaders.js +25 -5
  303. package/modules/weather/weatherDraw.js +20 -6
  304. package/modules/world/World.js +2 -1
  305. package/modules/world/index.js +2 -2
  306. package/modules/world/persist.js +6 -2
  307. package/modules/world/views.js +15 -2
  308. package/package.json +5 -1
  309. package/presets.js +5 -5
  310. package/render/PostFX.js +102 -42
  311. package/render/backend.js +142 -16
  312. package/render/bindingLimits.js +59 -0
  313. package/render/cascades.js +3 -1
  314. package/render/cascades.tsl.js +2 -0
  315. package/render/daylight.js +7 -1
  316. package/render/detail.js +7 -4
  317. package/render/effects.js +27 -8
  318. package/render/fogLook.js +24 -0
  319. package/render/fuse.js +5 -2
  320. package/render/fx/compareLevel.tsl.js +23 -0
  321. package/render/fx/detail.tsl.js +9 -7
  322. package/render/fx/index.js +9 -2
  323. package/render/fx/library.tsl.js +1 -0
  324. package/render/fx/lightShaft.tsl.js +114 -0
  325. package/render/fx/noise.tsl.js +25 -8
  326. package/render/fx/objectOrigin.tsl.js +39 -10
  327. package/render/fx/particles.tsl.js +23 -6
  328. package/render/fx/patchNodes.tsl.js +17 -12
  329. package/render/fx/pcss.tsl.js +51 -0
  330. package/render/fx/postWebGPU.tsl.js +104 -29
  331. package/render/fx/sky.tsl.js +3 -9
  332. package/render/fxNumbers.js +10 -4
  333. package/render/impostor.tsl.js +107 -0
  334. package/render/lighting.js +33 -1
  335. package/render/lightmap.js +42 -28
  336. package/render/lights.js +19 -3
  337. package/render/materials.js +6 -4
  338. package/render/mergeCommon.js +4 -1
  339. package/render/occlusion.js +14 -4
  340. package/render/patches.js +79 -41
  341. package/render/postRuns.js +32 -0
  342. package/render/postWebGL.js +97 -10
  343. package/render/probes.js +10 -14
  344. package/render/shaderErrors.js +44 -7
  345. package/render/shadowCache.tsl.js +33 -5
  346. package/render/shadows.js +42 -16
  347. package/render/slots.js +8 -5
  348. package/render/vertexInputs.js +52 -0
  349. package/types/core.d.ts +115 -47
  350. package/types/gameplay.d.ts +56 -23
  351. package/types/generated/core/audio/Audio.d.ts +27 -1
  352. package/types/generated/core/base/Random.d.ts +1 -1
  353. package/types/generated/core/input/Input.d.ts +6 -8
  354. package/types/generated/core/input/inputSeat.d.ts +1 -1
  355. package/types/generated/core/inspect/Budget.d.ts +26 -0
  356. package/types/generated/core/inspect/DebugOverrides.d.ts +0 -2
  357. package/types/generated/core/saves/Saves.d.ts +10 -7
  358. package/types/generated/core/saves/session.d.ts +8 -2
  359. package/types/generated/core/scene/Rays.d.ts +1 -3
  360. package/types/generated/core/scene/Views.d.ts +17 -3
  361. package/types/generated/modules/particles/Particles.d.ts +1 -1
  362. package/types/generated/modules/world/World.d.ts +2 -1
  363. package/types/generated/render/PostFX.d.ts +35 -9
  364. package/types/physics.d.ts +796 -764
  365. package/types/pixel.d.ts +1 -1
  366. package/types/tsl.d.ts +62 -1
  367. package/types/world.d.ts +12 -3
  368. package/ui/Focus.js +7 -5
  369. package/ui/Parts.js +1 -1
  370. package/ui/touchPart.js +6 -3
@@ -1,5 +1,10 @@
1
1
  # Who steers a character: engine.control
2
2
 
3
+ > **Covers:** who steers a character: the control slot, script moves, vehicles, your own mover.
4
+ > **Use when:** a quest, cutscene or vehicle takes over a character.
5
+ > **Shortest:** `engine.control.take(character, { owner, step })`.
6
+ > **Sections:** Who takes what · Control is not the · Moved by script ride · Vehicles · Saves · Advanced your own mover
7
+
3
8
  Every character (the player, an NPC, a hand-built `Character`) has one control slot. One owner is in charge of it at a time, and only that
4
9
  owner moves the character. Take it, steer, give it back:
5
10
 
@@ -16,8 +21,8 @@ engine.clock.after(0.4, () => roll.remove(), { channel: 'real' });
16
21
  const h = engine.control.take(drone, { owner: 'ai', layer: 'script' });
17
22
  engine.onFixed(dt => h.move(dir.x, dir.z, false, dt));
18
23
 
19
- engine.control.of(engine.player); // { owner: 'timeline', layer: 'cutscene', waiting: [{ owner: 'walkTo', layer: 'script' }, { owner: 'player-input', layer: 'base' }] }
20
- engine.describe().control; // the same for every held character, by id
24
+ engine.control.of(engine.player); // { owner: 'timeline', layer: 'cutscene', waiting: [{ owner: 'walkTo', layer: 'script' }, { owner: 'player-input', layer: 'base' }] }
25
+ engine.describe().control; // the same for every held character, by id
21
26
  ```
22
27
 
23
28
  What to remember:
@@ -38,7 +43,7 @@ What to remember:
38
43
 
39
44
  | Driver | Layer | Owner | Notes |
40
45
  |---|---|---|---|
41
- | `createPlayer({ control })` | base | `'player-input'` | `control` is `'camera'` or `(player, input, dt) => ({ x, z, run })`; jump and driving live here too |
46
+ | `addPlayer({ control })` | base | `'player-input'` | `control` is `'camera'` or `(player, input, dt) => ({ x, z, run })`; jump and driving live here too |
42
47
  | NPC behaviour (schedule, wander, your own) | base | `'npcs'` | paused near and far while anything above holds the NPC; kept by NPC id, so it survives the model being rebuilt |
43
48
  | `character.walkTo(target)` | script | `'walkTo'` | paused under a cutscene (no progress, no stuck clock), resumes after |
44
49
  | `timeline.play(steps, { actors })` | cutscene | `'timeline'` | `actors` defaults to `[engine.player]`; `[]` drives nobody; a `path` step adds its character. Resolves `{ ending, error? }`: `'finished'`, `'skipped'`, `'dropped'` (a load, new game or dispose took its state) or `'failed'`; `timeline:end` carries the same. While the player is an actor, the `'cutscene'` input context is up |
@@ -71,7 +76,7 @@ const ride = engine.control.take(engine.player, { owner: 'boat', layer: 'script'
71
76
  boat.updateWorldMatrix(true, false);
72
77
  boat.localToWorld(ch.root.position.copy(seat));
73
78
  ch.syncRecord();
74
- return false; // placed by hand this step
79
+ return false; // placed by hand this step
75
80
  } });
76
81
  ```
77
82
  To lock the player's input during a scripted ride, one line: `const lock = engine.input.push('ride');` and `lock.remove()` at the end.
@@ -79,14 +84,14 @@ Gravity comes back the moment the hold ends, so end a ride where the character c
79
84
  fixed step or an op. The camera and saves follow the position as usual.
80
85
 
81
86
  ```js fragment
82
- // a ladder (the landing point must be ground or a registered platform, engine.characters.support; anywhere else it drops to what is below): createPlayer({ clips: { climb: 'Climb' }, states: () => climbing ? 'climb' : null }), then call this when the player uses the ladder
87
+ // a ladder (the landing point must be ground or a registered platform, engine.characters.support; anywhere else it drops to what is below): addPlayer({ clips: { climb: 'Climb' }, states: () => climbing ? 'climb' : null }), then call this when the player uses the ladder
83
88
  let climbing = false;
84
- function climb(player, top) { // top: { x, y, z }, where it steps off, on ground or a registered platform
85
- climbing = true; player.mover = 'manual'; // no gravity, the position is yours
89
+ function climb(player, top) { // top: { x, y, z }, where it steps off, on ground or a registered platform
90
+ climbing = true; player.mover = 'manual'; // no gravity, the position is yours
86
91
  const h = engine.control.take(player, { owner: 'ladder', layer: 'script', step: (dt, ch) => {
87
92
  const up = (engine.input.down('moveForward') ? 1 : 0) - (engine.input.down('moveBack') ? 1 : 0);
88
93
  ch.root.position.y += up * 2 * dt;
89
- if (ch.root.position.y < top.y) return null; // null: the mover runs, so states picks climb
94
+ if (ch.root.position.y < top.y) return null; // null: the mover runs, so states picks climb
90
95
  climbing = false; ch.mover = 'simple'; h.remove(); ch.placeAt(top);
91
96
  return false;
92
97
  } });
@@ -100,9 +105,9 @@ cutscene that takes the player while driving stops the steering; the rider stays
100
105
 
101
106
  Holding a car on the grid (a countdown, after the finish) is the same take, plus the brake, since a released pedal only rolls:
102
107
  ```js
103
- const hold = engine.control.take(engine.player, { owner: 'race', layer: 'script', step: () => null }); // the keys stop driving
104
- engine.onFixed(() => { if (hold.active) car.drive(0, 0, 1); }); // throttle, steer, brake
105
- hold.remove(); // go
108
+ const hold = engine.control.take(engine.player, { owner: 'race', layer: 'script', step: () => null }); // the keys stop driving
109
+ engine.onFixed(() => { if (hold.active) car.drive(0, 0, 1); }); // throttle, steer, brake
110
+ hold.remove(); // go
106
111
  ```
107
112
 
108
113
  ## Saves
@@ -122,8 +127,8 @@ const fly = (c, e) => ({ name: 'fly', move(x, z, run, dt, y) {
122
127
  p.x += x * v; p.y += y * v; p.z += z * v;
123
128
  c.grounded = false; e.characters.kit.ownState(c, 'fly', v / dt);
124
129
  } });
125
- const held = engine.mod('character.mover', { owner: 'wings', id: 'player', set: fly }); // for a while: held.remove() puts back what was there
126
- engine.player.mover = fly; // or for good
130
+ const held = engine.mod('character.mover', { owner: 'wings', id: 'player', set: fly }); // for a while: held.remove() puts back what was there
131
+ engine.player.mover = fly; // or for good
127
132
  ```
128
133
 
129
134
  A mover that keeps something in the physics world gives it a `leave()`: the engine calls it when another mover takes over, and `move` runs again when it is back. `mover: 'rapier'` does this, so an NPC taking off leaves no capsule behind.
@@ -1,7 +1,12 @@
1
1
  # Input: modules declare actions, the game binds keys
2
2
 
3
+ > **Covers:** input: modules declare actions, the game binds keys, contexts, rebinding, local players.
4
+ > **Use when:** keys, mouse, gamepad or touch.
5
+ > **Shortest:** `createEngine({ bindings: { attack: ['KeyJ', 'Mouse0'] } })`.
6
+ > **Sections:** 1 Bind keys the · 2 Contexts the top · 3 In a module · 4 What the engine · 5 Rebinding the player) · Local players on one
7
+
3
8
  Three roles, one rule each:
4
- - **A module declares** an action and the context it is read in, never a key: `ctx.input.action('choice1', { context: 'dialog' })`.
9
+ - **A module declares** an action and the context it is read in, never a key: `ctx.input.define('choice1', { context: 'dialog' })`.
5
10
  - **The game binds** keys: `createEngine({ bindings })`, `engine.input.bind(...)`, or a ready map from `presets.bindings`.
6
11
  - **The player rebinds** in the settings menu, which calls `engine.input.rebind` and saves it.
7
12
 
@@ -12,14 +17,14 @@ Only the basics have default keys, the one default preset: WASD / arrows move (`
12
17
  ```js
13
18
  import { createEngine, presets } from 'threedog';
14
19
  const engine = createEngine({ canvas, bindings: {
15
- attack: ['KeyJ', 'Mouse0', 'PadX'], // keyboard, mouse buttons (Mouse0 / 1 / 2) and gamepad buttons go in one list
16
- ...presets.bindings.dialogNumbers, // 1-9 pick dialogue choices
17
- ...presets.bindings.debug, // F3 debug panel, F4 trigger wireframes
20
+ attack: ['KeyJ', 'Mouse0', 'PadX'], // keyboard, mouse buttons (Mouse0 / 1 / 2) and gamepad buttons go in one list
21
+ ...presets.bindings.dialogNumbers, // 1-9 pick dialogue choices
22
+ ...presets.bindings.debug, // F3 debug panel, F4 trigger wireframes
18
23
  } });
19
- engine.input.bind('dodge', ['ShiftLeft']); // later, in code; returns a handle, remove() takes the keys away
20
- engine.input.bind(presets.bindings.rtsRotate); // a whole map at once: rotateLeft Q, rotateRight R
21
- engine.input.action('brake', { context: 'vehicle', label: 'Brake', keys: ['KeyB'] }); // your own action with a context and a label for the menu
22
- engine.onFixed(() => { if (engine.input.pressed('attack')) swing(); }); // gameplay keys are read in the fixed step
24
+ engine.input.bind('dodge', ['ShiftLeft']); // later, in code; returns a handle, remove() takes the keys away
25
+ engine.input.bind(presets.bindings.rtsRotate); // a whole map at once: rotateLeft Q, rotateRight R
26
+ engine.input.define('brake', { context: 'vehicle', label: 'Brake', keys: ['KeyB'] }); // your own action with a context and a label for the menu
27
+ engine.onFixed(() => { if (engine.input.pressed('attack')) swing(); }); // gameplay keys are read in the fixed step
23
28
  ```
24
29
  `presets.bindings`: `walk` (run / jump), `interact`, `inventory`, `quests`, `photo`, `gridRotate` (rotate), `brake`, `dialogNumbers` (choice1..9),
25
30
  `rtsRotate` (rotateLeft / rotateRight), `cutsceneSkip` (skip: Backspace; cancel always skips), `debug` (debugPanel F3, triggersDebug F4). Spread one
@@ -30,16 +35,16 @@ its actions (gone with the module), the game binds them; `[]` is deliberately no
30
35
  Every action belongs to one context. The stack starts with `walk`; a module or the game pushes others: `vehicle` (pass: unrelated `walk` actions
31
36
  keep working), `dialog`, `menu`, `cutscene` (opaque: nothing below reads). The top context wins a key both bind.
32
37
  ```js
33
- const car = engine.input.push('vehicle', { pass: true, owner: 'car' }); // brake (context vehicle) reads now; car.remove() pops it
34
- engine.describe().input // { stack: ['walk', 'vehicle(owner: car)'], unbound: [], rebound: { attack: ['KeyK'] } }
38
+ const car = engine.input.push('vehicle', { pass: true, owner: 'car' }); // brake (context vehicle) reads now; car.remove() pops it
39
+ engine.describe().input // { stack: ['walk', 'vehicle(owner: car)'], unbound: [], rebound: { attack: ['KeyK'] } }
35
40
  ```
36
41
  Details of switching (next fixed step, no stuck keys, focus loss): recipe 07 §2b.
37
42
 
38
43
  ## 3. In a module: declare, read, leave
39
44
  ```js
40
45
  const sprint = () => ({ name: 'sprint', type: 'rules', install(e, ctx) {
41
- ctx.input.action('sprint', { label: 'sprint.action' }); // no keys: the game binds 'sprint'
42
- ctx.input.action('sprintHud', { label: 'sprint.hud', optional: true }); // optional: reading it unbound is silent
46
+ ctx.input.define('sprint', { label: 'sprint.action' }); // no keys: the game binds 'sprint'
47
+ ctx.input.define('sprintHud', { label: 'sprint.hud', optional: true }); // optional: reading it unbound is silent
43
48
  }, fixed(dt, e) { if (e.input.down('sprint')) boost(e.player); } });
44
49
  ```
45
50
  Everything a module declares or binds through `ctx.input` leaves with it (rollback, `replaces`, dispose).
@@ -47,8 +52,7 @@ Everything a module declares or binds through `ctx.input` leaves with it (rollba
47
52
  ## 4. What the engine tells you
48
53
  - **`input-unbound`** (dev, once per action): a module needs an action nobody bound. The message names the action, its context and the bind line.
49
54
  `engine.input.isUnbound('interact')` asks the same thing: true for no key at all, false for any key, an optional action or `[]` (no key on purpose).
50
- - **`interaction-no-key`** (dev warning, once per action): interactions were added to an action with no key. Rule R51 warns in `check`, `describe` calls the thing `no key bound`,
51
- and `ops` does not offer it, but `interaction.use` still runs when code asks: a click-only or touch-only game is right. `engine.input.bind('interact', [])` says so and ends the warning.
55
+ - **`interaction-no-key`** (dev warning, once per action): interactions were added to an action with no key (rule R51 warns in `check` too). A click-only or touch-only game is right: `engine.input.bind('interact', [])` says so and ends the warning.
52
56
  - **`input-bound-twice`** (dev throws; release: the later wins): two owners bind one action, e.g. the game's `createEngine({ bindings })` and a
53
57
  module's `ctx.input.bind` for the same action. Keep one. The same owner binding again only replaces its keys.
54
58
  - **`input-action-context`**: two owners declare one action in different contexts. Rename one, or use the same context to share it.
@@ -59,15 +63,21 @@ Everything a module declares or binds through `ctx.input` leaves with it (rollba
59
63
  `engine.input.rebound()` lists them (the settings menu saves exactly that and restores it at start, even before the module declaring an action is
60
64
  installed). The settings menu's key page, its reset button and its save all go through these two calls.
61
65
 
66
+ ## 6. Browser keys while playing
67
+ Playing (no menu or dialogue context, not paused) stops the browser acting on any key the game binds, modifiers included (Ctrl+S, F1, `/`, Backspace);
68
+ menus, pause and text fields get them back. `createEngine({ blockBrowserKeys: false })` turns it off. In dev, F5, Ctrl+R, F12 and Ctrl+Shift+I stay the browser's.
69
+ Limits: outside fullscreen Ctrl+W/T/N and Alt+F4 cannot be blocked; Esc always leaves fullscreen and pointer lock. In fullscreen on Chromium only, Keyboard Lock
70
+ captures the bound keys (Ctrl+W too; Esc then needs a long press). A desktop wrapper (Electron) can block all.
71
+
62
72
  ## Local players on one screen
63
73
 
64
74
  A seat is one player's own keys and gamepad. It reads like `engine.input` (`axis`, `down`, `pressed`, `released`), so a control function works on either.
65
75
 
66
76
  ```js
67
77
  const two = engine.input.seat({ pad: 1, keys: { moveForward: 'KeyI', moveBack: 'KeyK', moveLeft: 'KeyJ', moveRight: 'KeyL', jump: 'KeyU' } });
68
- const p2 = engine.characters.createPlayer({ id: 'two', input: two, control: 'camera', spawn: [4, 0, 0] });
78
+ const p2 = engine.characters.addPlayer({ id: 'two', input: two, control: 'camera', spawn: [4, 0, 0] });
69
79
  ```
70
80
 
71
81
  The seat's pad leaves `engine.input` and answers the game's pad bindings on this seat alone, so `bind('jump', ['PadA'])` works for it as written. A seat's keys are its own list: keep them out of the first player's bindings. Two seats on one pad or key, or one seat on two players, throw `input-seat`.
72
82
 
73
- `engine.player` stays the first player; `p2` has its own world record, saved with the world, and `removePlayer('two')` takes it away. There is one screen and one camera. Footstep sounds and NPCs giving way cover every player. A seat with its own `interact` key uses what its player stands by, as that player (`seat.actor`, set by `createPlayer`; `ctx.actor` in the op). The prompt shows `engine.actor`'s choice alone, and one hold runs at a time. A trigger zone hears every player when its `who` names them.
83
+ `engine.player` stays the first player; `p2` has its own world record, saved with the world, and `removePlayer('two')` takes it away. There is one screen and one camera. Footstep sounds and NPCs giving way cover every player. A seat with its own `interact` key uses what its player stands by, as that player (`seat.actor`, set by `addPlayer`; `ctx.actor` in the op). The prompt shows `engine.actor`'s choice alone, and one hold runs at a time. A trigger zone hears every player when its `who` names them.
@@ -1,5 +1,10 @@
1
1
  # A post effect that reads depth (volumetric fog, god rays)
2
2
 
3
+ > **Covers:** a post effect that reads depth on both renderers: volumetric fog, god rays.
4
+ > **Use when:** an effect needs the distance behind each pixel.
5
+ > **Shortest:** a Pass that reads the depth texture (§1).
6
+ > **Sections:** One effect, both renderers · Volumetric fog march along · God rays
7
+
3
8
  Fog you march through, light shafts, haze that thickens with distance, edge or focus effects: they all read the scene depth behind each pixel
4
9
  and turn it into a distance or a world position. This recipe writes one such effect with both forms, a three.js `Pass` (GLSL) for
5
10
  WebGLRenderer and a TSL node for WebGPURenderer, in one effect object. How effects are ordered, switched and tuned is recipe 52's
@@ -26,7 +31,7 @@ class DepthHazePass extends Pass {
26
31
  void main() {
27
32
  vec4 base = texture2D(tDiffuse, vUv);
28
33
  float z = texture2D(tDepth, vUv).x * 2.0 - 1.0;
29
- float dist = 2.0 * uNear * uFar / (uFar + uNear - z * (uFar - uNear)); // view distance in world units
34
+ float dist = 2.0 * uNear * uFar / (uFar + uNear - z * (uFar - uNear)); // view distance in world units
30
35
  gl_FragColor = vec4(mix(base.rgb, uColor, 1.0 - exp(-uDensity * dist)), base.a);
31
36
  }`,
32
37
  depthTest: false, depthWrite: false,
@@ -54,7 +59,7 @@ function depthHazeNode(input, { tsl: T, scenePass, camera, p }) {
54
59
  const update = (pass, p) => { pass.material.uniforms.uColor.value.copy(p.color); pass.material.uniforms.uDensity.value = p.density; };
55
60
  engine.post.add({ name: 'depthHaze', slot: 'hdr', needsDepth: true, params: { color: new THREE.Color(0.72, 0.76, 0.82), density: 0.02 },
56
61
  create: ({ camera, params }) => { const pass = new DepthHazePass(camera); update(pass, params); return pass; }, update, node: depthHazeNode });
57
- engine.post.get('depthHaze').set({ density: 0.05 }); // live on both renderers
62
+ engine.post.get('depthHaze').set({ density: 0.05 }); // live on both renderers
58
63
  ```
59
64
  - Slot `hdr`: the effect works in linear color, before tone mapping, so a bright sun shaft can bloom after it.
60
65
  - A world position instead of a distance (height fog, a fog volume): on WebGL multiply the clip-space point by `camera.projectionMatrixInverse`,
@@ -71,7 +76,7 @@ for an effect's node). On WebGL it is a plain `for` loop in the fragment shader.
71
76
  function marchedFogNode(input, { tsl: T, p }) {
72
77
  return T.Fn(() => {
73
78
  const acc = T.float(0).toVar();
74
- T.Loop(16, ({ i }) => { acc.addAssign(p.density.mul(T.float(i).add(0.5))); }); // your density per step goes here
79
+ T.Loop(16, ({ i }) => { acc.addAssign(p.density.mul(T.float(i).add(0.5))); }); // your density per step goes here
75
80
  return T.vec4(T.mix(input.rgb, p.color, acc.clamp(0, 1)), input.a);
76
81
  })();
77
82
  }
@@ -1,15 +1,16 @@
1
1
  # 60 Make the picture look good: what each knob does and how to judge it
2
2
 
3
+ > **Covers:** visual polish, how to tune the picture: the knobs, what each does on screen, how to judge it.
4
+ > **Use when:** the picture looks flat or off and you want to know what to try.
5
+ > **Shortest:** judge in the loop of §1.
6
+ > **Sections:** How to judge, in · The knobs · When the picture check · Same knob, different styles
7
+
3
8
  A map for visual polish: when you want to tune the picture, make a scene look prettier or closer to what the game wants, this page lists the
4
9
  knobs, what each one changes on screen and how to tell it is right. **It is not a list of steps and nothing here is required**: pick the knobs
5
10
  your style needs and leave the rest alone. There are no values to copy on purpose; the right value depends on the style, the camera and the
6
11
  time of day, so every row says what to look for instead.
7
12
 
8
- Where the rest lives (one home each, this page only points there):
9
- - the calls, their parameters and who writes what: [recipe 52](52-around-the-picture.md) (reading the picture, the post chain, the ownership table);
10
- - the plain three.js way and how the engine yields to it: [THREE.md](../THREE.md);
11
- - questions about the whole picture (light roles, readability, consistency) and the numbers each shot prints: [recipe 35](35-picture-from-reference.md) "Picture questions" and "Picture check after every shot";
12
- - a whole picture: the game's `picture/` code ([recipe 62](62-picture-code.md), materials and lights in [recipe 09](09-materials-lights-models.md)).
13
+ Where the rest lives (one home each): calls, parameters and who writes what: [recipe 52](52-around-the-picture.md); the plain three.js way: [THREE.md](../THREE.md); whole-picture questions and the numbers each shot prints: [recipe 35](35-picture-from-reference.md) "Picture questions" and "Picture check after every shot"; a whole picture: `picture/` code ([62](62-picture-code.md), materials and lights [09](09-materials-lights-models.md)).
13
14
 
14
15
  ## How to judge, in one loop
15
16
  Change one knob, take a shot (`threedog shot`, or `threedog snap` on a running page), compare with the one before, keep or undo. Shoot the
@@ -25,14 +26,14 @@ shadow. `threedog examples pull sun-and-key-light` shows three routes side by si
25
26
 
26
27
  | Knob | What it changes on screen | It is right when | How (details) |
27
28
  |---|---|---|---|
28
- | Sky gradient, horizon | the color from the top of the sky down to where it meets the ground | the horizon band and the fog agree where they meet; the top-to-horizon change matches the hour and mood; no visible seam | `engine.sky.top`, `engine.sky.horizon` ([08 §3](08-weather-sky.md#3-changing-sky-colors-sun-stars)); own shader: share `engine.uniforms.uSkyHorizon` / `uSkyTop` ([08](08-weather-sky.md#sky-color-for-my-shader-horizon-color-zenith-color)); own sky: `engine.sky.replace(mySky)` |
29
+ | Sky gradient, horizon | the color from the top of the sky down to where it meets the ground | the horizon band and the fog agree where they meet; the top-to-horizon change matches the hour and mood; no visible seam | `engine.sky.top`, `engine.sky.horizon` ([08 §3](08-weather-sky.md#3-changing-sky-colors-sun-stars-the-day-and-night-sky)); own shader: share `engine.uniforms.uSkyHorizon` / `uSkyTop` ([08](08-weather-sky.md#sky-color-for-my-shader-horizon-color-zenith-color)); own sky: `engine.sky.replace(mySky)` |
29
30
  | Fog near / far | how fast distant things fade | the play space stays clear, the far edge of the world dissolves instead of ending in a line, landmarks you want seen still read | `engine.scene.fog = new THREE.Fog(color, near, far)` ([34 Fog](34-environment-lighting.md#fog-plain-threejs-signals-your-own-math)) |
30
31
  | Fog color vs sky | whether the distance melts into the sky or into its own haze | distant hills fade toward the sky behind them; a fog color of its own is a choice you can name (smoke, mist, a dream) | `scene.fog.color`, your `picture/` code reads `uSkyHorizon` ([34 Fog](34-environment-lighting.md#fog-plain-threejs-signals-your-own-math)) |
31
32
  | Exposure | overall brightness after lighting | the brightest things you care about keep detail and the darkest still read; a night is dark because the lights are, not because exposure hides it | `engine.renderer.toneMappingExposure` ([34 Exposure](34-environment-lighting.md#exposure-and-the-tone-curve)) |
32
33
  | Tone mapping curve | how highlights roll off and how saturated bright colors stay | bright colors keep their hue where the style wants color, highlights soften where it wants film; flat-color styles may want almost no curve | `engine.renderer.toneMapping = THREE.AgXToneMapping` (or ACESFilmic, Neutral, No) ([52 Who writes it](52-around-the-picture.md#who-writes-it-the-ownership-table)) |
33
34
  | Sun direction | where shadows fall and which faces are lit | shapes read from the camera (lit side and shaded side both visible), shadows point somewhere useful, the hour looks like the hour | time of day (`engine.calendar`, [06](06-clock-events.md)); sun path: `engine.sky.orbit.tilt`; the lights do not move on their own: aim yours from `engine.uniforms.uSunDir` ([62](62-picture-code.md)) |
34
35
  | Sun color, intensity | the key light: color and strength of lit faces | lit and shaded sides separate; whites under the sun are the white the style wants (warm, neutral, cool) | your `picture/` code writes the light ([62](62-picture-code.md)) |
35
- | Ambient / hemisphere, environment | the fill: how bright and what color the shaded side is | shadows are as deep as the style wants and still show shape; up-facing and down-facing faces differ; metals have something to reflect | your `picture/` code writes the hemisphere light and `scene.environment`, `scene.environmentIntensity` ([34](34-environment-lighting.md), [08 brightness](08-weather-sky.md#3-changing-sky-colors-sun-stars)) |
36
+ | Ambient / hemisphere, environment | the fill: how bright and what color the shaded side is | shadows are as deep as the style wants and still show shape; up-facing and down-facing faces differ; metals have something to reflect | your `picture/` code writes the hemisphere light and `scene.environment`, `scene.environmentIntensity` ([34](34-environment-lighting.md), [08 brightness](08-weather-sky.md#3-changing-sky-colors-sun-stars-the-day-and-night-sky)) |
36
37
  | Shadow softness | hard or blurred shadow edges | edges match the light (crisp under a clear sun, soft under cloud or for a gentle style); no stair-steps or speckle | `renderer.shadowMap.type`, `light.shadow.radius` ([45](45-cascaded-shadows.md)) |
37
38
  | Shadow distance, detail | how far shadows reach and how sharp small ones are | the area the player looks at has shadows; small props keep theirs; objects touch the ground (no gap under a foot) | `engine.shadows.box(sun, { extent })`, `engine.shadows.cascades(sun, { count, maxFar })`, `light.shadow.bias`, `mapSize` ([45](45-cascaded-shadows.md)) |
38
39
  | Bloom | light bleeding around bright pixels | the bright things you meant (sun, lamps, magic) glow and nothing else does; the picture does not turn milky | `engine.post.add(bloom())` from `@threedog/post-effects`, or three's `UnrealBloomPass` through `engine.post.add(pass)` ([52 Post chain](52-around-the-picture.md#post-effect-chain)) |
@@ -45,7 +46,7 @@ shadow. `threedog examples pull sun-and-key-light` shows three routes side by si
45
46
  | Ambient occlusion | darker creases and contact corners | objects sit on the ground and corners have weight; no dark halo around thin things | `engine.post.add(ao())` ([52 Post chain](52-around-the-picture.md#post-effect-chain)) |
46
47
  | Outline | lines around shapes | lines help read shapes at play distance and match the style's line weight | `engine.post.add(outline())` ([52 Post chain](52-around-the-picture.md#post-effect-chain)), or three/addons `OutlinePass` |
47
48
  | Surface shading | how light falls across a surface (smooth, banded, flat) | materials that should differ (wood, stone, metal, cloth) differ in response, not only in color | `new THREE.MeshToonMaterial({ gradientMap })` or any material of yours; `applyEffects(mat, { lighting })`, `rampTexture` ([43](43-shader-patches-surfaces.md), [09](09-materials-lights-models.md)) |
48
- | God rays, volumetric fog | light shafts, fog thick in the air | shafts come from where the light is and fade when it leaves the screen | your own depth effect ([59](59-depth-post-effects.md)) |
49
+ | God rays, volumetric fog | light shafts, fog thick in the air | shafts come from where the light is and fade when it leaves the screen | `lightShaft`, `sunShafts`, `lightVolumes` ([34](34-environment-lighting.md)); haze by depth ([59](59-depth-post-effects.md)) |
49
50
 
50
51
  ## When the picture check names a feature
51
52
  The check printed after every shot states a fact and, where the engine has a feature for it, one line of usage. Each is a way out, not a request: a
@@ -60,7 +61,7 @@ hard-edged or pitch-dark look may want exactly what was measured. All of them re
60
61
  | fog covers X% | how much of the picture is fog color; printed before a line about the night, since the fog comes first | `scene.fog` |
61
62
 
62
63
  Limits a game sets per device go through the same check: `engine.budget.enable(engine.tier === 'low' ? { lights: 4 } : { lights: 12 })`. A limit you wrote is
63
- reported as your own intent; the engine's default line for lights is only a fact.
64
+ reported as your own intent; the engine's default line (lights 8, shadow maps 7) is only a fact.
64
65
 
65
66
  ## Same knob, different styles
66
67
  A knob is a direction, not a setting. Three styles, the same three knobs, moved different ways:
@@ -1,5 +1,10 @@
1
1
  # Deploy: put the built game on a web server, at the site root or under a sub-path
2
2
 
3
+ > **Covers:** putting the built game on a web server, at the root or under a sub-path.
4
+ > **Use when:** publishing the game.
5
+ > **Shortest:** `npm run build`, then copy `dist/`.
6
+ > **Sections:** At the site root · Under a sub-path https · The server
7
+
3
8
  `npm run build` writes the game to its `dist/`: plain files (HTML, JS, assets) that any static web server serves. Copy the whole folder.
4
9
 
5
10
  ## At the site root (`https://example.com/`)