@holoscript/core 8.0.8 → 8.0.9

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