@holoscript/core 7.0.0 → 8.0.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 (345) hide show
  1. package/README.md +2 -2
  2. package/bin/holoscript.cjs +3 -0
  3. package/dist/GLTFPipeline-276GE64O.js +16 -0
  4. package/dist/GLTFPipeline-M7WSSJED.cjs +37 -0
  5. package/dist/HoloScriptPlusParser-7FBIFUFC.js +693 -0
  6. package/dist/HoloScriptPlusParser-A2W7OCN2.cjs +698 -0
  7. package/dist/HoloScriptPlusParser-F2Z56FJR.js +10 -0
  8. package/dist/HoloScriptPlusParser-WKHRIH6T.cjs +27 -0
  9. package/dist/HoloScriptRuntime-3URVTKPJ.js +10 -0
  10. package/dist/HoloScriptRuntime-SXEAEU2N.cjs +19 -0
  11. package/dist/USDZExporter-3FWJ25JI.cjs +1037 -0
  12. package/dist/USDZExporter-D2HQLQYK.js +1035 -0
  13. package/dist/agents/index.cjs +19 -0
  14. package/dist/agents/index.d.ts +100 -0
  15. package/dist/agents/index.js +17 -0
  16. package/dist/chunk-23J755AR.js +1046 -0
  17. package/dist/chunk-253GBQZY.cjs +627 -0
  18. package/dist/chunk-25IQCHTO.cjs +781 -0
  19. package/dist/chunk-2BSMSUCE.js +1941 -0
  20. package/dist/chunk-2M2DPHKB.js +762 -0
  21. package/dist/chunk-2YSNA2F2.cjs +1274 -0
  22. package/dist/chunk-3AO425MZ.cjs +886 -0
  23. package/dist/chunk-3FOKASKO.cjs +348 -0
  24. package/dist/chunk-3HYYMEXI.cjs +56578 -0
  25. package/dist/chunk-3NFFOWGG.js +4287 -0
  26. package/dist/chunk-3WZEJHUQ.cjs +116 -0
  27. package/dist/chunk-4C57PR42.js +468 -0
  28. package/dist/chunk-4N4SXXWF.js +769 -0
  29. package/dist/chunk-4PDEPEQW.cjs +41 -0
  30. package/dist/chunk-4R6SBXDB.js +45 -0
  31. package/dist/chunk-4V2E7U7Q.cjs +2015 -0
  32. package/dist/chunk-5FSKKMR7.cjs +2092 -0
  33. package/dist/chunk-5GLCTO44.js +161 -0
  34. package/dist/chunk-5JEU52DW.js +382 -0
  35. package/dist/chunk-5S7RKFGR.cjs +446 -0
  36. package/dist/chunk-5WUNN6ZN.cjs +428 -0
  37. package/dist/chunk-62FBK3B7.js +70 -0
  38. package/dist/chunk-6CTRH7HT.cjs +1985 -0
  39. package/dist/chunk-6DPSFNJB.cjs +847 -0
  40. package/dist/chunk-6EX3I5P4.cjs +130 -0
  41. package/dist/chunk-73FELZVJ.cjs +611 -0
  42. package/dist/chunk-7CUEMLDZ.cjs +6445 -0
  43. package/dist/chunk-7HIASF7S.cjs +814 -0
  44. package/dist/chunk-A6KINLZJ.js +236 -0
  45. package/dist/chunk-AIA52I7T.cjs +543 -0
  46. package/dist/chunk-ANXZFVY2.js +113 -0
  47. package/dist/chunk-AYBXB26F.js +2176 -0
  48. package/dist/chunk-B4TFTDG4.js +449 -0
  49. package/dist/chunk-BE4UJCQT.js +623 -0
  50. package/dist/chunk-BRQJKJGT.cjs +20 -0
  51. package/dist/chunk-C2A5DUMF.cjs +689 -0
  52. package/dist/chunk-C37BHB7N.cjs +636 -0
  53. package/dist/chunk-CBJY23VL.js +126 -0
  54. package/dist/chunk-CIWWXYHZ.cjs +50 -0
  55. package/dist/chunk-CXFDRBQU.cjs +672 -0
  56. package/dist/chunk-D54CNIAJ.cjs +413 -0
  57. package/dist/chunk-DAJXW4KX.js +725 -0
  58. package/dist/chunk-DTGBOSEM.cjs +319 -0
  59. package/dist/chunk-E7JP3BS3.cjs +61 -0
  60. package/dist/chunk-EKBKLK7P.js +1169 -0
  61. package/dist/chunk-EKYL4PE3.cjs +404 -0
  62. package/dist/chunk-EUDQTK7N.cjs +4310 -0
  63. package/dist/chunk-EXKSFGSX.cjs +274 -0
  64. package/dist/chunk-EXUP2BUM.cjs +1173 -0
  65. package/dist/chunk-F43YAA34.js +623 -0
  66. package/dist/chunk-FDSGHPAK.js +130 -0
  67. package/dist/chunk-FEWUHQNM.cjs +144 -0
  68. package/dist/chunk-FGGJQRLZ.js +270 -0
  69. package/dist/chunk-FHP6LXJS.js +415 -0
  70. package/dist/chunk-FJPADH77.cjs +666 -0
  71. package/dist/chunk-FYSPZT4V.cjs +169 -0
  72. package/dist/chunk-GIOYPNTH.js +5575 -0
  73. package/dist/chunk-GJNCFRJU.cjs +125 -0
  74. package/dist/chunk-GMP623FG.cjs +1508 -0
  75. package/dist/chunk-GQHQOPXZ.cjs +5580 -0
  76. package/dist/chunk-GQT4TYKY.cjs +4381 -0
  77. package/dist/chunk-GTU2Z2WW.cjs +262 -0
  78. package/dist/chunk-GYZE55MO.js +2007 -0
  79. package/dist/chunk-GZG4KA4E.js +529 -0
  80. package/dist/chunk-H652NHX5.js +600 -0
  81. package/dist/chunk-HCCQLAA4.cjs +74 -0
  82. package/dist/chunk-HINXWAOD.cjs +1049 -0
  83. package/dist/chunk-HYNTS5CP.js +422 -0
  84. package/dist/chunk-HZSPDCXV.cjs +457 -0
  85. package/dist/chunk-HZTDET3N.js +1399 -0
  86. package/dist/chunk-I6XZ5DZF.cjs +488 -0
  87. package/dist/chunk-ILRBGFVD.cjs +72 -0
  88. package/dist/chunk-IPWSXCCN.js +1183 -0
  89. package/dist/chunk-IUTY5WQ2.cjs +424 -0
  90. package/dist/chunk-IVSZDECV.js +882 -0
  91. package/dist/chunk-IVY74O6C.js +247 -0
  92. package/dist/chunk-IZM5VQZD.js +714 -0
  93. package/dist/chunk-J32ZJZJH.js +554 -0
  94. package/dist/chunk-J6M4FPK5.js +421 -0
  95. package/dist/chunk-JC5YBPSF.cjs +984 -0
  96. package/dist/chunk-JCLBKPMX.js +3813 -0
  97. package/dist/chunk-JD7CIZ33.js +1949 -0
  98. package/dist/chunk-JIYN45TV.cjs +2525 -0
  99. package/dist/chunk-JJBE3TIH.cjs +1189 -0
  100. package/dist/chunk-JX7YL6ZE.js +2252 -0
  101. package/dist/chunk-K4VVR7CN.cjs +2433 -0
  102. package/dist/chunk-KEFNV2WM.cjs +2257 -0
  103. package/dist/chunk-KH4CNH66.cjs +424 -0
  104. package/dist/chunk-KJLB4OPV.js +5731 -0
  105. package/dist/chunk-KKFZ3B6J.cjs +557 -0
  106. package/dist/chunk-KKP7JKN4.cjs +6002 -0
  107. package/dist/chunk-KPJL34Y7.cjs +186 -0
  108. package/dist/chunk-KQCN6AKJ.cjs +3042 -0
  109. package/dist/chunk-KVRSTFNH.cjs +72 -0
  110. package/dist/chunk-LICPB5HZ.cjs +1409 -0
  111. package/dist/chunk-LM2VU56C.cjs +37 -0
  112. package/dist/chunk-M56JSP4A.js +400 -0
  113. package/dist/chunk-MBOOR7X4.js +18 -0
  114. package/dist/chunk-MGE5Z4GS.js +608 -0
  115. package/dist/chunk-MXFUTKCO.js +56 -0
  116. package/dist/chunk-MYY4PMWX.cjs +264 -0
  117. package/dist/chunk-N75IH2HY.js +258 -0
  118. package/dist/chunk-NBMHU6SW.js +669 -0
  119. package/dist/chunk-NG77ATEW.cjs +778 -0
  120. package/dist/chunk-NGKREZ36.js +6384 -0
  121. package/dist/chunk-NHWSN2SD.cjs +718 -0
  122. package/dist/chunk-NV4VMVXU.js +421 -0
  123. package/dist/chunk-NW5G5FBQ.js +215 -0
  124. package/dist/chunk-NXZFOPVD.cjs +5737 -0
  125. package/dist/chunk-OBIYPYYS.cjs +1993 -0
  126. package/dist/chunk-OIQYIIO3.cjs +473 -0
  127. package/dist/chunk-OL46QLBJ.js +61 -0
  128. package/dist/chunk-OMXII44L.js +5386 -0
  129. package/dist/chunk-OR4Q2BGL.cjs +759 -0
  130. package/dist/chunk-OSYNRVOV.cjs +243 -0
  131. package/dist/chunk-PGANYCAG.cjs +220 -0
  132. package/dist/chunk-PHENW4MQ.js +65 -0
  133. package/dist/chunk-PHVRG4I2.js +844 -0
  134. package/dist/chunk-Q56TT7IL.js +483 -0
  135. package/dist/chunk-QPOQ7VPI.js +1491 -0
  136. package/dist/chunk-QPSKHBJP.js +5963 -0
  137. package/dist/chunk-QXH7QDSZ.js +1989 -0
  138. package/dist/chunk-R75BSDH7.cjs +50 -0
  139. package/dist/chunk-RARB3MBR.js +207 -0
  140. package/dist/chunk-RVBHAXFG.js +56160 -0
  141. package/dist/chunk-S3MDHNKB.cjs +490 -0
  142. package/dist/chunk-S4W6Z2MN.js +2426 -0
  143. package/dist/chunk-S6YWHCKV.cjs +410 -0
  144. package/dist/chunk-SIEXCILW.js +229 -0
  145. package/dist/chunk-SJBGLS25.cjs +2196 -0
  146. package/dist/chunk-SLU6UPJI.cjs +410 -0
  147. package/dist/chunk-SMIWS6DE.cjs +212 -0
  148. package/dist/chunk-T2QCTZMO.js +811 -0
  149. package/dist/chunk-T5J7ZKP3.cjs +4885 -0
  150. package/dist/chunk-TDCNJHWO.js +341 -0
  151. package/dist/chunk-TG7O4WBC.js +406 -0
  152. package/dist/chunk-THCK6ECW.js +2085 -0
  153. package/dist/chunk-TJHVSBP2.js +439 -0
  154. package/dist/chunk-TVHSPJ4N.cjs +606 -0
  155. package/dist/chunk-U44IKGG7.cjs +5390 -0
  156. package/dist/chunk-UJXISJBN.js +487 -0
  157. package/dist/chunk-UM6C3CGK.js +4375 -0
  158. package/dist/chunk-UMABK6SI.js +686 -0
  159. package/dist/chunk-UOIGFQXC.cjs +9750 -0
  160. package/dist/chunk-URG2SJLK.js +2521 -0
  161. package/dist/chunk-V6MKC2FZ.js +979 -0
  162. package/dist/chunk-VECQYRXL.js +474 -0
  163. package/dist/chunk-VJ3L7CHT.cjs +169 -0
  164. package/dist/chunk-VMLKSV26.js +1216 -0
  165. package/dist/chunk-VVKVQZI6.js +55 -0
  166. package/dist/chunk-W6RW64BB.cjs +1219 -0
  167. package/dist/chunk-W7VDOASB.cjs +639 -0
  168. package/dist/chunk-WDT3JTGM.cjs +483 -0
  169. package/dist/chunk-WJIHFLMJ.js +404 -0
  170. package/dist/chunk-WKX5AMOY.js +309 -0
  171. package/dist/chunk-WNNE3PO3.js +34 -0
  172. package/dist/chunk-WRKUDAZJ.js +3038 -0
  173. package/dist/chunk-WRLUBRKS.cjs +1943 -0
  174. package/dist/chunk-WRNEH5MO.js +3169 -0
  175. package/dist/chunk-WRWEX5ZF.js +658 -0
  176. package/dist/chunk-X3GJPRVK.cjs +3246 -0
  177. package/dist/chunk-XHIV6326.cjs +793 -0
  178. package/dist/chunk-XIVIE43A.cjs +729 -0
  179. package/dist/chunk-XJAN7CZG.cjs +432 -0
  180. package/dist/chunk-XKTPFXGA.js +164 -0
  181. package/dist/chunk-XL6INWKT.js +121 -0
  182. package/dist/chunk-XSFNHP2E.js +632 -0
  183. package/dist/chunk-XT6JY5W5.js +9684 -0
  184. package/dist/chunk-XUILI4KB.cjs +430 -0
  185. package/dist/chunk-XUUVDHIF.cjs +3962 -0
  186. package/dist/chunk-YF2I3MV3.js +46 -0
  187. package/dist/chunk-YIMN575O.js +4847 -0
  188. package/dist/chunk-YIVFJNYV.js +176 -0
  189. package/dist/chunk-YKGPCZEE.cjs +237 -0
  190. package/dist/chunk-YN6V7R3L.cjs +327 -0
  191. package/dist/chunk-YQELFNJV.js +39 -0
  192. package/dist/chunk-YYXH45E2.js +426 -0
  193. package/dist/chunk-ZBQXLH2L.js +756 -0
  194. package/dist/chunk-ZDSYWBIE.cjs +69 -0
  195. package/dist/chunk-ZU7NIRT6.js +325 -0
  196. package/dist/chunk-ZZ7RO2UQ.js +1243 -0
  197. package/dist/chunk-ZZEI7MV4.js +778 -0
  198. package/dist/cli/holoscript-runner.cjs +2255 -0
  199. package/dist/cli/holoscript-runner.js +2230 -0
  200. package/dist/codebase/index.cjs +336 -0
  201. package/dist/codebase/index.js +331 -0
  202. package/dist/compiler/agent-inference.cjs +31 -0
  203. package/dist/compiler/agent-inference.js +8 -0
  204. package/dist/compiler/android-xr.cjs +24 -0
  205. package/dist/compiler/android-xr.js +14 -0
  206. package/dist/compiler/android.cjs +24 -0
  207. package/dist/compiler/android.js +14 -0
  208. package/dist/compiler/ar.cjs +23 -0
  209. package/dist/compiler/ar.js +11 -0
  210. package/dist/compiler/babylon.cjs +21 -0
  211. package/dist/compiler/babylon.js +15 -0
  212. package/dist/compiler/business-quest.cjs +43 -0
  213. package/dist/compiler/business-quest.js +4 -0
  214. package/dist/compiler/coco.cjs +27 -0
  215. package/dist/compiler/coco.js +4 -0
  216. package/dist/compiler/context.cjs +25 -0
  217. package/dist/compiler/context.d.ts +28 -0
  218. package/dist/compiler/context.js +8 -0
  219. package/dist/compiler/domain-block-utils.cjs +605 -0
  220. package/dist/compiler/domain-block-utils.js +11 -0
  221. package/dist/compiler/dtdl.cjs +27 -0
  222. package/dist/compiler/dtdl.js +11 -0
  223. package/dist/compiler/gltf-pipeline.cjs +39 -0
  224. package/dist/compiler/gltf-pipeline.js +4 -0
  225. package/dist/compiler/godot.cjs +18 -0
  226. package/dist/compiler/godot.js +12 -0
  227. package/dist/compiler/incremental.cjs +34 -0
  228. package/dist/compiler/incremental.js +9 -0
  229. package/dist/compiler/index.cjs +5860 -0
  230. package/dist/compiler/index.d.ts +322 -21
  231. package/dist/compiler/index.js +5525 -0
  232. package/dist/compiler/ios.cjs +23 -0
  233. package/dist/compiler/ios.js +13 -0
  234. package/dist/compiler/llm-provider-capabilities.cjs +25 -0
  235. package/dist/compiler/llm-provider-capabilities.d.ts +43 -0
  236. package/dist/compiler/llm-provider-capabilities.js +8 -0
  237. package/dist/compiler/multi-layer.cjs +24 -0
  238. package/dist/compiler/multi-layer.js +15 -0
  239. package/dist/compiler/nodetoy.cjs +23 -0
  240. package/dist/compiler/nodetoy.js +4 -0
  241. package/dist/compiler/openxr.cjs +19 -0
  242. package/dist/compiler/openxr.js +13 -0
  243. package/dist/compiler/playcanvas.cjs +19 -0
  244. package/dist/compiler/playcanvas.js +13 -0
  245. package/dist/compiler/r3f.cjs +38 -0
  246. package/dist/compiler/r3f.d.ts +22 -0
  247. package/dist/compiler/r3f.js +16 -0
  248. package/dist/compiler/remotion.cjs +23 -0
  249. package/dist/compiler/remotion.js +4 -0
  250. package/dist/compiler/reproducibility.cjs +39 -0
  251. package/dist/compiler/reproducibility.js +4 -0
  252. package/dist/compiler/sdf.cjs +24 -0
  253. package/dist/compiler/sdf.js +12 -0
  254. package/dist/compiler/semantic-scene.cjs +31 -0
  255. package/dist/compiler/semantic-scene.js +4 -0
  256. package/dist/compiler/state.cjs +21 -0
  257. package/dist/compiler/state.js +11 -0
  258. package/dist/compiler/trait-composition.cjs +30 -0
  259. package/dist/compiler/trait-composition.js +9 -0
  260. package/dist/compiler/unity.cjs +19 -0
  261. package/dist/compiler/unity.js +13 -0
  262. package/dist/compiler/unreal.cjs +23 -0
  263. package/dist/compiler/unreal.js +13 -0
  264. package/dist/compiler/urdf.cjs +52 -0
  265. package/dist/compiler/urdf.js +12 -0
  266. package/dist/compiler/usd-physics.cjs +26 -0
  267. package/dist/compiler/usd-physics.js +9 -0
  268. package/dist/compiler/visionos.cjs +19 -0
  269. package/dist/compiler/visionos.js +13 -0
  270. package/dist/compiler/vrchat.cjs +22 -0
  271. package/dist/compiler/vrchat.js +12 -0
  272. package/dist/compiler/vrr.cjs +24 -0
  273. package/dist/compiler/vrr.js +12 -0
  274. package/dist/compiler/wasm.cjs +36 -0
  275. package/dist/compiler/wasm.js +12 -0
  276. package/dist/compiler/webgpu.cjs +18 -0
  277. package/dist/compiler/webgpu.js +12 -0
  278. package/dist/coordinators/index.cjs +1266 -0
  279. package/dist/coordinators/index.d.ts +72 -1
  280. package/dist/coordinators/index.js +1259 -0
  281. package/dist/debugger.cjs +24 -0
  282. package/dist/debugger.js +11 -0
  283. package/dist/entries/interop.cjs +64 -0
  284. package/dist/entries/interop.js +7 -0
  285. package/dist/entries/scripting.cjs +55 -0
  286. package/dist/entries/scripting.js +10 -0
  287. package/dist/hololand/index.cjs +146 -0
  288. package/dist/hololand/index.d.ts +70 -0
  289. package/dist/hololand/index.js +5 -0
  290. package/dist/index.cjs +43233 -0
  291. package/dist/index.d.ts +976 -21
  292. package/dist/index.js +39995 -0
  293. package/dist/math/tropical-spmv.cjs +45 -0
  294. package/dist/math/tropical-spmv.js +4 -0
  295. package/dist/math/vec3.cjs +57 -0
  296. package/dist/math/vec3.js +4 -0
  297. package/dist/ml-dsa-FSKBTE3W.cjs +1265 -0
  298. package/dist/ml-dsa-Z7JDKW4L.js +1265 -0
  299. package/dist/paper-0c-spike/index.cjs +150 -0
  300. package/dist/paper-0c-spike/index.js +141 -0
  301. package/dist/parser.cjs +61 -0
  302. package/dist/parser.d.ts +11 -0
  303. package/dist/parser.js +12 -0
  304. package/dist/playwright-3AT3AKTV.cjs +98673 -0
  305. package/dist/playwright-VZPDVUEQ.js +98660 -0
  306. package/dist/reconstruction/index.cjs +153 -0
  307. package/dist/reconstruction/index.d.ts +29 -2
  308. package/dist/reconstruction/index.js +8 -0
  309. package/dist/runtime.cjs +316 -0
  310. package/dist/runtime.d.ts +61 -0
  311. package/dist/runtime.js +31 -0
  312. package/dist/self-improvement/index.cjs +563 -0
  313. package/dist/self-improvement/index.js +545 -0
  314. package/dist/storage/index.cjs +38 -0
  315. package/dist/storage/index.js +5 -0
  316. package/dist/testing.cjs +25 -0
  317. package/dist/testing.d.ts +70 -0
  318. package/dist/testing.js +4 -0
  319. package/dist/traitDocs/traitDocs.cjs +33 -0
  320. package/dist/traitDocs/traitDocs.js +7 -0
  321. package/dist/traits/botanical-lotus.cjs +41 -0
  322. package/dist/traits/botanical-lotus.d.ts +172 -0
  323. package/dist/traits/botanical-lotus.js +4 -0
  324. package/dist/traits/engines/index.cjs +520 -0
  325. package/dist/traits/engines/index.js +380 -0
  326. package/dist/traits/index.cjs +24409 -0
  327. package/dist/traits/index.d.ts +171 -35
  328. package/dist/traits/index.js +21634 -0
  329. package/dist/traits/simulation-solver-factory.cjs +13 -0
  330. package/dist/traits/simulation-solver-factory.d.ts +23 -0
  331. package/dist/traits/simulation-solver-factory.js +4 -0
  332. package/dist/traits/webcam-gaze.cjs +35 -0
  333. package/dist/traits/webcam-gaze.d.ts +17 -0
  334. package/dist/traits/webcam-gaze.js +4 -0
  335. package/dist/type-checker.cjs +19 -0
  336. package/dist/type-checker.js +6 -0
  337. package/dist/world/index.cjs +947 -0
  338. package/dist/world/index.d.ts +147 -0
  339. package/dist/world/index.js +939 -0
  340. package/dist/world-model/index.cjs +1446 -0
  341. package/dist/world-model/index.d.ts +119 -0
  342. package/dist/world-model/index.js +1414 -0
  343. package/dist/wot/index.cjs +29 -0
  344. package/dist/wot/index.js +4 -0
  345. package/package.json +93 -49
@@ -0,0 +1,4381 @@
1
+ 'use strict';
2
+
3
+ var chunkUOIGFQXC_cjs = require('./chunk-UOIGFQXC.cjs');
4
+ var chunk5S7RKFGR_cjs = require('./chunk-5S7RKFGR.cjs');
5
+ var chunkOIQYIIO3_cjs = require('./chunk-OIQYIIO3.cjs');
6
+ var chunkAIA52I7T_cjs = require('./chunk-AIA52I7T.cjs');
7
+ var chunkXUUVDHIF_cjs = require('./chunk-XUUVDHIF.cjs');
8
+ var chunkKKP7JKN4_cjs = require('./chunk-KKP7JKN4.cjs');
9
+ var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
10
+
11
+ // src/traits/visual/presets/hologram-media.visual.ts
12
+ var HOLOGRAM_MEDIA_VISUALS;
13
+ var init_hologram_media_visual = chunkHCCQLAA4_cjs.__esm({
14
+ "src/traits/visual/presets/hologram-media.visual.ts"() {
15
+ HOLOGRAM_MEDIA_VISUALS = {
16
+ depth_estimation: {
17
+ material: { roughness: 0.3 },
18
+ emissive: { color: "#6644FF", intensity: 0.2 },
19
+ tags: ["ai", "depth", "hologram"],
20
+ layer: "visual_effect"
21
+ },
22
+ displacement: {
23
+ material: { roughness: 0.4 },
24
+ emissive: { color: "#8866FF", intensity: 0.15 },
25
+ tags: ["3d", "depth", "mesh"],
26
+ layer: "visual_effect"
27
+ },
28
+ segment: {
29
+ material: { roughness: 0.3 },
30
+ emissive: { color: "#FF44AA", intensity: 0.15 },
31
+ tags: ["ai", "segmentation", "mask"],
32
+ layer: "visual_effect"
33
+ },
34
+ animated_texture: {
35
+ material: { roughness: 0.3 },
36
+ emissive: { color: "#44FFAA", intensity: 0.15 },
37
+ tags: ["animation", "texture", "gif"],
38
+ layer: "visual_effect"
39
+ },
40
+ holographic_sprite: {
41
+ material: { roughness: 0.2 },
42
+ emissive: { color: "#AA44FF", intensity: 0.3 },
43
+ tags: ["hologram", "sprite", "3d"],
44
+ layer: "visual_effect"
45
+ },
46
+ quilt: {
47
+ material: { roughness: 0.3 },
48
+ emissive: { color: "#44AAFF", intensity: 0.2 },
49
+ tags: ["hologram", "multiview", "looking-glass"],
50
+ layer: "visual_effect"
51
+ },
52
+ gaussian_splatting: {
53
+ material: { roughness: 0.2 },
54
+ emissive: { color: "#AACCFF", intensity: 0.15 },
55
+ tags: ["3d", "photorealistic", "splat"],
56
+ layer: "visual_effect"
57
+ },
58
+ spatial_video: {
59
+ material: { roughness: 0.3 },
60
+ emissive: { color: "#FF8844", intensity: 0.15 },
61
+ tags: ["video", "stereo", "spatial"],
62
+ layer: "visual_effect"
63
+ },
64
+ image: {
65
+ material: { roughness: 0.4 },
66
+ tags: ["media", "texture", "source"],
67
+ layer: "base_material"
68
+ },
69
+ depth_sequence: {
70
+ material: { roughness: 0.3 },
71
+ emissive: { color: "#6644FF", intensity: 0.1 },
72
+ tags: ["video", "depth", "temporal"],
73
+ layer: "visual_effect"
74
+ },
75
+ temporal_smoothing: {
76
+ material: { roughness: 0.3 },
77
+ tags: ["processing", "temporal"],
78
+ layer: "visual_effect"
79
+ },
80
+ depth_to_normal: {
81
+ material: { roughness: 0.3 },
82
+ emissive: { color: "#8888FF", intensity: 0.1 },
83
+ tags: ["processing", "normal-map"],
84
+ layer: "visual_effect"
85
+ }
86
+ };
87
+ }
88
+ });
89
+
90
+ // src/traits/visual/presets/gaps-physics.visual.ts
91
+ var GAPS_PHYSICS_VISUALS;
92
+ var init_gaps_physics_visual = chunkHCCQLAA4_cjs.__esm({
93
+ "src/traits/visual/presets/gaps-physics.visual.ts"() {
94
+ GAPS_PHYSICS_VISUALS = /* @__PURE__ */ new Map([
95
+ // --- Pillar A: Unified Physics ---
96
+ [
97
+ "fluid",
98
+ {
99
+ material: {
100
+ type: "physical",
101
+ color: "#1a6fc4",
102
+ metalness: 0,
103
+ roughness: 0.05,
104
+ transmission: 0.95,
105
+ ior: 1.33,
106
+ thickness: 0.5
107
+ },
108
+ layers: [
109
+ {
110
+ type: "effect",
111
+ name: "ssfr",
112
+ priority: 50,
113
+ config: {
114
+ resolutionScale: 0.5,
115
+ absorptionColor: [0.4, 0.04, 0],
116
+ absorptionStrength: 2,
117
+ fresnelPower: 0.02,
118
+ refractionStrength: 0.1
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ ],
124
+ [
125
+ "soft_body_pro",
126
+ {
127
+ material: {
128
+ type: "physical",
129
+ color: "#e8a87c",
130
+ metalness: 0,
131
+ roughness: 0.6
132
+ },
133
+ layers: [
134
+ {
135
+ type: "deformation",
136
+ name: "pbd_tearing",
137
+ priority: 45,
138
+ config: { tearThreshold: 0.8, tearColor: "#8b0000" }
139
+ }
140
+ ]
141
+ }
142
+ ],
143
+ [
144
+ "crowd_sim",
145
+ {
146
+ material: {
147
+ type: "standard",
148
+ color: "#7b68ee"
149
+ },
150
+ layers: [
151
+ {
152
+ type: "instanced",
153
+ name: "crowd_instances",
154
+ priority: 30,
155
+ config: { maxInstances: 1e4, lodLevels: 3 }
156
+ }
157
+ ]
158
+ }
159
+ ],
160
+ [
161
+ "deformable_terrain",
162
+ {
163
+ material: {
164
+ type: "standard",
165
+ color: "#8b7355",
166
+ roughness: 0.9
167
+ },
168
+ layers: [
169
+ {
170
+ type: "displacement",
171
+ name: "heightmap_erosion",
172
+ priority: 40,
173
+ config: { displacementScale: 5 }
174
+ }
175
+ ]
176
+ }
177
+ ],
178
+ [
179
+ "volumetric_clouds",
180
+ {
181
+ material: {
182
+ type: "shader",
183
+ color: "#ffffff"
184
+ },
185
+ layers: [
186
+ {
187
+ type: "volumetric",
188
+ name: "cloud_raymarcher",
189
+ priority: 80,
190
+ config: {
191
+ absorptionCoeff: 0.04,
192
+ scatteringCoeff: 0.06,
193
+ phaseG: 0.3,
194
+ maxSteps: 64
195
+ }
196
+ }
197
+ ]
198
+ }
199
+ ],
200
+ [
201
+ "god_rays",
202
+ {
203
+ material: {
204
+ type: "shader",
205
+ color: "#fffde7"
206
+ },
207
+ layers: [
208
+ {
209
+ type: "post_process",
210
+ name: "volumetric_light",
211
+ priority: 85,
212
+ config: { decay: 0.96, weight: 0.5, exposure: 0.3, samples: 100 }
213
+ }
214
+ ]
215
+ }
216
+ ],
217
+ // --- Weather Hub ---
218
+ [
219
+ "weather",
220
+ {
221
+ material: {
222
+ type: "none",
223
+ color: "#87ceeb"
224
+ },
225
+ layers: [
226
+ {
227
+ type: "ambient",
228
+ name: "weather_atmosphere",
229
+ priority: 90,
230
+ config: { affectsLighting: true, affectsFog: true }
231
+ }
232
+ ]
233
+ }
234
+ ],
235
+ // --- Pillar B: Persistent World ---
236
+ [
237
+ "world_state",
238
+ {
239
+ material: {
240
+ type: "none",
241
+ color: "#4a90d9"
242
+ },
243
+ layers: []
244
+ }
245
+ ],
246
+ [
247
+ "spatial_voice",
248
+ {
249
+ material: {
250
+ type: "none",
251
+ color: "#90ee90"
252
+ },
253
+ layers: [
254
+ {
255
+ type: "indicator",
256
+ name: "voice_range",
257
+ priority: 10,
258
+ config: { showRadius: true, radiusColor: "#90ee9040" }
259
+ }
260
+ ]
261
+ }
262
+ ],
263
+ [
264
+ "lip_sync",
265
+ {
266
+ material: {
267
+ type: "none",
268
+ color: "#ffb6c1"
269
+ },
270
+ layers: [
271
+ {
272
+ type: "morph",
273
+ name: "viseme_blendshapes",
274
+ priority: 60,
275
+ config: { blendShapePrefix: "viseme_" }
276
+ }
277
+ ]
278
+ }
279
+ ],
280
+ // --- Pillar C: Living Economy ---
281
+ [
282
+ "ai_companion",
283
+ {
284
+ material: {
285
+ type: "standard",
286
+ color: "#dda0dd",
287
+ emissive: "#330033",
288
+ emissiveIntensity: 0.2
289
+ },
290
+ layers: [
291
+ {
292
+ type: "indicator",
293
+ name: "ai_thinking",
294
+ priority: 15,
295
+ config: { pulseColor: "#9b59b6", pulseSpeed: 1.5 }
296
+ }
297
+ ]
298
+ }
299
+ ],
300
+ [
301
+ "token_gated",
302
+ {
303
+ material: {
304
+ type: "standard",
305
+ color: "#ffd700",
306
+ metalness: 0.8,
307
+ roughness: 0.2
308
+ },
309
+ layers: [
310
+ {
311
+ type: "barrier",
312
+ name: "token_gate_barrier",
313
+ priority: 70,
314
+ config: { barrierColor: "#ffd70060", shimmer: true }
315
+ }
316
+ ]
317
+ }
318
+ ],
319
+ [
320
+ "moderation",
321
+ {
322
+ material: {
323
+ type: "none",
324
+ color: "#ff6347"
325
+ },
326
+ layers: []
327
+ }
328
+ ],
329
+ [
330
+ "anti_grief",
331
+ {
332
+ material: {
333
+ type: "none",
334
+ color: "#32cd32"
335
+ },
336
+ layers: [
337
+ {
338
+ type: "shield",
339
+ name: "grief_shield",
340
+ priority: 95,
341
+ config: { shieldColor: "#32cd3230" }
342
+ }
343
+ ]
344
+ }
345
+ ]
346
+ ]);
347
+ }
348
+ });
349
+
350
+ // src/traits/visual/presets/phone-sleeve-vr.visual.ts
351
+ var PHONE_SLEEVE_VR_VISUALS;
352
+ var init_phone_sleeve_vr_visual = chunkHCCQLAA4_cjs.__esm({
353
+ "src/traits/visual/presets/phone-sleeve-vr.visual.ts"() {
354
+ PHONE_SLEEVE_VR_VISUALS = {
355
+ // --- Hardware Form Factor ---
356
+ phone_sleeve: {
357
+ material: { roughness: 0.3, metalness: 0.6 },
358
+ emissive: { color: "#00CCFF", intensity: 0.2 },
359
+ tags: ["vr", "phone", "sleeve", "headset"],
360
+ layer: "visual_effect"
361
+ },
362
+ sleeve_nfc_trigger: {
363
+ material: { roughness: 0.4 },
364
+ emissive: { color: "#FFD700", intensity: 0.15 },
365
+ tags: ["nfc", "trigger", "hardware"],
366
+ layer: "visual_effect"
367
+ },
368
+ sleeve_lens_profile: {
369
+ material: { roughness: 0.1, metalness: 0 },
370
+ opacity: 0.6,
371
+ tags: ["lens", "optics"],
372
+ layer: "visual_effect"
373
+ },
374
+ phone_detection: {
375
+ material: { roughness: 0.4 },
376
+ emissive: { color: "#44FF88", intensity: 0.1 },
377
+ tags: ["detection", "calibration"],
378
+ layer: "visual_effect"
379
+ },
380
+ // --- Display ---
381
+ stereo_split: {
382
+ material: { roughness: 0.2 },
383
+ emissive: { color: "#FF44AA", intensity: 0.2 },
384
+ tags: ["stereoscopic", "display", "split"],
385
+ layer: "visual_effect"
386
+ },
387
+ barrel_distortion: {
388
+ material: { roughness: 0.3 },
389
+ emissive: { color: "#AA44FF", intensity: 0.15 },
390
+ tags: ["distortion", "shader", "lens"],
391
+ layer: "visual_effect"
392
+ },
393
+ chromatic_aberration_fix: {
394
+ material: { roughness: 0.3 },
395
+ emissive: { color: "#FF8800", intensity: 0.1 },
396
+ tags: ["color", "correction", "lens"],
397
+ layer: "visual_effect"
398
+ },
399
+ ipd_adjust: {
400
+ material: { roughness: 0.4 },
401
+ emissive: { color: "#44CCFF", intensity: 0.1 },
402
+ tags: ["calibration", "ipd", "comfort"],
403
+ layer: "visual_effect"
404
+ },
405
+ // --- Sensor / Tracking ---
406
+ gyro_head_tracking: {
407
+ material: { roughness: 0.4 },
408
+ emissive: { color: "#00FF88", intensity: 0.15 },
409
+ tags: ["tracking", "gyroscope", "3dof"],
410
+ layer: "visual_effect"
411
+ },
412
+ accel_sensor_fusion: {
413
+ material: { roughness: 0.4 },
414
+ emissive: { color: "#00CC66", intensity: 0.1 },
415
+ tags: ["sensor", "accelerometer", "fusion"],
416
+ layer: "visual_effect"
417
+ },
418
+ mag_drift_correction: {
419
+ material: { roughness: 0.4 },
420
+ emissive: { color: "#8844FF", intensity: 0.1 },
421
+ tags: ["magnetometer", "drift", "correction"],
422
+ layer: "visual_effect"
423
+ },
424
+ positional_estimation: {
425
+ material: { roughness: 0.4 },
426
+ emissive: { color: "#FFAA00", intensity: 0.15 },
427
+ tags: ["6dof", "vio", "tracking"],
428
+ layer: "visual_effect"
429
+ },
430
+ // --- Interaction ---
431
+ gaze_cursor: {
432
+ material: { roughness: 0.2 },
433
+ emissive: { color: "#FFFFFF", intensity: 0.3 },
434
+ tags: ["gaze", "cursor", "reticle"],
435
+ layer: "visual_effect"
436
+ },
437
+ gaze_dwell_select: {
438
+ material: { roughness: 0.3 },
439
+ emissive: { color: "#FFFF44", intensity: 0.2 },
440
+ tags: ["gaze", "dwell", "selection"],
441
+ layer: "visual_effect"
442
+ },
443
+ bt_controller: {
444
+ material: { roughness: 0.5, metalness: 0.3 },
445
+ tags: ["bluetooth", "controller", "input"],
446
+ layer: "visual_effect"
447
+ },
448
+ tap_select: {
449
+ material: { roughness: 0.4 },
450
+ emissive: { color: "#44FF44", intensity: 0.1 },
451
+ tags: ["tap", "capacitive", "input"],
452
+ layer: "visual_effect"
453
+ },
454
+ voice_command: {
455
+ material: { roughness: 0.4 },
456
+ emissive: { color: "#4488FF", intensity: 0.1 },
457
+ tags: ["voice", "speech", "command"],
458
+ layer: "visual_effect"
459
+ },
460
+ // --- Performance ---
461
+ thermal_throttle: {
462
+ material: { roughness: 0.6 },
463
+ emissive: { color: "#FF4400", intensity: 0.2 },
464
+ tags: ["thermal", "throttle", "performance"],
465
+ layer: "visual_effect"
466
+ },
467
+ battery_aware_lod: {
468
+ material: { roughness: 0.5 },
469
+ emissive: { color: "#44FF00", intensity: 0.1 },
470
+ tags: ["battery", "lod", "adaptive"],
471
+ layer: "visual_effect"
472
+ },
473
+ sleeve_foveated: {
474
+ material: { roughness: 0.3 },
475
+ emissive: { color: "#CC44FF", intensity: 0.15 },
476
+ tags: ["foveated", "rendering", "performance"],
477
+ layer: "visual_effect"
478
+ },
479
+ low_persistence: {
480
+ material: { roughness: 0.2 },
481
+ emissive: { color: "#88CCFF", intensity: 0.1 },
482
+ tags: ["display", "persistence", "blur"],
483
+ layer: "visual_effect"
484
+ },
485
+ // --- Comfort ---
486
+ vr_comfort_vignette: {
487
+ material: { roughness: 0.5 },
488
+ opacity: 0.7,
489
+ tags: ["comfort", "vignette", "motion"],
490
+ layer: "visual_effect"
491
+ },
492
+ reorient_snap: {
493
+ material: { roughness: 0.4 },
494
+ emissive: { color: "#44FFCC", intensity: 0.1 },
495
+ tags: ["snap", "recenter", "comfort"],
496
+ layer: "visual_effect"
497
+ },
498
+ static_horizon: {
499
+ material: { roughness: 0.4 },
500
+ emissive: { color: "#88FF88", intensity: 0.1 },
501
+ tags: ["horizon", "stability", "nausea"],
502
+ layer: "visual_effect"
503
+ },
504
+ session_timer: {
505
+ material: { roughness: 0.4 },
506
+ emissive: { color: "#FFCC00", intensity: 0.15 },
507
+ tags: ["timer", "health", "breaks"],
508
+ layer: "visual_effect"
509
+ }
510
+ };
511
+ }
512
+ });
513
+
514
+ // src/traits/visual/index.ts
515
+ function registerAllPresets() {
516
+ const registry = chunkOIQYIIO3_cjs.TraitVisualRegistry.getInstance();
517
+ for (const presetMap of ALL_PRESETS) {
518
+ registry.registerBatch(presetMap);
519
+ }
520
+ }
521
+ var ALL_PRESETS;
522
+ var init_visual = chunkHCCQLAA4_cjs.__esm({
523
+ "src/traits/visual/index.ts"() {
524
+ chunkOIQYIIO3_cjs.init_TraitVisualRegistry();
525
+ chunkOIQYIIO3_cjs.init_types();
526
+ chunkOIQYIIO3_cjs.init_TraitVisualRegistry();
527
+ chunkUOIGFQXC_cjs.init_material_properties_visual();
528
+ chunkUOIGFQXC_cjs.init_surface_texture_visual();
529
+ chunkUOIGFQXC_cjs.init_lighting_visual();
530
+ chunkUOIGFQXC_cjs.init_gems_minerals_visual();
531
+ chunkUOIGFQXC_cjs.init_fabric_cloth_visual();
532
+ chunkUOIGFQXC_cjs.init_visual_effects_visual();
533
+ chunkUOIGFQXC_cjs.init_age_condition_visual();
534
+ chunkUOIGFQXC_cjs.init_water_fluid_visual();
535
+ chunkUOIGFQXC_cjs.init_weather_phenomena_visual();
536
+ chunkUOIGFQXC_cjs.init_emotion_mood_visual();
537
+ chunkUOIGFQXC_cjs.init_size_scale_visual();
538
+ chunkUOIGFQXC_cjs.init_environmental_biome_visual();
539
+ chunkUOIGFQXC_cjs.init_magic_fantasy_visual();
540
+ chunkUOIGFQXC_cjs.init_scifi_technology_visual();
541
+ chunkUOIGFQXC_cjs.init_creatures_mythical_visual();
542
+ chunkUOIGFQXC_cjs.init_nature_life_visual();
543
+ chunkUOIGFQXC_cjs.init_furniture_decor_visual();
544
+ chunkUOIGFQXC_cjs.init_construction_building_visual();
545
+ chunkUOIGFQXC_cjs.init_containers_storage_visual();
546
+ chunkUOIGFQXC_cjs.init_shape_form_visual();
547
+ chunkUOIGFQXC_cjs.init_animals_visual();
548
+ chunkUOIGFQXC_cjs.init_maritime_naval_visual();
549
+ chunkUOIGFQXC_cjs.init_time_period_visual();
550
+ chunkUOIGFQXC_cjs.init_accessibility_visual();
551
+ chunkUOIGFQXC_cjs.init_accessibility_extended_visual();
552
+ chunkUOIGFQXC_cjs.init_architecture_realestate_visual();
553
+ chunkUOIGFQXC_cjs.init_audio_visual();
554
+ chunkUOIGFQXC_cjs.init_cooking_food_visual();
555
+ chunkUOIGFQXC_cjs.init_core_vr_interaction_visual();
556
+ chunkUOIGFQXC_cjs.init_data_visualization_visual();
557
+ chunkUOIGFQXC_cjs.init_education_learning_visual();
558
+ chunkUOIGFQXC_cjs.init_environment_input_visual();
559
+ chunkUOIGFQXC_cjs.init_game_mechanics_visual();
560
+ chunkUOIGFQXC_cjs.init_geospatial_web3_visual();
561
+ chunkUOIGFQXC_cjs.init_healthcare_medical_visual();
562
+ chunkUOIGFQXC_cjs.init_humanoid_avatar_visual();
563
+ chunkUOIGFQXC_cjs.init_intelligence_behavior_visual();
564
+ chunkUOIGFQXC_cjs.init_interop_copresence_visual();
565
+ chunkUOIGFQXC_cjs.init_iot_autonomous_agents_visual();
566
+ chunkUOIGFQXC_cjs.init_locomotion_movement_visual();
567
+ chunkUOIGFQXC_cjs.init_measurement_sensing_visual();
568
+ chunkUOIGFQXC_cjs.init_media_analytics_visual();
569
+ chunkUOIGFQXC_cjs.init_multisensory_haptic_visual();
570
+ chunkUOIGFQXC_cjs.init_musical_sound_visual();
571
+ chunkUOIGFQXC_cjs.init_music_performance_visual();
572
+ chunkUOIGFQXC_cjs.init_narrative_storytelling_visual();
573
+ chunkUOIGFQXC_cjs.init_networking_ai_visual();
574
+ chunkUOIGFQXC_cjs.init_npc_roles_visual();
575
+ chunkUOIGFQXC_cjs.init_object_interaction_visual();
576
+ chunkUOIGFQXC_cjs.init_parser_core_ui_visual();
577
+ chunkUOIGFQXC_cjs.init_physical_affordances_visual();
578
+ chunkUOIGFQXC_cjs.init_physics_expansion_visual();
579
+ chunkUOIGFQXC_cjs.init_procedural_generation_visual();
580
+ chunkUOIGFQXC_cjs.init_resource_gathering_visual();
581
+ chunkUOIGFQXC_cjs.init_safety_boundaries_visual();
582
+ chunkUOIGFQXC_cjs.init_signs_communication_visual();
583
+ chunkUOIGFQXC_cjs.init_simple_modifiers_visual();
584
+ chunkUOIGFQXC_cjs.init_social_commerce_visual();
585
+ chunkUOIGFQXC_cjs.init_social_effects_visual();
586
+ chunkUOIGFQXC_cjs.init_sports_fitness_visual();
587
+ chunkUOIGFQXC_cjs.init_state_persistence_visual();
588
+ chunkUOIGFQXC_cjs.init_transportation_vehicles_visual();
589
+ chunkUOIGFQXC_cjs.init_volumetric_webgpu_visual();
590
+ chunkUOIGFQXC_cjs.init_weather_particles_visual();
591
+ chunkUOIGFQXC_cjs.init_xr_platform_visual();
592
+ init_hologram_media_visual();
593
+ init_gaps_physics_visual();
594
+ init_phone_sleeve_vr_visual();
595
+ ALL_PRESETS = [
596
+ // Original 12
597
+ chunkUOIGFQXC_cjs.MATERIAL_PROPERTIES_VISUALS,
598
+ chunkUOIGFQXC_cjs.SURFACE_TEXTURE_VISUALS,
599
+ chunkUOIGFQXC_cjs.LIGHTING_VISUALS,
600
+ chunkUOIGFQXC_cjs.GEMS_MINERALS_VISUALS,
601
+ chunkUOIGFQXC_cjs.FABRIC_CLOTH_VISUALS,
602
+ chunkUOIGFQXC_cjs.VISUAL_EFFECTS_VISUALS,
603
+ chunkUOIGFQXC_cjs.AGE_CONDITION_VISUALS,
604
+ chunkUOIGFQXC_cjs.WATER_FLUID_VISUALS,
605
+ chunkUOIGFQXC_cjs.WEATHER_PHENOMENA_VISUALS,
606
+ chunkUOIGFQXC_cjs.EMOTION_MOOD_VISUALS,
607
+ chunkUOIGFQXC_cjs.SIZE_SCALE_VISUALS,
608
+ chunkUOIGFQXC_cjs.ENVIRONMENTAL_BIOME_VISUALS,
609
+ // Expansion wave 1
610
+ chunkUOIGFQXC_cjs.MAGIC_FANTASY_VISUALS,
611
+ chunkUOIGFQXC_cjs.SCIFI_TECHNOLOGY_VISUALS,
612
+ chunkUOIGFQXC_cjs.CREATURES_MYTHICAL_VISUALS,
613
+ chunkUOIGFQXC_cjs.NATURE_LIFE_VISUALS,
614
+ chunkUOIGFQXC_cjs.FURNITURE_DECOR_VISUALS,
615
+ chunkUOIGFQXC_cjs.CONSTRUCTION_BUILDING_VISUALS,
616
+ chunkUOIGFQXC_cjs.CONTAINERS_STORAGE_VISUALS,
617
+ chunkUOIGFQXC_cjs.SHAPE_FORM_VISUALS,
618
+ chunkUOIGFQXC_cjs.ANIMALS_VISUALS,
619
+ chunkUOIGFQXC_cjs.MARITIME_NAVAL_VISUALS,
620
+ chunkUOIGFQXC_cjs.TIME_PERIOD_VISUALS,
621
+ // Expansion wave 2 — full coverage
622
+ chunkUOIGFQXC_cjs.ACCESSIBILITY_VISUALS,
623
+ chunkUOIGFQXC_cjs.ACCESSIBILITY_EXTENDED_VISUALS,
624
+ chunkUOIGFQXC_cjs.ARCHITECTURE_REALESTATE_VISUALS,
625
+ chunkUOIGFQXC_cjs.AUDIO_VISUALS,
626
+ chunkUOIGFQXC_cjs.COOKING_FOOD_VISUALS,
627
+ chunkUOIGFQXC_cjs.CORE_VR_INTERACTION_VISUALS,
628
+ chunkUOIGFQXC_cjs.DATA_VISUALIZATION_VISUALS,
629
+ chunkUOIGFQXC_cjs.EDUCATION_LEARNING_VISUALS,
630
+ chunkUOIGFQXC_cjs.ENVIRONMENT_INPUT_VISUALS,
631
+ chunkUOIGFQXC_cjs.GAME_MECHANICS_VISUALS,
632
+ chunkUOIGFQXC_cjs.GEOSPATIAL_WEB3_VISUALS,
633
+ chunkUOIGFQXC_cjs.HEALTHCARE_MEDICAL_VISUALS,
634
+ chunkUOIGFQXC_cjs.HUMANOID_AVATAR_VISUALS,
635
+ chunkUOIGFQXC_cjs.INTELLIGENCE_BEHAVIOR_VISUALS,
636
+ chunkUOIGFQXC_cjs.INTEROP_COPRESENCE_VISUALS,
637
+ chunkUOIGFQXC_cjs.IOT_AUTONOMOUS_AGENTS_VISUALS,
638
+ chunkUOIGFQXC_cjs.LOCOMOTION_MOVEMENT_VISUALS,
639
+ chunkUOIGFQXC_cjs.MEASUREMENT_SENSING_VISUALS,
640
+ chunkUOIGFQXC_cjs.MEDIA_ANALYTICS_VISUALS,
641
+ chunkUOIGFQXC_cjs.MULTISENSORY_HAPTIC_VISUALS,
642
+ chunkUOIGFQXC_cjs.MUSICAL_SOUND_VISUALS,
643
+ chunkUOIGFQXC_cjs.MUSIC_PERFORMANCE_VISUALS,
644
+ chunkUOIGFQXC_cjs.NARRATIVE_STORYTELLING_VISUALS,
645
+ chunkUOIGFQXC_cjs.NETWORKING_AI_VISUALS,
646
+ chunkUOIGFQXC_cjs.NPC_ROLES_VISUALS,
647
+ chunkUOIGFQXC_cjs.OBJECT_INTERACTION_VISUALS,
648
+ chunkUOIGFQXC_cjs.PARSER_CORE_UI_VISUALS,
649
+ chunkUOIGFQXC_cjs.PHYSICAL_AFFORDANCES_VISUALS,
650
+ chunkUOIGFQXC_cjs.PHYSICS_EXPANSION_VISUALS,
651
+ chunkUOIGFQXC_cjs.PROCEDURAL_GENERATION_VISUALS,
652
+ chunkUOIGFQXC_cjs.RESOURCE_GATHERING_VISUALS,
653
+ chunkUOIGFQXC_cjs.SAFETY_BOUNDARIES_VISUALS,
654
+ chunkUOIGFQXC_cjs.SIGNS_COMMUNICATION_VISUALS,
655
+ chunkUOIGFQXC_cjs.SIMPLE_MODIFIERS_VISUALS,
656
+ chunkUOIGFQXC_cjs.SOCIAL_COMMERCE_VISUALS,
657
+ chunkUOIGFQXC_cjs.SOCIAL_EFFECTS_VISUALS,
658
+ chunkUOIGFQXC_cjs.SPORTS_FITNESS_VISUALS,
659
+ chunkUOIGFQXC_cjs.STATE_PERSISTENCE_VISUALS,
660
+ chunkUOIGFQXC_cjs.TRANSPORTATION_VEHICLES_VISUALS,
661
+ chunkUOIGFQXC_cjs.VOLUMETRIC_WEBGPU_VISUALS,
662
+ chunkUOIGFQXC_cjs.WEATHER_PARTICLES_VISUALS,
663
+ chunkUOIGFQXC_cjs.XR_PLATFORM_VISUALS,
664
+ // Hologram Media Pipeline
665
+ HOLOGRAM_MEDIA_VISUALS,
666
+ // GAPS Feature Roadmap — Phase 1
667
+ GAPS_PHYSICS_VISUALS,
668
+ // Phone Sleeve VR — smartphone-as-headset
669
+ PHONE_SLEEVE_VR_VISUALS
670
+ ];
671
+ registerAllPresets();
672
+ }
673
+ });
674
+
675
+ // src/compiler/ObjectPool.ts
676
+ exports.ASTNodePool = void 0;
677
+ var init_ObjectPool = chunkHCCQLAA4_cjs.__esm({
678
+ "src/compiler/ObjectPool.ts"() {
679
+ exports.ASTNodePool = class {
680
+ /**
681
+ * @param factory Creates a fresh instance of the node.
682
+ * @param resetter Resets the node state before it is handed out again.
683
+ * @param initialCapacity How many nodes to pre-allocate.
684
+ */
685
+ constructor(factory, resetter, initialCapacity = 1e4) {
686
+ this.pool = [];
687
+ this.factory = factory;
688
+ this.resetter = resetter;
689
+ for (let i = 0; i < initialCapacity; i++) {
690
+ this.pool.push(this.factory());
691
+ }
692
+ }
693
+ /**
694
+ * Acquire a node from the pool, or create a new one if the pool is empty.
695
+ */
696
+ acquire() {
697
+ if (this.pool.length > 0) {
698
+ const node = this.pool.pop();
699
+ this.resetter(node);
700
+ return node;
701
+ }
702
+ return this.factory();
703
+ }
704
+ /**
705
+ * Release a node back to the pool to be reused.
706
+ */
707
+ release(node) {
708
+ this.pool.push(node);
709
+ }
710
+ /**
711
+ * Release an array of nodes back to the pool.
712
+ */
713
+ releaseAll(nodes) {
714
+ for (const node of nodes) {
715
+ this.pool.push(node);
716
+ }
717
+ }
718
+ /**
719
+ * Clear the pool, allowing garbage collection.
720
+ */
721
+ clear() {
722
+ this.pool.length = 0;
723
+ }
724
+ };
725
+ }
726
+ });
727
+
728
+ // src/compiler/R3FCompiler.ts
729
+ var R3FCompiler_exports = {};
730
+ chunkHCCQLAA4_cjs.__export(R3FCompiler_exports, {
731
+ ENVIRONMENT_PRESETS: () => exports.ENVIRONMENT_PRESETS,
732
+ MATERIAL_PRESETS: () => exports.MATERIAL_PRESETS,
733
+ QUALITY_TIER_SCALES: () => exports.QUALITY_TIER_SCALES,
734
+ R3FCompiler: () => exports.R3FCompiler,
735
+ UI_COMPONENT_PRESETS: () => exports.UI_COMPONENT_PRESETS
736
+ });
737
+ function isVfxParticleTraitName(name) {
738
+ return name.startsWith("vfx_particle_");
739
+ }
740
+ function vfxParticleEffect(name) {
741
+ return name.replace("vfx_particle_", "");
742
+ }
743
+ function gemResonanceConfig(config) {
744
+ return {
745
+ max_distance: 0.5,
746
+ base_frequencies: "auto",
747
+ blend_mode: "harmonic",
748
+ output: "spatial_audio",
749
+ ...config || {}
750
+ };
751
+ }
752
+ var r3fNodePool; exports.MATERIAL_PRESETS = void 0; exports.ENVIRONMENT_PRESETS = void 0; var MESH_TYPES; exports.UI_COMPONENT_PRESETS = void 0; exports.QUALITY_TIER_SCALES = void 0; exports.R3FCompiler = void 0;
753
+ var init_R3FCompiler = chunkHCCQLAA4_cjs.__esm({
754
+ "src/compiler/R3FCompiler.ts"() {
755
+ chunkOIQYIIO3_cjs.init_TraitCompositor();
756
+ chunk5S7RKFGR_cjs.init_ProvenanceSemiring();
757
+ init_visual();
758
+ chunkXUUVDHIF_cjs.init_DomainBlockCompilerMixin();
759
+ chunkAIA52I7T_cjs.init_PlatformConditionalCompilerMixin();
760
+ chunkKKP7JKN4_cjs.init_AgentRBAC();
761
+ chunkKKP7JKN4_cjs.init_CompilerBase();
762
+ init_ObjectPool();
763
+ r3fNodePool = new exports.ASTNodePool(
764
+ () => ({ type: "", props: {} }),
765
+ (node) => {
766
+ node.type = "";
767
+ node.id = void 0;
768
+ node.props = {};
769
+ node.children = void 0;
770
+ node.traits = void 0;
771
+ node.directives = void 0;
772
+ node.assetMaturity = void 0;
773
+ },
774
+ 0
775
+ // Was 20000 — demand-allocate instead of pre-allocating
776
+ );
777
+ exports.MATERIAL_PRESETS = {
778
+ plastic: { roughness: 0.5, metalness: 0, clearcoat: 0.1 },
779
+ metal: { roughness: 0.2, metalness: 1 },
780
+ chrome: { roughness: 0.05, metalness: 1, envMapIntensity: 1.5 },
781
+ gold: { roughness: 0.3, metalness: 1, color: "#ffd700" },
782
+ copper: { roughness: 0.4, metalness: 1, color: "#b87333" },
783
+ glass: {
784
+ roughness: 0,
785
+ metalness: 0,
786
+ transmission: 0.95,
787
+ ior: 1.5,
788
+ thickness: 0.5,
789
+ transparent: true
790
+ },
791
+ crystal: {
792
+ roughness: 0,
793
+ metalness: 0.1,
794
+ transmission: 0.9,
795
+ ior: 2,
796
+ iridescence: 1,
797
+ iridescenceIOR: 1.3
798
+ },
799
+ wood: { roughness: 0.8, metalness: 0 },
800
+ fabric: {
801
+ roughness: 0.95,
802
+ metalness: 0,
803
+ sheen: 0.5,
804
+ sheenRoughness: 0.8,
805
+ sheenColor: "#ffffff"
806
+ },
807
+ rubber: { roughness: 0.9, metalness: 0 },
808
+ leather: {
809
+ roughness: 0.7,
810
+ metalness: 0,
811
+ sheen: 0.3,
812
+ sheenRoughness: 0.6,
813
+ sheenColor: "#3d2b1f"
814
+ },
815
+ water: {
816
+ roughness: 0,
817
+ metalness: 0,
818
+ transmission: 0.9,
819
+ ior: 1.33,
820
+ transparent: true,
821
+ color: "#006994"
822
+ },
823
+ emissive: { roughness: 0.5, metalness: 0, emissiveIntensity: 2 },
824
+ hologram: {
825
+ roughness: 0,
826
+ metalness: 0.3,
827
+ transparent: true,
828
+ opacity: 0.6,
829
+ emissiveIntensity: 1
830
+ },
831
+ stone: { roughness: 0.85, metalness: 0, color: "#808080" },
832
+ marble: { roughness: 0.15, metalness: 0, color: "#F0EDE6", envMapIntensity: 0.8 },
833
+ shiny: { roughness: 0.05, metalness: 0.3, envMapIntensity: 1.5, clearcoat: 0.8 },
834
+ neon: {
835
+ roughness: 0,
836
+ metalness: 0,
837
+ emissiveIntensity: 3,
838
+ transparent: true,
839
+ opacity: 0.9
840
+ },
841
+ toon: { roughness: 1, metalness: 0 },
842
+ wireframe: { roughness: 0.5, metalness: 0.5, wireframe: true },
843
+ velvet: {
844
+ roughness: 1,
845
+ metalness: 0,
846
+ sheen: 1,
847
+ sheenRoughness: 0.8,
848
+ sheenColor: "#ffffff",
849
+ clearcoat: 0.3
850
+ },
851
+ xray: { roughness: 0, metalness: 0, transparent: true, opacity: 0.3, emissiveIntensity: 0.5 },
852
+ gradient: { roughness: 0.5, metalness: 0 },
853
+ matte: { roughness: 1, metalness: 0 },
854
+ // ===========================================================================
855
+ // REALISTIC FABRICS — differentiated by sheen, roughness, and anisotropy
856
+ // ===========================================================================
857
+ cotton: {
858
+ roughness: 0.95,
859
+ metalness: 0,
860
+ sheen: 0.6,
861
+ sheenRoughness: 0.9,
862
+ sheenColor: "#ffffff"
863
+ },
864
+ polyester: {
865
+ roughness: 0.7,
866
+ metalness: 0,
867
+ sheen: 0.8,
868
+ sheenRoughness: 0.4,
869
+ sheenColor: "#e8e8e8"
870
+ },
871
+ silk: {
872
+ roughness: 0.3,
873
+ metalness: 0,
874
+ sheen: 1,
875
+ sheenRoughness: 0.2,
876
+ sheenColor: "#fffaf0",
877
+ anisotropy: 0.8,
878
+ anisotropyRotation: 0
879
+ },
880
+ satin: {
881
+ roughness: 0.25,
882
+ metalness: 0,
883
+ sheen: 0.9,
884
+ sheenRoughness: 0.15,
885
+ sheenColor: "#fff5ee",
886
+ anisotropy: 0.6,
887
+ anisotropyRotation: 0
888
+ },
889
+ linen: {
890
+ roughness: 0.9,
891
+ metalness: 0,
892
+ sheen: 0.4,
893
+ sheenRoughness: 0.85,
894
+ sheenColor: "#f5f0e8"
895
+ },
896
+ wool: {
897
+ roughness: 1,
898
+ metalness: 0,
899
+ sheen: 0.7,
900
+ sheenRoughness: 1,
901
+ sheenColor: "#e8dcc8"
902
+ },
903
+ denim: {
904
+ roughness: 0.85,
905
+ metalness: 0,
906
+ color: "#2b4570",
907
+ sheen: 0.5,
908
+ sheenRoughness: 0.7,
909
+ sheenColor: "#4a6fa5"
910
+ },
911
+ canvas: {
912
+ roughness: 0.95,
913
+ metalness: 0,
914
+ color: "#c8b88a",
915
+ sheen: 0.3,
916
+ sheenRoughness: 0.9,
917
+ sheenColor: "#d4c9a8"
918
+ },
919
+ burlap: {
920
+ roughness: 1,
921
+ metalness: 0,
922
+ color: "#8b7355",
923
+ sheen: 0.2,
924
+ sheenRoughness: 1,
925
+ sheenColor: "#a08060"
926
+ },
927
+ // ===========================================================================
928
+ // SKIN & ORGANIC — differentiated by subsurface scattering
929
+ // ===========================================================================
930
+ skin: {
931
+ roughness: 0.5,
932
+ metalness: 0,
933
+ color: "#e8b89d",
934
+ thickness: 0.8,
935
+ attenuationColor: "#cc4422",
936
+ attenuationDistance: 0.5
937
+ },
938
+ skin_dark: {
939
+ roughness: 0.45,
940
+ metalness: 0,
941
+ color: "#8d5524",
942
+ thickness: 1,
943
+ attenuationColor: "#661111",
944
+ attenuationDistance: 0.3
945
+ },
946
+ // Dragon / creature material presets
947
+ dragon_bone: {
948
+ roughness: 0.35,
949
+ metalness: 0.15,
950
+ color: "#e8dcc8"
951
+ },
952
+ dragon_leather: {
953
+ roughness: 0.8,
954
+ metalness: 0,
955
+ color: "#5c3a21"
956
+ },
957
+ dragon_scale: {
958
+ roughness: 0.25,
959
+ metalness: 0.4,
960
+ color: "#1a0d3d"
961
+ },
962
+ obsidian: {
963
+ roughness: 0.05,
964
+ metalness: 0.1,
965
+ color: "#0d0d0d",
966
+ clearcoat: 0.9,
967
+ clearcoatRoughness: 0.1,
968
+ envMapIntensity: 1.2
969
+ },
970
+ skin_pale: {
971
+ roughness: 0.55,
972
+ metalness: 0,
973
+ color: "#fde0c8",
974
+ thickness: 0.6,
975
+ attenuationColor: "#ee5533",
976
+ attenuationDistance: 0.6
977
+ },
978
+ candle_wax: {
979
+ roughness: 0.7,
980
+ metalness: 0,
981
+ color: "#fff8dc",
982
+ thickness: 2,
983
+ attenuationColor: "#ffaa44",
984
+ attenuationDistance: 0.3,
985
+ transmission: 0.15
986
+ },
987
+ jade: {
988
+ roughness: 0.2,
989
+ metalness: 0,
990
+ color: "#00a86b",
991
+ thickness: 1.5,
992
+ attenuationColor: "#004d32",
993
+ attenuationDistance: 1,
994
+ transmission: 0.1
995
+ },
996
+ milk: {
997
+ roughness: 0.3,
998
+ metalness: 0,
999
+ color: "#fdfff5",
1000
+ thickness: 1,
1001
+ attenuationColor: "#fff5d6",
1002
+ attenuationDistance: 0.2,
1003
+ transmission: 0.6,
1004
+ ior: 1.35
1005
+ },
1006
+ leaf: {
1007
+ roughness: 0.6,
1008
+ metalness: 0,
1009
+ color: "#228b22",
1010
+ thickness: 0.3,
1011
+ attenuationColor: "#44cc22",
1012
+ attenuationDistance: 0.5
1013
+ },
1014
+ honey: {
1015
+ roughness: 0.1,
1016
+ metalness: 0,
1017
+ color: "#eb9605",
1018
+ thickness: 1.5,
1019
+ attenuationColor: "#cc6600",
1020
+ attenuationDistance: 0.4,
1021
+ transmission: 0.7,
1022
+ ior: 1.5
1023
+ },
1024
+ // ===========================================================================
1025
+ // MUD & EARTH — differentiated by roughness, color, and subtle properties
1026
+ // ===========================================================================
1027
+ clay_mud: {
1028
+ roughness: 0.95,
1029
+ metalness: 0,
1030
+ color: "#8b4513",
1031
+ thickness: 0.5,
1032
+ attenuationColor: "#663311",
1033
+ attenuationDistance: 0.8
1034
+ },
1035
+ sandy_mud: {
1036
+ roughness: 0.85,
1037
+ metalness: 0.02,
1038
+ color: "#c2a66b"
1039
+ },
1040
+ wet_mud: {
1041
+ roughness: 0.4,
1042
+ metalness: 0,
1043
+ color: "#3d2b1f",
1044
+ clearcoat: 0.6,
1045
+ clearcoatRoughness: 0.2
1046
+ },
1047
+ dry_earth: {
1048
+ roughness: 1,
1049
+ metalness: 0,
1050
+ color: "#9b7653"
1051
+ },
1052
+ peat: {
1053
+ roughness: 0.9,
1054
+ metalness: 0,
1055
+ color: "#2d1f0e"
1056
+ },
1057
+ red_clay: {
1058
+ roughness: 0.95,
1059
+ metalness: 0,
1060
+ color: "#cc4b2e",
1061
+ thickness: 0.4,
1062
+ attenuationColor: "#993322",
1063
+ attenuationDistance: 0.6
1064
+ },
1065
+ volcanic_ash: {
1066
+ roughness: 0.8,
1067
+ metalness: 0.05,
1068
+ color: "#3c3c3c"
1069
+ },
1070
+ wet_sand: {
1071
+ roughness: 0.6,
1072
+ metalness: 0.02,
1073
+ color: "#c2b280",
1074
+ clearcoat: 0.3,
1075
+ clearcoatRoughness: 0.4
1076
+ },
1077
+ dry_sand: {
1078
+ roughness: 0.95,
1079
+ metalness: 0.02,
1080
+ color: "#e0cc8e"
1081
+ },
1082
+ // ===========================================================================
1083
+ // METALS (BRUSHED/ANISOTROPIC) — directional roughness
1084
+ // ===========================================================================
1085
+ brushed_steel: {
1086
+ roughness: 0.35,
1087
+ metalness: 1,
1088
+ color: "#c0c0c0",
1089
+ anisotropy: 0.7,
1090
+ anisotropyRotation: 0
1091
+ },
1092
+ brushed_aluminum: {
1093
+ roughness: 0.3,
1094
+ metalness: 1,
1095
+ color: "#d0d0d0",
1096
+ anisotropy: 0.8,
1097
+ anisotropyRotation: 0
1098
+ },
1099
+ brushed_copper: {
1100
+ roughness: 0.35,
1101
+ metalness: 1,
1102
+ color: "#b87333",
1103
+ anisotropy: 0.6,
1104
+ anisotropyRotation: 0
1105
+ },
1106
+ cast_iron: {
1107
+ roughness: 0.7,
1108
+ metalness: 0.9,
1109
+ color: "#3a3a3a"
1110
+ },
1111
+ bronze: {
1112
+ roughness: 0.45,
1113
+ metalness: 1,
1114
+ color: "#cd7f32"
1115
+ },
1116
+ silver: {
1117
+ roughness: 0.15,
1118
+ metalness: 1,
1119
+ color: "#c0c0c0",
1120
+ envMapIntensity: 1.3
1121
+ },
1122
+ platinum: {
1123
+ roughness: 0.2,
1124
+ metalness: 1,
1125
+ color: "#e5e4e2",
1126
+ envMapIntensity: 1.2
1127
+ },
1128
+ rust: {
1129
+ roughness: 0.9,
1130
+ metalness: 0.3,
1131
+ color: "#8b3a15"
1132
+ },
1133
+ // ===========================================================================
1134
+ // HAIR & FIBERS — anisotropy-driven
1135
+ // ===========================================================================
1136
+ hair_dark: {
1137
+ roughness: 0.35,
1138
+ metalness: 0,
1139
+ color: "#1a1209",
1140
+ anisotropy: 1,
1141
+ anisotropyRotation: Math.PI / 2,
1142
+ sheen: 0.3,
1143
+ sheenRoughness: 0.3,
1144
+ sheenColor: "#2a2219"
1145
+ },
1146
+ hair_blonde: {
1147
+ roughness: 0.3,
1148
+ metalness: 0,
1149
+ color: "#c8a55a",
1150
+ anisotropy: 1,
1151
+ anisotropyRotation: Math.PI / 2,
1152
+ sheen: 0.4,
1153
+ sheenRoughness: 0.25,
1154
+ sheenColor: "#d4b86a"
1155
+ },
1156
+ hair_red: {
1157
+ roughness: 0.35,
1158
+ metalness: 0,
1159
+ color: "#8b3a15",
1160
+ anisotropy: 1,
1161
+ anisotropyRotation: Math.PI / 2,
1162
+ sheen: 0.35,
1163
+ sheenRoughness: 0.3,
1164
+ sheenColor: "#a04520"
1165
+ },
1166
+ // ===========================================================================
1167
+ // WET SURFACES — clearcoat simulates water film
1168
+ // ===========================================================================
1169
+ wet_stone: {
1170
+ roughness: 0.3,
1171
+ metalness: 0,
1172
+ color: "#606060",
1173
+ clearcoat: 0.8,
1174
+ clearcoatRoughness: 0.1
1175
+ },
1176
+ wet_wood: {
1177
+ roughness: 0.4,
1178
+ metalness: 0,
1179
+ color: "#5a3a1a",
1180
+ clearcoat: 0.7,
1181
+ clearcoatRoughness: 0.15
1182
+ },
1183
+ wet_concrete: {
1184
+ roughness: 0.5,
1185
+ metalness: 0,
1186
+ color: "#707070",
1187
+ clearcoat: 0.5,
1188
+ clearcoatRoughness: 0.2
1189
+ },
1190
+ // ===========================================================================
1191
+ // FOOD & ORGANIC — SSS-heavy
1192
+ // ===========================================================================
1193
+ fruit: {
1194
+ roughness: 0.4,
1195
+ metalness: 0,
1196
+ color: "#ff4444",
1197
+ thickness: 0.8,
1198
+ attenuationColor: "#cc2200",
1199
+ attenuationDistance: 0.5,
1200
+ clearcoat: 0.3,
1201
+ clearcoatRoughness: 0.2
1202
+ },
1203
+ cheese: {
1204
+ roughness: 0.7,
1205
+ metalness: 0,
1206
+ color: "#ffc125",
1207
+ thickness: 1.2,
1208
+ attenuationColor: "#cc9900",
1209
+ attenuationDistance: 0.4
1210
+ },
1211
+ bread: {
1212
+ roughness: 0.95,
1213
+ metalness: 0,
1214
+ color: "#c4a35a",
1215
+ thickness: 0.3,
1216
+ attenuationColor: "#8b6914",
1217
+ attenuationDistance: 0.8
1218
+ },
1219
+ chocolate: {
1220
+ roughness: 0.5,
1221
+ metalness: 0,
1222
+ color: "#3b1e08",
1223
+ clearcoat: 0.2,
1224
+ clearcoatRoughness: 0.3
1225
+ },
1226
+ // ===========================================================================
1227
+ // COATED SURFACES — clearcoat-driven
1228
+ // ===========================================================================
1229
+ car_paint: {
1230
+ roughness: 0.1,
1231
+ metalness: 0,
1232
+ clearcoat: 1,
1233
+ clearcoatRoughness: 0.05
1234
+ },
1235
+ lacquer: {
1236
+ roughness: 0.05,
1237
+ metalness: 0,
1238
+ clearcoat: 1,
1239
+ clearcoatRoughness: 0.02
1240
+ },
1241
+ varnished_wood: {
1242
+ roughness: 0.3,
1243
+ metalness: 0,
1244
+ color: "#8b5e3c",
1245
+ clearcoat: 0.9,
1246
+ clearcoatRoughness: 0.1
1247
+ },
1248
+ glazed_ceramic: {
1249
+ roughness: 0.15,
1250
+ metalness: 0,
1251
+ color: "#f0ede6",
1252
+ clearcoat: 0.8,
1253
+ clearcoatRoughness: 0.05
1254
+ },
1255
+ enamel: {
1256
+ roughness: 0.1,
1257
+ metalness: 0,
1258
+ clearcoat: 0.9,
1259
+ clearcoatRoughness: 0.03
1260
+ },
1261
+ // ===========================================================================
1262
+ // IRIDESCENT — thin-film interference
1263
+ // ===========================================================================
1264
+ soap_bubble: {
1265
+ roughness: 0,
1266
+ metalness: 0,
1267
+ transmission: 0.9,
1268
+ ior: 1.33,
1269
+ transparent: true,
1270
+ opacity: 0.3,
1271
+ iridescence: 1,
1272
+ iridescenceIOR: 1.5
1273
+ },
1274
+ oil_slick: {
1275
+ roughness: 0,
1276
+ metalness: 0.1,
1277
+ color: "#1a1a2e",
1278
+ iridescence: 1,
1279
+ iridescenceIOR: 1.8
1280
+ },
1281
+ beetle_shell: {
1282
+ roughness: 0.2,
1283
+ metalness: 0.3,
1284
+ color: "#0a3d0a",
1285
+ iridescence: 0.8,
1286
+ iridescenceIOR: 1.6,
1287
+ clearcoat: 0.5,
1288
+ clearcoatRoughness: 0.1
1289
+ },
1290
+ pearl: {
1291
+ roughness: 0.15,
1292
+ metalness: 0,
1293
+ color: "#fdeef4",
1294
+ iridescence: 0.6,
1295
+ iridescenceIOR: 1.3,
1296
+ sheen: 0.3,
1297
+ sheenRoughness: 0.2,
1298
+ sheenColor: "#fff0f5"
1299
+ },
1300
+ abalone: {
1301
+ roughness: 0.1,
1302
+ metalness: 0.1,
1303
+ color: "#e0f0e8",
1304
+ iridescence: 1,
1305
+ iridescenceIOR: 1.5
1306
+ },
1307
+ // ===========================================================================
1308
+ // GEMSTONES — transmission + IOR + iridescence
1309
+ // ===========================================================================
1310
+ diamond: {
1311
+ roughness: 0,
1312
+ metalness: 0,
1313
+ color: "#ffffff",
1314
+ transmission: 0.95,
1315
+ ior: 2.417,
1316
+ thickness: 0.5,
1317
+ transparent: true
1318
+ },
1319
+ ruby: {
1320
+ roughness: 0.05,
1321
+ metalness: 0,
1322
+ color: "#e0115f",
1323
+ transmission: 0.4,
1324
+ ior: 1.76,
1325
+ thickness: 1
1326
+ },
1327
+ sapphire: {
1328
+ roughness: 0.05,
1329
+ metalness: 0,
1330
+ color: "#0f52ba",
1331
+ transmission: 0.4,
1332
+ ior: 1.77,
1333
+ thickness: 1
1334
+ },
1335
+ emerald: {
1336
+ roughness: 0.1,
1337
+ metalness: 0,
1338
+ color: "#50c878",
1339
+ transmission: 0.3,
1340
+ ior: 1.57,
1341
+ thickness: 1.2
1342
+ },
1343
+ amber: {
1344
+ roughness: 0.1,
1345
+ metalness: 0,
1346
+ color: "#ffbf00",
1347
+ transmission: 0.6,
1348
+ ior: 1.55,
1349
+ thickness: 2,
1350
+ transparent: true,
1351
+ attenuationColor: "#cc6600",
1352
+ attenuationDistance: 1
1353
+ },
1354
+ opal: {
1355
+ roughness: 0.15,
1356
+ metalness: 0,
1357
+ color: "#e8e0d0",
1358
+ iridescence: 0.9,
1359
+ iridescenceIOR: 1.45,
1360
+ transmission: 0.1,
1361
+ ior: 1.45
1362
+ },
1363
+ amethyst: {
1364
+ roughness: 0.05,
1365
+ metalness: 0,
1366
+ color: "#9966cc",
1367
+ transmission: 0.5,
1368
+ ior: 1.54,
1369
+ thickness: 1,
1370
+ transparent: true
1371
+ },
1372
+ topaz: {
1373
+ roughness: 0.02,
1374
+ metalness: 0,
1375
+ color: "#ffc87c",
1376
+ transmission: 0.7,
1377
+ ior: 1.63,
1378
+ thickness: 0.8,
1379
+ transparent: true
1380
+ },
1381
+ turquoise: {
1382
+ roughness: 0.6,
1383
+ metalness: 0,
1384
+ color: "#40e0d0"
1385
+ },
1386
+ lapis_lazuli: {
1387
+ roughness: 0.4,
1388
+ metalness: 0,
1389
+ color: "#26619c",
1390
+ clearcoat: 0.3,
1391
+ clearcoatRoughness: 0.1
1392
+ },
1393
+ // ===========================================================================
1394
+ // MORE METALS — extended metallic palette
1395
+ // ===========================================================================
1396
+ titanium: {
1397
+ roughness: 0.25,
1398
+ metalness: 1,
1399
+ color: "#878681"
1400
+ },
1401
+ tungsten: {
1402
+ roughness: 0.3,
1403
+ metalness: 1,
1404
+ color: "#696969"
1405
+ },
1406
+ tin: {
1407
+ roughness: 0.35,
1408
+ metalness: 1,
1409
+ color: "#b0b0b0",
1410
+ envMapIntensity: 0.8
1411
+ },
1412
+ lead: {
1413
+ roughness: 0.6,
1414
+ metalness: 0.9,
1415
+ color: "#595959"
1416
+ },
1417
+ brass: {
1418
+ roughness: 0.35,
1419
+ metalness: 1,
1420
+ color: "#b5a642"
1421
+ },
1422
+ wrought_iron: {
1423
+ roughness: 0.7,
1424
+ metalness: 0.85,
1425
+ color: "#2c2c2c"
1426
+ },
1427
+ mercury: {
1428
+ roughness: 0,
1429
+ metalness: 1,
1430
+ color: "#d4d4d4",
1431
+ envMapIntensity: 2
1432
+ },
1433
+ // ===========================================================================
1434
+ // NATURAL / WEATHER — environmental surfaces
1435
+ // ===========================================================================
1436
+ snow: {
1437
+ roughness: 0.8,
1438
+ metalness: 0,
1439
+ color: "#f0f8ff",
1440
+ thickness: 0.5,
1441
+ attenuationColor: "#c8e0ff",
1442
+ attenuationDistance: 2
1443
+ },
1444
+ fresh_snow: {
1445
+ roughness: 0.6,
1446
+ metalness: 0,
1447
+ color: "#ffffff",
1448
+ sheen: 0.3,
1449
+ sheenRoughness: 0.5,
1450
+ sheenColor: "#e8f0ff"
1451
+ },
1452
+ frost: {
1453
+ roughness: 0.3,
1454
+ metalness: 0,
1455
+ color: "#e8f4f8",
1456
+ transmission: 0.15,
1457
+ ior: 1.31,
1458
+ clearcoat: 0.4,
1459
+ clearcoatRoughness: 0.1
1460
+ },
1461
+ ice: {
1462
+ roughness: 0.1,
1463
+ metalness: 0,
1464
+ color: "#d6eaf8",
1465
+ transmission: 0.8,
1466
+ ior: 1.31,
1467
+ transparent: true
1468
+ },
1469
+ moss: {
1470
+ roughness: 1,
1471
+ metalness: 0,
1472
+ color: "#4a7c3f",
1473
+ sheen: 0.2,
1474
+ sheenRoughness: 1,
1475
+ sheenColor: "#5a9c4f"
1476
+ },
1477
+ lichen: {
1478
+ roughness: 0.9,
1479
+ metalness: 0,
1480
+ color: "#8fa37a"
1481
+ },
1482
+ bark: {
1483
+ roughness: 0.95,
1484
+ metalness: 0,
1485
+ color: "#5c4033"
1486
+ },
1487
+ dried_leaves: {
1488
+ roughness: 0.9,
1489
+ metalness: 0,
1490
+ color: "#8b6914",
1491
+ thickness: 0.1,
1492
+ attenuationColor: "#664400",
1493
+ attenuationDistance: 0.3
1494
+ },
1495
+ // ===========================================================================
1496
+ // AGED / WEATHERED — patina, tarnish, wear
1497
+ // ===========================================================================
1498
+ patina: {
1499
+ roughness: 0.6,
1500
+ metalness: 0.4,
1501
+ color: "#4a9c7e"
1502
+ },
1503
+ tarnished_silver: {
1504
+ roughness: 0.5,
1505
+ metalness: 0.7,
1506
+ color: "#8a8a7a"
1507
+ },
1508
+ aged_bronze: {
1509
+ roughness: 0.55,
1510
+ metalness: 0.6,
1511
+ color: "#6b8e5a"
1512
+ },
1513
+ weathered_wood: {
1514
+ roughness: 0.95,
1515
+ metalness: 0,
1516
+ color: "#8a8070"
1517
+ },
1518
+ cracked_paint: {
1519
+ roughness: 0.8,
1520
+ metalness: 0,
1521
+ color: "#c8c0b0"
1522
+ },
1523
+ oxidized_copper: {
1524
+ roughness: 0.65,
1525
+ metalness: 0.5,
1526
+ color: "#2e8b57"
1527
+ },
1528
+ // ===========================================================================
1529
+ // CONSTRUCTION — architectural materials
1530
+ // ===========================================================================
1531
+ asphalt: {
1532
+ roughness: 0.9,
1533
+ metalness: 0,
1534
+ color: "#3a3a3a"
1535
+ },
1536
+ cement: {
1537
+ roughness: 0.85,
1538
+ metalness: 0,
1539
+ color: "#a0a0a0"
1540
+ },
1541
+ tile_ceramic: {
1542
+ roughness: 0.2,
1543
+ metalness: 0,
1544
+ color: "#e8e0d0",
1545
+ clearcoat: 0.6,
1546
+ clearcoatRoughness: 0.05
1547
+ },
1548
+ tile_porcelain: {
1549
+ roughness: 0.1,
1550
+ metalness: 0,
1551
+ color: "#f5f5f5",
1552
+ clearcoat: 0.8,
1553
+ clearcoatRoughness: 0.02
1554
+ },
1555
+ linoleum: {
1556
+ roughness: 0.6,
1557
+ metalness: 0,
1558
+ color: "#c0b090",
1559
+ clearcoat: 0.2,
1560
+ clearcoatRoughness: 0.3
1561
+ },
1562
+ drywall: {
1563
+ roughness: 1,
1564
+ metalness: 0,
1565
+ color: "#f0ece0"
1566
+ },
1567
+ rebar: {
1568
+ roughness: 0.6,
1569
+ metalness: 0.9,
1570
+ color: "#5a4a3a"
1571
+ },
1572
+ stucco: {
1573
+ roughness: 0.95,
1574
+ metalness: 0,
1575
+ color: "#e8dcc8"
1576
+ },
1577
+ gravel: {
1578
+ roughness: 1,
1579
+ metalness: 0.02,
1580
+ color: "#8a8070"
1581
+ },
1582
+ // ===========================================================================
1583
+ // LEATHER VARIANTS — sheen + clearcoat differentiation
1584
+ // ===========================================================================
1585
+ suede: {
1586
+ roughness: 1,
1587
+ metalness: 0,
1588
+ color: "#8b6914",
1589
+ sheen: 0.6,
1590
+ sheenRoughness: 1,
1591
+ sheenColor: "#a07828"
1592
+ },
1593
+ patent_leather: {
1594
+ roughness: 0.05,
1595
+ metalness: 0,
1596
+ color: "#1a1a1a",
1597
+ clearcoat: 1,
1598
+ clearcoatRoughness: 0.02
1599
+ },
1600
+ distressed_leather: {
1601
+ roughness: 0.8,
1602
+ metalness: 0,
1603
+ color: "#5a3a1a",
1604
+ sheen: 0.15,
1605
+ sheenRoughness: 0.8,
1606
+ sheenColor: "#4a3010"
1607
+ },
1608
+ nubuck: {
1609
+ roughness: 0.95,
1610
+ metalness: 0,
1611
+ color: "#c8a882",
1612
+ sheen: 0.5,
1613
+ sheenRoughness: 0.9,
1614
+ sheenColor: "#d4b892"
1615
+ },
1616
+ // ===========================================================================
1617
+ // RUBBER VARIANTS
1618
+ // ===========================================================================
1619
+ tire_rubber: {
1620
+ roughness: 0.85,
1621
+ metalness: 0,
1622
+ color: "#1a1a1a"
1623
+ },
1624
+ silicone: {
1625
+ roughness: 0.6,
1626
+ metalness: 0,
1627
+ color: "#e0e0e0",
1628
+ thickness: 0.5,
1629
+ attenuationColor: "#cccccc",
1630
+ attenuationDistance: 1,
1631
+ transmission: 0.05
1632
+ },
1633
+ latex: {
1634
+ roughness: 0.3,
1635
+ metalness: 0,
1636
+ color: "#ffefd5",
1637
+ clearcoat: 0.5,
1638
+ clearcoatRoughness: 0.1,
1639
+ thickness: 0.3,
1640
+ attenuationColor: "#ffcc88",
1641
+ attenuationDistance: 0.5
1642
+ },
1643
+ eraser: {
1644
+ roughness: 0.95,
1645
+ metalness: 0,
1646
+ color: "#ff6b81"
1647
+ },
1648
+ // ===========================================================================
1649
+ // LIQUIDS — transmission + animated surface hints
1650
+ // ===========================================================================
1651
+ lava: {
1652
+ roughness: 0.8,
1653
+ metalness: 0,
1654
+ color: "#ff4400",
1655
+ emissive: "#ff2200",
1656
+ emissiveIntensity: 3
1657
+ },
1658
+ blood: {
1659
+ roughness: 0.2,
1660
+ metalness: 0,
1661
+ color: "#8b0000",
1662
+ clearcoat: 0.7,
1663
+ clearcoatRoughness: 0.05,
1664
+ thickness: 1,
1665
+ attenuationColor: "#440000",
1666
+ attenuationDistance: 0.3
1667
+ },
1668
+ oil_liquid: {
1669
+ roughness: 0.05,
1670
+ metalness: 0,
1671
+ color: "#1a1a0a",
1672
+ clearcoat: 0.9,
1673
+ clearcoatRoughness: 0.02
1674
+ },
1675
+ molten_metal: {
1676
+ roughness: 0.15,
1677
+ metalness: 0.8,
1678
+ color: "#ff8c00",
1679
+ emissive: "#ff6600",
1680
+ emissiveIntensity: 5
1681
+ },
1682
+ syrup: {
1683
+ roughness: 0.1,
1684
+ metalness: 0,
1685
+ color: "#8b4513",
1686
+ transmission: 0.4,
1687
+ ior: 1.49,
1688
+ thickness: 2,
1689
+ attenuationColor: "#663300",
1690
+ attenuationDistance: 0.5
1691
+ },
1692
+ // ===========================================================================
1693
+ // BLACKBODY / THERMAL — temperature-driven emission
1694
+ // ===========================================================================
1695
+ heated_metal_low: {
1696
+ roughness: 0.5,
1697
+ metalness: 0.9,
1698
+ color: "#4a4a4a",
1699
+ emissive: "#ff1a00",
1700
+ emissiveIntensity: 1.5
1701
+ },
1702
+ heated_metal_mid: {
1703
+ roughness: 0.4,
1704
+ metalness: 0.8,
1705
+ color: "#5a5a5a",
1706
+ emissive: "#ff6600",
1707
+ emissiveIntensity: 3
1708
+ },
1709
+ heated_metal_hot: {
1710
+ roughness: 0.3,
1711
+ metalness: 0.7,
1712
+ color: "#6a6a6a",
1713
+ emissive: "#ffcc00",
1714
+ emissiveIntensity: 5
1715
+ },
1716
+ heated_metal_white: {
1717
+ roughness: 0.2,
1718
+ metalness: 0.6,
1719
+ color: "#8a8a8a",
1720
+ emissive: "#ffffff",
1721
+ emissiveIntensity: 8
1722
+ },
1723
+ ember: {
1724
+ roughness: 0.9,
1725
+ metalness: 0,
1726
+ color: "#2a0a00",
1727
+ emissive: "#ff4400",
1728
+ emissiveIntensity: 2
1729
+ },
1730
+ coal: {
1731
+ roughness: 0.85,
1732
+ metalness: 0,
1733
+ color: "#1a1a1a",
1734
+ emissive: "#cc2200",
1735
+ emissiveIntensity: 0.5
1736
+ },
1737
+ // ===========================================================================
1738
+ // SPECIAL EFFECTS — sparkle, glow, energy
1739
+ // ===========================================================================
1740
+ glitter: {
1741
+ roughness: 0.2,
1742
+ metalness: 0.8,
1743
+ color: "#ffd700",
1744
+ envMapIntensity: 2
1745
+ },
1746
+ sequin: {
1747
+ roughness: 0.05,
1748
+ metalness: 1,
1749
+ envMapIntensity: 2.5,
1750
+ iridescence: 0.3
1751
+ },
1752
+ mica: {
1753
+ roughness: 0.3,
1754
+ metalness: 0.2,
1755
+ color: "#c8b888",
1756
+ iridescence: 0.4,
1757
+ iridescenceIOR: 1.58,
1758
+ sheen: 0.2,
1759
+ sheenRoughness: 0.3,
1760
+ sheenColor: "#d4c498"
1761
+ },
1762
+ fluorescent_green: {
1763
+ roughness: 0.5,
1764
+ metalness: 0,
1765
+ color: "#39ff14",
1766
+ emissive: "#39ff14",
1767
+ emissiveIntensity: 1.5
1768
+ },
1769
+ fluorescent_orange: {
1770
+ roughness: 0.5,
1771
+ metalness: 0,
1772
+ color: "#ff6700",
1773
+ emissive: "#ff6700",
1774
+ emissiveIntensity: 1.5
1775
+ },
1776
+ fluorescent_pink: {
1777
+ roughness: 0.5,
1778
+ metalness: 0,
1779
+ color: "#ff1493",
1780
+ emissive: "#ff1493",
1781
+ emissiveIntensity: 1.5
1782
+ },
1783
+ glow_in_dark: {
1784
+ roughness: 0.7,
1785
+ metalness: 0,
1786
+ color: "#2a3a2a",
1787
+ emissive: "#44ff44",
1788
+ emissiveIntensity: 0.8
1789
+ },
1790
+ plasma: {
1791
+ roughness: 0,
1792
+ metalness: 0,
1793
+ color: "#4400ff",
1794
+ emissive: "#8844ff",
1795
+ emissiveIntensity: 4,
1796
+ transparent: true,
1797
+ opacity: 0.7
1798
+ },
1799
+ energy_field: {
1800
+ roughness: 0,
1801
+ metalness: 0,
1802
+ emissive: "#00ccff",
1803
+ emissiveIntensity: 3,
1804
+ transparent: true,
1805
+ opacity: 0.4,
1806
+ transmission: 0.6
1807
+ },
1808
+ force_field: {
1809
+ roughness: 0,
1810
+ metalness: 0,
1811
+ emissive: "#00ff88",
1812
+ emissiveIntensity: 2,
1813
+ transparent: true,
1814
+ opacity: 0.2,
1815
+ iridescence: 0.8,
1816
+ iridescenceIOR: 1.5
1817
+ },
1818
+ // ===========================================================================
1819
+ // RETROREFLECTIVE — safety, signage
1820
+ // ===========================================================================
1821
+ safety_vest: {
1822
+ roughness: 0.6,
1823
+ metalness: 0,
1824
+ color: "#ccff00",
1825
+ emissive: "#ccff00",
1826
+ emissiveIntensity: 0.3
1827
+ },
1828
+ road_sign: {
1829
+ roughness: 0.4,
1830
+ metalness: 0.1,
1831
+ color: "#ffffff",
1832
+ envMapIntensity: 1.8,
1833
+ emissive: "#ffffff",
1834
+ emissiveIntensity: 0.2
1835
+ },
1836
+ reflective_tape: {
1837
+ roughness: 0.2,
1838
+ metalness: 0.3,
1839
+ color: "#e0e0e0",
1840
+ envMapIntensity: 2.5
1841
+ },
1842
+ // ===========================================================================
1843
+ // MISC — everything else in the real world
1844
+ // ===========================================================================
1845
+ chalkboard: {
1846
+ roughness: 0.9,
1847
+ metalness: 0,
1848
+ color: "#2a3a2a"
1849
+ },
1850
+ chalk: {
1851
+ roughness: 1,
1852
+ metalness: 0,
1853
+ color: "#ffffff"
1854
+ },
1855
+ charcoal: {
1856
+ roughness: 0.9,
1857
+ metalness: 0,
1858
+ color: "#1a1a1a"
1859
+ },
1860
+ cork: {
1861
+ roughness: 0.95,
1862
+ metalness: 0,
1863
+ color: "#b88a50"
1864
+ },
1865
+ felt: {
1866
+ roughness: 1,
1867
+ metalness: 0,
1868
+ color: "#5a8a5a",
1869
+ sheen: 0.4,
1870
+ sheenRoughness: 1,
1871
+ sheenColor: "#6a9a6a"
1872
+ },
1873
+ sponge: {
1874
+ roughness: 1,
1875
+ metalness: 0,
1876
+ color: "#e8c840"
1877
+ },
1878
+ porcelain: {
1879
+ roughness: 0.1,
1880
+ metalness: 0,
1881
+ color: "#f8f4f0",
1882
+ clearcoat: 0.7,
1883
+ clearcoatRoughness: 0.02
1884
+ },
1885
+ terracotta: {
1886
+ roughness: 0.85,
1887
+ metalness: 0,
1888
+ color: "#cc6644"
1889
+ },
1890
+ concrete_polished: {
1891
+ roughness: 0.3,
1892
+ metalness: 0,
1893
+ color: "#a0a0a0",
1894
+ clearcoat: 0.3,
1895
+ clearcoatRoughness: 0.15
1896
+ },
1897
+ rope: {
1898
+ roughness: 1,
1899
+ metalness: 0,
1900
+ color: "#c4a35a",
1901
+ sheen: 0.2,
1902
+ sheenRoughness: 1,
1903
+ sheenColor: "#b89848"
1904
+ },
1905
+ wicker: {
1906
+ roughness: 0.9,
1907
+ metalness: 0,
1908
+ color: "#a08050"
1909
+ },
1910
+ parchment: {
1911
+ roughness: 0.8,
1912
+ metalness: 0,
1913
+ color: "#f0e6c8",
1914
+ thickness: 0.1,
1915
+ attenuationColor: "#d4c0a0",
1916
+ attenuationDistance: 0.2
1917
+ },
1918
+ // ===========================================================================
1919
+ // ANIMATED MATERIALS — time-driven surface effects (wired to scene.time)
1920
+ // These set metadata flags that the runtime uses to drive animated shaders.
1921
+ // ===========================================================================
1922
+ flowing_water: {
1923
+ roughness: 0,
1924
+ metalness: 0,
1925
+ color: "#006994",
1926
+ transmission: 0.85,
1927
+ ior: 1.33,
1928
+ transparent: true,
1929
+ _animated: { pattern: "flow", speed: 0.8, amplitude: 0.3 }
1930
+ },
1931
+ rippling_water: {
1932
+ roughness: 0.05,
1933
+ metalness: 0,
1934
+ color: "#005577",
1935
+ transmission: 0.8,
1936
+ ior: 1.33,
1937
+ transparent: true,
1938
+ _animated: { pattern: "ripple", speed: 1, amplitude: 0.4 }
1939
+ },
1940
+ flickering_fire: {
1941
+ roughness: 0.8,
1942
+ metalness: 0,
1943
+ color: "#ff4400",
1944
+ emissive: "#ff2200",
1945
+ emissiveIntensity: 3,
1946
+ _animated: { pattern: "flicker", speed: 3, amplitude: 0.6 }
1947
+ },
1948
+ pulsing_glow: {
1949
+ roughness: 0.5,
1950
+ metalness: 0,
1951
+ emissive: "#00ff88",
1952
+ emissiveIntensity: 2,
1953
+ _animated: { pattern: "pulse", speed: 1.5, amplitude: 0.5 }
1954
+ },
1955
+ breathing_light: {
1956
+ roughness: 0.3,
1957
+ metalness: 0,
1958
+ emissive: "#4488ff",
1959
+ emissiveIntensity: 1.5,
1960
+ _animated: { pattern: "breathe", speed: 0.5, amplitude: 0.8 }
1961
+ },
1962
+ scrolling_lava: {
1963
+ roughness: 0.8,
1964
+ metalness: 0,
1965
+ color: "#ff4400",
1966
+ emissive: "#ff2200",
1967
+ emissiveIntensity: 4,
1968
+ _animated: { pattern: "scroll", speed: 0.3, amplitude: 1 }
1969
+ },
1970
+ waving_grass: {
1971
+ roughness: 0.9,
1972
+ metalness: 0,
1973
+ color: "#228b22",
1974
+ sheen: 0.2,
1975
+ sheenRoughness: 0.8,
1976
+ sheenColor: "#44cc22",
1977
+ _animated: { pattern: "wave", speed: 0.8, amplitude: 0.2 }
1978
+ },
1979
+ flickering_neon: {
1980
+ roughness: 0,
1981
+ metalness: 0,
1982
+ emissive: "#ff00ff",
1983
+ emissiveIntensity: 3.5,
1984
+ transparent: true,
1985
+ opacity: 0.9,
1986
+ _animated: { pattern: "flicker", speed: 5, amplitude: 0.4 }
1987
+ },
1988
+ pulsing_crystal: {
1989
+ roughness: 0,
1990
+ metalness: 0.1,
1991
+ transmission: 0.8,
1992
+ ior: 2,
1993
+ iridescence: 0.8,
1994
+ iridescenceIOR: 1.3,
1995
+ emissive: "#8844ff",
1996
+ emissiveIntensity: 1,
1997
+ _animated: { pattern: "pulse", speed: 0.8, amplitude: 0.6 }
1998
+ },
1999
+ animated_hologram: {
2000
+ roughness: 0,
2001
+ metalness: 0.3,
2002
+ transparent: true,
2003
+ opacity: 0.5,
2004
+ emissive: "#00ccff",
2005
+ emissiveIntensity: 1.5,
2006
+ _animated: { pattern: "scroll", speed: 1.5, amplitude: 0.3 }
2007
+ },
2008
+ boiling_surface: {
2009
+ roughness: 0.7,
2010
+ metalness: 0,
2011
+ color: "#cc4400",
2012
+ emissive: "#ff6600",
2013
+ emissiveIntensity: 2,
2014
+ _animated: { pattern: "noise", speed: 2, amplitude: 0.5 }
2015
+ },
2016
+ shimmer_heat: {
2017
+ roughness: 0,
2018
+ metalness: 0,
2019
+ transparent: true,
2020
+ opacity: 0.15,
2021
+ _animated: { pattern: "wave", speed: 2, amplitude: 0.1 }
2022
+ },
2023
+ // ===========================================================================
2024
+ // VOLUMETRIC MATERIALS — metadata for ray-marched volume rendering
2025
+ // These presets describe volumetric phenomena; the runtime renders them via
2026
+ // a ray marching pass on a bounding box/sphere geometry.
2027
+ // ===========================================================================
2028
+ fog: {
2029
+ roughness: 0,
2030
+ metalness: 0,
2031
+ color: "#c0c0c0",
2032
+ transparent: true,
2033
+ opacity: 0.3,
2034
+ _volumetric: { type: "fog", density: 0.3, scattering: 0.8, absorption: 0.05 }
2035
+ },
2036
+ dense_fog: {
2037
+ roughness: 0,
2038
+ metalness: 0,
2039
+ color: "#a0a0a0",
2040
+ transparent: true,
2041
+ opacity: 0.5,
2042
+ _volumetric: { type: "fog", density: 0.7, scattering: 0.9, absorption: 0.1 }
2043
+ },
2044
+ smoke: {
2045
+ roughness: 0,
2046
+ metalness: 0,
2047
+ color: "#404040",
2048
+ transparent: true,
2049
+ opacity: 0.4,
2050
+ _volumetric: {
2051
+ type: "smoke",
2052
+ density: 0.5,
2053
+ scattering: 0.3,
2054
+ absorption: 0.4,
2055
+ riseSpeed: 0.5,
2056
+ turbulence: 0.6
2057
+ }
2058
+ },
2059
+ campfire_smoke: {
2060
+ roughness: 0,
2061
+ metalness: 0,
2062
+ color: "#505050",
2063
+ transparent: true,
2064
+ opacity: 0.35,
2065
+ _volumetric: {
2066
+ type: "smoke",
2067
+ density: 0.4,
2068
+ scattering: 0.25,
2069
+ absorption: 0.5,
2070
+ riseSpeed: 0.8,
2071
+ turbulence: 0.4
2072
+ }
2073
+ },
2074
+ fire_volume: {
2075
+ roughness: 0,
2076
+ metalness: 0,
2077
+ color: "#ff4400",
2078
+ emissive: "#ff2200",
2079
+ emissiveIntensity: 4,
2080
+ transparent: true,
2081
+ opacity: 0.7,
2082
+ _volumetric: {
2083
+ type: "fire",
2084
+ density: 0.6,
2085
+ scattering: 0.1,
2086
+ absorption: 0.2,
2087
+ riseSpeed: 1.2,
2088
+ turbulence: 0.7,
2089
+ temperature: 2500
2090
+ }
2091
+ },
2092
+ candle_flame: {
2093
+ roughness: 0,
2094
+ metalness: 0,
2095
+ color: "#ffaa33",
2096
+ emissive: "#ff8800",
2097
+ emissiveIntensity: 3,
2098
+ transparent: true,
2099
+ opacity: 0.6,
2100
+ _volumetric: {
2101
+ type: "fire",
2102
+ density: 0.4,
2103
+ scattering: 0.05,
2104
+ absorption: 0.1,
2105
+ riseSpeed: 0.3,
2106
+ turbulence: 0.2,
2107
+ temperature: 1800
2108
+ }
2109
+ },
2110
+ clouds: {
2111
+ roughness: 0,
2112
+ metalness: 0,
2113
+ color: "#ffffff",
2114
+ transparent: true,
2115
+ opacity: 0.6,
2116
+ _volumetric: {
2117
+ type: "clouds",
2118
+ density: 0.4,
2119
+ scattering: 0.95,
2120
+ absorption: 0.02,
2121
+ noiseScale: 2,
2122
+ octaves: 6
2123
+ }
2124
+ },
2125
+ storm_clouds: {
2126
+ roughness: 0,
2127
+ metalness: 0,
2128
+ color: "#3a3a4a",
2129
+ transparent: true,
2130
+ opacity: 0.8,
2131
+ _volumetric: {
2132
+ type: "clouds",
2133
+ density: 0.7,
2134
+ scattering: 0.6,
2135
+ absorption: 0.15,
2136
+ noiseScale: 1.5,
2137
+ octaves: 6
2138
+ }
2139
+ },
2140
+ dust_motes: {
2141
+ roughness: 0,
2142
+ metalness: 0,
2143
+ color: "#c8b888",
2144
+ transparent: true,
2145
+ opacity: 0.15,
2146
+ _volumetric: { type: "dust", density: 0.1, scattering: 0.5, absorption: 0.02 }
2147
+ },
2148
+ mist: {
2149
+ roughness: 0,
2150
+ metalness: 0,
2151
+ color: "#e0e8f0",
2152
+ transparent: true,
2153
+ opacity: 0.25,
2154
+ _volumetric: {
2155
+ type: "mist",
2156
+ density: 0.2,
2157
+ scattering: 0.85,
2158
+ absorption: 0.03,
2159
+ heightFalloff: 1.5
2160
+ }
2161
+ },
2162
+ steam: {
2163
+ roughness: 0,
2164
+ metalness: 0,
2165
+ color: "#e8e8e8",
2166
+ transparent: true,
2167
+ opacity: 0.3,
2168
+ _volumetric: {
2169
+ type: "steam",
2170
+ density: 0.35,
2171
+ scattering: 0.7,
2172
+ absorption: 0.05,
2173
+ riseSpeed: 1,
2174
+ turbulence: 0.3
2175
+ }
2176
+ },
2177
+ aurora_borealis: {
2178
+ roughness: 0,
2179
+ metalness: 0,
2180
+ emissive: "#00ff88",
2181
+ emissiveIntensity: 2,
2182
+ transparent: true,
2183
+ opacity: 0.3,
2184
+ _volumetric: {
2185
+ type: "aurora",
2186
+ density: 0.15,
2187
+ scattering: 0.1,
2188
+ absorption: 0.01,
2189
+ emissionIntensity: 2
2190
+ }
2191
+ },
2192
+ nebula: {
2193
+ roughness: 0,
2194
+ metalness: 0,
2195
+ emissive: "#ff44aa",
2196
+ emissiveIntensity: 1.5,
2197
+ transparent: true,
2198
+ opacity: 0.4,
2199
+ _volumetric: {
2200
+ type: "nebula",
2201
+ density: 0.25,
2202
+ scattering: 0.3,
2203
+ absorption: 0.05,
2204
+ emissionIntensity: 1.5,
2205
+ noiseScale: 1
2206
+ }
2207
+ },
2208
+ underwater_caustics: {
2209
+ roughness: 0,
2210
+ metalness: 0,
2211
+ color: "#003366",
2212
+ transparent: true,
2213
+ opacity: 0.2,
2214
+ _volumetric: { type: "underwater", density: 0.15, scattering: 0.6, absorption: 0.1 }
2215
+ },
2216
+ god_rays: {
2217
+ roughness: 0,
2218
+ metalness: 0,
2219
+ color: "#ffffd0",
2220
+ transparent: true,
2221
+ opacity: 0.15,
2222
+ emissive: "#ffff88",
2223
+ emissiveIntensity: 0.5,
2224
+ _volumetric: { type: "god_rays", density: 0.1, scattering: 0.9, absorption: 0.01 }
2225
+ },
2226
+ neon_gas: {
2227
+ roughness: 0,
2228
+ metalness: 0,
2229
+ emissive: "#ff4400",
2230
+ emissiveIntensity: 3,
2231
+ transparent: true,
2232
+ opacity: 0.5,
2233
+ _volumetric: {
2234
+ type: "neon_gas",
2235
+ density: 0.3,
2236
+ scattering: 0.2,
2237
+ absorption: 0.05,
2238
+ emissionIntensity: 3
2239
+ }
2240
+ },
2241
+ explosion: {
2242
+ roughness: 0,
2243
+ metalness: 0,
2244
+ color: "#ff6600",
2245
+ emissive: "#ff4400",
2246
+ emissiveIntensity: 6,
2247
+ transparent: true,
2248
+ opacity: 0.8,
2249
+ _volumetric: {
2250
+ type: "fire",
2251
+ density: 0.8,
2252
+ scattering: 0.15,
2253
+ absorption: 0.3,
2254
+ riseSpeed: 2,
2255
+ turbulence: 1,
2256
+ temperature: 4e3
2257
+ }
2258
+ },
2259
+ toxic_gas: {
2260
+ roughness: 0,
2261
+ metalness: 0,
2262
+ color: "#44cc00",
2263
+ emissive: "#33aa00",
2264
+ emissiveIntensity: 1,
2265
+ transparent: true,
2266
+ opacity: 0.35,
2267
+ _volumetric: {
2268
+ type: "smoke",
2269
+ density: 0.3,
2270
+ scattering: 0.4,
2271
+ absorption: 0.2,
2272
+ riseSpeed: 0.2,
2273
+ turbulence: 0.3
2274
+ }
2275
+ },
2276
+ magical_mist: {
2277
+ roughness: 0,
2278
+ metalness: 0,
2279
+ emissive: "#8844ff",
2280
+ emissiveIntensity: 1.5,
2281
+ transparent: true,
2282
+ opacity: 0.3,
2283
+ iridescence: 0.6,
2284
+ iridescenceIOR: 1.5,
2285
+ _volumetric: {
2286
+ type: "mist",
2287
+ density: 0.2,
2288
+ scattering: 0.5,
2289
+ absorption: 0.03,
2290
+ emissionIntensity: 1.5
2291
+ }
2292
+ },
2293
+ // --- Architectural & Natural Stone ---
2294
+ brick: { roughness: 0.9, metalness: 0, color: "#a6523c" },
2295
+ concrete: { roughness: 0.88, metalness: 0, color: "#8a8a8a" },
2296
+ granite: { roughness: 0.6, metalness: 0, color: "#666670" },
2297
+ sandstone: { roughness: 0.85, metalness: 0, color: "#cca66e" },
2298
+ slate: { roughness: 0.7, metalness: 0, color: "#3f4450" },
2299
+ adobe: { roughness: 0.95, metalness: 0, color: "#bf9160" },
2300
+ plaster: { roughness: 0.82, metalness: 0, color: "#ebe8de" },
2301
+ // --- Plant & Cellulose ---
2302
+ bamboo: { roughness: 0.65, metalness: 0, color: "#b3a84d" },
2303
+ paper: { roughness: 0.9, metalness: 0, color: "#f3f0e5" },
2304
+ cardboard: { roughness: 0.88, metalness: 0, color: "#b88c58" },
2305
+ // --- Organic & Animal ---
2306
+ bone: { roughness: 0.7, metalness: 0, color: "#e0d4b5" },
2307
+ ivory: { roughness: 0.35, metalness: 0, color: "#f0e8c5", envMapIntensity: 0.4 },
2308
+ coral: { roughness: 0.75, metalness: 0, color: "#f2614d" },
2309
+ shell: {
2310
+ roughness: 0.25,
2311
+ metalness: 0.05,
2312
+ color: "#f5ede0",
2313
+ iridescence: 0.8,
2314
+ iridescenceIOR: 1.5,
2315
+ envMapIntensity: 0.6
2316
+ },
2317
+ thatch: { roughness: 0.95, metalness: 0, color: "#c0a84a" },
2318
+ // --- Synthetic & Engineered ---
2319
+ resin: {
2320
+ roughness: 0.08,
2321
+ metalness: 0,
2322
+ transmission: 0.75,
2323
+ ior: 1.5,
2324
+ color: "#e8c46a",
2325
+ transparent: true,
2326
+ opacity: 0.88
2327
+ },
2328
+ foam: { roughness: 0.95, metalness: 0, color: "#f0f0f0" },
2329
+ composite: { roughness: 0.5, metalness: 0.25, color: "#333338" },
2330
+ carbon_fiber: {
2331
+ roughness: 0.28,
2332
+ metalness: 0.6,
2333
+ color: "#111114",
2334
+ envMapIntensity: 1.2,
2335
+ clearcoat: 0.6,
2336
+ clearcoatRoughness: 0.1
2337
+ },
2338
+ kevlar: { roughness: 0.82, metalness: 0, color: "#ccbb66" },
2339
+ fiberglass: {
2340
+ roughness: 0.3,
2341
+ metalness: 0.05,
2342
+ transmission: 0.4,
2343
+ ior: 1.45,
2344
+ color: "#e0ede0",
2345
+ transparent: true,
2346
+ opacity: 0.92
2347
+ },
2348
+ stained_glass: {
2349
+ roughness: 0.05,
2350
+ metalness: 0,
2351
+ transmission: 0.85,
2352
+ ior: 1.52,
2353
+ color: "#cc44ff",
2354
+ transparent: true,
2355
+ opacity: 0.75,
2356
+ thickness: 0.3
2357
+ }
2358
+ };
2359
+ exports.ENVIRONMENT_PRESETS = {
2360
+ forest_sunset: {
2361
+ background: true,
2362
+ envPreset: "sunset",
2363
+ fog: { color: "#ff9966", near: 10, far: 100 },
2364
+ ground: { color: "#2d5a27" },
2365
+ lighting: {
2366
+ ambient: { color: "#ffa366", intensity: 0.3 },
2367
+ directional: { color: "#ff7700", intensity: 1.5, position: [10, 20, 5], shadows: true }
2368
+ }
2369
+ },
2370
+ cyberpunk_city: {
2371
+ background: true,
2372
+ envPreset: "night",
2373
+ fog: { color: "#0a0020", near: 5, far: 60 },
2374
+ ground: { color: "#1a1a2e" },
2375
+ lighting: {
2376
+ ambient: { color: "#220044", intensity: 0.2 },
2377
+ directional: { color: "#ff00ff", intensity: 0.5, position: [5, 15, 5], shadows: true },
2378
+ points: [
2379
+ { color: "#00ffff", intensity: 3, position: [-5, 3, -5], distance: 15 },
2380
+ { color: "#ff00ff", intensity: 3, position: [5, 3, 5], distance: 15 }
2381
+ ]
2382
+ },
2383
+ postprocessing: { bloom: { intensity: 1.5, luminanceThreshold: 0.1 } }
2384
+ },
2385
+ space_void: {
2386
+ background: true,
2387
+ envPreset: "night",
2388
+ lighting: {
2389
+ ambient: { color: "#111133", intensity: 0.1 },
2390
+ directional: { color: "#ffffff", intensity: 0.5, position: [0, 10, 0], shadows: false }
2391
+ }
2392
+ },
2393
+ studio: {
2394
+ background: true,
2395
+ envPreset: "studio",
2396
+ ground: { color: "#cccccc" },
2397
+ lighting: {
2398
+ ambient: { color: "#ffffff", intensity: 0.4 },
2399
+ directional: { color: "#ffffff", intensity: 1, position: [5, 10, 5], shadows: true }
2400
+ }
2401
+ },
2402
+ underwater: {
2403
+ background: true,
2404
+ envPreset: "dawn",
2405
+ fog: { color: "#003366", near: 2, far: 40 },
2406
+ ground: { color: "#1a3a4a" },
2407
+ lighting: {
2408
+ ambient: { color: "#004488", intensity: 0.3 },
2409
+ directional: { color: "#66aacc", intensity: 0.8, position: [0, 20, 0], shadows: true }
2410
+ }
2411
+ },
2412
+ desert: {
2413
+ background: true,
2414
+ envPreset: "sunset",
2415
+ fog: { color: "#d4a574", near: 20, far: 150 },
2416
+ ground: { color: "#c4a35a" },
2417
+ lighting: {
2418
+ ambient: { color: "#f5deb3", intensity: 0.4 },
2419
+ directional: { color: "#ffffcc", intensity: 2, position: [15, 30, 10], shadows: true }
2420
+ }
2421
+ }
2422
+ };
2423
+ MESH_TYPES = /* @__PURE__ */ new Set([
2424
+ "orb",
2425
+ "sphere",
2426
+ "cube",
2427
+ "box",
2428
+ "cylinder",
2429
+ "pyramid",
2430
+ "cone",
2431
+ "plane",
2432
+ "torus",
2433
+ "ring",
2434
+ "capsule",
2435
+ "object",
2436
+ "avatar",
2437
+ "dna",
2438
+ "gaussian_splat",
2439
+ "splat",
2440
+ "nerf",
2441
+ "volumetric_video",
2442
+ // Procedural geometry types (hull/spline/membrane/blob/metaball)
2443
+ "hull",
2444
+ "spline",
2445
+ "membrane",
2446
+ "blob",
2447
+ "metaball"
2448
+ ]);
2449
+ exports.UI_COMPONENT_PRESETS = {
2450
+ UIPanel: {
2451
+ component: "Container",
2452
+ // @react-three/uikit Container
2453
+ defaultProps: {
2454
+ flexDirection: "column",
2455
+ padding: 16,
2456
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
2457
+ borderRadius: 8
2458
+ }
2459
+ },
2460
+ UIText: {
2461
+ component: "Text",
2462
+ // @react-three/uikit Text
2463
+ defaultProps: {
2464
+ fontSize: 16,
2465
+ color: "white"
2466
+ }
2467
+ },
2468
+ UIButton: {
2469
+ component: "Button",
2470
+ // Custom button using Container with hover
2471
+ defaultProps: {
2472
+ padding: 12,
2473
+ paddingX: 24,
2474
+ backgroundColor: "#4a90d9",
2475
+ borderRadius: 4,
2476
+ cursor: "pointer"
2477
+ }
2478
+ },
2479
+ UISlider: {
2480
+ component: "Slider",
2481
+ // Custom slider implementation
2482
+ defaultProps: {
2483
+ width: 200,
2484
+ height: 20,
2485
+ trackColor: "#333",
2486
+ fillColor: "#4a90d9",
2487
+ thumbSize: 16
2488
+ }
2489
+ },
2490
+ UIInput: {
2491
+ component: "Input",
2492
+ // @react-three/uikit Input
2493
+ defaultProps: {
2494
+ width: 200,
2495
+ padding: 8,
2496
+ backgroundColor: "#222",
2497
+ borderColor: "#444",
2498
+ borderWidth: 1,
2499
+ borderRadius: 4,
2500
+ color: "white"
2501
+ }
2502
+ },
2503
+ UIImage: {
2504
+ component: "Image",
2505
+ // @react-three/uikit Image
2506
+ defaultProps: {
2507
+ objectFit: "contain"
2508
+ }
2509
+ },
2510
+ UIChart: {
2511
+ component: "Chart",
2512
+ // Custom chart component
2513
+ defaultProps: {
2514
+ width: 300,
2515
+ height: 200,
2516
+ backgroundColor: "#1a1a2e"
2517
+ }
2518
+ },
2519
+ UIGauge: {
2520
+ component: "Gauge",
2521
+ // Custom gauge component
2522
+ defaultProps: {
2523
+ size: 100,
2524
+ strokeWidth: 8,
2525
+ trackColor: "#333",
2526
+ fillColor: "#4a90d9"
2527
+ }
2528
+ }
2529
+ };
2530
+ exports.QUALITY_TIER_SCALES = {
2531
+ low: {
2532
+ particleScale: 0.25,
2533
+ lodLevel: "draft",
2534
+ maxLights: 2,
2535
+ shadowMapSize: 512,
2536
+ shaderComplexity: "basic"
2537
+ },
2538
+ med: {
2539
+ particleScale: 0.6,
2540
+ lodLevel: "mesh",
2541
+ maxLights: 4,
2542
+ shadowMapSize: 1024,
2543
+ shaderComplexity: "standard"
2544
+ },
2545
+ high: {
2546
+ particleScale: 1,
2547
+ lodLevel: "final",
2548
+ maxLights: 8,
2549
+ shadowMapSize: 2048,
2550
+ shaderComplexity: "physical"
2551
+ },
2552
+ ultra: {
2553
+ particleScale: 1.5,
2554
+ lodLevel: "final",
2555
+ maxLights: 16,
2556
+ shadowMapSize: 4096,
2557
+ shaderComplexity: "physical"
2558
+ }
2559
+ };
2560
+ exports.R3FCompiler = class {
2561
+ constructor(options = {}) {
2562
+ // ─── RBAC Enforcement ─────────────────────────────────────────────────
2563
+ this.compilerName = "R3FCompiler";
2564
+ this.rbac = chunkKKP7JKN4_cjs.getRBAC();
2565
+ this.qualityTier = options.qualityTier ?? "high";
2566
+ this.tierScales = exports.QUALITY_TIER_SCALES[this.qualityTier];
2567
+ this._defaultLighting = options.defaultLighting ?? true;
2568
+ this._holomapPointCloud = options.holomapPointCloud;
2569
+ if (options.platformTarget) {
2570
+ this._platformTarget = typeof options.platformTarget === "string" ? chunkAIA52I7T_cjs.createPlatformTarget(options.platformTarget) : options.platformTarget;
2571
+ }
2572
+ }
2573
+ /**
2574
+ * Validate agent permissions before compilation.
2575
+ * Skips validation when no token is provided (backwards compatibility).
2576
+ *
2577
+ * Checks:
2578
+ * 1. AST read access (can the agent read AST?)
2579
+ * 2. Code generation access (can the agent generate code?)
2580
+ * 3. Output path scope (if outputPath provided)
2581
+ *
2582
+ * @param agentToken - Agent JWT token (optional for backwards compat)
2583
+ * @param outputPath - Optional output file path for scope validation
2584
+ * @throws UnauthorizedCompilerAccessError if token is provided but invalid/unauthorized
2585
+ */
2586
+ validateCompilerAccess(agentToken, outputPath) {
2587
+ if (!agentToken) return;
2588
+ const astDecision = this.rbac.checkAccess({
2589
+ token: agentToken,
2590
+ resourceType: "ast" /* AST */,
2591
+ operation: "read",
2592
+ expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
2593
+ });
2594
+ if (!astDecision.allowed) {
2595
+ throw new chunkKKP7JKN4_cjs.UnauthorizedCompilerAccessError(astDecision, "AST access", this.compilerName);
2596
+ }
2597
+ const codeDecision = this.rbac.checkAccess({
2598
+ token: agentToken,
2599
+ resourceType: "code" /* CODE */,
2600
+ operation: "write",
2601
+ expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
2602
+ });
2603
+ if (!codeDecision.allowed) {
2604
+ throw new chunkKKP7JKN4_cjs.UnauthorizedCompilerAccessError(codeDecision, "code generation", this.compilerName);
2605
+ }
2606
+ if (outputPath) {
2607
+ const outputDecision = this.rbac.checkAccess({
2608
+ token: agentToken,
2609
+ resourceType: "output" /* OUTPUT */,
2610
+ operation: "write",
2611
+ resourcePath: outputPath,
2612
+ expectedWorkflowStep: "serialize" /* SERIALIZE */
2613
+ });
2614
+ if (!outputDecision.allowed) {
2615
+ throw new chunkKKP7JKN4_cjs.UnauthorizedCompilerAccessError(
2616
+ outputDecision,
2617
+ `output write to '${outputPath}'`,
2618
+ this.compilerName
2619
+ );
2620
+ }
2621
+ }
2622
+ }
2623
+ // ─── Spread Expansion Utility ─────────────────────────────────────────
2624
+ /**
2625
+ * Expands spread expressions in a properties object.
2626
+ * Spreads are stored with keys like `__spread_0`, `__spread_1` and have
2627
+ * the structure: { type: 'spread', argument: <value> }
2628
+ *
2629
+ * @param props - The properties object potentially containing spreads
2630
+ * @param context - Optional context for resolving references (templates, state)
2631
+ * @returns A new object with spreads expanded and merged
2632
+ */
2633
+ expandSpreads(props, context) {
2634
+ const result = {};
2635
+ const spreadKeys = [];
2636
+ for (const [key, value] of Object.entries(props)) {
2637
+ if (key.startsWith("__spread_")) {
2638
+ spreadKeys.push(key);
2639
+ } else if (value && typeof value === "object" && value.type === "spread") {
2640
+ spreadKeys.push(key);
2641
+ } else {
2642
+ if (value && typeof value === "object" && !Array.isArray(value) && !("__ref" in value) && !("__expr" in value)) {
2643
+ result[key] = this.expandSpreads(value, context);
2644
+ } else if (Array.isArray(value)) {
2645
+ result[key] = this.expandArraySpreads(value, context);
2646
+ } else {
2647
+ result[key] = value;
2648
+ }
2649
+ }
2650
+ }
2651
+ for (const spreadKey of spreadKeys) {
2652
+ const spreadValue = props[spreadKey];
2653
+ if (spreadValue && typeof spreadValue === "object" && spreadValue.type === "spread") {
2654
+ const resolved = this.resolveSpreadArgument(
2655
+ spreadValue.argument,
2656
+ context
2657
+ );
2658
+ if (resolved && typeof resolved === "object" && !Array.isArray(resolved)) {
2659
+ Object.assign(result, this.expandSpreads(resolved, context));
2660
+ }
2661
+ }
2662
+ }
2663
+ for (const [key, value] of Object.entries(props)) {
2664
+ if (!key.startsWith("__spread_") && !(value && typeof value === "object" && value.type === "spread")) {
2665
+ if (value && typeof value === "object" && !Array.isArray(value) && !("__ref" in value) && !("__expr" in value)) {
2666
+ result[key] = this.expandSpreads(value, context);
2667
+ } else if (Array.isArray(value)) {
2668
+ result[key] = this.expandArraySpreads(value, context);
2669
+ } else {
2670
+ result[key] = value;
2671
+ }
2672
+ }
2673
+ }
2674
+ return result;
2675
+ }
2676
+ /**
2677
+ * Expands spread expressions within an array.
2678
+ * Spread elements have { type: 'spread', argument: <value> }
2679
+ */
2680
+ expandArraySpreads(arr, context) {
2681
+ const result = [];
2682
+ for (const item of arr) {
2683
+ if (item && typeof item === "object" && item.type === "spread") {
2684
+ const resolved = this.resolveSpreadArgument(
2685
+ item.argument,
2686
+ context
2687
+ );
2688
+ if (Array.isArray(resolved)) {
2689
+ result.push(...resolved);
2690
+ } else if (resolved !== void 0 && resolved !== null) {
2691
+ result.push(resolved);
2692
+ }
2693
+ } else if (item && typeof item === "object" && !Array.isArray(item)) {
2694
+ result.push(this.expandSpreads(item, context));
2695
+ } else {
2696
+ result.push(item);
2697
+ }
2698
+ }
2699
+ return result;
2700
+ }
2701
+ /**
2702
+ * Resolves a spread argument to its value.
2703
+ * Handles: direct values, __ref references, template references
2704
+ */
2705
+ resolveSpreadArgument(argument, context) {
2706
+ if (argument === null || argument === void 0) {
2707
+ return void 0;
2708
+ }
2709
+ if (typeof argument === "object" && !("__ref" in argument)) {
2710
+ return argument;
2711
+ }
2712
+ if (typeof argument === "object" && "__ref" in argument) {
2713
+ const ref = argument.__ref;
2714
+ if (context?.templates) {
2715
+ const template = context.templates.get(ref);
2716
+ if (template) {
2717
+ return template.properties || template;
2718
+ }
2719
+ }
2720
+ if (context?.state && ref in context.state) {
2721
+ return context.state[ref];
2722
+ }
2723
+ if (context?.state && ref.includes(".")) {
2724
+ const parts = ref.split(".");
2725
+ let value = context.state;
2726
+ for (const part of parts) {
2727
+ if (value && typeof value === "object" && part in value) {
2728
+ value = value[part];
2729
+ } else {
2730
+ value = void 0;
2731
+ break;
2732
+ }
2733
+ }
2734
+ if (value !== void 0) {
2735
+ return value;
2736
+ }
2737
+ }
2738
+ return argument;
2739
+ }
2740
+ if (typeof argument === "string") {
2741
+ if (context?.templates) {
2742
+ const template = context.templates.get(argument);
2743
+ if (template) {
2744
+ return template.properties || template;
2745
+ }
2746
+ }
2747
+ return { __ref: argument };
2748
+ }
2749
+ return argument;
2750
+ }
2751
+ // ─── HSPlusAST Compilation ────────────────────────────────────────────
2752
+ compile(ast, agentToken, outputPath) {
2753
+ this.validateCompilerAccess(agentToken, outputPath);
2754
+ const root = this.compileNode(ast.root);
2755
+ if (this.hasPostProcessing(root)) {
2756
+ root.children?.unshift({
2757
+ type: "EffectComposer",
2758
+ props: {},
2759
+ children: this.extractPostProcessingNodes(root)
2760
+ });
2761
+ }
2762
+ this.injectDefaultLighting(root);
2763
+ const domainBlocks = ast.domainBlocks ?? [];
2764
+ if (domainBlocks.length > 0) {
2765
+ const compiled = chunkXUUVDHIF_cjs.compileDomainBlocks(
2766
+ domainBlocks,
2767
+ {
2768
+ material: (block) => {
2769
+ const mat = chunkXUUVDHIF_cjs.compileMaterialBlock(block);
2770
+ return {
2771
+ type: "DomainBlockOutput",
2772
+ props: {
2773
+ __raw: chunkXUUVDHIF_cjs.materialToR3F(mat, this.tierScales),
2774
+ __domain: "material",
2775
+ __name: mat.name
2776
+ },
2777
+ children: []
2778
+ };
2779
+ },
2780
+ physics: (block) => {
2781
+ const phys = chunkXUUVDHIF_cjs.compilePhysicsBlock(block);
2782
+ return {
2783
+ type: "DomainBlockOutput",
2784
+ props: {
2785
+ __raw: chunkXUUVDHIF_cjs.physicsToR3F(phys),
2786
+ __domain: "physics",
2787
+ __name: phys.name || phys.keyword
2788
+ },
2789
+ children: []
2790
+ };
2791
+ },
2792
+ vfx: (block) => {
2793
+ const ps = chunkXUUVDHIF_cjs.compileParticleBlock(block);
2794
+ return {
2795
+ type: "DomainBlockOutput",
2796
+ props: {
2797
+ __raw: chunkXUUVDHIF_cjs.particlesToR3F(ps, this.tierScales),
2798
+ __domain: "vfx",
2799
+ __name: ps.name
2800
+ },
2801
+ children: []
2802
+ };
2803
+ },
2804
+ postfx: (block) => {
2805
+ const pp = chunkXUUVDHIF_cjs.compilePostProcessingBlock(block);
2806
+ return {
2807
+ type: "DomainBlockOutput",
2808
+ props: {
2809
+ __raw: chunkXUUVDHIF_cjs.postProcessingToR3F(pp),
2810
+ __domain: "postfx",
2811
+ __name: pp.name || "PostProcessing"
2812
+ },
2813
+ children: []
2814
+ };
2815
+ },
2816
+ audio: (block) => {
2817
+ const audio = chunkXUUVDHIF_cjs.compileAudioSourceBlock(block);
2818
+ return {
2819
+ type: "DomainBlockOutput",
2820
+ props: { __raw: chunkXUUVDHIF_cjs.audioSourceToR3F(audio), __domain: "audio", __name: audio.name },
2821
+ children: []
2822
+ };
2823
+ },
2824
+ weather: (block) => {
2825
+ const weather = chunkXUUVDHIF_cjs.compileWeatherBlock(block);
2826
+ return {
2827
+ type: "DomainBlockOutput",
2828
+ props: {
2829
+ __raw: chunkXUUVDHIF_cjs.weatherToR3F(weather),
2830
+ __domain: "weather",
2831
+ __name: weather.name || "Weather"
2832
+ },
2833
+ children: []
2834
+ };
2835
+ },
2836
+ simulation: (block) => {
2837
+ const sim = chunkXUUVDHIF_cjs.compileSimulationBlock(block);
2838
+ return {
2839
+ type: "DomainBlockOutput",
2840
+ props: {
2841
+ __raw: chunkXUUVDHIF_cjs.simulationToR3F(sim),
2842
+ __domain: "simulation",
2843
+ __name: sim.name || "Simulation"
2844
+ },
2845
+ children: []
2846
+ };
2847
+ }
2848
+ }
2849
+ );
2850
+ if (!root.children) root.children = [];
2851
+ for (const c of compiled) {
2852
+ if (typeof c === "object") root.children.push(c);
2853
+ }
2854
+ }
2855
+ return root;
2856
+ }
2857
+ /**
2858
+ * Compiles a declarative 'world' node into R3F scene nodes.
2859
+ * Nested `world.children` (objects) are compiled via the same path as top-level objects.
2860
+ */
2861
+ compileWorldNode(world, templateMap) {
2862
+ const nodes = [];
2863
+ const props = {};
2864
+ if (world.properties) {
2865
+ for (const prop of world.properties) {
2866
+ props[prop.key] = prop.value;
2867
+ }
2868
+ }
2869
+ if (props.ambient_light !== void 0) {
2870
+ nodes.push(
2871
+ this.createNode("ambientLight", {
2872
+ intensity: Number(props.ambient_light)
2873
+ })
2874
+ );
2875
+ }
2876
+ if (props.skybox_color !== void 0) {
2877
+ nodes.push(
2878
+ this.createNode("Environment", {
2879
+ background: true,
2880
+ preset: "sunset"
2881
+ // Default preset if just color is given
2882
+ })
2883
+ );
2884
+ nodes.push(
2885
+ this.createNode("color", {
2886
+ attach: "background",
2887
+ args: [props.skybox_color]
2888
+ })
2889
+ );
2890
+ }
2891
+ if (props.gravity !== void 0) {
2892
+ nodes.push(
2893
+ this.createNode("Physics", {
2894
+ gravity: [0, -Number(props.gravity), 0]
2895
+ })
2896
+ );
2897
+ }
2898
+ const childNodes = [];
2899
+ if (world.children && world.children.length > 0) {
2900
+ for (const child of world.children) {
2901
+ childNodes.push(this.compileObjectDecl(child, templateMap));
2902
+ }
2903
+ }
2904
+ if (childNodes.length === 0) {
2905
+ return nodes;
2906
+ }
2907
+ const group = this.createNode(
2908
+ "group",
2909
+ {},
2910
+ world.name ? chunkKKP7JKN4_cjs.escapeStringValue(world.name, "JSX") : void 0
2911
+ );
2912
+ group.children = [...nodes, ...childNodes];
2913
+ return [group];
2914
+ }
2915
+ createNode(type, props = {}, id) {
2916
+ const node = r3fNodePool.acquire();
2917
+ node.type = type;
2918
+ node.id = id;
2919
+ node.props = props;
2920
+ node.children = [];
2921
+ node.traits = /* @__PURE__ */ new Map();
2922
+ node.directives = [];
2923
+ return node;
2924
+ }
2925
+ compileNode(node) {
2926
+ if (node.type === "system") {
2927
+ return this.compileSystemNode(node);
2928
+ }
2929
+ if (node.type === "component") {
2930
+ return this.compileComponentNode(node);
2931
+ }
2932
+ const rawProps = node.properties || {};
2933
+ const type = this.mapType(node.type, rawProps);
2934
+ const r3fNode = r3fNodePool.acquire();
2935
+ r3fNode.type = type;
2936
+ const rawId = node.id || node.name;
2937
+ r3fNode.id = rawId ? chunkKKP7JKN4_cjs.escapeStringValue(rawId, "JSX") : void 0;
2938
+ r3fNode.props = this.compileProperties(node, rawProps);
2939
+ r3fNode.children = [];
2940
+ r3fNode.traits = /* @__PURE__ */ new Map();
2941
+ r3fNode.directives = node.directives || [];
2942
+ if (node.directives) {
2943
+ for (const directive of node.directives) {
2944
+ if (directive.type === "trait") {
2945
+ r3fNode.traits?.set(
2946
+ directive.name,
2947
+ directive.config
2948
+ );
2949
+ }
2950
+ }
2951
+ }
2952
+ const enhanced = node;
2953
+ if (enhanced.graphics) {
2954
+ this.applyGraphicsConfig(r3fNode, enhanced.graphics);
2955
+ }
2956
+ if (enhanced.children && Array.isArray(enhanced.children)) {
2957
+ r3fNode.children = enhanced.children.map(
2958
+ (child) => this.compileNode(child)
2959
+ );
2960
+ }
2961
+ return r3fNode;
2962
+ }
2963
+ // ─── HoloComposition Compilation (.holo files) ────────────────────────
2964
+ compileComposition(composition, agentToken, outputPath) {
2965
+ this.validateCompilerAccess(agentToken, outputPath);
2966
+ if (this._platformTarget) {
2967
+ const platformMixin = new chunkAIA52I7T_cjs.PlatformConditionalCompilerMixin();
2968
+ composition = platformMixin.filterForPlatform(composition, this._platformTarget);
2969
+ }
2970
+ const root = r3fNodePool.acquire();
2971
+ root.type = "group";
2972
+ root.id = composition.name ? chunkKKP7JKN4_cjs.escapeStringValue(composition.name, "JSX") : void 0;
2973
+ root.props = {};
2974
+ root.children = [];
2975
+ root.traits = /* @__PURE__ */ new Map();
2976
+ root.directives = [];
2977
+ const templateMap = /* @__PURE__ */ new Map();
2978
+ if (Array.isArray(composition.templates)) {
2979
+ for (const tmpl of composition.templates) {
2980
+ templateMap.set(tmpl.name, tmpl);
2981
+ }
2982
+ }
2983
+ if (composition.children && Array.isArray(composition.children)) {
2984
+ for (const child of composition.children) {
2985
+ if (child.type === "template" && child.name) {
2986
+ templateMap.set(child.name, child);
2987
+ }
2988
+ }
2989
+ for (const child of composition.children) {
2990
+ root.children.push(this.compileChildNode(child, templateMap));
2991
+ }
2992
+ }
2993
+ if (composition.environment) {
2994
+ root.children.push(
2995
+ ...this.compileEnvironmentBlock(composition.environment)
2996
+ );
2997
+ }
2998
+ if (Array.isArray(composition.lights)) {
2999
+ for (const light of composition.lights) {
3000
+ root.children.push(this.compileLightBlock(light));
3001
+ }
3002
+ }
3003
+ if (Array.isArray(composition.objects)) {
3004
+ for (const obj of composition.objects) {
3005
+ root.children.push(this.compileObjectDecl(obj, templateMap));
3006
+ }
3007
+ }
3008
+ if (Array.isArray(composition.spatialGroups)) {
3009
+ for (const group of composition.spatialGroups) {
3010
+ root.children.push(this.compileSpatialGroup(group, templateMap));
3011
+ }
3012
+ }
3013
+ if (Array.isArray(composition.timelines)) {
3014
+ for (const timeline of composition.timelines) {
3015
+ root.children.push(this.compileTimelineBlock(timeline));
3016
+ }
3017
+ }
3018
+ if (Array.isArray(composition.audio)) {
3019
+ for (const audio of composition.audio) {
3020
+ root.children.push(this.compileAudioBlock(audio));
3021
+ }
3022
+ }
3023
+ if (Array.isArray(composition.zones)) {
3024
+ for (const zone of composition.zones) {
3025
+ root.children.push(this.compileZoneBlock(zone));
3026
+ }
3027
+ }
3028
+ if (Array.isArray(composition.worlds)) {
3029
+ for (const world of composition.worlds) {
3030
+ root.children.push(
3031
+ ...this.compileWorldNode(
3032
+ world,
3033
+ templateMap
3034
+ )
3035
+ );
3036
+ }
3037
+ }
3038
+ if (composition.ui) {
3039
+ root.children.push(this.compileUIBlock(composition.ui));
3040
+ }
3041
+ if (Array.isArray(composition.transitions)) {
3042
+ for (const transition of composition.transitions) {
3043
+ root.children.push(this.compileTransitionBlock(transition));
3044
+ }
3045
+ }
3046
+ if (Array.isArray(composition.conditionals)) {
3047
+ for (const cond of composition.conditionals) {
3048
+ root.children.push(this.compileConditionalBlock(cond, templateMap));
3049
+ }
3050
+ }
3051
+ if (Array.isArray(composition.iterators)) {
3052
+ for (const iter of composition.iterators) {
3053
+ root.children.push(this.compileForEachBlock(iter, templateMap));
3054
+ }
3055
+ }
3056
+ if (composition.camera) {
3057
+ root.children.push(this.compileCameraBlock(composition.camera));
3058
+ }
3059
+ if (composition.effects) {
3060
+ root.children.unshift(
3061
+ this.compileEffectsBlock(composition.effects)
3062
+ );
3063
+ } else if (this.hasPostProcessing(root)) {
3064
+ root.children.unshift({
3065
+ type: "EffectComposer",
3066
+ props: {},
3067
+ children: this.extractPostProcessingNodes(root)
3068
+ });
3069
+ }
3070
+ this.injectHolomapPointCloud(root);
3071
+ this.injectDefaultLighting(root);
3072
+ return root;
3073
+ }
3074
+ /** R3F host apps can map this node to BufferGeometry + pointsMaterial from base64 buffers. */
3075
+ injectHolomapPointCloud(root) {
3076
+ const h = this._holomapPointCloud;
3077
+ if (!h || h.pointCount < 1 || !h.positionsB64 || !h.colorsB64) return;
3078
+ if (!root.children) root.children = [];
3079
+ root.children.push({
3080
+ type: "holomapPointCloud",
3081
+ props: {
3082
+ positionsB64: h.positionsB64,
3083
+ colorsB64: h.colorsB64,
3084
+ pointCount: h.pointCount
3085
+ }
3086
+ });
3087
+ }
3088
+ compileLightBlock(light) {
3089
+ const lightMapping = {
3090
+ directional: "directionalLight",
3091
+ point: "pointLight",
3092
+ spot: "spotLight",
3093
+ hemisphere: "hemisphereLight",
3094
+ ambient: "ambientLight",
3095
+ area: "rectAreaLight"
3096
+ };
3097
+ const type = lightMapping[light.lightType] || "directionalLight";
3098
+ const props = {};
3099
+ if (Array.isArray(light.properties)) {
3100
+ for (const prop of light.properties) {
3101
+ const key = prop.key;
3102
+ const value = prop.value;
3103
+ if (key === "cast_shadow" || key === "castShadow") {
3104
+ props.castShadow = value;
3105
+ } else if (key === "ground_color" || key === "groundColor") {
3106
+ props.groundColor = value;
3107
+ } else if (key === "shadow_map_size") {
3108
+ props["shadow-mapSize"] = Array.isArray(value) ? value : [value, value];
3109
+ } else {
3110
+ props[key] = value;
3111
+ }
3112
+ }
3113
+ }
3114
+ if ((light.lightType === "directional" || light.lightType === "spot") && props.castShadow === void 0) {
3115
+ props.castShadow = true;
3116
+ }
3117
+ const r3fNode = r3fNodePool.acquire();
3118
+ r3fNode.type = type;
3119
+ r3fNode.id = light.name ? chunkKKP7JKN4_cjs.escapeStringValue(light.name, "JSX") : void 0;
3120
+ r3fNode.props = props;
3121
+ r3fNode.children = [];
3122
+ r3fNode.traits = /* @__PURE__ */ new Map();
3123
+ r3fNode.directives = [];
3124
+ return r3fNode;
3125
+ }
3126
+ compileEffectsBlock(effects) {
3127
+ const children = [];
3128
+ if (Array.isArray(effects.effects)) {
3129
+ for (const effect of effects.effects) {
3130
+ const effectMapping = {
3131
+ bloom: "Bloom",
3132
+ ssao: "SSAO",
3133
+ vignette: "Vignette",
3134
+ dof: "DepthOfField",
3135
+ chromatic_aberration: "ChromaticAberration",
3136
+ tone_mapping: "ToneMapping",
3137
+ noise: "Noise"
3138
+ };
3139
+ const effectType = effect.effectType;
3140
+ const type = effectMapping[effectType] || effectType;
3141
+ children.push(
3142
+ this.createNode(type, { ...effect.properties || {} })
3143
+ );
3144
+ }
3145
+ }
3146
+ const composer = this.createNode("EffectComposer", {});
3147
+ composer.children = children;
3148
+ return composer;
3149
+ }
3150
+ compileCameraBlock(camera) {
3151
+ const props = {};
3152
+ if (Array.isArray(camera.properties)) {
3153
+ for (const prop of camera.properties) {
3154
+ if (prop.key === "field_of_view" || prop.key === "fov") {
3155
+ props.fov = prop.value;
3156
+ } else if (prop.key === "look_at" || prop.key === "lookAt") {
3157
+ props.lookAt = prop.value;
3158
+ } else {
3159
+ props[prop.key] = prop.value;
3160
+ }
3161
+ }
3162
+ }
3163
+ props.cameraType = camera.cameraType;
3164
+ return this.createNode("Camera", props, "__camera");
3165
+ }
3166
+ compileEnvironmentBlock(env) {
3167
+ const nodes = [];
3168
+ const envProps = {};
3169
+ if (env.properties) {
3170
+ for (const prop of env.properties) {
3171
+ envProps[prop.key] = prop.value;
3172
+ }
3173
+ }
3174
+ const presetName = envProps.skybox || envProps.preset;
3175
+ if (presetName) {
3176
+ const preset = exports.ENVIRONMENT_PRESETS[presetName];
3177
+ if (preset) {
3178
+ nodes.push(
3179
+ this.createNode("Environment", {
3180
+ background: true,
3181
+ preset: preset.envPreset || presetName
3182
+ })
3183
+ );
3184
+ const lighting = preset.lighting;
3185
+ if (lighting?.ambient) {
3186
+ nodes.push(
3187
+ this.createNode("ambientLight", {
3188
+ color: lighting.ambient.color,
3189
+ intensity: lighting.ambient.intensity
3190
+ })
3191
+ );
3192
+ }
3193
+ if (lighting?.directional) {
3194
+ const dl = lighting.directional;
3195
+ nodes.push(
3196
+ this.createNode("directionalLight", {
3197
+ color: dl.color,
3198
+ intensity: dl.intensity,
3199
+ position: dl.position,
3200
+ castShadow: dl.shadows !== false,
3201
+ "shadow-mapSize": [2048, 2048]
3202
+ })
3203
+ );
3204
+ }
3205
+ if (Array.isArray(lighting?.points)) {
3206
+ for (const pl of lighting.points) {
3207
+ nodes.push(
3208
+ this.createNode("pointLight", {
3209
+ color: pl.color,
3210
+ intensity: pl.intensity,
3211
+ position: pl.position,
3212
+ distance: pl.distance
3213
+ })
3214
+ );
3215
+ }
3216
+ }
3217
+ const presetMap = preset;
3218
+ if (presetMap.fog) {
3219
+ const fogMap = presetMap.fog;
3220
+ nodes.push(
3221
+ this.createNode("fog", {
3222
+ attach: "fog",
3223
+ color: fogMap.color,
3224
+ near: fogMap.near,
3225
+ far: fogMap.far
3226
+ })
3227
+ );
3228
+ }
3229
+ if (presetMap.ground) {
3230
+ const groundMap = presetMap.ground;
3231
+ nodes.push(
3232
+ this.createNode(
3233
+ "mesh",
3234
+ {
3235
+ hsType: "plane",
3236
+ rotation: [-Math.PI / 2, 0, 0],
3237
+ position: [0, -0.01, 0],
3238
+ receiveShadow: true,
3239
+ args: [200, 200],
3240
+ color: groundMap.color,
3241
+ materialProps: { roughness: 0.8, metalness: 0 }
3242
+ },
3243
+ "__ground"
3244
+ )
3245
+ );
3246
+ }
3247
+ } else {
3248
+ nodes.push(this.createNode("Environment", { background: true, preset: presetName }));
3249
+ }
3250
+ }
3251
+ if (envProps.ambient_light !== void 0) {
3252
+ nodes.push(
3253
+ this.createNode("ambientLight", {
3254
+ intensity: typeof envProps.ambient_light === "number" ? envProps.ambient_light : 0.5
3255
+ })
3256
+ );
3257
+ }
3258
+ const explicitFog = envProps.fog;
3259
+ if (explicitFog && typeof explicitFog === "object") {
3260
+ nodes.push(
3261
+ this.createNode("fog", {
3262
+ attach: "fog",
3263
+ color: explicitFog.color || "#cccccc",
3264
+ near: explicitFog.near || 10,
3265
+ far: explicitFog.far || 100
3266
+ })
3267
+ );
3268
+ }
3269
+ return nodes;
3270
+ }
3271
+ compileObjectDecl(obj, templateMap) {
3272
+ const props = {};
3273
+ let geometryType = "cube";
3274
+ if (obj.template && templateMap) {
3275
+ const tmpl = templateMap.get(obj.template);
3276
+ if (tmpl) {
3277
+ const tmplTraits = tmpl.traits;
3278
+ if (tmplTraits && Array.isArray(tmplTraits)) {
3279
+ const existingTraitNames = new Set(
3280
+ (obj.traits || []).map(
3281
+ (t) => t.name
3282
+ )
3283
+ );
3284
+ obj.traits = [
3285
+ ...tmplTraits.filter(
3286
+ (t) => !existingTraitNames.has(t.name)
3287
+ ),
3288
+ ...obj.traits || []
3289
+ ];
3290
+ }
3291
+ const tmplProps = tmpl.properties;
3292
+ if (tmplProps && Array.isArray(tmplProps)) {
3293
+ const existingKeys = new Set(
3294
+ (obj.properties || []).map(
3295
+ (p) => p.key
3296
+ )
3297
+ );
3298
+ const mergedProps = tmplProps.filter((p) => !existingKeys.has(p.key)).map((p) => ({
3299
+ type: "ObjectProperty",
3300
+ key: p.key,
3301
+ value: p.value
3302
+ }));
3303
+ obj.properties = [...mergedProps, ...obj.properties || []];
3304
+ }
3305
+ }
3306
+ }
3307
+ if (obj.properties && Array.isArray(obj.properties)) {
3308
+ const expandedProperties = [];
3309
+ for (const p of obj.properties) {
3310
+ const prop = p;
3311
+ if (prop && prop.type === "spread") {
3312
+ const resolved = this.resolveSpreadArgument(
3313
+ prop.target || prop.argument,
3314
+ {
3315
+ templates: templateMap
3316
+ }
3317
+ );
3318
+ if (resolved && typeof resolved === "object" && !Array.isArray(resolved)) {
3319
+ for (const [key, value] of Object.entries(resolved)) {
3320
+ expandedProperties.push({ key, value });
3321
+ }
3322
+ } else if (Array.isArray(resolved)) {
3323
+ expandedProperties.push(...resolved);
3324
+ }
3325
+ } else {
3326
+ expandedProperties.push(prop);
3327
+ }
3328
+ }
3329
+ obj.properties = expandedProperties;
3330
+ }
3331
+ if (obj.properties) {
3332
+ for (const p of obj.properties) {
3333
+ const key = p.key;
3334
+ const value = p.value;
3335
+ if (key === "geometry" || key === "mesh") {
3336
+ geometryType = value;
3337
+ } else if (key === "type") {
3338
+ const valStr = value;
3339
+ if (["text", "sparkles", "portal", "audio"].includes(valStr)) {
3340
+ geometryType = valStr;
3341
+ } else if (["directional", "point", "spot", "hemisphere", "ambient", "area"].includes(valStr)) {
3342
+ geometryType = "light";
3343
+ props.lightType = valStr;
3344
+ } else {
3345
+ props[key] = value;
3346
+ }
3347
+ } else if (key === "light_type") {
3348
+ props.lightType = value;
3349
+ } else if (key === "position" && Array.isArray(value)) {
3350
+ props.position = value;
3351
+ } else if (key === "rotation" && Array.isArray(value)) {
3352
+ props.rotation = value;
3353
+ } else if (key === "scale") {
3354
+ props.scale = Array.isArray(value) ? value : [value, value, value];
3355
+ } else if (key === "color") {
3356
+ props.color = value;
3357
+ } else if (key === "src" || key === "model" || key === "source") {
3358
+ props.src = value;
3359
+ geometryType = "model";
3360
+ } else if (key === "text") {
3361
+ props.children = this.resolveValue(value);
3362
+ props.text = this.resolveValue(value);
3363
+ } else if (key === "font_size") {
3364
+ props.fontSize = value;
3365
+ } else if (key === "material") {
3366
+ const currentMaterialProps = props.materialProps || {};
3367
+ if (typeof value === "string" && exports.MATERIAL_PRESETS[value]) {
3368
+ props.materialProps = { ...exports.MATERIAL_PRESETS[value], ...currentMaterialProps };
3369
+ } else if (typeof value === "object" && value !== null) {
3370
+ const valObj = value;
3371
+ if (valObj.preset && typeof valObj.preset === "string" && exports.MATERIAL_PRESETS[valObj.preset]) {
3372
+ const { preset: _, ...rest } = valObj;
3373
+ props.materialProps = {
3374
+ ...exports.MATERIAL_PRESETS[valObj.preset],
3375
+ ...rest,
3376
+ ...currentMaterialProps
3377
+ };
3378
+ } else {
3379
+ props.materialProps = { ...currentMaterialProps, ...valObj };
3380
+ }
3381
+ }
3382
+ } else if (key === "roughness" || key === "metalness" || key === "metallic") {
3383
+ const mProps = props.materialProps || {};
3384
+ mProps[key === "metallic" ? "metalness" : key] = value;
3385
+ props.materialProps = mProps;
3386
+ } else if (key === "opacity") {
3387
+ const mProps = props.materialProps || {};
3388
+ mProps.opacity = value;
3389
+ mProps.transparent = value < 1;
3390
+ props.materialProps = mProps;
3391
+ } else if (key === "emissive") {
3392
+ props.materialProps = {
3393
+ ...props.materialProps || {},
3394
+ emissive: value
3395
+ };
3396
+ } else if (key === "emissiveIntensity" || key === "emissive_intensity") {
3397
+ props.materialProps = {
3398
+ ...props.materialProps || {},
3399
+ emissiveIntensity: value
3400
+ };
3401
+ } else if (key === "size") {
3402
+ if (Array.isArray(value)) {
3403
+ props.args = value;
3404
+ }
3405
+ props.size = value;
3406
+ } else if (key === "radius") {
3407
+ props.size = value * 2;
3408
+ } else if (key === "intensity") {
3409
+ props.intensity = value;
3410
+ } else if (key === "cast_shadow" || key === "castShadow") {
3411
+ props.castShadow = value;
3412
+ } else if (key === "receiveShadow" || key === "receive_shadow") {
3413
+ props.receiveShadow = value;
3414
+ } else if (key === "visible") {
3415
+ props[key] = value;
3416
+ } else if (key === "maturity") {
3417
+ props.maturityOverride = value;
3418
+ } else if (key === "promoteUrl" || key === "promote_url") {
3419
+ props.promoteUrl = value;
3420
+ } else if (key === "collisionShape" || key === "collision_shape") {
3421
+ props.collisionShape = value;
3422
+ } else {
3423
+ props[key] = this.resolveValue(value);
3424
+ }
3425
+ }
3426
+ }
3427
+ if (obj.traits && Array.isArray(obj.traits)) {
3428
+ const semiring = new chunk5S7RKFGR_cjs.ProvenanceSemiring();
3429
+ const physicsApplications = obj.traits.filter((t) => t.name === "physics" || t.name === "collidable").map((t) => {
3430
+ let baseConfig = t.config || {};
3431
+ if (t.name === "collidable" && !baseConfig.type)
3432
+ baseConfig = { ...baseConfig, type: "fixed" };
3433
+ if (t.name === "physics" && !baseConfig.type)
3434
+ baseConfig = { ...baseConfig, type: "dynamic" };
3435
+ return {
3436
+ name: t.name,
3437
+ config: baseConfig,
3438
+ context: obj.provenance?.context
3439
+ };
3440
+ });
3441
+ if (physicsApplications.length > 0) {
3442
+ const { config: mergedPhysics } = semiring.add(physicsApplications);
3443
+ props.rigidBody = { ...mergedPhysics };
3444
+ props.collider = { type: "auto" };
3445
+ if (props.rigidBody?.type === "fixed") {
3446
+ props.castShadow = true;
3447
+ props.receiveShadow = true;
3448
+ }
3449
+ }
3450
+ for (const trait of obj.traits) {
3451
+ const name = trait.name;
3452
+ if (name === "physics" || name === "collidable") {
3453
+ continue;
3454
+ } else if (name === "grabbable") {
3455
+ props.castShadow = true;
3456
+ props.grabbable = trait.config || true;
3457
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3458
+ if (!props.collider) props.collider = { type: "auto" };
3459
+ } else if (name === "hoverable") {
3460
+ props.hoverable = trait.config || true;
3461
+ } else if (name === "animated") {
3462
+ props.animated = trait.config || true;
3463
+ } else if (name === "positional" || name === "spatial_audio") {
3464
+ props.spatial = true;
3465
+ } else if (name === "gem_resonance") {
3466
+ props.gemResonance = gemResonanceConfig(trait.config);
3467
+ props.spatial = true;
3468
+ } else if (name === "shadow") {
3469
+ props.castShadow = true;
3470
+ if (trait.config?.mapSize)
3471
+ props["shadow-mapSize"] = [trait.config.mapSize, trait.config.mapSize];
3472
+ } else if (name === "material") {
3473
+ const presetName = trait.config?.preset;
3474
+ if (presetName && typeof presetName === "string" && exports.MATERIAL_PRESETS[presetName]) {
3475
+ const { preset: _, ...rest } = trait.config;
3476
+ props.materialProps = {
3477
+ ...exports.MATERIAL_PRESETS[presetName],
3478
+ ...rest,
3479
+ ...props.materialProps
3480
+ };
3481
+ } else {
3482
+ props.materialProps = {
3483
+ ...props.materialProps,
3484
+ ...trait.config
3485
+ };
3486
+ }
3487
+ } else if (name === "networked") {
3488
+ props.networked = trait.config || true;
3489
+ } else if (name === "moldable") {
3490
+ props.moldable = trait.config || true;
3491
+ } else if (name === "stretchable") {
3492
+ props.stretchable = trait.config || true;
3493
+ } else if (name === "bloom") {
3494
+ props.bloom = trait.config || { intensity: 1 };
3495
+ } else if (name === "portal") {
3496
+ props.portal = trait.config || true;
3497
+ } else if (name === "attach") {
3498
+ props.attach = trait.config || true;
3499
+ } else if (name === "orbit") {
3500
+ props.orbit = trait.config || true;
3501
+ } else if (name === "look_at") {
3502
+ props.lookAtTarget = trait.config || true;
3503
+ } else if (name === "follow") {
3504
+ props.follow = trait.config || true;
3505
+ } else if (name === "plane_detection") {
3506
+ props.planeDetection = trait.config || { mode: "all" };
3507
+ } else if (name === "mesh_detection") {
3508
+ props.meshDetection = trait.config || { classification: true };
3509
+ } else if (name === "anchor") {
3510
+ props.anchor = trait.config || { type: "spatial" };
3511
+ } else if (name === "persistent_anchor") {
3512
+ props.persistentAnchor = trait.config || { storage: "local" };
3513
+ } else if (name === "shared_anchor") {
3514
+ props.sharedAnchor = trait.config || { authority: "creator" };
3515
+ } else if (name === "occlusion") {
3516
+ props.occlusionMode = trait.config?.mode || "environment";
3517
+ props.occlusion = trait.config || true;
3518
+ } else if (name === "light_estimation") {
3519
+ props.lightEstimation = trait.config || { auto_apply: true };
3520
+ } else if (name === "geospatial") {
3521
+ props.geospatial = trait.config || true;
3522
+ } else if (name === "gaussian_splat") {
3523
+ props.gaussianSplat = trait.config || true;
3524
+ } else if (name === "nerf") {
3525
+ props.nerf = trait.config || true;
3526
+ } else if (name === "volumetric_video") {
3527
+ props.volumetricVideo = trait.config || true;
3528
+ } else if (name === "point_cloud") {
3529
+ props.pointCloud = trait.config || true;
3530
+ } else if (name === "photogrammetry") {
3531
+ props.photogrammetry = trait.config || true;
3532
+ } else if (name === "web_surface") {
3533
+ props.webSurface = trait.config || true;
3534
+ } else if (name === "cloth") {
3535
+ props.cloth = trait.config || { stiffness: 0.8 };
3536
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3537
+ } else if (name === "fluid") {
3538
+ props.fluid = trait.config || { viscosity: 0.01 };
3539
+ props.__gapsComponents = props.__gapsComponents || [];
3540
+ props.__gapsComponents.push("FluidRenderer");
3541
+ } else if (name === "soft_body") {
3542
+ props.softBody = trait.config || { elasticity: 0.5 };
3543
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3544
+ } else if (name === "rope") {
3545
+ props.rope = trait.config || { segments: 20 };
3546
+ } else if (name === "chain") {
3547
+ props.chain = trait.config || { link_count: 20 };
3548
+ } else if (name === "wind") {
3549
+ props.wind = trait.config || { strength: 5 };
3550
+ } else if (name === "buoyancy") {
3551
+ props.buoyancy = trait.config || { water_level: 0 };
3552
+ } else if (name === "destruction") {
3553
+ props.destruction = trait.config || { health: 100 };
3554
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3555
+ if (!props.collider) props.collider = { type: "auto" };
3556
+ } else if (name === "soft_body_pro") {
3557
+ props.softBodyPro = trait.config || { tear_threshold: 0.5 };
3558
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3559
+ } else if (name === "crowd_sim") {
3560
+ props.crowdSim = trait.config || { max_agents: 1e3 };
3561
+ } else if (name === "deformable_terrain") {
3562
+ props.deformableTerrain = trait.config || { resolution: 256 };
3563
+ } else if (name === "volumetric_clouds") {
3564
+ props.volumetricClouds = trait.config || { coverage: 0.5 };
3565
+ props.__gapsComponents = props.__gapsComponents || [];
3566
+ props.__gapsComponents.push("CloudRenderer");
3567
+ } else if (name === "god_rays") {
3568
+ props.godRays = trait.config || { intensity: 1 };
3569
+ props.__gapsComponents = props.__gapsComponents || [];
3570
+ props.__gapsComponents.push("GodRaysEffect");
3571
+ } else if (name === "spatial_voice") {
3572
+ props.spatialVoice = trait.config || { max_distance: 30 };
3573
+ props.spatial = true;
3574
+ } else if (name === "ai_companion") {
3575
+ props.aiCompanion = trait.config || { personality: "friendly" };
3576
+ } else if (name === "moderation") {
3577
+ props.moderation = trait.config || { sensitivity: "medium" };
3578
+ } else if (name === "anti_grief") {
3579
+ props.antiGrief = trait.config || { detection_window: 30 };
3580
+ } else if (name === "world_state") {
3581
+ props.worldState = trait.config || { sync_rate: 10 };
3582
+ } else if (name === "token_gated") {
3583
+ props.tokenGated = trait.config || { token_contract: "", min_balance: 1 };
3584
+ } else if (name === "ambisonics") {
3585
+ props.ambisonics = trait.config || { order: 1 };
3586
+ props.spatial = true;
3587
+ } else if (name === "hrtf") {
3588
+ props.hrtf = trait.config || true;
3589
+ props.spatial = true;
3590
+ } else if (name === "reverb_zone") {
3591
+ props.reverbZone = trait.config || { preset: "room" };
3592
+ } else if (name === "audio_occlusion") {
3593
+ props.audioOcclusion = trait.config || true;
3594
+ } else if (name === "audio_portal") {
3595
+ props.audioPortal = trait.config || true;
3596
+ } else if (name === "head_tracked_audio") {
3597
+ props.headTrackedAudio = trait.config || true;
3598
+ props.spatial = true;
3599
+ } else if (name === "accessible") {
3600
+ props.accessible = trait.config || { role: "generic" };
3601
+ } else if (name === "alt_text") {
3602
+ props.altText = trait.config?.text || "";
3603
+ } else if (name === "magnifiable") {
3604
+ props.magnifiable = trait.config || { max_scale: 3 };
3605
+ } else if (name === "high_contrast") {
3606
+ props.highContrast = trait.config || { mode: "outline" };
3607
+ } else if (name === "motion_reduced") {
3608
+ props.motionReduced = trait.config || true;
3609
+ if (props.animated) props.animated = false;
3610
+ } else if (name === "compute") {
3611
+ props.compute = trait.config || true;
3612
+ } else if (name === "gpu_particle") {
3613
+ props.gpuParticle = trait.config || { count: 1e4 };
3614
+ } else if (isVfxParticleTraitName(name)) {
3615
+ const particleConfig = {
3616
+ effect: vfxParticleEffect(name),
3617
+ ...trait.config || {}
3618
+ };
3619
+ const gpuParticles = props.gpuParticles ?? [];
3620
+ props.gpuParticles = [...gpuParticles, particleConfig];
3621
+ if (!props.gpuParticle) props.gpuParticle = particleConfig;
3622
+ } else if (name === "gpu_physics") {
3623
+ props.gpuPhysics = trait.config || true;
3624
+ } else if (name === "digital_twin") {
3625
+ props.digitalTwin = trait.config || true;
3626
+ } else if (name === "sensor") {
3627
+ props.sensor = trait.config || true;
3628
+ } else if (name === "data_binding") {
3629
+ props.dataBinding = trait.config || true;
3630
+ } else if (name === "behavior_tree") {
3631
+ props.behaviorTree = trait.config || true;
3632
+ } else if (name === "llm_agent") {
3633
+ props.llmAgent = trait.config || true;
3634
+ } else if (name === "neural_link") {
3635
+ props.neuralLink = trait.config || { model: "brittney-v4.gguf", temperature: 0.7 };
3636
+ } else if (name === "perception") {
3637
+ props.perception = trait.config || { sight_range: 20 };
3638
+ } else if (name === "patrol") {
3639
+ props.patrol = trait.config || true;
3640
+ } else if (name === "co_located") {
3641
+ props.coLocated = trait.config || true;
3642
+ } else if (name === "shared_world") {
3643
+ props.sharedWorld = trait.config || true;
3644
+ } else if (name === "voice_proximity") {
3645
+ props.voiceProximity = trait.config || { max_distance: 20 };
3646
+ props.spatial = true;
3647
+ } else if (name === "spatial_persona") {
3648
+ props.spatialPersona = trait.config || { style: "realistic" };
3649
+ } else if (name === "shareplay") {
3650
+ props.sharePlay = trait.config || { activity_type: "custom" };
3651
+ } else if (name === "object_tracking") {
3652
+ props.objectTracking = trait.config || true;
3653
+ } else if (name === "scene_reconstruction") {
3654
+ props.sceneReconstruction = trait.config || { mode: "mesh" };
3655
+ } else if (name === "eye_tracked") {
3656
+ props.eyeTracked = true;
3657
+ } else if (name === "eye_hand_fusion") {
3658
+ props.eyeHandFusion = true;
3659
+ } else if (name === "controlnet") {
3660
+ props.controlNet = trait.config || { model: "canny" };
3661
+ } else if (name === "ai_texture_gen") {
3662
+ props.aiTextureGen = trait.config || { style: "photorealistic" };
3663
+ } else if (name === "diffusion_realtime") {
3664
+ props.diffusionRealtime = trait.config || { backend: "cuda" };
3665
+ } else if (name === "ai_upscaling") {
3666
+ props.aiUpscaling = trait.config || { factor: 2 };
3667
+ } else if (name === "ai_inpainting") {
3668
+ props.aiInpainting = trait.config || true;
3669
+ } else if (name === "neural_forge") {
3670
+ props.neuralForge = trait.config || true;
3671
+ } else if (name === "embedding_search") {
3672
+ props.embeddingSearch = trait.config || { dimensions: 1536 };
3673
+ } else if (name === "ai_npc_brain") {
3674
+ props.aiNpcBrain = trait.config || { model: "llm" };
3675
+ } else if (name === "vector_db") {
3676
+ props.vectorDb = trait.config || true;
3677
+ } else if (name === "vision" || name === "ai_vision") {
3678
+ props.vision = trait.config || { task: "detection" };
3679
+ } else if (name === "spatial_awareness") {
3680
+ props.spatialAwareness = trait.config || true;
3681
+ } else if (name === "neural_animation") {
3682
+ props.neuralAnimation = trait.config || { style: "motion_matching" };
3683
+ } else if (name === "draft") {
3684
+ props.draftMode = true;
3685
+ props.draftShape = trait.config?.shape || "box";
3686
+ props.draftColor = trait.config?.color || "#88aaff";
3687
+ props.draftOpacity = trait.config?.opacity ?? 1;
3688
+ props.draftWireframe = trait.config?.wireframe || false;
3689
+ if (trait.config?.collision !== false) {
3690
+ if (!props.rigidBody) props.rigidBody = { type: "fixed" };
3691
+ if (!props.collider) props.collider = { type: "auto" };
3692
+ }
3693
+ } else {
3694
+ props[name] = trait.config || true;
3695
+ if (!props.__unrecognizedTraits) {
3696
+ props.__unrecognizedTraits = [];
3697
+ }
3698
+ props.__unrecognizedTraits.push(name);
3699
+ }
3700
+ }
3701
+ }
3702
+ if (obj.traits && Array.isArray(obj.traits)) {
3703
+ const traitNames = obj.traits.map(
3704
+ (t) => t.name
3705
+ );
3706
+ const compositor = new chunkOIQYIIO3_cjs.TraitCompositor();
3707
+ const composedMaterial = compositor.compose(traitNames);
3708
+ if (Object.keys(composedMaterial).length > 0) {
3709
+ props.materialProps = {
3710
+ ...props.materialProps,
3711
+ ...composedMaterial
3712
+ };
3713
+ }
3714
+ }
3715
+ let type;
3716
+ if (geometryType === "model" && props.src) {
3717
+ type = "gltfModel";
3718
+ } else if (geometryType === "light") {
3719
+ const lightType = props.lightType || props.type || "directional";
3720
+ const lightMapping = {
3721
+ directional: "directionalLight",
3722
+ point: "pointLight",
3723
+ spot: "spotLight",
3724
+ hemisphere: "hemisphereLight",
3725
+ ambient: "ambientLight",
3726
+ area: "rectAreaLight"
3727
+ };
3728
+ type = lightMapping[lightType] || "directionalLight";
3729
+ delete props.lightType;
3730
+ } else if (geometryType === "text") {
3731
+ type = "Text";
3732
+ } else if (geometryType === "sparkles") {
3733
+ type = "Sparkles";
3734
+ } else if (geometryType === "portal") {
3735
+ type = "Portal";
3736
+ } else {
3737
+ type = "mesh";
3738
+ props.hsType = geometryType;
3739
+ if (!props.args) {
3740
+ const size = typeof props.size === "number" ? props.size : 1;
3741
+ props.args = this.getGeometryArgs(geometryType, { size });
3742
+ }
3743
+ }
3744
+ const r3fNode = this.createNode(type, props, obj.name);
3745
+ if (props.draftMode) {
3746
+ r3fNode.assetMaturity = "draft";
3747
+ } else if (props.maturityOverride) {
3748
+ const m = props.maturityOverride;
3749
+ if (m === "draft" || m === "mesh" || m === "final") {
3750
+ r3fNode.assetMaturity = m;
3751
+ }
3752
+ }
3753
+ delete props.maturityOverride;
3754
+ if (obj.children && Array.isArray(obj.children)) {
3755
+ for (const child of obj.children) {
3756
+ r3fNode.children.push(this.compileObjectDecl(child));
3757
+ }
3758
+ }
3759
+ if (props.__gapsComponents && Array.isArray(props.__gapsComponents)) {
3760
+ for (const componentType of props.__gapsComponents) {
3761
+ const componentProps = {};
3762
+ if (componentType === "CloudRenderer" && props.volumetricClouds) {
3763
+ const vc = props.volumetricClouds;
3764
+ componentProps.coverage = vc.coverage ?? 0.5;
3765
+ componentProps.altitude = vc.altitude ?? 500;
3766
+ componentProps.windOffset = vc.wind ?? [0, 0, 0];
3767
+ componentProps.layers = vc.layers ?? 3;
3768
+ } else if (componentType === "GodRaysEffect" && props.godRays) {
3769
+ const gr = props.godRays;
3770
+ componentProps.intensity = gr.intensity ?? 1;
3771
+ componentProps.decay = gr.decay ?? 0.96;
3772
+ componentProps.lightColor = gr.color ?? "#fffde7";
3773
+ } else if (componentType === "FluidRenderer" && props.fluid) {
3774
+ const fl = props.fluid;
3775
+ componentProps.color = fl.color ?? "#1a6fc4";
3776
+ componentProps.particleSize = fl.particle_radius ?? 0.02;
3777
+ componentProps.renderMode = fl.render_mode ?? "points";
3778
+ }
3779
+ r3fNode.children.push(
3780
+ this.createNode(componentType, componentProps, `${obj.name}-${componentType}`)
3781
+ );
3782
+ }
3783
+ delete props.__gapsComponents;
3784
+ }
3785
+ return r3fNode;
3786
+ }
3787
+ /**
3788
+ * Compile a SystemNode into an R3FNode.
3789
+ *
3790
+ * Systems are logical containers with state, actions, lifecycle hooks,
3791
+ * and optionally child objects/UI. In the R3F tree, a system compiles
3792
+ * to a group node annotated with its rich metadata (state, actions,
3793
+ * hooks) so the runtime/renderer can wire up behavior.
3794
+ */
3795
+ compileSystemNode(node, templateMap) {
3796
+ const props = {};
3797
+ if (node.state) {
3798
+ props.systemState = node.state;
3799
+ }
3800
+ if (node.actions) {
3801
+ props.systemActions = node.actions;
3802
+ }
3803
+ if (node.hooks) {
3804
+ props.systemHooks = node.hooks;
3805
+ }
3806
+ if (node.properties && typeof node.properties === "object") {
3807
+ for (const [key, value] of Object.entries(node.properties)) {
3808
+ props[key] = value;
3809
+ }
3810
+ }
3811
+ const r3fNode = this.createNode("System", props, node.id || node.name);
3812
+ if (node.directives) {
3813
+ r3fNode.directives = node.directives;
3814
+ }
3815
+ if (node.directives) {
3816
+ for (const d of node.directives) {
3817
+ if (d.type === "trait") {
3818
+ r3fNode.traits?.set(d.name, d.config || {});
3819
+ }
3820
+ }
3821
+ }
3822
+ if (node.children && Array.isArray(node.children)) {
3823
+ for (const child of node.children) {
3824
+ r3fNode.children.push(this.compileChildNode(child, templateMap));
3825
+ }
3826
+ }
3827
+ if (node.ui && Array.isArray(node.ui)) {
3828
+ for (const uiNode of node.ui) {
3829
+ r3fNode.children.push(this.compileNode(uiNode));
3830
+ }
3831
+ }
3832
+ return r3fNode;
3833
+ }
3834
+ /**
3835
+ * Compile a ComponentNode into an R3FNode.
3836
+ *
3837
+ * Components are UI-focused containers with props, state, actions,
3838
+ * and render/UI blocks. They compile to a group node annotated with
3839
+ * component metadata for the runtime.
3840
+ */
3841
+ compileComponentNode(node, templateMap) {
3842
+ const props = {};
3843
+ if (node.props) {
3844
+ props.componentProps = node.props;
3845
+ }
3846
+ if (node.state) {
3847
+ props.componentState = node.state;
3848
+ }
3849
+ if (node.actions) {
3850
+ props.componentActions = node.actions;
3851
+ }
3852
+ if (node.hooks) {
3853
+ props.componentHooks = node.hooks;
3854
+ }
3855
+ if (node.properties && typeof node.properties === "object") {
3856
+ for (const [key, value] of Object.entries(node.properties)) {
3857
+ props[key] = value;
3858
+ }
3859
+ }
3860
+ const r3fNode = this.createNode(
3861
+ "Component",
3862
+ props,
3863
+ node.id || node.name
3864
+ );
3865
+ if (node.directives) {
3866
+ r3fNode.directives = node.directives;
3867
+ }
3868
+ if (node.directives) {
3869
+ for (const d of node.directives) {
3870
+ if (d.type === "trait") {
3871
+ r3fNode.traits?.set(d.name, d.config || {});
3872
+ }
3873
+ }
3874
+ }
3875
+ if (node.children && Array.isArray(node.children)) {
3876
+ for (const child of node.children) {
3877
+ r3fNode.children.push(this.compileChildNode(child, templateMap));
3878
+ }
3879
+ }
3880
+ if (node.ui && Array.isArray(node.ui)) {
3881
+ for (const uiNode of node.ui) {
3882
+ r3fNode.children.push(this.compileNode(uiNode));
3883
+ }
3884
+ }
3885
+ return r3fNode;
3886
+ }
3887
+ /**
3888
+ * Dispatch a child node to the appropriate compile method based on its type.
3889
+ * Used by compileSystemNode, compileComponentNode, and compileComposition
3890
+ * when processing the parser's children array.
3891
+ */
3892
+ compileChildNode(child, templateMap) {
3893
+ switch (child.type) {
3894
+ case "system":
3895
+ return this.compileSystemNode(child, templateMap);
3896
+ case "component":
3897
+ return this.compileComponentNode(child, templateMap);
3898
+ case "object":
3899
+ return this.compileObjectDecl(child, templateMap);
3900
+ case "template":
3901
+ if (templateMap && typeof child.name === "string") {
3902
+ templateMap.set(child.name, child);
3903
+ }
3904
+ return this.compileTemplateNode(child, templateMap);
3905
+ case "spatial_group":
3906
+ return this.compileSpatialGroup(child, templateMap);
3907
+ default:
3908
+ return this.compileNode(child);
3909
+ }
3910
+ }
3911
+ /**
3912
+ * Compile a template node. Templates define reusable types.
3913
+ * In the R3F tree, they compile to an empty group (they're not
3914
+ * rendered directly — objects "using" them inherit their properties).
3915
+ */
3916
+ compileTemplateNode(node, _templateMap) {
3917
+ const props = {};
3918
+ if (node.state || node.properties?.state) {
3919
+ props.templateState = node.state || node.properties?.state;
3920
+ }
3921
+ if (node.properties) {
3922
+ for (const [key, value] of Object.entries(node.properties)) {
3923
+ if (key !== "state") {
3924
+ props[key] = value;
3925
+ }
3926
+ }
3927
+ }
3928
+ return this.createNode("Template", props, node.name);
3929
+ }
3930
+ compileSpatialGroup(group, templateMap) {
3931
+ const props = {};
3932
+ if (group.properties) {
3933
+ for (const prop of group.properties) {
3934
+ if (prop.key === "position") props.position = prop.value;
3935
+ else if (prop.key === "rotation") props.rotation = prop.value;
3936
+ else if (prop.key === "scale")
3937
+ props.scale = Array.isArray(prop.value) ? prop.value : [prop.value, prop.value, prop.value];
3938
+ }
3939
+ }
3940
+ const node = this.createNode("group", props, group.name);
3941
+ if (group.objects) {
3942
+ for (const obj of group.objects)
3943
+ node.children.push(this.compileObjectDecl(obj, templateMap));
3944
+ }
3945
+ if (group.groups) {
3946
+ for (const sub of group.groups)
3947
+ node.children.push(this.compileSpatialGroup(sub, templateMap));
3948
+ }
3949
+ return node;
3950
+ }
3951
+ compileTimelineBlock(timeline) {
3952
+ const entries = [];
3953
+ if (timeline.entries) {
3954
+ for (const entry of timeline.entries) {
3955
+ const action = entry.action;
3956
+ const entryProps = { time: entry.time, actionKind: action.kind };
3957
+ if (action.kind === "animate") {
3958
+ entryProps.target = action.target;
3959
+ entryProps.properties = action.properties;
3960
+ } else if (action.kind === "emit") {
3961
+ entryProps.event = action.event;
3962
+ if (action.data !== void 0) entryProps.data = action.data;
3963
+ } else if (action.kind === "call") {
3964
+ entryProps.method = action.method;
3965
+ if (action.args) entryProps.args = action.args;
3966
+ }
3967
+ entries.push(this.createNode("TimelineEntry", entryProps));
3968
+ }
3969
+ }
3970
+ const safeName = timeline.name ? chunkKKP7JKN4_cjs.escapeStringValue(timeline.name, "JSX") : void 0;
3971
+ const timelineNode = this.createNode(
3972
+ "Timeline",
3973
+ { autoplay: timeline.autoplay, loop: timeline.loop },
3974
+ safeName
3975
+ );
3976
+ timelineNode.children = entries;
3977
+ return timelineNode;
3978
+ }
3979
+ compileAudioBlock(audio) {
3980
+ const props = {};
3981
+ if (audio.properties) {
3982
+ for (const prop of audio.properties) {
3983
+ if (prop.key === "src" || prop.key === "source") {
3984
+ props.src = prop.value;
3985
+ } else if (prop.key === "rolloff") {
3986
+ props.rolloffFactor = prop.value;
3987
+ } else {
3988
+ props[prop.key] = prop.value;
3989
+ }
3990
+ }
3991
+ }
3992
+ const safeName = audio.name ? chunkKKP7JKN4_cjs.escapeStringValue(audio.name, "JSX") : void 0;
3993
+ return this.createNode("Audio", props, safeName);
3994
+ }
3995
+ compileZoneBlock(zone) {
3996
+ const props = {};
3997
+ if (zone.properties) {
3998
+ for (const prop of zone.properties) {
3999
+ props[prop.key] = prop.value;
4000
+ }
4001
+ }
4002
+ if (zone.handlers && zone.handlers.length > 0) {
4003
+ props.handlers = zone.handlers.map(
4004
+ (h) => ({
4005
+ event: h.event,
4006
+ parameters: h.parameters,
4007
+ body: h.body
4008
+ })
4009
+ );
4010
+ }
4011
+ const safeName = zone.name ? chunkKKP7JKN4_cjs.escapeStringValue(zone.name, "JSX") : void 0;
4012
+ return this.createNode("Zone", props, safeName);
4013
+ }
4014
+ compileUIBlock(ui) {
4015
+ const children = [];
4016
+ if (ui.elements) {
4017
+ for (const el of ui.elements) {
4018
+ const elProps = {};
4019
+ if (el.properties) {
4020
+ for (const prop of el.properties) {
4021
+ if (prop.key === "font_size") {
4022
+ elProps.fontSize = prop.value;
4023
+ } else {
4024
+ elProps[prop.key] = this.resolveValue(prop.value);
4025
+ }
4026
+ }
4027
+ }
4028
+ const safeElName = el.name ? chunkKKP7JKN4_cjs.escapeStringValue(el.name, "JSX") : void 0;
4029
+ children.push(this.createNode("UIElement", elProps, safeElName));
4030
+ }
4031
+ }
4032
+ const uiNode = this.createNode("UI", {}, "__ui");
4033
+ uiNode.children = children;
4034
+ return uiNode;
4035
+ }
4036
+ compileTransitionBlock(transition) {
4037
+ const props = {};
4038
+ if (transition.properties) {
4039
+ for (const prop of transition.properties) {
4040
+ props[prop.key] = prop.value;
4041
+ }
4042
+ }
4043
+ const safeName = transition.name ? chunkKKP7JKN4_cjs.escapeStringValue(transition.name, "JSX") : void 0;
4044
+ return this.createNode("Transition", props, safeName);
4045
+ }
4046
+ compileConditionalBlock(cond, templateMap) {
4047
+ const children = [];
4048
+ if (cond.objects) {
4049
+ for (const obj of cond.objects)
4050
+ children.push(this.compileObjectDecl(obj, templateMap));
4051
+ }
4052
+ if (cond.spatialGroups) {
4053
+ for (const g of cond.spatialGroups)
4054
+ children.push(this.compileSpatialGroup(g, templateMap));
4055
+ }
4056
+ const elseChildren = [];
4057
+ if (cond.elseObjects) {
4058
+ for (const obj of cond.elseObjects)
4059
+ elseChildren.push(this.compileObjectDecl(obj, templateMap));
4060
+ }
4061
+ if (cond.elseSpatialGroups) {
4062
+ for (const g of cond.elseSpatialGroups)
4063
+ elseChildren.push(this.compileSpatialGroup(g, templateMap));
4064
+ }
4065
+ const conditionalNode = this.createNode("ConditionalGroup", {
4066
+ condition: cond.condition,
4067
+ elseChildren: elseChildren.length > 0 ? elseChildren : void 0
4068
+ });
4069
+ conditionalNode.children = children;
4070
+ return conditionalNode;
4071
+ }
4072
+ compileForEachBlock(iter, templateMap) {
4073
+ const templateChildren = [];
4074
+ if (iter.objects) {
4075
+ for (const obj of iter.objects)
4076
+ templateChildren.push(this.compileObjectDecl(obj, templateMap));
4077
+ }
4078
+ if (iter.spatialGroups) {
4079
+ for (const g of iter.spatialGroups)
4080
+ templateChildren.push(this.compileSpatialGroup(g, templateMap));
4081
+ }
4082
+ const forEachNode = this.createNode("ForEachGroup", {
4083
+ variable: iter.variable,
4084
+ iterable: iter.iterable
4085
+ });
4086
+ forEachNode.children = templateChildren;
4087
+ return forEachNode;
4088
+ }
4089
+ /**
4090
+ * Resolve a property value, converting bind expressions into runtime-reactive markers.
4091
+ */
4092
+ resolveValue(value) {
4093
+ if (value && typeof value === "object" && value.__bind) {
4094
+ return {
4095
+ __bind: true,
4096
+ source: value.source,
4097
+ transform: value.transform
4098
+ };
4099
+ }
4100
+ return value;
4101
+ }
4102
+ // ─── Shared Helpers ───────────────────────────────────────────────────
4103
+ injectDefaultLighting(root) {
4104
+ if (!this._defaultLighting) return;
4105
+ if (!this.treeHasLights(root)) {
4106
+ const shadowSize = this.tierScales.shadowMapSize;
4107
+ root.children?.unshift(
4108
+ this.createNode("ambientLight", { intensity: 0.4, color: "#ffffff" }),
4109
+ this.createNode("directionalLight", {
4110
+ intensity: 1,
4111
+ position: [5, 10, 5],
4112
+ castShadow: true,
4113
+ "shadow-mapSize": [shadowSize, shadowSize],
4114
+ color: "#ffffff"
4115
+ })
4116
+ );
4117
+ }
4118
+ }
4119
+ treeHasLights(node) {
4120
+ if (node.type.toLowerCase().includes("light")) return true;
4121
+ return node.children?.some((c) => this.treeHasLights(c)) || false;
4122
+ }
4123
+ hasPostProcessing(node) {
4124
+ if (node.traits?.has("bloom") || node.traits?.has("postprocessing"))
4125
+ return true;
4126
+ if (node.props.bloom) return true;
4127
+ return node.children?.some((c) => this.hasPostProcessing(c)) || false;
4128
+ }
4129
+ extractPostProcessingNodes(node) {
4130
+ const effects = [];
4131
+ const ppTrait = node.traits?.get(
4132
+ "postprocessing"
4133
+ );
4134
+ if (ppTrait) {
4135
+ if (ppTrait.bloom)
4136
+ effects.push(this.createNode("Bloom", ppTrait.bloom));
4137
+ if (ppTrait.ssao)
4138
+ effects.push(this.createNode("SSAO", ppTrait.ssao));
4139
+ if (ppTrait.vignette)
4140
+ effects.push(this.createNode("Vignette", ppTrait.vignette));
4141
+ }
4142
+ if (node.props.bloom) {
4143
+ const bloom = node.props.bloom;
4144
+ const bloomProps = typeof bloom === "object" && bloom !== null ? bloom : { intensity: 1 };
4145
+ effects.push(this.createNode("Bloom", bloomProps));
4146
+ }
4147
+ node.children?.forEach((child) => effects.push(...this.extractPostProcessingNodes(child)));
4148
+ return effects;
4149
+ }
4150
+ mapType(type, props) {
4151
+ if (type === "environment") {
4152
+ if (props.name && typeof props.name === "string" && exports.ENVIRONMENT_PRESETS[props.name]) {
4153
+ Object.assign(props, exports.ENVIRONMENT_PRESETS[props.name]);
4154
+ }
4155
+ return "Environment";
4156
+ }
4157
+ if (type === "light") {
4158
+ const lightType = props.type || "directional";
4159
+ const lightMapping = {
4160
+ directional: "directionalLight",
4161
+ point: "pointLight",
4162
+ spot: "spotLight",
4163
+ hemisphere: "hemisphereLight",
4164
+ ambient: "ambientLight",
4165
+ area: "rectAreaLight"
4166
+ };
4167
+ return lightMapping[lightType] || "directionalLight";
4168
+ }
4169
+ if (type === "portal") return "Portal";
4170
+ if (type === "sparkles") return "Sparkles";
4171
+ if (MESH_TYPES.has(type)) {
4172
+ props.hsType = type;
4173
+ return "mesh";
4174
+ }
4175
+ const mapping = {
4176
+ ambient_light: "ambientLight",
4177
+ model: "gltfModel",
4178
+ audio: "positionalAudio",
4179
+ composition: "group",
4180
+ scale: "group",
4181
+ focus: "group",
4182
+ spatial_agent: "SpatialAgent",
4183
+ spatial_container: "group",
4184
+ ui_panel: "UIPanel",
4185
+ ui_text: "UIText",
4186
+ ui_button: "UIButton",
4187
+ ui_slider: "UISlider",
4188
+ ui_input: "UIInput",
4189
+ ui_image: "UIImage",
4190
+ ui_chart: "UIChart",
4191
+ ui_gauge: "UIGauge",
4192
+ ui_value: "UIValue",
4193
+ ui_status_indicator: "UIStatusIndicator",
4194
+ tool_slot: "ToolSlot",
4195
+ behavior: "group",
4196
+ system: "System",
4197
+ component: "Component",
4198
+ dna: "DNA",
4199
+ gaussian_splat: "GaussianSplat",
4200
+ splat: "GaussianSplat",
4201
+ nerf: "NeRF",
4202
+ volumetric_video: "VolumetricVideo",
4203
+ world: "group"
4204
+ };
4205
+ return mapping[type] || type;
4206
+ }
4207
+ compileProperties(node, rawProps) {
4208
+ const expandedProps = this.expandSpreads(rawProps);
4209
+ const props = { ...expandedProps };
4210
+ if (node.position) {
4211
+ props.position = node.position;
4212
+ }
4213
+ if (rawProps.position && Array.isArray(rawProps.position)) {
4214
+ props.position = rawProps.position;
4215
+ }
4216
+ if (node.hologram) {
4217
+ const h = node.hologram;
4218
+ if (h.color) props.color = h.color;
4219
+ if (MESH_TYPES.has(node.type)) {
4220
+ props.args = this.getGeometryArgs(node.type, h);
4221
+ props.hsType = node.type;
4222
+ }
4223
+ }
4224
+ if (rawProps.scale !== void 0 && !props.scale) {
4225
+ props.scale = Array.isArray(rawProps.scale) ? rawProps.scale : [rawProps.scale, rawProps.scale, rawProps.scale];
4226
+ }
4227
+ if (rawProps.geometry && !props.hsType) {
4228
+ props.hsType = rawProps.geometry;
4229
+ props.args = this.getGeometryArgs(rawProps.geometry, { size: rawProps.size || 1 });
4230
+ }
4231
+ if (rawProps.material && typeof rawProps.material === "string" && exports.MATERIAL_PRESETS[rawProps.material]) {
4232
+ props.materialProps = {
4233
+ ...exports.MATERIAL_PRESETS[rawProps.material],
4234
+ ...props.materialProps
4235
+ };
4236
+ }
4237
+ if (node.directives) {
4238
+ for (const d of node.directives) {
4239
+ if (d.type === "trait") {
4240
+ if (d.name === "grabbable") {
4241
+ props.castShadow = true;
4242
+ props.grabbable = d.config || true;
4243
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
4244
+ if (!props.collider) props.collider = { type: "auto" };
4245
+ } else if (d.name === "animated") {
4246
+ props.animated = d.config || true;
4247
+ } else if (d.name === "spatial_audio" || d.name === "voice") {
4248
+ props.spatial = true;
4249
+ } else if (d.name === "gem_resonance") {
4250
+ props.gemResonance = gemResonanceConfig(d.config);
4251
+ props.spatial = true;
4252
+ } else if (d.name === "networked") {
4253
+ props.networked = d.config || true;
4254
+ } else if (d.name === "moldable") {
4255
+ props.moldable = d.config || true;
4256
+ } else if (d.name === "stretchable") {
4257
+ props.stretchable = d.config || true;
4258
+ } else if (d.name === "ai_driven") {
4259
+ props.ai_driven = d.config || true;
4260
+ } else if (d.name === "dialogue") {
4261
+ props.dialogue = d.config || true;
4262
+ } else if (d.name === "gesture") {
4263
+ props.gesture = d.config || true;
4264
+ } else if (d.name === "haptic") {
4265
+ props.haptic = d.config || true;
4266
+ } else if (d.name === "avatar_embodiment") {
4267
+ props.avatarEmbodiment = d.config || true;
4268
+ } else if (d.name === "lip_sync") {
4269
+ props.lipSync = d.config || true;
4270
+ } else if (d.name === "emotion_directive") {
4271
+ props.emotionDirective = d.config || true;
4272
+ } else if (d.name === "stt") {
4273
+ props.stt = d.config || true;
4274
+ } else if (d.name === "tts") {
4275
+ props.tts = d.config || true;
4276
+ } else if (d.name === "generate") {
4277
+ props.generate = d.config;
4278
+ } else if (d.name === "skeleton") {
4279
+ props.skeleton = d.config || true;
4280
+ } else if (d.name === "body") {
4281
+ props.body = d.config || true;
4282
+ } else if (d.name === "gaussian_splat") {
4283
+ props.gaussianSplat = d.config || true;
4284
+ } else if (d.name === "nerf") {
4285
+ props.nerf = d.config || true;
4286
+ } else if (d.name === "volumetric_video") {
4287
+ props.volumetricVideo = d.config || true;
4288
+ } else if (d.name === "web_surface") {
4289
+ props.webSurface = d.config || true;
4290
+ }
4291
+ }
4292
+ }
4293
+ }
4294
+ delete props.type;
4295
+ delete props.geometry;
4296
+ return props;
4297
+ }
4298
+ applyGraphicsConfig(r3fNode, graphics) {
4299
+ if (graphics.material) {
4300
+ const m = graphics.material;
4301
+ const materialProps = {};
4302
+ if (m.preset && exports.MATERIAL_PRESETS[m.preset]) {
4303
+ Object.assign(materialProps, exports.MATERIAL_PRESETS[m.preset]);
4304
+ }
4305
+ if (m.type === "pbr" && m.pbr) {
4306
+ if (m.pbr.baseColor) materialProps["color"] = this.mapColor(m.pbr.baseColor);
4307
+ if (m.pbr.metallic !== void 0) materialProps["metalness"] = m.pbr.metallic;
4308
+ if (m.pbr.roughness !== void 0) materialProps["roughness"] = m.pbr.roughness;
4309
+ if (m.pbr.emission) materialProps["emissive"] = this.mapColor(m.pbr.emission);
4310
+ if (m.pbr.emissionStrength) materialProps["emissiveIntensity"] = m.pbr.emissionStrength;
4311
+ if (m.pbr.clearcoat !== void 0) materialProps["clearcoat"] = m.pbr.clearcoat;
4312
+ if (m.pbr.transmission !== void 0) materialProps["transmission"] = m.pbr.transmission;
4313
+ if (m.pbr.ior !== void 0) materialProps["ior"] = m.pbr.ior;
4314
+ if (m.pbr.iridescence !== void 0) materialProps["iridescence"] = m.pbr.iridescence;
4315
+ }
4316
+ const prior = r3fNode.props.materialProps ?? {};
4317
+ r3fNode.props.materialProps = { ...prior, ...materialProps };
4318
+ }
4319
+ if (graphics.lighting) {
4320
+ const l = graphics.lighting;
4321
+ if (r3fNode.type.toLowerCase().includes("light")) {
4322
+ if (l.shadows) r3fNode.props.castShadow = true;
4323
+ if (l.intensity !== void 0) r3fNode.props.intensity = l.intensity;
4324
+ if (l.color) r3fNode.props.color = this.mapColor(l.color);
4325
+ }
4326
+ if (r3fNode.type === "Environment" && l.preset) {
4327
+ r3fNode.props.preset = l.preset;
4328
+ }
4329
+ }
4330
+ if (graphics.networked) {
4331
+ r3fNode.props.networked = graphics.networked;
4332
+ }
4333
+ }
4334
+ mapColor(c) {
4335
+ if (typeof c === "string") return c;
4336
+ if (typeof c === "number") return `#${c.toString(16).padStart(6, "0")}`;
4337
+ if (c.r !== void 0) {
4338
+ const r = c.r > 1 ? c.r : Math.floor(c.r * 255);
4339
+ const g = c.g > 1 ? c.g : Math.floor(c.g * 255);
4340
+ const b = c.b > 1 ? c.b : Math.floor(c.b * 255);
4341
+ return `rgb(${r}, ${g}, ${b})`;
4342
+ }
4343
+ return "#ffffff";
4344
+ }
4345
+ getGeometryArgs(type, hologram) {
4346
+ const size = hologram.size || 1;
4347
+ switch (type) {
4348
+ case "sphere":
4349
+ case "orb":
4350
+ return [size * 0.5, 32, 32];
4351
+ case "cube":
4352
+ case "box":
4353
+ return [size, size, size];
4354
+ case "cylinder":
4355
+ return [size * 0.5, size * 0.5, size, 32];
4356
+ case "pyramid":
4357
+ case "cone":
4358
+ return [size * 0.5, 0, size, 4];
4359
+ case "plane":
4360
+ return [size, size];
4361
+ case "torus":
4362
+ return [size * 0.5, size * 0.15, 16, 32];
4363
+ case "ring":
4364
+ return [size * 0.3, size * 0.5, 32];
4365
+ case "capsule":
4366
+ return [size * 0.3, size * 0.5, 4, 16];
4367
+ default:
4368
+ return [size, size, size];
4369
+ }
4370
+ }
4371
+ };
4372
+ }
4373
+ });
4374
+
4375
+ exports.R3FCompiler_exports = R3FCompiler_exports;
4376
+ exports.init_ObjectPool = init_ObjectPool;
4377
+ exports.init_R3FCompiler = init_R3FCompiler;
4378
+ exports.init_visual = init_visual;
4379
+ exports.registerAllPresets = registerAllPresets;
4380
+ //# sourceMappingURL=chunk-GQT4TYKY.cjs.map
4381
+ //# sourceMappingURL=chunk-GQT4TYKY.cjs.map