@fleox/agent3d 0.3.1 → 0.5.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 (122) hide show
  1. package/README.md +16 -14
  2. package/changelog.json +25 -0
  3. package/dist/agent/agent3d.mjs +802 -90
  4. package/dist/agent/chunks/{assets-YBkgdfgy.mjs → assets-DdzHgVcn.mjs} +2 -2
  5. package/dist/agent/chunks/{browser-Dil7VM5m.mjs → browser-nFaRUETt.mjs} +1 -1
  6. package/dist/agent/chunks/{cdp-DLEis_Z3.mjs → cdp-6vF_gP-H.mjs} +1 -1
  7. package/dist/agent/chunks/{check-DP9fRYbK.mjs → check-E7GdPxTt.mjs} +14 -2
  8. package/dist/agent/chunks/{depth-CD_ql3QJ.mjs → depth-Bf7cHwod.mjs} +4 -4
  9. package/dist/agent/chunks/{depth-BZT4gseQ.mjs → depth-DEaogEAi.mjs} +4 -114
  10. package/dist/agent/chunks/{export-bJwh2SqG.mjs → export-BSOqVfPT.mjs} +87 -7
  11. package/dist/agent/chunks/{imageCodec-DeGfmBp3.mjs → imageCodec-DXxqkEQA.mjs} +53 -4
  12. package/dist/agent/chunks/{objects-DuytRxiC.mjs → objects-DvzrcVmK.mjs} +2 -2
  13. package/dist/agent/chunks/{optimizeSizing-B-BBiUkD.mjs → optimizeSizing-Dd8vaSnE.mjs} +24 -1
  14. package/dist/agent/chunks/{package-fMbw9UGh.mjs → package-DzXqX5Oe.mjs} +2 -2
  15. package/dist/agent/chunks/photoPlacement-D-k3mD0T.mjs +138 -0
  16. package/dist/agent/chunks/plate-Cwl35I2T.mjs +604 -0
  17. package/dist/agent/chunks/pngEncode-BMc3U9QC.mjs +119 -0
  18. package/dist/agent/chunks/{render-B05DU4Q5.mjs → render-CCKciCgu.mjs} +76 -11
  19. package/dist/agent/chunks/{scene-DWgXH6As.mjs → scene-DSjsun-3.mjs} +22 -5
  20. package/dist/agent/chunks/{server-Dt_YFvN7.mjs → server-CLvLORgA.mjs} +1 -1
  21. package/dist/agent/chunks/{tools-Cm4BqDkO.mjs → tools-Vs74Xopx.mjs} +153 -14
  22. package/dist/runtime/agent3d-photo.js +72 -0
  23. package/dist/runtime/agent3d-runtime.js +41 -41
  24. package/dist/runtime/agent3d-runtime.single.js +526 -250
  25. package/dist/runtime/chunks/assets-kC2Z1Xy_.js +1 -0
  26. package/dist/runtime/chunks/game-CbQaEB4q.js +20 -0
  27. package/dist/runtime/chunks/materials-jwhXlLYl.js +107 -0
  28. package/dist/runtime/chunks/model-CG5T_jcB.js +1 -0
  29. package/dist/runtime/chunks/num-CQNAlL82.js +1 -0
  30. package/dist/runtime/chunks/photo-Dq-AKlfw.js +526 -0
  31. package/dist/runtime/chunks/physicsHost-BU-2V-CZ.js +1 -0
  32. package/dist/runtime/chunks/{postfx-Cbf_vvOr.js → postfx-DnIeKXAh.js} +1 -1
  33. package/dist/runtime/chunks/postfx-ylpcQcVK.js +1 -0
  34. package/dist/runtime/chunks/svg-fYjsY-rV.js +1 -0
  35. package/dist/runtime/chunks/{text-rSo_2Luk.js → text-CySfj5sH.js} +1 -1
  36. package/dist/runtime/chunks/util-BEflQURG.js +1 -0
  37. package/dist/studio/assets/BufferGeometryUtils-BbzK4rCj.js +1 -0
  38. package/dist/studio/assets/{EXRLoader-BKkzlNd8.js → EXRLoader-CuDOo1xG.js} +1 -1
  39. package/dist/studio/assets/{FontLoader-Bzjx8mXt.js → FontLoader-DlBfss5q.js} +1 -1
  40. package/dist/studio/assets/{GLTFLoader-1Zd9N406.js → GLTFLoader-bl1eymL4.js} +1 -1
  41. package/dist/studio/assets/{GroundedSkybox-BEMqNCBD.js → GroundedSkybox-cLn9JVlt.js} +1 -1
  42. package/dist/studio/assets/{HDRLoader-DxB0kxPH.js → HDRLoader-8EiZoQQP.js} +1 -1
  43. package/dist/studio/assets/{OrbitControls-MlE9XiCg.js → OrbitControls-1xEm394I.js} +1 -1
  44. package/dist/studio/assets/{RectAreaLightUniformsLib-ClHrtYY6.js → RectAreaLightUniformsLib-S0AelTmO.js} +1 -1
  45. package/dist/studio/assets/{RoomEnvironment-MJ-jIEC8.js → RoomEnvironment-v4QurKxu.js} +1 -1
  46. package/dist/studio/assets/{SVGLoader-CIYl0nEy.js → SVGLoader-KDBVv02P.js} +1 -1
  47. package/dist/studio/assets/{Sky-DNMfpp92.js → Sky-D8Lp9Zh3.js} +1 -1
  48. package/dist/studio/assets/assets-DnOt59SU.js +2 -0
  49. package/dist/studio/assets/camera-DrubOxWu.js +2 -0
  50. package/dist/studio/assets/catalog-DDg904x2.js +1 -0
  51. package/dist/studio/assets/{editor-NkBUKsDB.js → editor-V--luWVq.js} +1 -1
  52. package/dist/studio/assets/{extrude-9bG8hr2C.js → extrude-BpJda0hq.js} +1 -1
  53. package/dist/studio/assets/game-43BhY_EE.js +19 -0
  54. package/dist/studio/assets/{generators-BjIs-kHx.js → generators-lG93qWTO.js} +5 -5
  55. package/dist/studio/assets/index-BPVRhKVV.js +479 -0
  56. package/dist/studio/assets/index-D-TPNQMQ.css +1 -0
  57. package/dist/studio/assets/model-D8-inS_D.js +2 -0
  58. package/dist/studio/assets/num-CQNAlL82.js +1 -0
  59. package/dist/studio/assets/params-BZqUA__U.js +1 -0
  60. package/dist/studio/assets/photo-BuVK-UvQ.js +526 -0
  61. package/dist/studio/assets/physicsHost-EkPuIy04.js +1 -0
  62. package/dist/studio/assets/{postfx-BGu30OJK.js → postfx-Bcnem9ci.js} +13 -13
  63. package/dist/studio/assets/rolldown-runtime-4tVxZq34.js +1 -0
  64. package/dist/studio/assets/runtime-5Ti8UJJR.js +572 -0
  65. package/dist/studio/assets/{shaders-Dt6FGXH_.js → shaders-WM5brr9C.js} +1 -1
  66. package/dist/studio/assets/svg-CJ_RtiER.js +2 -0
  67. package/dist/studio/assets/text-NO7lyCoH.js +3 -0
  68. package/dist/studio/assets/three.module-B9FlcKtd.js +4225 -0
  69. package/dist/studio/index.html +5 -3
  70. package/package.json +2 -2
  71. package/plugin/.claude-plugin/plugin.json +1 -1
  72. package/plugin/skills/agent3d-assets/SKILL.md +42 -27
  73. package/plugin/skills/agent3d-create/SKILL.md +77 -29
  74. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  75. package/plugin/skills/agent3d-create/references/recipes.md +6 -6
  76. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  77. package/plugin/skills/agent3d-edit/references/patch-ops.md +3 -3
  78. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  79. package/plugin/skills/agent3d-publish/SKILL.md +32 -23
  80. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
  81. package/templates/hero-scroll-story/README.md +1 -1
  82. package/templates/photo-scroll-story/README.md +29 -0
  83. package/templates/photo-scroll-story/agent3d.json +8 -0
  84. package/templates/photo-scroll-story/assets/depth/lake-depth.png +0 -0
  85. package/templates/photo-scroll-story/assets/depth/street-depth.png +0 -0
  86. package/templates/photo-scroll-story/assets/manifest.json +46 -0
  87. package/templates/photo-scroll-story/assets/textures/lake.webp +0 -0
  88. package/templates/photo-scroll-story/assets/textures/street.webp +0 -0
  89. package/templates/photo-scroll-story/preview.png +0 -0
  90. package/templates/photo-scroll-story/scene.json +112 -0
  91. package/templates/photo-scroll-story/template.json +8 -0
  92. package/templates/photo-title-inside/README.md +31 -0
  93. package/templates/photo-title-inside/agent3d.json +8 -0
  94. package/templates/photo-title-inside/assets/depth/street-depth.png +0 -0
  95. package/templates/photo-title-inside/assets/manifest.json +25 -0
  96. package/templates/photo-title-inside/assets/textures/street.webp +0 -0
  97. package/templates/photo-title-inside/preview.png +0 -0
  98. package/templates/photo-title-inside/scene.json +80 -0
  99. package/templates/photo-title-inside/template.json +8 -0
  100. package/dist/runtime/chunks/assets-qnxDnVkj.js +0 -1
  101. package/dist/runtime/chunks/game-BoEiyZrL.js +0 -20
  102. package/dist/runtime/chunks/materials-dC4vDNHh.js +0 -107
  103. package/dist/runtime/chunks/model-BCAl_NRl.js +0 -1
  104. package/dist/runtime/chunks/photo-DNf14X7B.js +0 -250
  105. package/dist/runtime/chunks/physicsHost-ChPgysMQ.js +0 -1
  106. package/dist/runtime/chunks/postfx-CFucYRev.js +0 -1
  107. package/dist/runtime/chunks/svg-CLUxY6Zy.js +0 -1
  108. package/dist/runtime/chunks/util-CyaW1fcW.js +0 -1
  109. package/dist/studio/assets/BufferGeometryUtils-CAlXAboW.js +0 -1
  110. package/dist/studio/assets/assets-BW5lQkYR.js +0 -1
  111. package/dist/studio/assets/camera-BgzPVnn-.js +0 -2
  112. package/dist/studio/assets/game-DARpu0ah.js +0 -19
  113. package/dist/studio/assets/index-BQT0otii.css +0 -1
  114. package/dist/studio/assets/index-L-N-e2KM.js +0 -479
  115. package/dist/studio/assets/model-CqI8j03Z.js +0 -2
  116. package/dist/studio/assets/params-DhsDKSDs.js +0 -1
  117. package/dist/studio/assets/photo-DAHd1yNF.js +0 -250
  118. package/dist/studio/assets/physicsHost-tEUto2-_.js +0 -1
  119. package/dist/studio/assets/runtime-C_qkIpAK.js +0 -572
  120. package/dist/studio/assets/svg-ZZt5MdNf.js +0 -2
  121. package/dist/studio/assets/text-B-HM422i.js +0 -3
  122. package/dist/studio/assets/three.module-CnI50X0U.js +0 -4225
@@ -4,7 +4,7 @@ description: Build a mini game or an interactive 3D experience for a web page wi
4
4
  license: PolyForm-Noncommercial-1.0.0
5
5
  compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
6
6
  metadata:
7
- version: "0.3.1"
7
+ version: "0.5.0"
8
8
  repository: "https://github.com/fleox/agent3d"
9
9
  allowed-tools: Bash Read Write
10
10
  ---
@@ -15,13 +15,13 @@ A game is an ordinary scene (`target.kind: "game"`) plus **scripts**: ES modules
15
15
 
16
16
  **Language:** talk to the user in their language; keep commands, ids, code and files in English.
17
17
 
18
- Every command is `npx -y @fleox/agent3d@0.3.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
18
+ Every command is `npx -y @fleox/agent3d@0.5.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
19
19
 
20
20
  ## Start
21
21
 
22
22
  ```bash
23
- npx -y @fleox/agent3d@0.3.1 new dodge --target game --title "Dodge" --json
24
- npx -y @fleox/agent3d@0.3.1 scene summary --project dodge --json
23
+ npx -y @fleox/agent3d@0.5.0 new dodge --target game --title "Dodge" --json
24
+ npx -y @fleox/agent3d@0.5.0 scene summary --project dodge --json
25
25
  ```
26
26
 
27
27
  The game starter has a `kinematic` player moved by position, coins with a `coin` tag, a follow camera, a score HUD, a coin sound and `scripts/game.js` (move with arrows / WASD, collect coins). Game templates to start from (`templates list --json`): `game-coin-collector`, `game-runner`, `game-maze`, `game-tap-targets`, `game-physics-playground` (rigid bodies, impulses, impact sounds) — `new my-game --template game-physics-playground --json`. A complete validated example (lane runner: lanes, spawning by cloning, difficulty ramp, best score, attract mode) is in skill `agent3d-create` → `references/recipes.md` ("Lane runner game"; "Physics toss game" for rigid bodies); patterns in [references/game-patterns.md](references/game-patterns.md); the full API in [references/script-api.md](references/script-api.md).
@@ -55,15 +55,15 @@ Scripts only get `api`. `check` fails (`forbidden-script`) on `fetch`, `XMLHttpR
55
55
  1. Design the loop with the user in one paragraph: goal, controls (keyboard + touch), how you lose, what the score counts, how long a round lasts (30–90 s for a web page).
56
56
  2. Declare the scene: player and obstacle templates (hidden, with `tags` and a `body`), camera, HUD elements per phase, sounds (`catalog sounds`), `data` for tuning.
57
57
  3. Write the script (patterns below). Keep it under ~200 lines; one file is fine.
58
- 4. Validate and lint: `npx -y @fleox/agent3d@0.3.1 check --project dodge --json` (sandbox errors carry the line: `scripts/game.js:12`).
58
+ 4. Validate and lint: `npx -y @fleox/agent3d@0.5.0 check --project dodge --json` (sandbox errors carry the line: `scripts/game.js:12`).
59
59
  5. Render several moments and LOOK:
60
60
  ```bash
61
- npx -y @fleox/agent3d@0.3.1 render --project dodge --sheet --frames 0,2,4,6 --json
61
+ npx -y @fleox/agent3d@0.5.0 render --project dodge --sheet --frames 0,2,4,6 --json
62
62
  ```
63
63
  Plain renders have no player input, so the game must show something on its own: an **attract mode** (an autopilot plays during the `ready` phase, behind the title and Play button). The HUD is captured because the scene has a `ui` (`--capture page` forces it); posters (`export --format poster`, the embed's `poster.webp`) and videos show the canvas only, without the HUD. Check `data.issues` and `data.consoleErrors` for `script-error`. `data.state` is the script's `api.state` after the last frame (e.g. `{ "score": 0, "phase": "ready" }`); frame and sheet paths are relative to the project folder `data.dir`.
64
64
  6. **Play it headlessly** with `--input`: a JSON script of simulated keys / clicks applied while seeking (frames are rendered in time order), then check `data.state` and the frames:
65
65
  ```bash
66
- npx -y @fleox/agent3d@0.3.1 render --project dodge --sheet --frames 0,1,2,3 --input '[{"t": 0.2, "click": [0, -0.3]}, {"t": 0.5, "key": "ArrowLeft", "hold": 0.6}, {"t": 1.5, "key": "Space", "down": true}, {"t": 1.6, "key": "Space", "down": false}]' --json
66
+ npx -y @fleox/agent3d@0.5.0 render --project dodge --sheet --frames 0,1,2,3 --input '[{"t": 0.2, "click": [0, -0.3]}, {"t": 0.5, "key": "ArrowLeft", "hold": 0.6}, {"t": 1.5, "key": "Space", "down": true}, {"t": 1.6, "key": "Space", "down": false}]' --json
67
67
  ```
68
68
  Events: `{ "t", "key", "down" }` (`key` is a `KeyboardEvent.code`: `ArrowLeft`, `KeyA`, `Space`…; `down: false` releases), `{ "t", "key", "hold": seconds }` (press and release), `{ "t", "click": [x, y] }`, `{ "t", "pointer": [x, y] }` (add `"down": true` / `false` to press / release there), `{ "t", "pointerDown": [x, y] }` and `{ "t", "pointerUp": [x, y] }` (hold the pointer: `api.input.pointer.down`), `{ "t", "drag": { "from": [x, y], "to": [x, y], "duration": 0.4 } }` (press, move, release), `{ "t", "swipe": "left" | "right" | "up" | "down" }` (what `api.input.swipe()` returns next step), `{ "t", "scroll": 0.5 }` (page scroll progress, scroll-driven scenes), `{ "t", "ui": "retryBtn" }` (click that HUD button by id — a warning in `inputWarnings` when it is hidden at that time), `{ "t", "emit": "retry" }` (emit the event / button action directly), `{ "t", "segment": "intro" }` (play a timeline segment) — canvas coordinates −1..1, y up (a canvas `click` never presses a HUD button: use `ui`). Unknown fields are rejected (exit 2, the hint lists the valid shapes). Test the touch controls too, e.g. `--input '[{"t": 0.5, "swipe": "left"}, {"t": 1.2, "drag": {"from": [0, -0.5], "to": [0, 0.3], "duration": 0.3}}]'`. Use `@inputs.json` for longer scripts. MCP: `render_preview` takes the same events as `input`.
69
69
  7. To test a state that is hard to reach with input (game over screen, high score), temporarily set the starting phase in `api.data` (e.g. `"startPhase": "over"`), render, then restore it.
@@ -4,7 +4,7 @@ description: Export an Agent3D scene and put it on a website - embed folder (Web
4
4
  license: PolyForm-Noncommercial-1.0.0
5
5
  compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge) for renders.
6
6
  metadata:
7
- version: "0.3.1"
7
+ version: "0.5.0"
8
8
  repository: "https://github.com/fleox/agent3d"
9
9
  allowed-tools: Bash Read Write
10
10
  ---
@@ -13,12 +13,12 @@ allowed-tools: Bash Read Write
13
13
 
14
14
  **Language:** talk to the user in their language; keep commands, code and files in English.
15
15
 
16
- Every command is `npx -y @fleox/agent3d@0.3.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
16
+ Every command is `npx -y @fleox/agent3d@0.5.0 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
17
17
 
18
18
  ## Before exporting
19
19
 
20
20
  ```bash
21
- npx -y @fleox/agent3d@0.3.1 check --project my-banner --render --json
21
+ npx -y @fleox/agent3d@0.5.0 check --project my-banner --render --json
22
22
  ```
23
23
 
24
24
  No errors, no warnings (or warnings the user accepted). Keep the `licences` list: credits ship in the export.
@@ -31,7 +31,7 @@ No errors, no warnings (or warnings the user accepted). Keep the `licences` list
31
31
  | `zip` | `export --format zip --project my-banner` | the embed folder as one `dist/zip/<name>-embed.zip` | Handing the export to someone, uploading through a file manager |
32
32
  | `single-html` | `export --format single-html --project my-banner` | one `dist/single-html/<name>.html` with the runtime, the scene and the assets inline (data: URIs) — about 2 MB minimum (the runtime is not split) | Sending a file, a standalone page, an `<iframe>` in Squarespace / Wix / Framer |
33
33
  | `poster` | `export --format poster --project my-banner` | `dist/poster.webp` at `target.posterTime` (`--time 2`), 2× pixel ratio (`--scale`); `--image png\|jpeg`, `--quality high\|ultra`, `--transparent` (png / webp) | Social images, email, a fallback |
34
- | `video` | `export --format video --project my-banner` | `dist/video.webm` (VP9), or MP4 (H.264) when `--out` ends in `.mp4`; `--duration`, `--fps`, `--size`, `--quality` | Social posts, presentations, places that can't run WebGL |
34
+ | `video` | `export --format video --project my-banner` | `dist/video.webm` (VP9), or MP4 (H.264) when `--out` ends in `.mp4`; `--duration`, `--fps`, `--size`, `--quality`; `--preset vertical\|square\|landscape\|story` = a ready-to-post MP4 (below) | Social posts, presentations, places that can't run WebGL |
35
35
  | `gif` | `export --format gif --project my-banner` | `dist/animation.gif` (looping, 640 px wide, 15 fps by default) | Email, chat, READMEs |
36
36
 
37
37
  Every asset the scene uses is copied into the export (never hotlinked): a 3D photo ships its photo and its depth PNG (`<name>/assets/textures/…`, `<name>/assets/depth/…`), never the depth model. `CREDITS.txt` lists the depth map with the photo's licence and author.
@@ -39,17 +39,24 @@ Every asset the scene uses is copied into the export (never hotlinked): a 3D pho
39
39
  Default outputs land in `<project>/dist/`. A relative `--out` is resolved from the **project folder** (like every output path of `render` and `export`): `--project my-banner --out dist/promo.mp4` writes `my-banner/dist/promo.mp4`; absolute paths are kept.
40
40
 
41
41
  ```bash
42
- npx -y @fleox/agent3d@0.3.1 export --project my-banner --json
43
- npx -y @fleox/agent3d@0.3.1 export --project my-banner --name spring-banner --out ./site/agent3d --json
44
- npx -y @fleox/agent3d@0.3.1 export --project my-banner --base-url /wp-content/uploads/agent3d/ --cache-bust --out ./wp --json
45
- npx -y @fleox/agent3d@0.3.1 export --project my-banner --optimize --json
46
- npx -y @fleox/agent3d@0.3.1 export --format zip --project my-banner --json
47
- npx -y @fleox/agent3d@0.3.1 export --format single-html --project my-banner --json
48
- npx -y @fleox/agent3d@0.3.1 export --format poster --time 2 --image png --quality high --transparent --project my-banner --json
49
- npx -y @fleox/agent3d@0.3.1 export --format video --out dist/promo.mp4 --duration 8 --fps 30 --size 1920x1080 --project my-banner --json
50
- npx -y @fleox/agent3d@0.3.1 export --format gif --duration 4 --project my-banner --json
42
+ npx -y @fleox/agent3d@0.5.0 export --project my-banner --json
43
+ npx -y @fleox/agent3d@0.5.0 export --project my-banner --name spring-banner --out ./site/agent3d --json
44
+ npx -y @fleox/agent3d@0.5.0 export --project my-banner --base-url /wp-content/uploads/agent3d/ --cache-bust --out ./wp --json
45
+ npx -y @fleox/agent3d@0.5.0 export --project my-banner --optimize --json
46
+ npx -y @fleox/agent3d@0.5.0 export --format zip --project my-banner --json
47
+ npx -y @fleox/agent3d@0.5.0 export --format single-html --project my-banner --json
48
+ npx -y @fleox/agent3d@0.5.0 export --format poster --time 2 --image png --quality high --transparent --project my-banner --json
49
+ npx -y @fleox/agent3d@0.5.0 export --format video --out dist/promo.mp4 --duration 8 --fps 30 --size 1920x1080 --project my-banner --json
50
+ npx -y @fleox/agent3d@0.5.0 export --format gif --duration 4 --project my-banner --json
51
51
  ```
52
52
 
53
+ **Social video** (LinkedIn, Instagram, TikTok, YouTube): `--preset vertical` (1080×1920), `square` (1080×1080), `landscape` (1920×1080) or `story` (1080×1920, max 15 s) gives an H.264 MP4 at 30 fps and ~10 Mbit/s whose length is **one seamless loop** of the 3D photo's `motion.auto` move (set `dolly`, `pan`, `rise` or `vertigo` for a cinematic camera move — skill `agent3d-create`), with a **cover fit**: the photo fills the frame whatever the scene's aspect, its edges never show. Read `notes` in the result (what was cropped, how much the camera was tightened), and look at three frames before posting — text laid out for 16:9 gets cut in 9:16:
54
+ ```bash
55
+ npx -y @fleox/agent3d@0.5.0 render --preset vertical --count 4 --sheet --project my-hero --json # check the framing
56
+ npx -y @fleox/agent3d@0.5.0 export --format video --preset vertical --project my-hero --json # dist/video-vertical.mp4
57
+ ```
58
+ The `export` AI tool takes the same `preset` (format `video`).
59
+
53
60
  Embed / zip options:
54
61
 
55
62
  | Option | Effect |
@@ -62,19 +69,21 @@ Embed / zip options:
62
69
  | `--no-poster` | No poster nor og-image (no Chrome needed). The element then shows nothing until the first frame and has no fallback without WebGL: prefer keeping it |
63
70
  | `--no-og` | No `<name>/og-image.png` (1200×630 social preview). To use it, add `<meta property="og:image" content="https://<site>/…/<name>/og-image.png">` and `<meta name="twitter:card" content="summary_large_image">` to the page head — crawlers need an absolute URL (the demo `index.html` uses a relative one) |
64
71
  | `--no-extras` | No `EMBED.md` and no `frameworks/` |
72
+ | `--runtime auto\|full` | `auto` (default, also for `single-html`): a scene that is a single 3D photo (one `photo` object in parallax mode or without depth, fixed perspective camera, `#hex` or transparent background, no timeline / interactions / postfx / scripts / text) ships the photo-only lite runtime `agent3d-photo.js` (~19 KB gzipped, no three.js) instead of ~210 KB. `full` forces `agent3d-runtime.js` |
65
73
 
66
74
  - **Page weight**: for a brief like "under 300 KB", quote `pageKb` / `pageKbGzip` from the export result (what a visitor downloads for this scene, runtime chunks included — `folderKb` counts every file written, unused chunks too). `--prune-runtime` copies only the chunks this scene loads (a smaller folder to upload) — only when this runtime folder serves this scene alone; other scenes sharing `agent3d-runtime/` may need the chunks it leaves out.
75
+ - **3D photo heroes**: check the result's `runtime`. `"photo-lite"` = the light runtime (the snippet loads `agent3d-runtime/agent3d-photo.js`); `"full"` comes with `runtimeReasons` (e.g. `"post effects (postfx)"`, `"2 objects (the lite runtime shows exactly one photo)"`). When the brief is about page weight and the reasons are cosmetic (a vignette, a 3D headline that could be HTML text over the element), tell the user what removing them would save. The lite and full runtimes render the same pixels.
67
76
  - Exporting again into a non-empty folder prints a plan (`needsConfirmation`, with the existing entries): re-run with `--yes` after the user agreed.
68
- - The result gives `snippet`, `head` (all modulepreload links), `integrity`, `runtimeDir`, `out`, `entry` (the demo page, or the zip / html file), `pageKb` / `pageKbGzip` (what a visitor downloads for this scene: the runtime entry + the lazy chunks it uses + scene, assets, scripts, poster — quote this one as the page weight), `folderKb` (= `totalKb`, every file written, all chunks and og-image included), `page` (runtime files loaded / chunks skipped), `sizes` (`runtimeKb`, `sceneKb`, `assetsKb`, `scriptsKb`, `posterKb`), `credits`, `issues` (+ `optimized` with `--optimize`). Media formats return `{ format, path, codec?, frames?, fps?, duration?, size, bytes }`.
77
+ - The result gives `snippet`, `head` (all modulepreload links), `integrity`, `runtimeDir`, `out`, `entry` (the demo page, or the zip / html file), `pageKb` / `pageKbGzip` (what a visitor downloads for this scene: the runtime entry + the lazy chunks it uses + scene, assets, scripts, poster — quote this one as the page weight), `folderKb` (= `totalKb`, every file written, all chunks and og-image included), `page` (runtime files loaded / chunks skipped), `runtime` (`photo-lite` or `full`, + `runtimeReasons`), `sizes` (`runtimeKb`, `sceneKb`, `assetsKb`, `scriptsKb`, `posterKb`), `credits`, `issues` (+ `optimized` with `--optimize`). Media formats return `{ format, path, codec?, frames?, fps?, duration?, size, bytes }`.
69
78
 
70
79
  Media straight from `render` (frame-exact, any size / fps; LOOK at a few frames of the result):
71
80
 
72
81
  ```bash
73
- npx -y @fleox/agent3d@0.3.1 render --video renders/promo.mp4 --duration 6 --size 1920x1080 --quality high --project my-banner --json
74
- npx -y @fleox/agent3d@0.3.1 render --gif renders/banner.gif --duration 4 --project my-banner --json
75
- npx -y @fleox/agent3d@0.3.1 render --webp renders/banner.webp --duration 4 --project my-banner --json
76
- npx -y @fleox/agent3d@0.3.1 render --frames 2 --size 2400x600 --quality ultra --transparent --project my-banner --json
77
- npx -y @fleox/agent3d@0.3.1 render --scroll 0.5 --project my-scroll-story --json
82
+ npx -y @fleox/agent3d@0.5.0 render --video renders/promo.mp4 --duration 6 --size 1920x1080 --quality high --project my-banner --json
83
+ npx -y @fleox/agent3d@0.5.0 render --gif renders/banner.gif --duration 4 --project my-banner --json
84
+ npx -y @fleox/agent3d@0.5.0 render --webp renders/banner.webp --duration 4 --project my-banner --json
85
+ npx -y @fleox/agent3d@0.5.0 render --frames 2 --size 2400x600 --quality ultra --transparent --project my-banner --json
86
+ npx -y @fleox/agent3d@0.5.0 render --scroll 0.5 --project my-scroll-story --json
78
87
  ```
79
88
 
80
89
  `--quality high|ultra` supersamples 2× / 3× (smoother edges), `--transparent` gives alpha PNG / GIF / WebP, `--scroll 0.5` holds a scroll-driven scene at that scroll progress, `--fps` / `--start` / `--bitrate` tune videos, `--yes` overwrites an existing media file. `--video`, `--gif` and `--webp` paths (like `--out`) are relative to the project folder. MP4 needs Google Chrome or Edge (H.264 encoder); with Chromium, render `.webm`. Videos and posters capture the WebGL canvas only (no HUD).
@@ -82,8 +91,8 @@ npx -y @fleox/agent3d@0.3.1 render --scroll 0.5 --project my-scroll-story --json
82
91
  Scenes whose timeline waits for the visitor (`autoplay: false`, `trigger: "manual"` / `"click"`, segments played by interactions) are still at t = 0 in a plain render: film the segment with `--segment`, or play the interaction with `--input` (frames, `--video`, `--gif` and `--webp` all apply it):
83
92
 
84
93
  ```bash
85
- npx -y @fleox/agent3d@0.3.1 render --video renders/celebrate.webm --segment celebrate --duration 4 --project my-mascot --json
86
- npx -y @fleox/agent3d@0.3.1 render --sheet --frames 0,1,2,3 --input '[{"t": 0, "segment": "celebrate"}]' --project my-mascot --json
94
+ npx -y @fleox/agent3d@0.5.0 render --video renders/celebrate.webm --segment celebrate --duration 4 --project my-mascot --json
95
+ npx -y @fleox/agent3d@0.5.0 render --sheet --frames 0,1,2,3 --input '[{"t": 0, "segment": "celebrate"}]' --project my-mascot --json
87
96
  ```
88
97
 
89
98
  `--reduced-motion` renders what visitors with prefers-reduced-motion see.
@@ -114,7 +123,7 @@ Always paste the snippet from the export result (hashes and file names change wi
114
123
  Write `{data.key}` in a text object's `text` (or an `href`), give defaults in `scene.data`, and the page fills them per embed — no re-export:
115
124
 
116
125
  ```bash
117
- npx -y @fleox/agent3d@0.3.1 scene patch --project my-banner '[{"op":"set","path":"data","value":{"title":"Spring sale"}},{"op":"updateObject","id":"title","set":{"text":"{data.title}"}}]' --json
126
+ npx -y @fleox/agent3d@0.5.0 scene patch --project my-banner '[{"op":"set","path":"data","value":{"title":"Spring sale"}},{"op":"updateObject","id":"title","set":{"text":"{data.title}"}}]' --json
118
127
  ```
119
128
 
120
129
  ```html
@@ -127,7 +136,7 @@ Placeholders work in text objects' `text`, any object's `href` and HUD texts. `{
127
136
 
128
137
  Step-by-step per platform (plain HTML, WordPress, AgentCMS, React / Next.js, Astro, Vue / Nuxt, Svelte, static hosts and CDNs): [references/integrations.md](references/integrations.md). In short:
129
138
 
130
- - **Plain HTML / static hosts** (Netlify, GitHub Pages, Cloudflare Pages, S3): copy the export folder next to the page, paste the snippet. Open `index.html` of the export through a local server (`npx -y @fleox/agent3d@0.3.1 serve --project my-banner` previews the project; module scripts don't run from `file://`: opened that way, the demo page only shows the poster and a note asking for a web server).
139
+ - **Plain HTML / static hosts** (Netlify, GitHub Pages, Cloudflare Pages, S3): copy the export folder next to the page, paste the snippet. Open `index.html` of the export through a local server (`npx -y @fleox/agent3d@0.5.0 serve --project my-banner` previews the project; module scripts don't run from `file://`: opened that way, the demo page only shows the poster and a note asking for a web server).
131
140
  - **WordPress**: export with `--base-url /wp-content/uploads/agent3d/`, upload the export folder there (SFTP / the host's file manager), then a **Custom HTML** block with the snippet. The media library refuses `.js` / `.json` files.
132
141
  - **Webflow / Shopify**: host the folder on a static host or CDN, export with `--base-url https://…/`, paste the snippet in an Embed element / Custom Liquid section.
133
142
  - **Squarespace / Wix / Framer**: `single-html` in an `<iframe>`.
@@ -7,7 +7,7 @@ All examples assume the embed export was uploaded to `/agent3d/` at the root of
7
7
  /agent3d/spring-banner/scene.json (+ assets/, scripts/, poster.webp, og-image.png, CREDITS.txt)
8
8
  ```
9
9
 
10
- Export straight into that layout with `npx -y @fleox/agent3d@0.3.1 export --project spring-banner --out ./public/agent3d --base-url /agent3d/ --json` (the `<name>` folder defaults to the project name; `--name` changes it; `--base-url` writes root-absolute URLs in the snippet, the wrappers and EMBED.md). Paste the `snippet` of the result: the examples below shorten the integrity hashes and the poster markup.
10
+ Export straight into that layout with `npx -y @fleox/agent3d@0.5.0 export --project spring-banner --out ./public/agent3d --base-url /agent3d/ --json` (the `<name>` folder defaults to the project name; `--name` changes it; `--base-url` writes root-absolute URLs in the snippet, the wrappers and EMBED.md). Paste the `snippet` of the result: the examples below shorten the integrity hashes and the poster markup.
11
11
 
12
12
  ## Plain HTML
13
13
 
@@ -10,7 +10,7 @@ A 16:9 scroll-driven story. The timeline uses `trigger: "scroll"`: its time foll
10
10
 
11
11
  ## Page setup
12
12
 
13
- To let the visitor scroll through the whole story while the scene stays on screen, put the embed in a tall wrapper with a sticky child, e.g. `<section style="height:300vh"><div style="position:sticky;top:0"><agent3d-scene …></agent3d-scene></div></section>`. Without a wrapper, the story plays while the hero scrolls past.
13
+ To let the visitor scroll through the whole story while the scene stays on screen, put the embed in a tall wrapper with a sticky child, e.g. `<section style="height:300vh"><div style="position:sticky;top:0"><agent3d-scene …></agent3d-scene></div></section>`. Without a wrapper, the story plays while the hero scrolls past. The scene detects the pin: it measures the scroll on the sticky box's parent (the tall section) minus the pinned height, so `"top top"` → `"bottom top"` runs exactly while it is pinned.
14
14
 
15
15
  ## What to tweak
16
16
 
@@ -0,0 +1,29 @@
1
+ # Photo scroll story
2
+
3
+ A 16:9 hero where scrolling the page dives into photographs. Two 3D photos (parallax mode, CC0 pictures + depth maps from `agent3d assets depth`) are stacked: the street in front, the lake just behind. The timeline uses `trigger: "scroll"` (range `top top` → `bottom top`, smoothing 0.85), so its time follows the page scroll, and its tracks drive each photo's camera move through `motion.progress`:
4
+
5
+ | Scroll | What happens | Tracks |
6
+ |---|---|---|
7
+ | 0–55 % | **Dolly** down the street: the view pushes in, the near houses grow faster than the far end | `street.motion.progress` 0 → 1 (`motion.auto: "dolly"`) |
8
+ | 0–32 % | "OLD TOWN" rises and fades | `title1.material.opacity`, `title1.position.y`, `sub1.material.opacity` |
9
+ | 42–58 % | The street dissolves into the lake | `street.material.opacity` 1 → 0 |
10
+ | 50–100 % | **Dolly zoom** on the lake: the jetties keep their place while the mountains swell | `lake.motion.progress` 0 → 1 (`motion.auto: "vertigo"`) |
11
+ | 60–72 % | "THEN, THE LAKE" fades in | `title2.material.opacity`, `title2.position.y` |
12
+
13
+ The pointer (and the phone gyroscope) still looks around inside each photo (`motion.pointer` 0.6); the moves themselves only follow the scroll. Markers `street` / `lake` emit `agent3d:event` on the element.
14
+
15
+ ## Page setup
16
+
17
+ To let the visitor scroll through the whole story while the scene stays on screen, put the embed in a tall wrapper with a sticky child: `<section style="height:300vh"><div style="position:sticky;top:0"><agent3d-scene …></agent3d-scene></div></section>`. Without a wrapper, the story plays while the hero scrolls out of view. The scene detects the pin: it measures the scroll on the sticky box's parent (the tall section) minus the pinned height, so `"top top"` → `"bottom top"` runs exactly while it is pinned.
18
+
19
+ ## What to tweak
20
+
21
+ | Change | Where |
22
+ |---|---|
23
+ | Your photos | replace `assets/textures/*.webp`, run `agent3d assets depth assets/textures/<photo>` and point `objects#street/lake.src` / `.depth` at them; set `focus` to the subject's depth (0 far … 1 near) |
24
+ | The moves | `objects#<photo>.motion.auto`: `dolly` (push in), `pan` (truck left → right), `rise` (crane up), `vertigo` (dolly zoom), `zoom`, `sway`, `orbit` |
25
+ | Pacing | the keys of the `<photo>.motion.progress` and `street.material.opacity` tracks (timeline seconds = scroll × 10) |
26
+ | A third photo | add a photo behind the lake (`position` z -0.1), fade `lake.material.opacity` out and drive the new photo's `motion.progress`, extend `timeline.duration` |
27
+ | Headlines | `data.title`, `data.subtitle`, `data.title2` (or `data-title` … attributes on the element) |
28
+
29
+ Reduced motion: the scene stays on its first frame (`posterTime` 0). Check a scroll position with `agent3d render --scroll 0.6`.
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "photo-scroll-story",
3
+ "title": "Photo scroll story",
4
+ "createdAt": "2026-11-26T00:00:00.000Z",
5
+ "updatedAt": "2026-11-26T00:00:00.000Z",
6
+ "template": "photo-scroll-story",
7
+ "agent3d": "0.4.0"
8
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "assets": [
3
+ {
4
+ "path": "assets/depth/lake-depth.png",
5
+ "kind": "texture",
6
+ "bytes": 70333,
7
+ "source": "depth-anything-v2-small",
8
+ "sourceUrl": "https://huggingface.co/onnx-community/depth-anything-v2-small",
9
+ "license": "CC0-1.0",
10
+ "author": "DimiTalen (Wikimedia Commons user)",
11
+ "attribution": "Depth map of assets/textures/lake.webp estimated with Depth Anything V2 Small (Apache-2.0). Image: \"Kawaguchiko rowing center jetties on Lake Kawaguchi, with Mount Setto in the background\" by DimiTalen (https://commons.wikimedia.org/wiki/File:Kawaguchiko_rowing_center_jetties_on_Lake_Kawaguchi,_with_Mount_Setto_in_the_background,_Fujikawaguchiko,_2016.jpg), licensed under CC0-1.0.",
12
+ "addedAt": "2026-11-26T00:00:00.000Z"
13
+ },
14
+ {
15
+ "path": "assets/depth/street-depth.png",
16
+ "kind": "texture",
17
+ "bytes": 80233,
18
+ "source": "depth-anything-v2-small",
19
+ "sourceUrl": "https://huggingface.co/onnx-community/depth-anything-v2-small",
20
+ "license": "CC0-1.0",
21
+ "author": "Wilfredo Rafael Rodriguez Hernandez (Wilfredor)",
22
+ "attribution": "Depth map of assets/textures/street.jpg estimated with Depth Anything V2 Small (Apache-2.0). Image: \"street.jpg\" by Wilfredo Rafael Rodriguez Hernandez (Wilfredor) (https://commons.wikimedia.org/wiki/File:Herzog-Friedrich-Stra%C3%9Fe_in_Innsbruck%27s_Historic_Old_Town,_Austria.jpg), licensed under CC0-1.0.",
23
+ "addedAt": "2026-11-26T00:00:00.000Z"
24
+ },
25
+ {
26
+ "path": "assets/textures/lake.webp",
27
+ "kind": "texture",
28
+ "bytes": 174222,
29
+ "source": "local",
30
+ "sourceUrl": "https://commons.wikimedia.org/wiki/File:Kawaguchiko_rowing_center_jetties_on_Lake_Kawaguchi,_with_Mount_Setto_in_the_background,_Fujikawaguchiko,_2016.jpg",
31
+ "license": "CC0-1.0",
32
+ "author": "DimiTalen (Wikimedia Commons user)",
33
+ "addedAt": "2026-11-26T00:00:00.000Z"
34
+ },
35
+ {
36
+ "path": "assets/textures/street.webp",
37
+ "kind": "texture",
38
+ "bytes": 329510,
39
+ "source": "local",
40
+ "sourceUrl": "https://commons.wikimedia.org/wiki/File:Herzog-Friedrich-Stra%C3%9Fe_in_Innsbruck%27s_Historic_Old_Town,_Austria.jpg",
41
+ "license": "CC0-1.0",
42
+ "author": "Wilfredo Rafael Rodriguez Hernandez (Wilfredor)",
43
+ "addedAt": "2026-11-26T00:00:00.000Z"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "version": 1,
3
+ "id": "photo-scroll-story",
4
+ "title": "Photo scroll story",
5
+ "description": "A scroll-driven hero made of two 3D photos: scrolling dives down an old-town street at blue hour (dolly), crossfades into a mountain lake, and ends on a dolly zoom where the mountain swells behind the jetties.",
6
+ "ariaLabel": "Scroll story: a blue-hour old-town street you dive into as you scroll, dissolving into a calm mountain lake with wooden jetties, under the headlines Old Town and Then, the lake",
7
+ "target": {
8
+ "kind": "hero",
9
+ "aspect": "16:9",
10
+ "posterTime": 0,
11
+ "reducedMotion": "static",
12
+ "toneMapping": "none"
13
+ },
14
+ "camera": {
15
+ "type": "perspective",
16
+ "fov": 35,
17
+ "position": [0, 0, 10],
18
+ "target": [0, 0, 0]
19
+ },
20
+ "environment": {
21
+ "background": "#0b1020"
22
+ },
23
+ "lights": [
24
+ { "id": "fill", "type": "hemisphere", "intensity": 1 }
25
+ ],
26
+ "objects": [
27
+ {
28
+ "id": "lake",
29
+ "kind": "photo",
30
+ "src": "assets/textures/lake.webp",
31
+ "depth": "assets/depth/lake-depth.png",
32
+ "mode": "parallax",
33
+ "width": 11.9,
34
+ "strength": 0.9,
35
+ "focus": 0.7,
36
+ "position": [0, 0, -0.05],
37
+ "motion": { "auto": "vertigo", "progress": 0, "pointer": 0.6, "gyro": true, "smoothing": 0.9 }
38
+ },
39
+ {
40
+ "id": "street",
41
+ "kind": "photo",
42
+ "src": "assets/textures/street.webp",
43
+ "depth": "assets/depth/street-depth.png",
44
+ "mode": "parallax",
45
+ "width": 11.9,
46
+ "strength": 0.8,
47
+ "focus": 0.45,
48
+ "motion": { "auto": "dolly", "progress": 0, "pointer": 0.6, "gyro": true, "smoothing": 0.9 }
49
+ },
50
+ {
51
+ "id": "title1",
52
+ "kind": "text",
53
+ "text": "{data.title|OLD TOWN}",
54
+ "font": "serif-bold",
55
+ "size": 0.56,
56
+ "depth": 0,
57
+ "letterSpacing": 0.06,
58
+ "align": "center",
59
+ "position": [0, 1.95, 0.5],
60
+ "material": { "type": "basic", "color": "#ffffff", "transparent": true }
61
+ },
62
+ {
63
+ "id": "sub1",
64
+ "kind": "text",
65
+ "text": "{data.subtitle|SCROLL TO WALK IN}",
66
+ "font": "sans-bold",
67
+ "size": 0.088,
68
+ "depth": 0,
69
+ "letterSpacing": 0.1,
70
+ "align": "center",
71
+ "position": [0, 1.6, 0.5],
72
+ "material": { "type": "basic", "color": "#e8eef8", "transparent": true }
73
+ },
74
+ {
75
+ "id": "title2",
76
+ "kind": "text",
77
+ "text": "{data.title2|THEN, THE LAKE}",
78
+ "font": "serif-bold",
79
+ "size": 0.5,
80
+ "depth": 0,
81
+ "letterSpacing": 0.06,
82
+ "align": "center",
83
+ "position": [0, 1.95, 0.5],
84
+ "material": { "type": "basic", "color": "#ffffff", "opacity": 0, "transparent": true }
85
+ }
86
+ ],
87
+ "timeline": {
88
+ "duration": 10,
89
+ "trigger": "scroll",
90
+ "loop": false,
91
+ "scroll": { "start": "top top", "end": "bottom top", "smoothing": 0.85 },
92
+ "tracks": [
93
+ { "target": "street.motion.progress", "keys": [[0, 0], [5.5, 1]], "ease": "inOutSine" },
94
+ { "target": "street.material.opacity", "keys": [[4.2, 1], [5.8, 0]], "ease": "inOutSine" },
95
+ { "target": "lake.motion.progress", "keys": [[5, 0], [10, 1]], "ease": "inOutSine" },
96
+ { "target": "title1.material.opacity", "keys": [[0, 1], [2, 1], [3.2, 0]] },
97
+ { "target": "sub1.material.opacity", "keys": [[0, 1], [1.5, 1], [2.6, 0]] },
98
+ { "target": "title1.position.y", "keys": [[0, 1.95], [3.2, 2.4]], "ease": "inSine" },
99
+ { "target": "title2.material.opacity", "keys": [[6, 0], [7.2, 1]] },
100
+ { "target": "title2.position.y", "keys": [[6, 1.6], [7.2, 1.95]], "ease": "outCubic" }
101
+ ],
102
+ "markers": { "street": 0, "lake": 6 }
103
+ },
104
+ "postfx": [
105
+ { "type": "vignette", "darkness": 0.55 }
106
+ ],
107
+ "data": {
108
+ "title": "OLD TOWN",
109
+ "subtitle": "SCROLL TO WALK IN",
110
+ "title2": "THEN, THE LAKE"
111
+ }
112
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "id": "photo-scroll-story",
3
+ "title": "Photo scroll story",
4
+ "description": "A scroll-driven hero made of two 3D photos (CC0, with estimated depth maps): scrolling the page dives down a blue-hour old-town street (a dolly move driven by the timeline), dissolves into a mountain lake, and ends on a dolly zoom where the mountains swell behind the jetties, with headlines that fade between the chapters (data-bound). Swap the photos and run `assets depth` to tell your own story.",
5
+ "kind": "hero",
6
+ "tags": ["hero", "scroll", "scrollytelling", "story", "photo", "3d-photo", "depth-map", "parallax", "dolly", "vertigo", "cinematic", "crossfade", "travel", "timeline", "data-bindings"],
7
+ "aspect": "16:9"
8
+ }
@@ -0,0 +1,31 @@
1
+ # 3D title inside a photo
2
+
3
+ A 16:9 hero where the 3D content lives **inside** a 3D photo. The picture is a blue-hour street of Innsbruck's old town (CC0, Wilfredo Rafael Rodriguez Hernandez on Wikimedia Commons) with a depth map estimated locally by `agent3d assets depth` (white = near, black = far). The big 3D title "OLD TOWN" sits between the far houses and the nearest building on the right, so that facade hides the end of the letters, and snow falls both in front of and behind the buildings.
4
+
5
+ How it works: the photo has `"occlude": true`. Each photo pixel writes its true depth to the depth buffer, so any 3D object (text, mesh, model, particles) placed between the photo's depth planes is hidden where the photo is nearer. The photo's motion (pointer, phone gyroscope, a gentle automatic sway) also moves the real camera, so the title slides exactly like the pixels of the street at the same depth: it never swims over the facade. Visitors who prefer reduced motion get the still frame at 2.5 s.
6
+
7
+ ## Where to put things
8
+
9
+ `agent3d scene summary --json` gives the photo a `depthRange: [zFar, zNear]`: the world z of its farthest (depth 0) and nearest (depth 1) pixels. Here the focus depth (0.45, the plane that stays still) is at z = 0, the sky at about z = -1.2 and the nearest facade at about z = 1.15. A depth-map value d sits at local z ≈ (d - focus) × strength × width × 0.25 (exactly: see `docs/scene-format.md`, "3D inside the photo"). The title is at z = -0.15, depth ≈ 0.4: the nearest bay windows on the left and the right facade cover the ends of its first and last letters, the sky and the far houses stay behind it. Move it to z = 0.2 and less of it hides; to z = -0.45 and the buildings on both sides cut deep into it.
10
+
11
+ ## What to tweak
12
+
13
+ | Change | Where |
14
+ |---|---|
15
+ | Title / subtitle | `data.title`, `data.subtitle` (or `data-title` / `data-subtitle` on the embed) |
16
+ | How much the building hides the title | `objects#title.position` (z: higher = nearer, less hidden; x: towards the right facade = more hidden) |
17
+ | Snow | `objects#snow`: `count`, `size`, `speed`, `area` (its depth range [z] spans in front of and behind the facades); try the `dust` preset for a summer street |
18
+ | Depth amount | `objects#photo.strength` (also scales the depth range the 3D content can live in) |
19
+ | Still plane | `objects#photo.focus` (0 = far … 1 = near) |
20
+ | Motion | `objects#photo.motion`: `pointer`, `gyro`, `auto` (`sway`, `orbit`, `zoom`, `none`), `speed`, `smoothing` |
21
+
22
+ ## Use your own photo
23
+
24
+ ```bash
25
+ agent3d assets add /path/to/photo.jpg --license CC0-1.0 --author "Name" --json
26
+ agent3d assets depth assets/textures/photo.jpg --json
27
+ ```
28
+
29
+ Point `objects#photo.src` / `depth` to the new files, read the new `depthRange` from `scene summary`, then render with the pointer at the corners (`render --sheet --input '[{"t":0.5,"pointer":[-1,0.7]},{"t":1.5,"pointer":[1,-0.7]}]'`) and move the title until the subject you want in front of it covers it.
30
+
31
+ `target.toneMapping` is `none` so the photo keeps its original colours. The photo (330 KB) and its depth map (80 KB) are the only assets.
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "photo-title-inside",
3
+ "title": "3D title inside a photo",
4
+ "createdAt": "2026-11-26T00:00:00.000Z",
5
+ "updatedAt": "2026-11-26T00:00:00.000Z",
6
+ "template": "photo-title-inside",
7
+ "agent3d": "0.4.0"
8
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "assets": [
3
+ {
4
+ "path": "assets/depth/street-depth.png",
5
+ "kind": "texture",
6
+ "bytes": 80233,
7
+ "source": "depth-anything-v2-small",
8
+ "sourceUrl": "https://huggingface.co/onnx-community/depth-anything-v2-small",
9
+ "license": "CC0-1.0",
10
+ "author": "Wilfredo Rafael Rodriguez Hernandez (Wilfredor)",
11
+ "attribution": "Depth map of assets/textures/street.jpg estimated with Depth Anything V2 Small (Apache-2.0). Image: \"street.jpg\" by Wilfredo Rafael Rodriguez Hernandez (Wilfredor) (https://commons.wikimedia.org/wiki/File:Herzog-Friedrich-Stra%C3%9Fe_in_Innsbruck%27s_Historic_Old_Town,_Austria.jpg), licensed under CC0-1.0.",
12
+ "addedAt": "2026-11-26T00:00:00.000Z"
13
+ },
14
+ {
15
+ "path": "assets/textures/street.webp",
16
+ "kind": "texture",
17
+ "bytes": 329510,
18
+ "source": "local",
19
+ "sourceUrl": "https://commons.wikimedia.org/wiki/File:Herzog-Friedrich-Stra%C3%9Fe_in_Innsbruck%27s_Historic_Old_Town,_Austria.jpg",
20
+ "license": "CC0-1.0",
21
+ "author": "Wilfredo Rafael Rodriguez Hernandez (Wilfredor)",
22
+ "addedAt": "2026-11-26T00:00:00.000Z"
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "version": 1,
3
+ "id": "photo-title-inside",
4
+ "title": "3D title inside a photo",
5
+ "ariaLabel": "Old Town: a big 3D title floating inside a blue-hour street of Innsbruck, between the far houses and the nearest building, while snow falls in front of and behind the facades",
6
+ "target": {
7
+ "kind": "hero",
8
+ "aspect": "16:9",
9
+ "posterTime": 2.5,
10
+ "reducedMotion": "static",
11
+ "toneMapping": "none"
12
+ },
13
+ "camera": {
14
+ "type": "perspective",
15
+ "fov": 35,
16
+ "position": [0, 0, 10],
17
+ "target": [0, 0, 0]
18
+ },
19
+ "environment": {
20
+ "background": "#0b1020"
21
+ },
22
+ "lights": [
23
+ { "id": "fill", "type": "hemisphere", "intensity": 1.1, "color": "#dfe8ff", "groundColor": "#3a2a20" },
24
+ { "id": "key", "type": "directional", "intensity": 1.6, "position": [-4, 5, 8], "color": "#ffe2bf" }
25
+ ],
26
+ "objects": [
27
+ {
28
+ "id": "photo",
29
+ "kind": "photo",
30
+ "src": "assets/textures/street.webp",
31
+ "depth": "assets/depth/street-depth.png",
32
+ "mode": "parallax",
33
+ "occlude": true,
34
+ "width": 11.9,
35
+ "strength": 0.8,
36
+ "focus": 0.45,
37
+ "motion": { "pointer": 1, "gyro": true, "auto": "sway", "speed": 1.2, "smoothing": 0.9 }
38
+ },
39
+ {
40
+ "id": "title",
41
+ "kind": "text",
42
+ "text": "{data.title|OLD TOWN}",
43
+ "font": "serif-bold",
44
+ "size": 0.85,
45
+ "depth": 0.14,
46
+ "letterSpacing": 0.04,
47
+ "align": "center",
48
+ "position": [-0.25, 1.45, -0.15],
49
+ "material": { "type": "standard", "color": "#ffffff", "roughness": 0.45, "emissive": "#ffffff", "emissiveIntensity": 0.35 },
50
+ "reveal": { "effect": "rise", "stagger": 0.04, "duration": 0.8, "delay": 0, "ease": "outCubic" }
51
+ },
52
+ {
53
+ "id": "subtitle",
54
+ "kind": "text",
55
+ "text": "{data.subtitle|AFTER-DARK WALKING TOURS}",
56
+ "font": "sans-bold",
57
+ "size": 0.11,
58
+ "depth": 0,
59
+ "letterSpacing": 0.12,
60
+ "align": "center",
61
+ "position": [-0.25, 0.62, 0.35],
62
+ "material": { "type": "basic", "color": "#e8eef8" },
63
+ "behaviours": [{ "type": "appear", "effect": "fade", "duration": 1, "delay": 1.1 }]
64
+ },
65
+ {
66
+ "id": "snow",
67
+ "kind": "particles",
68
+ "preset": "snow",
69
+ "count": 700,
70
+ "area": [12, 8, 4],
71
+ "position": [0, 0, 0.4],
72
+ "size": 0.05,
73
+ "speed": 0.35,
74
+ "opacity": 0.85
75
+ }
76
+ ],
77
+ "postfx": [{ "type": "vignette", "darkness": 0.55 }],
78
+ "description": "A blue-hour photo of a European old-town street turned into a 3D photo that writes its depth (occlude), with a big 3D title placed inside it, between the far houses and the nearest building, and snow falling in front of and behind the facades; the view moves with the pointer, the gyroscope and a gentle sway.",
79
+ "data": { "title": "OLD TOWN", "subtitle": "AFTER-DARK WALKING TOURS" }
80
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "id": "photo-title-inside",
3
+ "title": "3D title inside a photo",
4
+ "description": "3D inside a 3D photo: a big 3D title placed between the far houses and the nearest building of a blue-hour old-town street (CC0), so the facade hides part of the letters, with snow falling both in front of and behind the buildings. The photo writes its depth (`occlude: true`) and its pointer / gyro / sway motion moves the real camera, so the title slides exactly with the street around it. Data-bound title and subtitle.",
5
+ "kind": "hero",
6
+ "tags": ["hero", "photo", "3d-photo", "depth-map", "occlusion", "occlude", "parallax", "3d-text", "title", "snow", "particles", "travel", "city", "street", "night", "pointer", "gyro", "data-bindings"],
7
+ "aspect": "16:9"
8
+ }
@@ -1 +0,0 @@
1
- function e(e){return e.endsWith(`/`)?e:e+`/`}function t(t){let n=e(t.assetBase??`./`),r=e(t.libraryBase??n+`assets/library/`),i=t.assetUrls??{};return e=>{if(i[e])return i[e];if(/^(https?:|data:|blob:|\/)/.test(e))return e;if(e.startsWith(`library:`)){let t=e.slice(8);return t.startsWith(`fonts/`)&&!/\.json$/.test(t)&&(t+=`.typeface.json`),i[`library:`+t]?i[`library:`+t]:r+t}return n+e.replace(/^\.\//,``)}}var n=/* @__PURE__ */ new Map;function r(e){let t=n.get(e);return t||(t=fetch(e).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status} for ${e}`);return t.text()}),t.catch(()=>n.delete(e)),n.set(e,t)),t}async function i(e){return JSON.parse(await r(e))}var a=/* @__PURE__ */ new Map;function o(e){let t=a.get(e);return t||(t=import(`./three.module-DnaBiDAJ.js`).then(e=>e.a).then(t=>new Promise((n,r)=>{new t.TextureLoader().load(e,n,void 0,()=>r(/* @__PURE__ */ Error(`Cannot load texture ${e}`)))})),t.catch(()=>a.delete(e)),a.set(e,t)),t.then(e=>{let t=e.clone();return t.needsUpdate=!0,t})}export{o as i,i as n,r,t};