@fleox/agent3d 0.0.0-stage → 0.2.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 (455) hide show
  1. package/LICENSE +143 -0
  2. package/README.md +172 -2
  3. package/changelog.json +56 -0
  4. package/dist/agent/agent3d.mjs +11242 -0
  5. package/dist/agent/chunks/assets-BUUM9TUB.mjs +2448 -0
  6. package/dist/agent/chunks/browser-t_JL_B82.mjs +226 -0
  7. package/dist/agent/chunks/cdp-CaKRRzMX.mjs +177 -0
  8. package/dist/agent/chunks/check-CBO3Ekx1.mjs +971 -0
  9. package/dist/agent/chunks/export-BCI8vKw8.mjs +1130 -0
  10. package/dist/agent/chunks/gif-DQznzHTL.mjs +319 -0
  11. package/dist/agent/chunks/gltf-f_f0-OiV.mjs +207 -0
  12. package/dist/agent/chunks/imageCodec-BpDU9Lsq.mjs +101 -0
  13. package/dist/agent/chunks/jsonPath-DUCe1JpS.mjs +155 -0
  14. package/dist/agent/chunks/meshoptimizer-C-tN9jn5.mjs +1165 -0
  15. package/dist/agent/chunks/mp4-aOALfp3s.mjs +130 -0
  16. package/dist/agent/chunks/objects-DBAws7uf.mjs +53 -0
  17. package/dist/agent/chunks/optimizeSizing-CkZ3fZRp.mjs +540 -0
  18. package/dist/agent/chunks/package-Ck7_Nszg.mjs +75 -0
  19. package/dist/agent/chunks/png-DXfSGJZt.mjs +91 -0
  20. package/dist/agent/chunks/render-Cbuhz5uW.mjs +1511 -0
  21. package/dist/agent/chunks/rolldown-runtime-ebOQtxsr.mjs +18 -0
  22. package/dist/agent/chunks/scene-BgajNvBf.mjs +444 -0
  23. package/dist/agent/chunks/server-CACCerkZ.mjs +237 -0
  24. package/dist/agent/chunks/suggest-Cpcgv1RP.mjs +46 -0
  25. package/dist/agent/chunks/tools-DT2tetIK.mjs +1412 -0
  26. package/dist/agent/chunks/tree-BrNYGui2.mjs +75 -0
  27. package/dist/agent/chunks/webpAnim-qaq9YgKl.mjs +132 -0
  28. package/dist/runtime/agent3d-runtime.js +373 -0
  29. package/dist/runtime/agent3d-runtime.single.js +7360 -0
  30. package/dist/runtime/chunks/BufferGeometryUtils-Re3wQkXp.js +1 -0
  31. package/dist/runtime/chunks/EXRLoader-Bzm84si5.js +1 -0
  32. package/dist/runtime/chunks/FontLoader-BocwqK8V.js +2 -0
  33. package/dist/runtime/chunks/GLTFLoader-DHp1wv6J.js +1 -0
  34. package/dist/runtime/chunks/GroundedSkybox-esvlRCO0.js +1 -0
  35. package/dist/runtime/chunks/HDRLoader-DHrHp8fs.js +5 -0
  36. package/dist/runtime/chunks/OrbitControls-sjN2MF0e.js +1 -0
  37. package/dist/runtime/chunks/RectAreaLightUniformsLib-_mZ62yWn.js +1 -0
  38. package/dist/runtime/chunks/RoomEnvironment-CL4UR6ZW.js +1 -0
  39. package/dist/runtime/chunks/RoundedBoxGeometry-x-ot8ZSh.js +1 -0
  40. package/dist/runtime/chunks/SVGLoader-hRF0EwD-.js +1 -0
  41. package/dist/runtime/chunks/SkeletonUtils-DHlReJx3.js +1 -0
  42. package/dist/runtime/chunks/Sky-BrLN9Fk5.js +243 -0
  43. package/dist/runtime/chunks/audio-DbVNbf-r.js +1 -0
  44. package/dist/runtime/chunks/catalog-DL6sgPay.js +1 -0
  45. package/dist/runtime/chunks/easing-CXSz2e6P.js +1 -0
  46. package/dist/runtime/chunks/extrude-m04mghOS.js +1 -0
  47. package/dist/runtime/chunks/game-BoG2S6g4.js +20 -0
  48. package/dist/runtime/chunks/generators-OHhFCc2E.js +331 -0
  49. package/dist/runtime/chunks/materials-C2uffFEd.js +107 -0
  50. package/dist/runtime/chunks/meshGradient.glsl-BMatplLA.js +88 -0
  51. package/dist/runtime/chunks/meshopt_decoder.module-DXTYc6wn.js +1 -0
  52. package/dist/runtime/chunks/model-D-4xZz21.js +1 -0
  53. package/dist/runtime/chunks/params-DdApDOBw.js +1 -0
  54. package/dist/runtime/chunks/physicsHost-DPaVdM0R.js +1 -0
  55. package/dist/runtime/chunks/postfx-BpBXjLX3.js +1527 -0
  56. package/dist/runtime/chunks/postfx-i_J5Vf-l.js +1 -0
  57. package/dist/runtime/chunks/random-eeej60NW.js +1 -0
  58. package/dist/runtime/chunks/shaders-CmeJRio1.js +443 -0
  59. package/dist/runtime/chunks/svg-B3nZaQFD.js +1 -0
  60. package/dist/runtime/chunks/text-CmkU-b0C.js +2 -0
  61. package/dist/runtime/chunks/three.module-W4hp4qHb.js +4225 -0
  62. package/dist/runtime/chunks/toon-B5Jhf37V.js +6 -0
  63. package/dist/runtime/chunks/util-THUewKBk.js +1 -0
  64. package/dist/studio/assets/BufferGeometryUtils-wW9vV1l2.js +1 -0
  65. package/dist/studio/assets/EXRLoader-f8U8jnlr.js +1 -0
  66. package/dist/studio/assets/FontLoader-9sHudKzD.js +2 -0
  67. package/dist/studio/assets/GLTFLoader-C3C_3K62.js +1 -0
  68. package/dist/studio/assets/GroundedSkybox-BTqmv4fv.js +1 -0
  69. package/dist/studio/assets/HDRLoader-CkQyrTWY.js +5 -0
  70. package/dist/studio/assets/OrbitControls-fcOgB96a.js +1 -0
  71. package/dist/studio/assets/RectAreaLightUniformsLib-CZHWO9xf.js +1 -0
  72. package/dist/studio/assets/RoomEnvironment-BsISzuCp.js +1 -0
  73. package/dist/studio/assets/SVGLoader-BIkQDT66.js +1 -0
  74. package/dist/studio/assets/SkeletonUtils-CG5akqME.js +1 -0
  75. package/dist/studio/assets/Sky-C282PFL1.js +243 -0
  76. package/dist/studio/assets/audio-JD1kyX0A.js +1 -0
  77. package/dist/studio/assets/camera-BhKdE9ej.js +2 -0
  78. package/dist/studio/assets/editor-BgY_RoRd.js +1 -0
  79. package/dist/studio/assets/extrude-CnayHczh.js +1 -0
  80. package/dist/studio/assets/game-Dv5s4eMN.js +19 -0
  81. package/dist/studio/assets/generators-DVX3bAxe.js +331 -0
  82. package/dist/studio/assets/index-BQT0otii.css +1 -0
  83. package/dist/studio/assets/index-Dh-2Y34U.js +479 -0
  84. package/dist/studio/assets/meshopt_decoder.module-DXTYc6wn.js +1 -0
  85. package/dist/studio/assets/meshoptimizer-BCSwHBL3.js +1 -0
  86. package/dist/studio/assets/model-XZSP52pV.js +2 -0
  87. package/dist/studio/assets/physicsHost-C84FddIe.js +1 -0
  88. package/dist/studio/assets/postfx-BWWXb8i8.js +1527 -0
  89. package/dist/studio/assets/runtime-k_MFerbJ.js +572 -0
  90. package/dist/studio/assets/shaders-BEznGIct.js +443 -0
  91. package/dist/studio/assets/svg-DT8kx37i.js +2 -0
  92. package/dist/studio/assets/text-5DsJJHcj.js +3 -0
  93. package/dist/studio/assets/three.module-ByMn_ZTv.js +4225 -0
  94. package/dist/studio/index.html +16 -0
  95. package/library/LICENSES.md +77 -0
  96. package/library/fonts/LICENSES.md +42 -0
  97. package/library/fonts/anton.typeface.json +1 -0
  98. package/library/fonts/bebas-neue.typeface.json +1 -0
  99. package/library/fonts/display.typeface.json +1 -0
  100. package/library/fonts/inter-black.typeface.json +1 -0
  101. package/library/fonts/lobster.typeface.json +1 -0
  102. package/library/fonts/mono.typeface.json +1 -0
  103. package/library/fonts/montserrat-extrabold.typeface.json +1 -0
  104. package/library/fonts/pacifico.typeface.json +1 -0
  105. package/library/fonts/sans-bold.typeface.json +1 -0
  106. package/library/fonts/sans.typeface.json +1 -0
  107. package/library/fonts/serif-bold.typeface.json +1 -0
  108. package/library/fonts/serif.typeface.json +1 -0
  109. package/library/fonts/space-grotesk-bold.typeface.json +1 -0
  110. package/library/hdri/beach.hdr +0 -0
  111. package/library/hdri/beach.jpg +0 -0
  112. package/library/hdri/city.hdr +0 -0
  113. package/library/hdri/city.jpg +0 -0
  114. package/library/hdri/forest.hdr +0 -0
  115. package/library/hdri/forest.jpg +0 -0
  116. package/library/hdri/night-city.hdr +0 -0
  117. package/library/hdri/night-city.jpg +0 -0
  118. package/library/hdri/night.hdr +0 -0
  119. package/library/hdri/night.jpg +0 -0
  120. package/library/hdri/sky.hdr +0 -0
  121. package/library/hdri/sky.jpg +0 -0
  122. package/library/hdri/softbox.hdr +0 -0
  123. package/library/hdri/softbox.jpg +0 -0
  124. package/library/hdri/studio.hdr +0 -0
  125. package/library/hdri/studio.jpg +0 -0
  126. package/library/hdri/sunset.hdr +0 -0
  127. package/library/hdri/sunset.jpg +0 -0
  128. package/library/hdri/warehouse.hdr +0 -0
  129. package/library/hdri/warehouse.jpg +0 -0
  130. package/library/index.json +5510 -0
  131. package/library/models/animals/fish.glb +0 -0
  132. package/library/models/animals/fox.glb +0 -0
  133. package/library/models/buildings/castle.glb +0 -0
  134. package/library/models/buildings/house.glb +0 -0
  135. package/library/models/buildings/market.glb +0 -0
  136. package/library/models/buildings/tavern.glb +0 -0
  137. package/library/models/buildings/tower.glb +0 -0
  138. package/library/models/buildings/windmill.glb +0 -0
  139. package/library/models/characters/barbarian.glb +0 -0
  140. package/library/models/characters/knight.glb +0 -0
  141. package/library/models/characters/mage.glb +0 -0
  142. package/library/models/characters/mini-soldier.glb +0 -0
  143. package/library/models/characters/platformer-hero.glb +0 -0
  144. package/library/models/characters/robot.glb +0 -0
  145. package/library/models/characters/rogue.glb +0 -0
  146. package/library/models/characters/skeleton.glb +0 -0
  147. package/library/models/city/building-a.glb +0 -0
  148. package/library/models/city/building-b.glb +0 -0
  149. package/library/models/city/building-tall.glb +0 -0
  150. package/library/models/city/fire-hydrant.glb +0 -0
  151. package/library/models/city/road-corner.glb +0 -0
  152. package/library/models/city/road-crossing.glb +0 -0
  153. package/library/models/city/road-junction.glb +0 -0
  154. package/library/models/city/road-straight.glb +0 -0
  155. package/library/models/city/streetlight.glb +0 -0
  156. package/library/models/city/suburban-house.glb +0 -0
  157. package/library/models/city/traffic-light.glb +0 -0
  158. package/library/models/city/water-tower.glb +0 -0
  159. package/library/models/food/apple.glb +0 -0
  160. package/library/models/food/avocado.glb +0 -0
  161. package/library/models/food/baguette.glb +0 -0
  162. package/library/models/food/bread-loaf.glb +0 -0
  163. package/library/models/food/burger.glb +0 -0
  164. package/library/models/food/carrot.glb +0 -0
  165. package/library/models/food/cheese.glb +0 -0
  166. package/library/models/food/cookie.glb +0 -0
  167. package/library/models/food/croissant.glb +0 -0
  168. package/library/models/food/cupcake.glb +0 -0
  169. package/library/models/food/dinner-plate.glb +0 -0
  170. package/library/models/food/donut.glb +0 -0
  171. package/library/models/food/ketchup.glb +0 -0
  172. package/library/models/food/mug.glb +0 -0
  173. package/library/models/food/pain-au-chocolat.glb +0 -0
  174. package/library/models/food/stew.glb +0 -0
  175. package/library/models/food/tomato.glb +0 -0
  176. package/library/models/food/veggie-burger.glb +0 -0
  177. package/library/models/nature/bush.glb +0 -0
  178. package/library/models/nature/cactus.glb +0 -0
  179. package/library/models/nature/cloud.glb +0 -0
  180. package/library/models/nature/fir-tree.glb +0 -0
  181. package/library/models/nature/forest-patch.glb +0 -0
  182. package/library/models/nature/grass-small.glb +0 -0
  183. package/library/models/nature/grass.glb +0 -0
  184. package/library/models/nature/hex-grass.glb +0 -0
  185. package/library/models/nature/hex-water.glb +0 -0
  186. package/library/models/nature/hills.glb +0 -0
  187. package/library/models/nature/mountain.glb +0 -0
  188. package/library/models/nature/pine-autumn.glb +0 -0
  189. package/library/models/nature/pine-tree.glb +0 -0
  190. package/library/models/nature/pumpkin.glb +0 -0
  191. package/library/models/nature/rock-flat.glb +0 -0
  192. package/library/models/nature/rock.glb +0 -0
  193. package/library/models/nature/tree-dead.glb +0 -0
  194. package/library/models/nature/tree-slim.glb +0 -0
  195. package/library/models/nature/trees-cluster.glb +0 -0
  196. package/library/models/nature/waterlily.glb +0 -0
  197. package/library/models/platformer/blaster.glb +0 -0
  198. package/library/models/platformer/block-coin.glb +0 -0
  199. package/library/models/platformer/brick.glb +0 -0
  200. package/library/models/platformer/coin.glb +0 -0
  201. package/library/models/platformer/enemy-flying.glb +0 -0
  202. package/library/models/platformer/flag.glb +0 -0
  203. package/library/models/platformer/platform-falling.glb +0 -0
  204. package/library/models/platformer/platform-grass-round.glb +0 -0
  205. package/library/models/platformer/platform-large.glb +0 -0
  206. package/library/models/platformer/platform-medium.glb +0 -0
  207. package/library/models/platformer/platform.glb +0 -0
  208. package/library/models/platformer/target.glb +0 -0
  209. package/library/models/platformer/track-corner.glb +0 -0
  210. package/library/models/platformer/track-straight.glb +0 -0
  211. package/library/models/platformer/wall-low.glb +0 -0
  212. package/library/models/products/boombox.glb +0 -0
  213. package/library/models/products/iridescent-lamp.glb +0 -0
  214. package/library/models/products/lantern.glb +0 -0
  215. package/library/models/products/lounge-chair.glb +0 -0
  216. package/library/models/products/sneaker.glb +0 -0
  217. package/library/models/products/velvet-sofa.glb +0 -0
  218. package/library/models/products/water-bottle.glb +0 -0
  219. package/library/models/props/alarm-clock.glb +0 -0
  220. package/library/models/props/armchair.glb +0 -0
  221. package/library/models/props/barrel.glb +0 -0
  222. package/library/models/props/bench.glb +0 -0
  223. package/library/models/props/brass-vase.glb +0 -0
  224. package/library/models/props/chest.glb +0 -0
  225. package/library/models/props/coffee-table.glb +0 -0
  226. package/library/models/props/coin-stack.glb +0 -0
  227. package/library/models/props/coin.glb +0 -0
  228. package/library/models/props/couch.glb +0 -0
  229. package/library/models/props/crate.glb +0 -0
  230. package/library/models/props/flag.glb +0 -0
  231. package/library/models/props/gravestone.glb +0 -0
  232. package/library/models/props/key.glb +0 -0
  233. package/library/models/props/lamp.glb +0 -0
  234. package/library/models/props/lantern.glb +0 -0
  235. package/library/models/props/marble-bust.glb +0 -0
  236. package/library/models/props/modern-armchair.glb +0 -0
  237. package/library/models/props/potted-succulent.glb +0 -0
  238. package/library/models/props/rubber-duck.glb +0 -0
  239. package/library/models/props/shield.glb +0 -0
  240. package/library/models/props/sword-shield.glb +0 -0
  241. package/library/models/props/sword.glb +0 -0
  242. package/library/models/props/table.glb +0 -0
  243. package/library/models/props/tent.glb +0 -0
  244. package/library/models/props/torch.glb +0 -0
  245. package/library/models/props/trophy.glb +0 -0
  246. package/library/models/space/base-module.glb +0 -0
  247. package/library/models/space/lander.glb +0 -0
  248. package/library/models/space/landing-pad.glb +0 -0
  249. package/library/models/space/rocks.glb +0 -0
  250. package/library/models/space/solar-panel.glb +0 -0
  251. package/library/models/space/space-truck.glb +0 -0
  252. package/library/models/space/wind-turbine.glb +0 -0
  253. package/library/models/vehicles/car.glb +0 -0
  254. package/library/models/vehicles/hatchback.glb +0 -0
  255. package/library/models/vehicles/motorcycle.glb +0 -0
  256. package/library/models/vehicles/police-car.glb +0 -0
  257. package/library/models/vehicles/taxi.glb +0 -0
  258. package/library/models/vehicles/truck.glb +0 -0
  259. package/library/sources.json +2856 -0
  260. package/library/textures/brick-color.jpg +0 -0
  261. package/library/textures/brick-normal.jpg +0 -0
  262. package/library/textures/brick-roughness.jpg +0 -0
  263. package/library/textures/concrete-color.jpg +0 -0
  264. package/library/textures/concrete-normal.jpg +0 -0
  265. package/library/textures/concrete-roughness.jpg +0 -0
  266. package/library/textures/fabric-color.jpg +0 -0
  267. package/library/textures/fabric-normal.jpg +0 -0
  268. package/library/textures/fabric-roughness.jpg +0 -0
  269. package/library/textures/grass-ground-color.jpg +0 -0
  270. package/library/textures/grass-ground-normal.jpg +0 -0
  271. package/library/textures/grass-ground-roughness.jpg +0 -0
  272. package/library/textures/rusty-metal-color.jpg +0 -0
  273. package/library/textures/rusty-metal-normal.jpg +0 -0
  274. package/library/textures/rusty-metal-roughness.jpg +0 -0
  275. package/library/textures/wood-planks-color.jpg +0 -0
  276. package/library/textures/wood-planks-normal.jpg +0 -0
  277. package/library/textures/wood-planks-roughness.jpg +0 -0
  278. package/package.json +67 -4
  279. package/plugin/.claude-plugin/plugin.json +19 -0
  280. package/plugin/skills/agent3d-assets/SKILL.md +140 -0
  281. package/plugin/skills/agent3d-assets/references/sources.md +33 -0
  282. package/plugin/skills/agent3d-create/SKILL.md +141 -0
  283. package/plugin/skills/agent3d-create/references/art-direction.md +144 -0
  284. package/plugin/skills/agent3d-create/references/recipes.md +1357 -0
  285. package/plugin/skills/agent3d-edit/SKILL.md +121 -0
  286. package/plugin/skills/agent3d-edit/references/patch-ops.md +278 -0
  287. package/plugin/skills/agent3d-game/SKILL.md +111 -0
  288. package/plugin/skills/agent3d-game/references/game-patterns.md +262 -0
  289. package/plugin/skills/agent3d-game/references/script-api.md +211 -0
  290. package/plugin/skills/agent3d-publish/SKILL.md +161 -0
  291. package/plugin/skills/agent3d-publish/references/integrations.md +221 -0
  292. package/templates/banner-aurora-night/README.md +15 -0
  293. package/templates/banner-aurora-night/agent3d.json +8 -0
  294. package/templates/banner-aurora-night/preview.png +0 -0
  295. package/templates/banner-aurora-night/scene.json +327 -0
  296. package/templates/banner-aurora-night/template.json +24 -0
  297. package/templates/banner-data-bars/README.md +15 -0
  298. package/templates/banner-data-bars/agent3d.json +8 -0
  299. package/templates/banner-data-bars/preview.png +0 -0
  300. package/templates/banner-data-bars/scene.json +222 -0
  301. package/templates/banner-data-bars/template.json +25 -0
  302. package/templates/banner-floating-shapes/README.md +15 -0
  303. package/templates/banner-floating-shapes/agent3d.json +8 -0
  304. package/templates/banner-floating-shapes/preview.png +0 -0
  305. package/templates/banner-floating-shapes/scene.json +703 -0
  306. package/templates/banner-floating-shapes/template.json +24 -0
  307. package/templates/banner-gradient-blob/README.md +16 -0
  308. package/templates/banner-gradient-blob/agent3d.json +8 -0
  309. package/templates/banner-gradient-blob/preview.png +0 -0
  310. package/templates/banner-gradient-blob/scene.json +330 -0
  311. package/templates/banner-gradient-blob/template.json +21 -0
  312. package/templates/banner-liquid-chrome/README.md +16 -0
  313. package/templates/banner-liquid-chrome/agent3d.json +8 -0
  314. package/templates/banner-liquid-chrome/preview.png +0 -0
  315. package/templates/banner-liquid-chrome/scene.json +290 -0
  316. package/templates/banner-liquid-chrome/template.json +24 -0
  317. package/templates/banner-logo-extrude/README.md +24 -0
  318. package/templates/banner-logo-extrude/agent3d.json +8 -0
  319. package/templates/banner-logo-extrude/assets/logo.svg +6 -0
  320. package/templates/banner-logo-extrude/assets/manifest.json +13 -0
  321. package/templates/banner-logo-extrude/preview.png +0 -0
  322. package/templates/banner-logo-extrude/scene.json +332 -0
  323. package/templates/banner-logo-extrude/template.json +22 -0
  324. package/templates/banner-neon-title/README.md +18 -0
  325. package/templates/banner-neon-title/agent3d.json +8 -0
  326. package/templates/banner-neon-title/preview.png +0 -0
  327. package/templates/banner-neon-title/scene.json +494 -0
  328. package/templates/banner-neon-title/template.json +25 -0
  329. package/templates/banner-wave-grid/README.md +18 -0
  330. package/templates/banner-wave-grid/agent3d.json +8 -0
  331. package/templates/banner-wave-grid/preview.png +0 -0
  332. package/templates/banner-wave-grid/scene.json +217 -0
  333. package/templates/banner-wave-grid/template.json +23 -0
  334. package/templates/card-hover-3d/README.md +16 -0
  335. package/templates/card-hover-3d/agent3d.json +8 -0
  336. package/templates/card-hover-3d/preview.png +0 -0
  337. package/templates/card-hover-3d/scene.json +359 -0
  338. package/templates/card-hover-3d/template.json +21 -0
  339. package/templates/card-product-tilt/README.md +14 -0
  340. package/templates/card-product-tilt/agent3d.json +8 -0
  341. package/templates/card-product-tilt/preview.png +0 -0
  342. package/templates/card-product-tilt/scene.json +296 -0
  343. package/templates/card-product-tilt/template.json +23 -0
  344. package/templates/character-mascot-hero/README.md +19 -0
  345. package/templates/character-mascot-hero/agent3d.json +8 -0
  346. package/templates/character-mascot-hero/preview.png +0 -0
  347. package/templates/character-mascot-hero/scene.json +512 -0
  348. package/templates/character-mascot-hero/template.json +8 -0
  349. package/templates/character-showcase/README.md +27 -0
  350. package/templates/character-showcase/agent3d.json +8 -0
  351. package/templates/character-showcase/preview.png +0 -0
  352. package/templates/character-showcase/scene.json +440 -0
  353. package/templates/character-showcase/template.json +24 -0
  354. package/templates/diorama-city/README.md +21 -0
  355. package/templates/diorama-city/agent3d.json +8 -0
  356. package/templates/diorama-city/preview.png +0 -0
  357. package/templates/diorama-city/scene.json +432 -0
  358. package/templates/diorama-city/template.json +21 -0
  359. package/templates/game-basket/README.md +25 -0
  360. package/templates/game-basket/agent3d.json +8 -0
  361. package/templates/game-basket/preview.png +0 -0
  362. package/templates/game-basket/scene.json +640 -0
  363. package/templates/game-basket/scripts/basket.js +176 -0
  364. package/templates/game-basket/template.json +8 -0
  365. package/templates/game-coin-collector/README.md +28 -0
  366. package/templates/game-coin-collector/agent3d.json +8 -0
  367. package/templates/game-coin-collector/preview.png +0 -0
  368. package/templates/game-coin-collector/scene.json +900 -0
  369. package/templates/game-coin-collector/scripts/collector.js +210 -0
  370. package/templates/game-coin-collector/template.json +19 -0
  371. package/templates/game-maze/README.md +24 -0
  372. package/templates/game-maze/agent3d.json +8 -0
  373. package/templates/game-maze/preview.png +0 -0
  374. package/templates/game-maze/scene.json +315 -0
  375. package/templates/game-maze/scripts/maze.js +168 -0
  376. package/templates/game-maze/template.json +18 -0
  377. package/templates/game-physics-playground/README.md +30 -0
  378. package/templates/game-physics-playground/agent3d.json +8 -0
  379. package/templates/game-physics-playground/preview.png +0 -0
  380. package/templates/game-physics-playground/scene.json +1712 -0
  381. package/templates/game-physics-playground/scripts/playground.js +151 -0
  382. package/templates/game-physics-playground/template.json +19 -0
  383. package/templates/game-platformer/README.md +26 -0
  384. package/templates/game-platformer/agent3d.json +8 -0
  385. package/templates/game-platformer/preview.png +0 -0
  386. package/templates/game-platformer/scene.json +1063 -0
  387. package/templates/game-platformer/scripts/platformer.js +222 -0
  388. package/templates/game-platformer/template.json +8 -0
  389. package/templates/game-runner/README.md +30 -0
  390. package/templates/game-runner/agent3d.json +8 -0
  391. package/templates/game-runner/preview.png +0 -0
  392. package/templates/game-runner/scene.json +1317 -0
  393. package/templates/game-runner/scripts/runner.js +263 -0
  394. package/templates/game-runner/template.json +18 -0
  395. package/templates/game-tap-targets/README.md +21 -0
  396. package/templates/game-tap-targets/agent3d.json +8 -0
  397. package/templates/game-tap-targets/preview.png +0 -0
  398. package/templates/game-tap-targets/scene.json +924 -0
  399. package/templates/game-tap-targets/scripts/targets.js +159 -0
  400. package/templates/game-tap-targets/template.json +19 -0
  401. package/templates/hero-floating-island/README.md +18 -0
  402. package/templates/hero-floating-island/agent3d.json +8 -0
  403. package/templates/hero-floating-island/preview.png +0 -0
  404. package/templates/hero-floating-island/scene.json +658 -0
  405. package/templates/hero-floating-island/template.json +8 -0
  406. package/templates/hero-perfume-luxury/README.md +18 -0
  407. package/templates/hero-perfume-luxury/agent3d.json +8 -0
  408. package/templates/hero-perfume-luxury/preview.png +0 -0
  409. package/templates/hero-perfume-luxury/scene.json +529 -0
  410. package/templates/hero-perfume-luxury/template.json +27 -0
  411. package/templates/hero-product-turntable/README.md +16 -0
  412. package/templates/hero-product-turntable/agent3d.json +8 -0
  413. package/templates/hero-product-turntable/preview.png +0 -0
  414. package/templates/hero-product-turntable/scene.json +225 -0
  415. package/templates/hero-product-turntable/template.json +21 -0
  416. package/templates/hero-saas-globe/README.md +16 -0
  417. package/templates/hero-saas-globe/agent3d.json +8 -0
  418. package/templates/hero-saas-globe/preview.png +0 -0
  419. package/templates/hero-saas-globe/scene.json +318 -0
  420. package/templates/hero-saas-globe/template.json +24 -0
  421. package/templates/hero-scroll-story/README.md +26 -0
  422. package/templates/hero-scroll-story/agent3d.json +8 -0
  423. package/templates/hero-scroll-story/preview.png +0 -0
  424. package/templates/hero-scroll-story/scene.json +642 -0
  425. package/templates/hero-scroll-story/template.json +22 -0
  426. package/templates/hero-sneaker-showcase/README.md +19 -0
  427. package/templates/hero-sneaker-showcase/agent3d.json +8 -0
  428. package/templates/hero-sneaker-showcase/preview.png +0 -0
  429. package/templates/hero-sneaker-showcase/scene.json +523 -0
  430. package/templates/hero-sneaker-showcase/template.json +23 -0
  431. package/templates/hero-space-planet/README.md +17 -0
  432. package/templates/hero-space-planet/agent3d.json +8 -0
  433. package/templates/hero-space-planet/preview.png +0 -0
  434. package/templates/hero-space-planet/scene.json +330 -0
  435. package/templates/hero-space-planet/template.json +21 -0
  436. package/templates/landscape-island/README.md +21 -0
  437. package/templates/landscape-island/agent3d.json +8 -0
  438. package/templates/landscape-island/preview.png +0 -0
  439. package/templates/landscape-island/scene.json +716 -0
  440. package/templates/landscape-island/template.json +24 -0
  441. package/templates/landscape-night-galaxy/README.md +25 -0
  442. package/templates/landscape-night-galaxy/agent3d.json +8 -0
  443. package/templates/landscape-night-galaxy/preview.png +0 -0
  444. package/templates/landscape-night-galaxy/scene.json +403 -0
  445. package/templates/landscape-night-galaxy/template.json +8 -0
  446. package/templates/landscape-valley-sunset/README.md +20 -0
  447. package/templates/landscape-valley-sunset/agent3d.json +8 -0
  448. package/templates/landscape-valley-sunset/preview.png +0 -0
  449. package/templates/landscape-valley-sunset/scene.json +265 -0
  450. package/templates/landscape-valley-sunset/template.json +22 -0
  451. package/templates/scene-cozy-room/README.md +21 -0
  452. package/templates/scene-cozy-room/agent3d.json +8 -0
  453. package/templates/scene-cozy-room/preview.png +0 -0
  454. package/templates/scene-cozy-room/scene.json +728 -0
  455. package/templates/scene-cozy-room/template.json +8 -0
@@ -0,0 +1 @@
1
+ import{l as e,o as t,r as n}from"./catalog-DL6sgPay.js";var r=[`low`,`medium`,`high`,`ultra`],i=/* @__PURE__ */ new Set([`strength`,`intensity`,`darkness`,`amount`,`toning`,`streaks`,`ghosts`,`halo`,`bleach`,`scanlines`]);function a(e){if(!e?.length)return[];let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let a of e){if(!a||typeof a.type!=`string`)continue;if(a.type!==`look`){n.has(a.type)||n.set(a.type,a);continue}let e=t[String(a.preset??`cinematic`)];if(!e)continue;let o=typeof a.intensity==`number`?Math.max(0,Math.min(1,a.intensity)):1;for(let t of e.effects){if(r.has(t.type))continue;let e={...t};if(o!==1){for(let[n,r]of Object.entries(t))i.has(n)&&typeof r==`number`&&(e[n]=r*o);t.type===`grading`&&t.look&&(e.intensity=o)}r.set(t.type,e)}}let a=[],o=/* @__PURE__ */ new Set,s=e=>{if(o.has(e))return;o.add(e);let t=n.get(e),i=r.get(e);a.push(t&&i?{...i,...t}:t??i)};for(let r of e)if(r&&typeof r.type==`string`){if(r.type!==`look`)s(r.type);else for(let e of t[String(r.preset??`cinematic`)]?.effects??[])n.has(e.type)||s(e.type)}return a}function o(e){let t={exposure:0,contrast:1,saturation:1,vibrance:0,temperature:0,tint:0,lift:0,gamma:1,gain:1,toning:0,bleach:0},r=e.look&&e.look!==`none`?n[e.look]:void 0,i=typeof e.intensity==`number`?Math.max(0,Math.min(1,e.intensity)):1,a={...t};if(r)for(let[e,n]of Object.entries(r.values))a[e]=typeof n==`number`?t[e]+(n-t[e])*i:n;for(let[t,n]of Object.entries(e))t!==`type`&&t!==`look`&&t!==`intensity`&&(typeof n==`number`||typeof n==`string`)&&(a[t]=n);return a}var s={low:0,medium:1,high:2};function c(e){switch(e){case`low`:return{tier:e,dprCap:1,msaa:0,effectScale:.5,maxCost:`medium`,aoSamples:8,dofSamples:16,rays:24,maxStillSamples:4};case`medium`:return{tier:e,dprCap:1.5,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:12,dofSamples:24,rays:32,maxStillSamples:8};case`ultra`:return{tier:e,dprCap:3,msaa:8,effectScale:1,maxCost:`high`,aoSamples:24,dofSamples:64,rays:64,maxStillSamples:64};default:return{tier:`high`,dprCap:2,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:16,dofSamples:40,rays:48,maxStillSamples:32}}}function l(e,t={}){return e&&e!==`auto`?e:t.deterministic?`high`:t.gpu&&/swiftshader|llvmpipe|softpipe|software|microsoft basic render/i.test(t.gpu)?`low`:t.mobile?(t.memoryGb??4)<=2||(t.cores??8)<=4?`low`:`medium`:t.cores!==void 0&&t.cores<=2||t.memoryGb!==void 0&&t.memoryGb<=2?`low`:t.cores!==void 0&&t.cores<=4||t.memoryGb!==void 0&&t.memoryGb<=4||t.gpu&&/intel|mali|adreno|powervr/i.test(t.gpu)?`medium`:`high`}function u(e){let t=r.indexOf(e);return t>0?r[t-1]:null}function d(t){return e(`postfx`,t)?.gpu??`low`}function f(e,t){let n=s[c(t).maxCost],r=[],i=[];for(let t of a(e))s[d(t.type)]>n?i.push(t.type):r.push(t);return{active:r,dropped:i}}export{o as a,c as i,a as n,l as o,u as r,f as t};
@@ -0,0 +1 @@
1
+ function e(e){let t=(Math.floor(e)|0)^2654435769,n=()=>{t=t+2654435769|0;let e=t;return e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^e>>>16)>>>0},r=n(),i=n(),a=n(),o=n(),s=()=>{r>>>=0,i>>>=0,a>>>=0,o>>>=0;let e=(r+i|0)+o|0;return o=o+1|0,r=i^i>>>9,i=a+(a<<3)|0,a=a<<21|a>>>11,a=a+e|0,(e>>>0)/4294967296};for(let e=0;e<12;e++)s();return{next:s,range:(e,t)=>e+(t-e)*s(),int:(e,t)=>e+Math.floor(s()*(t-e+1)),pick:e=>e[Math.floor(s()*e.length)]}}function t(e,t){let n=(e|0)^2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}var n=/* @__PURE__ */ new Uint8Array(512),r=/* @__PURE__ */ new Uint8Array(512);{let t=/* @__PURE__ */ new Uint8Array(256);for(let e=0;e<256;e++)t[e]=e;let i=e(1337);for(let e=255;e>0;e--){let n=Math.floor(i.next()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}for(let e=0;e<512;e++)n[e]=t[e&255],r[e]=n[e]%12}var i=new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),a=.5*(Math.sqrt(3)-1),o=(3-Math.sqrt(3))/6;function s(e,t){let s=(e+t)*a,c=Math.floor(e+s),l=Math.floor(t+s),u=(c+l)*o,d=e-(c-u),f=t-(l-u),p=+(d>f),m=d>f?0:1,h=d-p+o,g=f-m+o,_=d-1+2*o,v=f-1+2*o,y=c&255,b=l&255,x=0,S=.5-d*d-f*f;if(S>0){let e=r[y+n[b]]*3;S*=S,x+=S*S*(i[e]*d+i[e+1]*f)}let C=.5-h*h-g*g;if(C>0){let e=r[y+p+n[b+m]]*3;C*=C,x+=C*C*(i[e]*h+i[e+1]*g)}let w=.5-_*_-v*v;if(w>0){let e=r[y+1+n[b+1]]*3;w*=w,x+=w*w*(i[e]*_+i[e+1]*v)}return 70*x}var c=1/3,l=1/6;function u(e,t,a){let o=(e+t+a)*c,s=Math.floor(e+o),u=Math.floor(t+o),d=Math.floor(a+o),f=(s+u+d)*l,p=e-(s-f),m=t-(u-f),h=a-(d-f),g,_,v,y,b,x;p>=m?m>=h?[g,_,v,y,b,x]=[1,0,0,1,1,0]:p>=h?[g,_,v,y,b,x]=[1,0,0,1,0,1]:[g,_,v,y,b,x]=[0,0,1,1,0,1]:m<h?[g,_,v,y,b,x]=[0,0,1,0,1,1]:p<h?[g,_,v,y,b,x]=[0,1,0,0,1,1]:[g,_,v,y,b,x]=[0,1,0,1,1,0];let S=p-g+l,C=m-_+l,w=h-v+l,T=p-y+2*l,E=m-b+2*l,D=h-x+2*l,O=p-1+3*l,k=m-1+3*l,A=h-1+3*l,j=s&255,M=u&255,N=d&255,P=0,F=(e,t,n,r)=>{let a=.6-e*e-t*t-n*n;if(a>0){let o=r*3;a*=a,P+=a*a*(i[o]*e+i[o+1]*t+i[o+2]*n)}};return F(p,m,h,r[j+n[M+n[N]]]),F(S,C,w,r[j+g+n[M+_+n[N+v]]]),F(T,E,D,r[j+y+n[M+b+n[N+x]]]),F(O,k,A,r[j+1+n[M+1+n[N+1]]]),32*P}function d(e,t,n,r=2,i=.5){let a=0,o=1,c=1,l=0;for(let u=0;u<n;u++)a+=o*s(e*c+u*17.31,t*c-u*9.17),l+=o,o*=i,c*=r;return l>0?a/l:0}function f(e,t,n,r,i=2,a=.5){let o=0,s=1,c=1,l=0;for(let d=0;d<r;d++)o+=s*u(e*c+d*17.31,t*c-d*9.17,n*c+d*3.7),l+=s,s*=a,c*=i;return l>0?o/l:0}function p(e,t,n,r=2,i=.5){let a=0,o=1,c=1,l=0;for(let u=0;u<n;u++){let n=1-Math.abs(s(e*c+u*31.7,t*c+u*11.3));a+=o*n*n,l+=o,o*=i,c*=r}return l>0?a/l:0}export{s as a,t as i,d as n,u as o,f as r,p as s,e as t};
@@ -0,0 +1,443 @@
1
+ import{Nn as e,Pn as t,in as n,x as r}from"./three.module-W4hp4qHb.js";import{r as i}from"./params-DdApDOBw.js";import{n as a,t as o}from"./meshGradient.glsl-BMatplLA.js";var s=`
2
+ varying vec2 vUv;
3
+ varying vec3 vPos;
4
+ varying vec3 vNormalV;
5
+ varying vec3 vViewDir;
6
+ void main() {
7
+ vUv = uv;
8
+ vPos = position;
9
+ vec4 mv = modelViewMatrix * vec4(position, 1.0);
10
+ vNormalV = normalize(normalMatrix * normal);
11
+ vViewDir = normalize(-mv.xyz);
12
+ gl_Position = projectionMatrix * mv;
13
+ }`,c=`
14
+ uniform vec3 uColors[6];
15
+ uniform int uCount;
16
+ vec3 palette(float t) {
17
+ t = clamp(t, 0.0, 1.0) * float(uCount - 1);
18
+ int i = int(floor(t));
19
+ float f = t - float(i);
20
+ vec3 a = uColors[0];
21
+ vec3 b = uColors[0];
22
+ for (int k = 0; k < 6; k++) {
23
+ if (k == i) a = uColors[k];
24
+ if (k == i + 1) b = uColors[k];
25
+ }
26
+ if (i >= uCount - 1) b = a;
27
+ return mix(a, b, f);
28
+ }
29
+ // cyclic palette (wraps last → first)
30
+ vec3 paletteCycle(float t) {
31
+ t = fract(t) * float(uCount);
32
+ int i = int(floor(t));
33
+ float f = smoothstep(0.0, 1.0, t - float(i));
34
+ vec3 a = uColors[0];
35
+ vec3 b = uColors[0];
36
+ for (int k = 0; k < 6; k++) {
37
+ if (k == i) a = uColors[k];
38
+ if (k == i + 1) b = uColors[k];
39
+ }
40
+ if (i + 1 >= uCount) b = uColors[0];
41
+ return mix(a, b, f);
42
+ }
43
+ `,l=`
44
+ #include <tonemapping_fragment>
45
+ #include <colorspace_fragment>
46
+ `;function u(e){return{uColors:{value:Array.from({length:6},(t,n)=>(e[Math.min(n,e.length-1)]??new r(`#ffffff`)).clone())},uCount:{value:Math.max(1,Math.min(6,e.length))}}}function d(e,t,a,o,c={}){return{create(l,d){let f={uTime:{value:0},...a(i(e,l,d))},p=new n({uniforms:f,vertexShader:s,fragmentShader:t,...c});return p.name=`shader:${e}`,p.userData.shader=e,p.userData.setParam=(t,n)=>{let a=o[t];if(!a||!f[a])return;if(t===`colors`){let t=u(i(e,{colors:n},d).colors(`colors`));f.uColors.value=t.uColors.value,f.uCount.value=t.uCount.value;return}let s=f[a].value;s instanceof r?typeof n==`string`&&s.copy(d.color(n)):typeof n==`number`&&(f[a].value=n)},{material:p,update(e){f.uTime.value=e}}}}}var f=`
47
+ float h21(vec2 p) { vec3 q = fract(vec3(p.xyx) * 0.1031); q += dot(q, q.yzx + 33.33); return fract((q.x + q.y) * q.z); }
48
+ vec2 h22(vec2 p) { vec3 q = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973)); q += dot(q, q.yzx + 33.33); return fract((q.xx + q.yz) * q.zy); }
49
+ `,p={gradientMesh:d(`gradientMesh`,`
50
+ uniform float uTime;
51
+ uniform float uSpeed;
52
+ uniform float uGrain;
53
+ varying vec2 vUv;
54
+ ${a}
55
+ ${o}
56
+ void main() {
57
+ float t = uTime * uSpeed;
58
+ vec3 col = meshGradient((vUv - 0.5) * 1.6, t);
59
+ col += mgGrain(gl_FragCoord.xy, uTime) * uGrain;
60
+ gl_FragColor = vec4(col, 1.0);
61
+ ${l}
62
+ }`,t=>{let n=u(t.colors(`colors`));return{...n,uMgColors:n.uColors,uMgCount:n.uCount,uMgScale:{value:t.num(`scale`)},uMgSeed:{value:1},uMgSpread:{value:new e(1,1)},uSpeed:{value:t.num(`speed`)},uGrain:{value:t.num(`grain`)}}},{colors:`uColors`,speed:`uSpeed`,scale:`uMgScale`,grain:`uGrain`},{toneMapped:!1}),aurora:d(`aurora`,`
63
+ uniform float uTime;
64
+ uniform float uSpeed;
65
+ uniform float uIntensity;
66
+ uniform vec3 uBg;
67
+ varying vec2 vUv;
68
+ ${a}
69
+ ${c}
70
+ ${f}
71
+ void main() {
72
+ float t = uTime * uSpeed;
73
+ vec2 uv = vUv;
74
+ vec3 col = uBg * (0.6 + 0.4 * uv.y);
75
+ // Stars
76
+ vec2 sc = floor(uv * vec2(220.0, 90.0));
77
+ float s = h21(sc);
78
+ if (s > 0.985) col += vec3(smoothstep(0.35, 0.0, length(fract(uv * vec2(220.0, 90.0)) - 0.5))) * (s - 0.985) * 40.0 * (0.6 + 0.4 * sin(uTime * 2.0 + s * 50.0));
79
+ for (int i = 0; i < 3; i++) {
80
+ float fi = float(i);
81
+ float line = 0.42 + fi * 0.1 + 0.13 * snoise(vec3(uv.x * 1.3 + fi * 3.1, t * 0.25 + fi, fi * 7.0)) + 0.05 * snoise(vec3(uv.x * 4.0, t * 0.4, fi));
82
+ float d = uv.y - line;
83
+ float shape = d > 0.0 ? exp(-d * (5.0 + fi * 2.0)) : exp(d * 45.0);
84
+ float rays = 0.45 + 0.55 * smoothstep(-0.3, 0.8, snoise(vec3(uv.x * 26.0 + fi * 11.0, t * 0.6, fi * 2.0)));
85
+ float fade = smoothstep(0.0, 0.25, uv.x) * smoothstep(1.0, 0.75, uv.x) * 0.6 + 0.4;
86
+ vec3 c = palette(clamp(fi / 2.0 + d * 1.5, 0.0, 1.0));
87
+ col += c * shape * rays * fade * uIntensity * 0.55;
88
+ }
89
+ gl_FragColor = vec4(col, 1.0);
90
+ ${l}
91
+ }`,e=>({...u(e.colors(`colors`)),uSpeed:{value:e.num(`speed`)},uIntensity:{value:e.num(`intensity`)},uBg:{value:e.color(`background`)}}),{colors:`uColors`,speed:`uSpeed`,intensity:`uIntensity`,background:`uBg`}),liquidChrome:d(`liquidChrome`,`
92
+ uniform float uTime;
93
+ uniform float uSpeed;
94
+ uniform float uScale;
95
+ varying vec2 vUv;
96
+ varying vec3 vNormalV;
97
+ varying vec3 vViewDir;
98
+ ${a}
99
+ ${c}
100
+ float field(vec2 p, float t) {
101
+ vec2 q = vec2(snoise(vec3(p * 0.8, t)), snoise(vec3(p * 0.8 + 5.2, t * 1.1)));
102
+ return snoise(vec3(p + q * 1.2, t * 0.6)) * 0.6 + snoise(vec3(p * 2.0 - q, t * 0.8)) * 0.25;
103
+ }
104
+ void main() {
105
+ float t = uTime * uSpeed;
106
+ vec2 p = (vUv - 0.5) * 3.0 * uScale;
107
+ float e = 0.02;
108
+ float h = field(p, t);
109
+ float hx = field(p + vec2(e, 0.0), t) - h;
110
+ float hy = field(p + vec2(0.0, e), t) - h;
111
+ vec3 n = normalize(vec3(-hx / e * 0.35, -hy / e * 0.35, 1.0));
112
+ // Bend by the mesh normal so curved surfaces read as curved.
113
+ n = normalize(n + vec3(vNormalV.xy, 0.0) * 0.6);
114
+ vec3 r = reflect(vec3(0.0, 0.0, -1.0), n);
115
+ float k = clamp(r.y * 0.55 + 0.5 + h * 0.18, 0.0, 1.0);
116
+ vec3 col = palette(k);
117
+ // Studio horizon line: wider, softer and antialiased (its width never drops
118
+ // under ~1.5 px of r.y change, so steep normals don't alias into hairlines).
119
+ float hw = 0.035 + fwidth(r.y) * 1.5;
120
+ float horizon = (1.0 - smoothstep(0.0, hw, abs(r.y + 0.05))) * 0.45;
121
+ float spec = pow(max(dot(r, normalize(vec3(0.35, 0.6, 0.7))), 0.0), 60.0) * 2.0;
122
+ col += vec3(horizon + spec);
123
+ gl_FragColor = vec4(col, 1.0);
124
+ ${l}
125
+ }`,e=>({...u(e.colors(`colors`)),uSpeed:{value:e.num(`speed`)},uScale:{value:e.num(`scale`)}}),{colors:`uColors`,speed:`uSpeed`,scale:`uScale`}),nebula:d(`nebula`,`
126
+ uniform float uTime;
127
+ uniform float uSpeed;
128
+ uniform float uStars;
129
+ uniform float uScale;
130
+ varying vec2 vUv;
131
+ ${a}
132
+ ${c}
133
+ ${f}
134
+ float stars(vec2 uv, float density, float seed) {
135
+ vec2 g = uv * density;
136
+ vec2 id = floor(g);
137
+ vec2 off = h22(id + seed) - 0.5;
138
+ float b = h21(id + seed * 3.1);
139
+ float d = length(fract(g) - 0.5 - off * 0.7);
140
+ return smoothstep(0.08 + b * 0.06, 0.0, d) * step(0.72, b) * (0.5 + b);
141
+ }
142
+ void main() {
143
+ float t = uTime * uSpeed;
144
+ vec2 p = (vUv - 0.5) * 1.3 * uScale;
145
+ vec2 w = vec2(fbm(vec3(p, t)), fbm(vec3(p + 4.3, t * 1.2)));
146
+ float n = fbm(vec3(p + w * 1.6, t * 0.5));
147
+ float n2 = fbm(vec3(p * 2.2 - w, t * 0.7 + 3.0));
148
+ float gas = smoothstep(-0.35, 0.75, n);
149
+ vec3 col = palette(clamp(gas * 0.85 + n2 * 0.2, 0.0, 1.0)) * (0.25 + gas * 1.1);
150
+ col += palette(1.0) * pow(max(n2, 0.0), 3.0) * 0.8;
151
+ col *= 0.9 + 0.1 * smoothstep(-0.5, 0.5, n2);
152
+ float st = stars(vUv + t * 0.02, 90.0, 1.0) + stars(vUv * 1.7 + t * 0.01, 140.0, 7.0) * 0.6 + stars(vUv, 40.0, 13.0) * 1.4;
153
+ col += vec3(st) * uStars * (0.8 + 0.2 * sin(uTime * 3.0 + vUv.x * 60.0));
154
+ gl_FragColor = vec4(col, 1.0);
155
+ ${l}
156
+ }`,e=>({...u(e.colors(`colors`)),uSpeed:{value:e.num(`speed`)},uStars:{value:e.num(`stars`)},uScale:{value:e.num(`scale`)}}),{colors:`uColors`,speed:`uSpeed`,stars:`uStars`,scale:`uScale`}),caustics:d(`caustics`,`
157
+ uniform float uTime;
158
+ uniform float uSpeed;
159
+ uniform float uScale;
160
+ uniform float uIntensity;
161
+ uniform vec3 uColor;
162
+ uniform vec3 uBg;
163
+ varying vec2 vUv;
164
+ ${a}
165
+ ${f}
166
+ // Animated Voronoi: thin bright lines where two cells meet.
167
+ float cells(vec2 p, float t) {
168
+ vec2 ip = floor(p);
169
+ vec2 fp = fract(p);
170
+ float f1 = 8.0, f2 = 8.0;
171
+ for (int j = -1; j <= 1; j++) for (int i = -1; i <= 1; i++) {
172
+ vec2 g = vec2(float(i), float(j));
173
+ vec2 o = h22(ip + g);
174
+ o = 0.5 + 0.45 * sin(t + 6.2831 * o);
175
+ float d = length(g + o - fp);
176
+ if (d < f1) { f2 = f1; f1 = d; } else if (d < f2) f2 = d;
177
+ }
178
+ return f2 - f1;
179
+ }
180
+ void main() {
181
+ float t = uTime * uSpeed;
182
+ vec2 p = vUv * uScale * 2.0;
183
+ p += 0.15 * vec2(snoise(vec3(p * 0.6, t * 0.3)), snoise(vec3(p * 0.6 + 9.0, t * 0.3)));
184
+ float a = cells(p, t * 1.3);
185
+ float b = cells(p * 1.35 + 3.7, -t * 1.1);
186
+ float c = pow(smoothstep(0.22, 0.0, a), 2.5) + pow(smoothstep(0.18, 0.0, b), 2.5) * 0.7;
187
+ vec3 col = uBg * (0.85 + 0.15 * snoise(vec3(vUv * 3.0, t * 0.2)));
188
+ col += uColor * c * uIntensity;
189
+ gl_FragColor = vec4(col, 1.0);
190
+ ${l}
191
+ }`,e=>({uSpeed:{value:e.num(`speed`)},uScale:{value:e.num(`scale`)},uIntensity:{value:e.num(`intensity`)},uColor:{value:e.color(`color`)},uBg:{value:e.color(`background`)}}),{speed:`uSpeed`,scale:`uScale`,intensity:`uIntensity`,color:`uColor`,background:`uBg`}),fresnelGlow:d(`fresnelGlow`,`
192
+ uniform float uTime;
193
+ uniform float uPower;
194
+ uniform float uIntensity;
195
+ uniform float uPulse;
196
+ uniform vec3 uColor;
197
+ uniform vec3 uCore;
198
+ varying vec3 vNormalV;
199
+ varying vec3 vViewDir;
200
+ void main() {
201
+ vec3 n = normalize(vNormalV);
202
+ if (!gl_FrontFacing) n = -n;
203
+ float f = pow(1.0 - clamp(abs(dot(n, normalize(vViewDir))), 0.0, 1.0), uPower);
204
+ float pulse = uPulse > 0.0 ? 0.8 + 0.2 * sin(uTime * uPulse * 6.2831) : 1.0;
205
+ vec3 col = uCore + uColor * f * uIntensity * pulse;
206
+ gl_FragColor = vec4(col, 1.0);
207
+ ${l}
208
+ }`,e=>({uPower:{value:e.num(`power`)},uIntensity:{value:e.num(`intensity`)},uPulse:{value:e.num(`pulse`)},uColor:{value:e.color(`color`)},uCore:{value:e.color(`core`)}}),{power:`uPower`,intensity:`uIntensity`,pulse:`uPulse`,color:`uColor`,core:`uCore`},{transparent:!0,blending:2,depthWrite:!1}),iridescentFoil:d(`iridescentFoil`,`
209
+ uniform float uTime;
210
+ uniform float uSpeed;
211
+ uniform float uScale;
212
+ uniform float uSparkle;
213
+ uniform vec3 uTint;
214
+ varying vec2 vUv;
215
+ varying vec3 vNormalV;
216
+ varying vec3 vViewDir;
217
+ ${a}
218
+ ${f}
219
+ vec3 hsv(float h, float s, float v) { vec3 k = clamp(abs(fract(h + vec3(0.0, 2.0 / 3.0, 1.0 / 3.0)) * 6.0 - 3.0) - 1.0, 0.0, 1.0); return v * mix(vec3(1.0), k, s); }
220
+ void main() {
221
+ float t = uTime * uSpeed;
222
+ vec3 n = normalize(vNormalV);
223
+ vec3 v = normalize(vViewDir);
224
+ float ndv = dot(n, v);
225
+ float wob = snoise(vec3(vUv * 3.0, t * 0.5)) * 0.25;
226
+ float hue = fract(ndv * uScale * 0.6 + vUv.x * 0.35 * uScale + vUv.y * 0.2 + t * 0.15 + wob);
227
+ vec3 col = hsv(hue, 0.5, 1.0) * uTint;
228
+ col *= 0.65 + 0.35 * pow(1.0 - abs(ndv), 0.5);
229
+ vec2 g = vUv * 180.0;
230
+ vec2 id = floor(g);
231
+ float r = h21(id);
232
+ float tw = pow(max(sin(uTime * (2.0 + r * 5.0) + r * 40.0 + ndv * 20.0), 0.0), 16.0);
233
+ col += vec3(step(1.0 - uSparkle * 0.25, r) * tw * smoothstep(0.5, 0.0, length(fract(g) - 0.5)) * 2.0);
234
+ float spec = pow(max(dot(reflect(-v, n), normalize(vec3(0.4, 0.7, 0.6))), 0.0), 30.0);
235
+ col += spec * 0.6;
236
+ gl_FragColor = vec4(col, 1.0);
237
+ ${l}
238
+ }`,e=>({uSpeed:{value:e.num(`speed`)},uScale:{value:e.num(`scale`)},uSparkle:{value:e.num(`sparkle`)},uTint:{value:e.color(`tint`)}}),{speed:`uSpeed`,scale:`uScale`,sparkle:`uSparkle`,tint:`uTint`}),lavaLamp:d(`lavaLamp`,`
239
+ uniform float uTime;
240
+ uniform float uSpeed;
241
+ uniform float uScale;
242
+ varying vec2 vUv;
243
+ ${c}
244
+ float hash1(float n) { return fract(sin(n * 127.1) * 43758.5453); }
245
+ void main() {
246
+ float t = uTime * uSpeed;
247
+ vec2 uv = vUv;
248
+ float f = 0.0;
249
+ for (int i = 0; i < 9; i++) {
250
+ float fi = float(i);
251
+ float sp = 0.05 + hash1(fi) * 0.08;
252
+ vec2 c = vec2(0.15 + 0.7 * hash1(fi + 3.3) + 0.08 * sin(t * (0.7 + hash1(fi + 1.1)) + fi), fract(hash1(fi + 7.7) + t * sp) * 1.5 - 0.25);
253
+ float r = (0.08 + 0.07 * hash1(fi + 5.5)) * uScale;
254
+ vec2 d = (uv - c) * vec2(1.6, 1.0);
255
+ f += r * r / max(dot(d, d), 1e-4);
256
+ }
257
+ float blob = smoothstep(0.85, 1.15, f);
258
+ vec3 bg = palette(0.0) * (0.7 + 0.3 * uv.y);
259
+ vec3 bc = mix(palette(0.5), palette(1.0), clamp(uv.y + (f - 1.0) * 0.08, 0.0, 1.0));
260
+ vec3 col = mix(bg, bc, blob) + palette(0.5) * clamp(f, 0.0, 1.0) * 0.18 * (1.0 - blob);
261
+ col += vec3(1.0, 0.9, 0.8) * smoothstep(1.4, 3.0, f) * 0.15;
262
+ gl_FragColor = vec4(col, 1.0);
263
+ ${l}
264
+ }`,e=>({...u(e.colors(`colors`)),uSpeed:{value:e.num(`speed`)},uScale:{value:e.num(`scale`)}}),{colors:`uColors`,speed:`uSpeed`,scale:`uScale`}),grainGradient:d(`grainGradient`,`
265
+ uniform float uTime;
266
+ uniform float uAngle;
267
+ uniform float uGrain;
268
+ uniform float uSpeed;
269
+ varying vec2 vUv;
270
+ ${a}
271
+ ${c}
272
+ ${f}
273
+ void main() {
274
+ float a = radians(uAngle);
275
+ vec2 dir = vec2(sin(a), cos(a));
276
+ float g = dot(vUv - 0.5, dir) + 0.5;
277
+ g += snoise(vec3(vUv * 1.5, 0.3 + uTime * uSpeed * 0.05)) * 0.08;
278
+ vec3 col = palette(clamp(g, 0.0, 1.0));
279
+ float n = h21(gl_FragCoord.xy + floor(uTime * uSpeed * 24.0) * 17.0) - 0.5;
280
+ col += n * uGrain;
281
+ gl_FragColor = vec4(col, 1.0);
282
+ ${l}
283
+ }`,e=>({...u(e.colors(`colors`)),uAngle:{value:e.num(`angle`)},uGrain:{value:e.num(`grain`)},uSpeed:{value:e.num(`speed`)}}),{colors:`uColors`,angle:`uAngle`,grain:`uGrain`,speed:`uSpeed`},{toneMapped:!1}),matrixRain:d(`matrixRain`,`
284
+ uniform float uTime;
285
+ uniform float uSpeed;
286
+ uniform float uColumns;
287
+ uniform vec3 uColor;
288
+ uniform vec3 uBg;
289
+ varying vec2 vUv;
290
+ ${f}
291
+ void main() {
292
+ float cols = floor(uColumns);
293
+ vec2 grid = vec2(cols, cols * 1.4);
294
+ vec2 g = vUv * grid;
295
+ vec2 cell = floor(g);
296
+ vec2 f = fract(g);
297
+ float colSeed = h21(vec2(cell.x, 3.7));
298
+ float speed = (0.35 + colSeed * 0.65) * uSpeed;
299
+ float head = fract(colSeed * 7.3 + uTime * speed * 0.35);
300
+ float y = 1.0 - (cell.y + 0.5) / grid.y;
301
+ float behind = fract(y - head + 1.0);
302
+ float trail = exp(-behind * 7.0) * step(behind, 0.6);
303
+ // 5x7 glyph from a hash, changing a few times per second.
304
+ float tick = floor(uTime * (2.0 + colSeed * 6.0) + h21(cell) * 10.0);
305
+ vec2 px = floor(f * vec2(5.0, 7.0));
306
+ float on = step(0.5, h21(cell * 13.1 + px * 1.7 + tick));
307
+ float inside = step(0.08, f.x) * step(f.x, 0.92) * step(0.06, f.y) * step(f.y, 0.94);
308
+ float glyph = on * inside;
309
+ float headGlow = smoothstep(0.035, 0.0, behind);
310
+ vec3 col = uBg + uColor * glyph * trail * 1.2 + vec3(0.85, 1.0, 0.9) * glyph * headGlow * 1.5;
311
+ gl_FragColor = vec4(col, 1.0);
312
+ ${l}
313
+ }`,e=>({uSpeed:{value:e.num(`speed`)},uColumns:{value:e.num(`columns`)},uColor:{value:e.color(`color`)},uBg:{value:e.color(`background`)}}),{speed:`uSpeed`,columns:`uColumns`,color:`uColor`,background:`uBg`})},m={plasma:d(`plasma`,`
314
+ uniform float uTime;
315
+ uniform float uSpeed;
316
+ uniform float uScale;
317
+ varying vec2 vUv;
318
+ varying vec3 vNormalV;
319
+ varying vec3 vViewDir;
320
+ ${c}
321
+ void main() {
322
+ vec2 p = (vUv - 0.5) * 10.0 * uScale;
323
+ float t = uTime * uSpeed;
324
+ float v = sin(p.x + t);
325
+ v += sin((p.y + t) * 0.5);
326
+ v += sin((p.x + p.y + t) * 0.5);
327
+ vec2 c = p + 0.5 * vec2(sin(t / 5.0), cos(t / 3.0)) * 3.0;
328
+ v += sin(sqrt(c.x * c.x + c.y * c.y + 1.0) + t);
329
+ vec3 col = paletteCycle(v * 0.22 + t * 0.05);
330
+ float rim = pow(1.0 - abs(dot(normalize(vNormalV), normalize(vViewDir))), 3.0);
331
+ gl_FragColor = vec4(col + rim * 0.15, 1.0);
332
+ ${l}
333
+ }`,e=>({...u(e.colors(`colors`)),uSpeed:{value:e.num(`speed`)},uScale:{value:e.num(`scale`)}}),{colors:`uColors`,speed:`uSpeed`,scale:`uScale`}),waves:d(`waves`,`
334
+ uniform float uTime;
335
+ uniform float uSpeed;
336
+ uniform float uFreq;
337
+ uniform vec3 uA;
338
+ uniform vec3 uB;
339
+ varying vec2 vUv;
340
+ void main() {
341
+ float t = uTime * uSpeed;
342
+ float y = vUv.y + sin(vUv.x * 6.2831 * 1.5 + t * 1.3) * 0.05 + sin(vUv.x * 6.2831 * 0.5 - t * 0.7) * 0.04;
343
+ float s = sin(y * uFreq * 6.2831 - t * 2.0);
344
+ float band = smoothstep(-0.25, 0.25, s);
345
+ vec3 col = mix(uA, uB, band);
346
+ col *= 0.9 + 0.1 * sin(y * uFreq * 3.1415 + t);
347
+ gl_FragColor = vec4(col, 1.0);
348
+ ${l}
349
+ }`,e=>{let t=e.colors(`colors`);return{uSpeed:{value:e.num(`speed`)},uFreq:{value:e.num(`frequency`)},uA:{value:t[0]},uB:{value:t[1]??t[0].clone()}}},{speed:`uSpeed`,frequency:`uFreq`}),noise:d(`noise`,`
350
+ uniform float uTime;
351
+ uniform float uSpeed;
352
+ uniform float uScale;
353
+ varying vec3 vPos;
354
+ varying vec2 vUv;
355
+ ${a}
356
+ ${c}
357
+ void main() {
358
+ float t = uTime * uSpeed;
359
+ vec3 q = vPos * uScale;
360
+ vec3 w = vec3(fbm(q + vec3(0.0, 0.0, t)), fbm(q + vec3(5.2, 1.3, -t)), 0.0);
361
+ float n = fbm(q + w * 1.5 + vec3(t * 0.3));
362
+ gl_FragColor = vec4(palette(smoothstep(-0.55, 0.55, n)), 1.0);
363
+ ${l}
364
+ }`,e=>({...u(e.colors(`colors`)),uSpeed:{value:e.num(`speed`)},uScale:{value:e.num(`scale`)}}),{colors:`uColors`,speed:`uSpeed`,scale:`uScale`}),hologram:d(`hologram`,`
365
+ uniform float uTime;
366
+ uniform float uSpeed;
367
+ uniform float uLines;
368
+ uniform vec3 uColor;
369
+ varying vec3 vNormalV;
370
+ varying vec3 vViewDir;
371
+ varying vec3 vPos;
372
+ float hash(float x) { return fract(sin(x * 91.17) * 43758.5453); }
373
+ void main() {
374
+ float t = uTime * uSpeed;
375
+ float fres = pow(1.0 - abs(dot(normalize(vNormalV), normalize(vViewDir))), 2.0);
376
+ float lines = 0.55 + 0.45 * sin((vPos.y * uLines - t * 4.0) * 3.14159);
377
+ float band = smoothstep(0.0, 0.08, fract(vPos.y * 0.6 - t * 0.35)) * (1.0 - smoothstep(0.08, 0.2, fract(vPos.y * 0.6 - t * 0.35)));
378
+ float flicker = 0.92 + 0.08 * hash(floor(t * 18.0));
379
+ float a = (0.12 + fres * 0.9) * lines * flicker + band * 0.35;
380
+ vec3 col = uColor * (0.6 + fres * 1.2) + band * 0.4;
381
+ gl_FragColor = vec4(col * a, a);
382
+ ${l}
383
+ }`,e=>({uColor:{value:e.color(`color`)},uSpeed:{value:e.num(`speed`)},uLines:{value:e.num(`lines`)/10}}),{color:`uColor`,speed:`uSpeed`,lines:`uLines`},{transparent:!0,blending:2,depthWrite:!1,side:2}),gradientFlow:d(`gradientFlow`,`
384
+ uniform float uTime;
385
+ uniform float uSpeed;
386
+ varying vec2 vUv;
387
+ varying vec3 vNormalV;
388
+ varying vec3 vViewDir;
389
+ ${a}
390
+ ${c}
391
+ void main() {
392
+ float t = uTime * uSpeed;
393
+ vec2 p = vUv * 1.6;
394
+ float n = snoise(vec3(p * 1.2, t * 0.5)) * 0.5 + snoise(vec3(p * 2.4 + 3.0, t * 0.7)) * 0.25;
395
+ float g = vUv.x * 0.55 + vUv.y * 0.35 + n * 0.45 + t * 0.08 + dot(vNormalV, vec3(0.2, 0.3, 0.0));
396
+ vec3 col = paletteCycle(g);
397
+ float rim = pow(1.0 - abs(dot(normalize(vNormalV), normalize(vViewDir))), 2.5);
398
+ gl_FragColor = vec4(col + rim * 0.08, 1.0);
399
+ ${l}
400
+ }`,e=>({...u(e.colors(`colors`)),uSpeed:{value:e.num(`speed`)}}),{colors:`uColors`,speed:`uSpeed`}),toonRim:d(`toonRim`,`
401
+ uniform float uTime;
402
+ uniform vec3 uColor;
403
+ uniform vec3 uRim;
404
+ uniform float uSteps;
405
+ uniform vec3 uLightDir;
406
+ varying vec3 vNormalV;
407
+ varying vec3 vViewDir;
408
+ void main() {
409
+ vec3 n = normalize(vNormalV);
410
+ vec3 l = normalize((viewMatrix * vec4(uLightDir, 0.0)).xyz);
411
+ float d = max(dot(n, l), 0.0);
412
+ float q = floor(d * uSteps + 0.5) / uSteps;
413
+ vec3 shadow = uColor * vec3(0.42, 0.4, 0.55);
414
+ vec3 col = mix(shadow, uColor, q);
415
+ vec3 h = normalize(l + normalize(vViewDir));
416
+ float spec = step(0.94, dot(n, h));
417
+ float rim = smoothstep(0.62, 0.72, 1.0 - max(dot(n, normalize(vViewDir)), 0.0)) * (0.35 + 0.65 * d);
418
+ col = mix(col, uRim, rim * 0.85) + spec * 0.25;
419
+ gl_FragColor = vec4(col, 1.0);
420
+ ${l}
421
+ }`,e=>({uColor:{value:e.color(`color`)},uRim:{value:e.color(`rim`)},uSteps:{value:e.int(`steps`)},uLightDir:{value:new t(.5,.85,.6).normalize()}}),{color:`uColor`,rim:`uRim`,steps:`uSteps`}),dissolve:d(`dissolve`,`
422
+ uniform float uTime;
423
+ uniform vec3 uColor;
424
+ uniform vec3 uEdge;
425
+ uniform float uProgress;
426
+ varying vec3 vPos;
427
+ varying vec3 vNormalV;
428
+ varying vec3 vViewDir;
429
+ ${a}
430
+ void main() {
431
+ float n = fbm(vPos * 2.2) * 0.5 + 0.5;
432
+ float p = uProgress * 1.15 - 0.075;
433
+ if (n < p) discard;
434
+ float e = 1.0 - smoothstep(0.0, 0.06, n - p);
435
+ vec3 nn = normalize(vNormalV);
436
+ if (!gl_FrontFacing) nn = -nn;
437
+ vec3 l = normalize(vec3(0.4, 0.8, 0.6));
438
+ float d = max(dot(nn, l), 0.0) * 0.75 + 0.3;
439
+ vec3 col = uColor * d;
440
+ col = mix(col, uEdge * 2.2, e * step(0.001, uProgress));
441
+ gl_FragColor = vec4(col, 1.0);
442
+ ${l}
443
+ }`,e=>({uColor:{value:e.color(`color`)},uEdge:{value:e.color(`edge`)},uProgress:{value:e.num(`progress`)}}),{color:`uColor`,edge:`uEdge`,progress:`uProgress`},{side:2}),...p};export{m as SHADER_IMPLS};
@@ -0,0 +1 @@
1
+ import{I as e,Nn as t,P as n,U as r,bt as i,d as a,h as o,m as s,sn as c,tn as l,x as u}from"./three.module-W4hp4qHb.js";import{l as d,n as f,o as p}from"./materials-C2uffFEd.js";import{c as m}from"./util-THUewKBk.js";import{i as h,n as g,r as _,t as v}from"./extrude-m04mghOS.js";var y=e=>!!e&&e!==`none`&&e!==`transparent`;function b(e,t,n){if(e===`currentColor`)return n;let r=/^url\(\s*['"]?#([^'")]+)['"]?\s*\)/.exec(e);if(r){let e=t.userData?.gradients?.[r[1]]?.stops??[];if(!e.length)return n;let i=new u(e[0].color),a=new u(e[e.length-1].color);return`#${i.lerp(a,.5).getHexString()}`}try{let t=new u;return t.setStyle(e,l),`#${t.getHexString(l)}`}catch{return n}}function x(e,t){let n=new a;for(let t of e.paths)for(let e of t.subPaths)for(let t of e.getPoints(4))n.expandByPoint(t);return(n.isEmpty()?100:Math.max(n.max.x-n.min.x,n.max.y-n.min.y,1e-6))/(t*10)}function S(e,t,n={}){let r=[],i=Math.max(1,Math.round(m(n.curveSegments,12))),a=x(e,i),o=n.currentColor??`#1f2330`;for(let s of e.paths){let e=s.userData?.style??{};if(e.visibility===`hidden`||e.visibility===`collapse`)continue;let c=m(e.opacity,1);if(y(e.fill)){let t=s.toShapes().map(e=>_(e,a));t.length&&r.push({kind:`fill`,color:b(e.fill,s,o),opacity:m(e.fillOpacity,1)*c,shapes:t})}if(n.strokes!==!1&&y(e.stroke)&&m(e.strokeWidth,1)>0){let n=t.getStrokeStyle(m(e.strokeWidth,1),`#000`,e.strokeLineJoin??`miter`,e.strokeLineCap??`butt`,m(e.strokeMiterLimit,4)),l=[];for(let e of s.subPaths){let r=g(e,a);if(r.length<2)continue;let o=t.pointsToStroke(r,n,i);o&&l.push(o)}if(l.length){let t=l.length===1?l[0]:C(l);r.push({kind:`stroke`,color:b(e.stroke,s,o),opacity:m(e.strokeOpacity,1)*c,stroke:t})}}}return r}function C(e){let t=0;for(let n of e)t+=n.getAttribute(`position`).count;let n=new Float32Array(t*3),r=0;for(let t of e){let e=t.getAttribute(`position`).array;n.set(e,r),r+=e.length,t.dispose()}let i=new o;return i.setAttribute(`position`,new s(n,3)),i}function w(e,n=12){let r=new a;for(let i of e){if(i.shapes)for(let e of i.shapes)for(let t of e.getPoints(n))r.expandByPoint(t);if(i.stroke){let e=i.stroke.getAttribute(`position`);for(let n=0;n<e.count;n++)r.expandByPoint(new t(e.getX(n),e.getY(n)))}}return r}function T(e,t,r,i,a){if(e.kind===`stroke`)return e.stroke?v(e.stroke,t):null;if(!e.shapes?.length)return null;if(t<=0)return new c(e.shapes,i);let o=Math.min(r,t*.45),s=new n(e.shapes,{depth:Math.max(t-o*2,t*.05),curveSegments:i,bevelEnabled:o>0,bevelThickness:o,bevelSize:o*.6,bevelOffset:0,bevelSegments:3});return s.translate(0,0,o),s.clearGroups(),h(s,50*Math.PI/180,a)}async function E(t,n){let[{SVGLoader:a},o]=await Promise.all([import(`./SVGLoader-hRF0EwD-.js`),import(`./BufferGeometryUtils-Re3wQkXp.js`).then(e=>e.t)]),s=t.src.trim().startsWith(`<`)?t.src:await d(n.resolveAsset(t.src)),c=new a().parse(s),l=t.material?p(t.material):void 0,u=typeof l?.color==`string`?l.color:void 0,h=Math.max(1,Math.round(m(t.curveSegments,12))),g=S(c,a,{strokes:t.strokes,curveSegments:h,currentColor:u}),_=new r,v=w(g,h);if(!g.length||v.isEmpty())return _;let y=m(t.size,2),b=Math.max(v.max.x-v.min.x,1e-6),x=Math.max(v.max.y-v.min.y,1e-6),C=t.fit??`width`,E=y/(C===`height`?x:C===`max`?Math.max(b,x):b),D=Math.max(0,m(t.depth,.2)),O=D/E,k=m(t.bevel,0)/E,A=m(t.layerGap,D>0?D*.02:y*.002),j=t.keepColors??!t.material,M=/* @__PURE__ */ new Map,N=async(e,r)=>{let i=j?`${e}|${r}`:`|${r}`,a=M.get(i);if(!a){let o=j?{roughness:.4,metalness:.1,...t.material??{},color:e,...r<1?{opacity:r}:{}}:t.material?{...t.material,...r<1?{opacity:r}:{}}:{color:`#dddddd`,roughness:.4,metalness:.1};a=await f(o,n,{defaultColor:e}),r<1&&(a.transparent=!0),D<=0&&(a.side=2),M.set(i,a)}return a},P=[];for(let e of g){let t=T(e,O,k,h,o);if(!t)continue;t.getAttribute(`normal`)||t.computeVertexNormals();let n=j?`${e.color}|${e.opacity}`:`|${e.opacity}`,r=P[P.length-1];r&&r.key===n?r.geos.push(t):P.push({key:n,color:e.color,opacity:e.opacity,geos:[t]})}let F=new r;for(let[t,n]of P.entries()){for(let t of n.geos){for(let e of Object.keys(t.attributes))[`position`,`normal`,`uv`].includes(e)||t.deleteAttribute(e);t.getAttribute(`uv`)||t.setAttribute(`uv`,new e(new Float32Array(t.getAttribute(`position`).count*2),2))}let r=n.geos.length===1?n.geos[0]:o.mergeGeometries(n.geos.map(e=>e.index?e.toNonIndexed():e),!1)??n.geos[0],a=new i(r,await N(n.color,n.opacity));a.position.z=t*A/E,F.add(a)}let I=(v.min.x+v.max.x)/2,L=(v.min.y+v.max.y)/2;return F.scale.set(E,-E,E),F.position.set(-I*E,L*E,-(D+Math.max(0,P.length-1)*A)/2),_.add(F),_}export{E as buildSvg};
@@ -0,0 +1,2 @@
1
+ import{It as e,Nn as t,P as n,U as r,bt as i,h as a,on as o,sn as s,xt as c}from"./three.module-W4hp4qHb.js";import{c as l,n as u}from"./materials-C2uffFEd.js";import{t as d}from"./easing-CXSz2e6P.js";import{c as f}from"./util-THUewKBk.js";import{i as p,r as m}from"./extrude-m04mghOS.js";var h=/* @__PURE__ */ new Map;function g(e){let t=h.get(e);return t||(t=Promise.all([import(`./FontLoader-BocwqK8V.js`),l(e)]).then(([e,t])=>new e.FontLoader().parse(t)),t.catch(()=>h.delete(e)),h.set(e,t)),t}var _=e=>{let t=e.normalize(`NFD`);return t.length>1?t[0]:e};function v(e,t,n){let r=e.kerning;if(!r)return 0;let i=r[t]?.[n];if(i!==void 0)return i;let a=_(t),o=_(n);return a===t&&o===n?0:r[a]?.[o]??0}function y(e,t){let n=t.em/e.resolution,r=f(t.letterSpacing,0),i=f(t.lineHeight,1.25)*t.em,a=t.kerning!==!1,o=t=>(e.glyphs[t]??e.glyphs[`?`])?.ha??e.resolution*.5,s=t=>{let i=[],s=0;return t.forEach((c,l)=>{l>0&&(s+=r+(a?v(e,t[l-1],c)*n:0)),i.push(s),s+=o(c)*n}),{xs:i,width:s}},c=[],l=typeof t.maxWidth==`number`&&t.maxWidth>0?t.maxWidth:1/0;for(let e of String(t.text??``).split(`
2
+ `)){if(l===1/0){c.push(Array.from(e));continue}let t=e.split(/ +/),n=[];for(let e of t){let t=n.length?[...n,` `,...Array.from(e)]:Array.from(e);n.length&&s(t).width>l?(c.push(n),n=Array.from(e)):n=t}c.push(n)}let u=[],d=[],p=0;return c.forEach((e,n)=>{for(;e.length&&e[e.length-1]===` `;)e.pop();let{xs:r,width:a}=s(e);p=Math.max(p,a);let o=t.align===`left`?0:t.align===`right`?-a:-a/2;e.forEach((e,t)=>{e.trim()&&u.push({ch:e,x:r[t]+o,line:n})}),d.push({width:a,y:-n*i})}),{glyphs:u,lines:d,lineHeight:i,width:p}}function b(e){let t=e.data;if(t.capHeight&&t.resolution)return t.capHeight/t.resolution;let n=e.generateShapes(`H`,1);if(!n.length)return .72;let r=new s(n);r.computeBoundingBox();let i=r.boundingBox.max.y-r.boundingBox.min.y;return r.dispose(),i>0?i:.72}function x(e,t){let n=e.data,r=f(t.size,1),i=r/b(e),a=Math.max(0,f(t.depth,.2)),o=a>0?Math.max(0,Math.min(f(t.bevel,Math.min(a*.3,r*.035)),a*.45,r*.08)):0,s=Math.round(Math.max(2,Math.min(32,f(t.curveSegments,a>0?5+r*3:8+r*4)))),c=y(n,{text:t.text,em:i,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,align:t.align??`center`,maxWidth:t.maxWidth,kerning:t.kerning});return{size:r,em:i,depth:a,bevel:o,curveSegments:s,layout:c,offsetY:-(r+(c.lines.length?c.lines[c.lines.length-1].y:0))/2,frontZ:a/2,backZ:-a/2}}function S(e){let t=e.bevel;return{depth:Math.max(e.depth-t*2,1e-4),curveSegments:e.curveSegments,bevelEnabled:t>0,bevelThickness:t,bevelSize:t*.6,bevelOffset:0,bevelSegments:3}}function C(e,t,n){let r=n.em/(n.curveSegments*5);return e.generateShapes(t,n.em).map(e=>m(e,r,1,n.curveSegments))}function w(e,t,r,i){let a=C(e,t,r);if(!a.length)return null;if(r.depth<=0)return new s(a,r.curveSegments);let o=new n(a,S(r));return o.translate(0,0,r.backZ+r.bevel),o.clearGroups(),p(o,50*Math.PI/180,i)}function T(e,t){let n=e.outline;if(!n)return null;let r=n===!0?{}:n,i=Math.max(1e-4,f(r.width,t.size*.06)),a=t.depth>0?t.depth*.5:t.size*.01,o=t.frontZ-a;return{width:i,frontZ:o,backZ:o-Math.max(f(r.depth,t.depth>0?t.depth*.6:t.size*.01),1e-4),material:r.material,color:r.color??`#111111`}}function E(e){let t=0;for(let n=0,r=e.length-1;n<e.length;r=n++)t+=(e[r].x-e[n].x)*(e[r].y+e[n].y);return t/2}function D(e,n,r=2){let i=e.filter((t,n)=>{let r=e[(n+1)%e.length];return Math.hypot(r.x-t.x,r.y-t.y)>1e-9}),a=i.length,o=[];if(a<3)return i.map(e=>new t(e.x,e.y));let s=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.hypot(n,r)||1;return{x:r/i,y:-n/i}};for(let e=0;e<a;e++){let c=i[(e-1+a)%a],l=i[e],u=i[(e+1)%a],d=s(c,l),f=s(l,u),p=(l.x-c.x)*(u.y-l.y)-(l.y-c.y)*(u.x-l.x),m=d.x*f.x+d.y*f.y;if(p>0&&m<.995){let e=Math.atan2(d.y,d.x),r=Math.atan2(f.y,f.x);for(;r<e;)r+=Math.PI*2;for(;r>e+Math.PI*2;)r-=Math.PI*2;let i=Math.max(1,Math.ceil(Math.abs(r-e)/(Math.PI/8)));for(let a=0;a<=i;a++){let s=e+(r-e)*a/i;o.push(new t(l.x+Math.cos(s)*n,l.y+Math.sin(s)*n))}}else{let e=d.x+f.x,i=d.y+f.y,a=Math.hypot(e,i)||1;e/=a,i/=a;let s=Math.max(e*d.x+i*d.y,1/r);o.push(new t(l.x+e*n/s,l.y+i*n/s))}}return o}function O(t,n){let r=[];for(let i of t){let{shape:t,holes:a}=i.extractPoints(1),s=t.slice();E(s)<0&&(s=s.reverse());let c=new o(D(s,n));for(let t of a){let r=t.slice(),i=Math.abs(E(r));E(r)>0&&(r=r.reverse());let a=r.map(e=>e.x),o=r.map(e=>e.y);if(Math.max(...a)-Math.min(...a)<=2*n||Math.max(...o)-Math.min(...o)<=2*n)continue;let s=D(r,n),l=E(s);l<0&&-l>i*.02&&c.holes.push(new e(s))}r.push(c)}return r}function k(e,t,r,i,a){let o=C(e,t,r);if(!o.length)return null;let s=new n(O(o,i.width),{depth:i.frontZ-i.backZ,curveSegments:1,bevelEnabled:!1});return s.translate(0,0,i.backZ),s.clearGroups(),p(s,40*Math.PI/180,a)}function A(e,t,n){let r=/* @__PURE__ */ new Map,i=[];for(let n of e.layout.glyphs){r.has(n.ch)||r.set(n.ch,t(n.ch));let a=r.get(n.ch);if(!a)continue;let o=a.clone();o.translate(n.x,e.layout.lines[n.line].y+e.offsetY,0),i.push(o)}for(let e of r.values())e?.dispose();let o;if(!i.length)o=new a;else{o=(i.length===1?i[0].clone():n.mergeGeometries(i,!1))??new a;for(let e of i)e.dispose()}return o.computeBoundingBox(),o.computeBoundingSphere(),o}function j(e,t,n){let r=f(e.stagger,.04),i=t;if(e.order===`reverse`)i=n-1-t;else if(e.order===`center`)i=Math.abs(t-(n-1)/2);else if(e.order===`random`){let e=(t+1)*2654435761;e=(e^e>>>13)>>>0,i=e%1e3/1e3*(n-1)}return f(e.delay,0)+i*r}function M(e,t){return(n,r)=>{let i=e.effect??`rise`,a=Math.max(f(e.duration,.6),.001),o=e.ease??(i===`scale`||i===`spin`?`outBack`:`outCubic`),s=i!==`scale`,c=[],l=[];if(s){let e=[];r.object.traverse(t=>{let n=t.material;if(n&&!t.userData.depthTwin){e.push(t);for(let e of Array.isArray(n)?n:[n])e.userData.baseOpacity===void 0&&(e.userData.baseOpacity=e.opacity),e.userData.baseTransparent===void 0&&(e.userData.baseTransparent=e.transparent),c.push(e)}});for(let t of e)l.push(P(t))}return{update(e){let n=Math.min(Math.max(e/a,0),1),u=d(o,n),f=r.object;if(s){let e=d(`outCubic`,Math.min(1,n*1.6));for(let t of c)t.opacity=t.userData.baseOpacity*e,t.transparent=e<1||t.userData.baseTransparent;for(let t of l)t.visible=e>0&&e<1}switch(n<=0&&(f.visible=!1),i){case`rise`:f.position.y-=(1-u)*t*.6;break;case`drop`:f.position.y+=(1-u)*t*1.2;break;case`scale`:f.scale.multiplyScalar(Math.max(1e-4,u));break;case`spin`:f.rotation.y+=(1-u)*Math.PI,f.scale.multiplyScalar(Math.max(1e-4,Math.min(1,n*2)))}}}}}var N=null;function P(e){N??=new c({colorWrite:!1,depthWrite:!0});let t=new i(e.geometry,N);return t.name=`${e.name}#depth`,t.visible=!1,t.castShadow=!1,t.receiveShadow=!1,t.renderOrder=-1,t.userData.helper=!0,t.userData.depthTwin=!0,e.add(t),t}function F(e,t){let n=e.font??`sans-bold`;return t.resolveAsset(n.includes(`/`)||n.includes(`:`)?n:`library:fonts/${n}`)}function I(e,t,n){let r=e.userData.gradient;r&&(r.uGradMin.value=t,r.uGradMax.value=n)}async function L(e,t){let[n,a]=await Promise.all([g(F(e,t)),import(`./BufferGeometryUtils-Re3wQkXp.js`).then(e=>e.t)]),o=x(n,e),s=T(e,o),c=!!e.splitLetters||!!e.reveal,l=o.depth<=0,d=()=>u(e.material,t,{defaultColor:`#ffffff`}),f=()=>s?u(s.material??{color:s.color,roughness:.55},t):null,p=(o.layout.lines.length?o.layout.lines[o.layout.lines.length-1].y:0)+o.offsetY,m=o.size+o.offsetY,h=e=>(l&&(e.side=2),e);if(!c){let t=A(o,e=>w(n,e,o,a),a),r=h(await d());I(r,p,m);let c=new i(t,r);if(s){let t=A(o,e=>k(n,e,o,s,a),a),r=await f();if(r){I(r,p,m);let n=new i(t,r);n.name=`${e.id}/outline`,c.add(n)}}return{object:c,letters:[]}}let _=new r,v=/* @__PURE__ */ new Map,y=/* @__PURE__ */ new Map,b=o.size/2,S=[],C=o.layout.glyphs.length,E=0;for(let t of o.layout.glyphs){if(!v.has(t.ch)){let e=w(n,t.ch,o,a),r=0;if(e&&(e.computeBoundingBox(),r=(e.boundingBox.min.x+e.boundingBox.max.x)/2,e.translate(-r,-b,0),e.computeBoundingSphere()),v.set(t.ch,e),s){let e=k(n,t.ch,o,s,a);e?.translate(-r,-b,0),y.set(t.ch,e)}e&&(e.userData.cx=r)}let r=v.get(t.ch);if(!r)continue;let c=r.userData.cx,l=o.layout.lines[t.line].y+o.offsetY,u=h(await d());I(u,p-l-b,m-l-b);let g=new i(r,u);g.position.set(t.x+c,l+b,0);let x=`${e.id}/${E}`;g.name=x,g.userData.a3dId=x;let T=y.get(t.ch);if(T){let e=await f();if(e){I(e,p-l-b,m-l-b);let t=new i(T,e);t.name=`${x}/outline`,g.add(t)}}_.add(g);let D={id:x,object:g,def:{id:x,kind:`text`,text:t.ch}};e.reveal&&(D.reveal={def:{type:`appear`,when:`visible`,delay:j(e.reveal,E,C)},impl:M(e.reveal,o.size)}),S.push(D),E++}return{object:_,letters:S}}export{L as buildText};