@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.
- package/bin/holoscript.cjs +5 -1
- package/dist/GLTFPipeline-L76YTXKA.js +15 -0
- package/dist/GLTFPipeline-ZWJN7GI6.cjs +36 -0
- package/dist/HoloCompositionParser-K76KTEEE.js +12 -0
- package/dist/HoloCompositionParser-UZH6Y4HO.cjs +45 -0
- package/dist/HoloScriptCodeParser-2D4ERFUZ.js +6 -0
- package/dist/HoloScriptCodeParser-UDRLDA7I.cjs +23 -0
- package/dist/HoloScriptPlusParser-FTMCGWXD.js +13 -0
- package/dist/HoloScriptPlusParser-LQR5GIKF.cjs +30 -0
- package/dist/HoloScriptRuntime-UTRLJI5L.js +12 -0
- package/dist/HoloScriptRuntime-YBYXJHJN.cjs +21 -0
- package/dist/SceneIRCompiler-63KA3M2F.js +17 -0
- package/dist/SceneIRCompiler-KWUFHZ4O.cjs +42 -0
- package/dist/{USDZExporter-AUHZODOF.cjs → USDZExporter-ML4UMIGC.cjs} +3 -3
- package/dist/{USDZExporter-GXB4AUSG.js → USDZExporter-ZFKLQ76G.js} +3 -3
- package/dist/agents/index.cjs +1 -1
- package/dist/agents/index.js +1 -1
- package/dist/audit/AuditLogger.d.ts +106 -0
- package/dist/audit/AuditQueryBuilder.d.ts +79 -0
- package/dist/audit/ComplianceReporter.d.ts +90 -0
- package/dist/audit/index.d.ts +13 -0
- package/dist/{chunk-FGMDMJM7.js → chunk-2BYAUHBO.js} +3 -3
- package/dist/{chunk-EDPYCLRC.cjs → chunk-2E6PP5UE.cjs} +83 -59
- package/dist/{chunk-GASCWJK5.js → chunk-2EGGAZT3.js} +65 -287
- package/dist/{chunk-SIEXCILW.js → chunk-2I3XAGMF.js} +3 -3
- package/dist/{chunk-OS533P33.cjs → chunk-2KKOYZYI.cjs} +1074 -1655
- package/dist/chunk-2MQKNDNH.js +51 -0
- package/dist/{chunk-7DMMMBCY.cjs → chunk-2X3IPCBK.cjs} +10 -10
- package/dist/chunk-2ZOTBO25.cjs +202 -0
- package/dist/chunk-356N4NPM.cjs +152 -0
- package/dist/{chunk-X3GJPRVK.cjs → chunk-36NPLOI4.cjs} +92 -81
- package/dist/{chunk-SLU6UPJI.cjs → chunk-37HHY7RH.cjs} +5 -5
- package/dist/{chunk-YDPEHCCI.cjs → chunk-3CDDRUER.cjs} +3 -118
- package/dist/chunk-3F7ZZWIN.js +1651 -0
- package/dist/chunk-3ILD7TKP.cjs +187 -0
- package/dist/{chunk-X27QRG4C.cjs → chunk-3IUHTGDD.cjs} +153 -41
- package/dist/{chunk-PXNZ6TME.js → chunk-4376VHNJ.js} +60 -36
- package/dist/{chunk-YKGPCZEE.cjs → chunk-4FIBOJW6.cjs} +10 -10
- package/dist/chunk-4Q7RKQQI.cjs +14195 -0
- package/dist/{chunk-YCM6QQRT.cjs → chunk-566ZB4LZ.cjs} +180 -8
- package/dist/{chunk-2Y3V22SG.js → chunk-5CURIYGT.js} +3 -3
- package/dist/{chunk-QBWNJXNR.js → chunk-5FYMCVBY.js} +5 -5
- package/dist/{chunk-ZA34AN3R.js → chunk-5LVFTGKH.js} +841 -12
- package/dist/chunk-63AUAIL6.js +48 -0
- package/dist/chunk-655FATJU.js +110 -0
- package/dist/{chunk-TQ377OLB.cjs → chunk-65S62L4D.cjs} +28 -22
- package/dist/chunk-6NTAZN5Z.cjs +502 -0
- package/dist/chunk-6TRX6AR2.js +9376 -0
- package/dist/chunk-6ZCCLKS2.cjs +51 -0
- package/dist/{chunk-MDR235RZ.js → chunk-734OB5SK.js} +721 -8
- package/dist/{chunk-Q2Q34NF3.js → chunk-77QI552M.js} +6 -6
- package/dist/{chunk-WKX5AMOY.js → chunk-7I74JWPW.js} +3 -3
- package/dist/{chunk-5FSKKMR7.cjs → chunk-7IDJDMPU.cjs} +232 -4
- package/dist/chunk-7VBKRGIZ.cjs +847 -0
- package/dist/{chunk-KCPHASCO.js → chunk-AATYYLYK.js} +5 -5
- package/dist/{chunk-WFKVS2K4.cjs → chunk-AUZRKIHQ.cjs} +1101 -55
- package/dist/{chunk-DTGBOSEM.cjs → chunk-AWXFEAQL.cjs} +12 -12
- package/dist/{chunk-THCK6ECW.js → chunk-B3CWTCK2.js} +231 -3
- package/dist/chunk-BCP4E7MD.cjs +997 -0
- package/dist/chunk-BG7RPYJP.js +91 -0
- package/dist/{chunk-VF257YKO.js → chunk-BP4KTMLY.js} +117 -5
- package/dist/{chunk-YN6IETRZ.js → chunk-BQJ3YBF3.js} +6424 -987
- package/dist/{chunk-KOUAQL2B.cjs → chunk-CANAL6CT.cjs} +1569 -168
- package/dist/{chunk-FDSGHPAK.js → chunk-CBSDJF3B.js} +3 -3
- package/dist/{chunk-FEWUHQNM.cjs → chunk-CFVK26P4.cjs} +4 -4
- package/dist/{chunk-M7K4LE66.cjs → chunk-CI33NINL.cjs} +4 -4
- package/dist/{chunk-2OWDB4FB.js → chunk-CKV5NYAE.js} +6 -6
- package/dist/{chunk-LPS5AMQD.cjs → chunk-CM4NHXVO.cjs} +24 -24
- package/dist/chunk-D3HSRXYB.js +115 -0
- package/dist/{chunk-FNHJRI32.js → chunk-DBH3D2MU.js} +1561 -160
- package/dist/{chunk-GW3LKD5C.js → chunk-DJNH4HFW.js} +3 -3
- package/dist/{chunk-2GCNOI2U.cjs → chunk-DN6F4DHH.cjs} +9 -3
- package/dist/chunk-DQRJ5RJG.js +432 -0
- package/dist/{chunk-C7ZBSV2Q.js → chunk-DUG3OQAS.js} +106 -43
- package/dist/chunk-ECUYJOJ2.cjs +199 -0
- package/dist/chunk-EEMTCAK7.js +182 -0
- package/dist/{chunk-3SKLAUDD.cjs → chunk-EI3J6LTW.cjs} +359 -581
- package/dist/{chunk-SSSN7VAM.js → chunk-EM2OGPYE.js} +4 -4
- package/dist/{chunk-56VOWURB.cjs → chunk-ENZCIQZC.cjs} +522 -453
- package/dist/chunk-ESBXUYOC.cjs +836 -0
- package/dist/{chunk-L5U4W6JC.js → chunk-ESSEF6U2.js} +4 -4
- package/dist/chunk-ET3AN4W3.js +824 -0
- package/dist/chunk-EXKSFGSX.cjs +14 -14
- package/dist/{chunk-I76GIKN7.cjs → chunk-F3YT6GUF.cjs} +17 -17
- package/dist/{chunk-WRWEX5ZF.js → chunk-F75DZBBI.js} +3 -3
- package/dist/{chunk-4JGRWHZJ.js → chunk-FG6PYGIZ.js} +12 -6
- package/dist/chunk-FGGJQRLZ.js +14 -14
- package/dist/{chunk-SXOSDZD6.js → chunk-FWCHPCD4.js} +128 -10
- package/dist/{chunk-XW6IXEQH.cjs → chunk-G35CAQ7I.cjs} +5 -5
- package/dist/{chunk-7VMGP2FW.js → chunk-G6KACNMO.js} +132 -188
- package/dist/{chunk-FJPADH77.cjs → chunk-GAWJJAGT.cjs} +6 -6
- package/dist/chunk-GGR7QUKK.cjs +4724 -0
- package/dist/chunk-GIBF4BHH.js +14098 -0
- package/dist/{chunk-AWB7QYY6.cjs → chunk-GILYQ5VH.cjs} +6 -6
- package/dist/{chunk-FWVYAMNW.cjs → chunk-GKFCHGCM.cjs} +4 -4
- package/dist/{chunk-Y3ZFVUUU.js → chunk-GLEJ2TLS.js} +3 -3
- package/dist/{chunk-3GWWJT7L.js → chunk-GP3OKSKT.js} +13 -13
- package/dist/chunk-GTIPOEHN.js +196 -0
- package/dist/{chunk-LMJ5EBV7.cjs → chunk-GZPUA2TL.cjs} +16 -15
- package/dist/{chunk-IELX2OKI.js → chunk-H4LJ4HEA.js} +3 -115
- package/dist/{chunk-ACVWFGBI.cjs → chunk-HCX4SMFK.cjs} +3 -3
- package/dist/{chunk-HYNTS5CP.js → chunk-HHRZ6STP.js} +24 -2
- package/dist/chunk-HIDEIEFG.js +48 -0
- package/dist/{chunk-W6RW64BB.cjs → chunk-HSWBIDZM.cjs} +228 -5
- package/dist/{chunk-GSOUNWEL.js → chunk-HVX7QQYK.js} +1035 -1616
- package/dist/{chunk-TRCGG42I.cjs → chunk-IFW5IW4L.cjs} +6502 -1019
- package/dist/{chunk-F5LKJ6F5.cjs → chunk-IJU6AS67.cjs} +32 -28
- package/dist/{chunk-TVANHNJ7.js → chunk-IK6Z2HNC.js} +173 -3
- package/dist/{chunk-QGMUTVVH.cjs → chunk-IS7NTKY5.cjs} +20 -20
- package/dist/{chunk-YFVQWSNJ.js → chunk-IXWGYWH6.js} +3 -3
- package/dist/chunk-J2DAS2PL.js +148 -0
- package/dist/chunk-JBQXZIWB.js +148 -0
- package/dist/chunk-JBYBMBMW.js +261 -0
- package/dist/{chunk-LWUOUCYL.js → chunk-JEJ7TT54.js} +5 -5
- package/dist/{chunk-DUCB6LGL.js → chunk-JOTCTHN5.js} +211 -5
- package/dist/{chunk-47RUFYKR.js → chunk-K56UVEXV.js} +3 -3
- package/dist/{chunk-XSFNHP2E.js → chunk-KB26H447.js} +3 -3
- package/dist/{chunk-3NGDZZR4.js → chunk-KEYG7HGY.js} +430 -37
- package/dist/{chunk-DY72BMU5.js → chunk-KFVNCW4Q.js} +4 -4
- package/dist/chunk-KPGC7SK2.js +192 -0
- package/dist/chunk-KROXXBK5.cjs +53 -0
- package/dist/{chunk-ZPZAVHXL.cjs → chunk-LB3ZZMKT.cjs} +137 -19
- package/dist/chunk-LDYZWNJW.cjs +1654 -0
- package/dist/{chunk-ULMSSHCJ.cjs → chunk-LMB555QB.cjs} +405 -38
- package/dist/{chunk-CBJY23VL.js → chunk-MD4IVS42.js} +3 -3
- package/dist/{chunk-VMLKSV26.js → chunk-MDDWEBCX.js} +226 -3
- package/dist/chunk-MUWH4QK5.cjs +94 -0
- package/dist/{chunk-T6W3Z3SH.cjs → chunk-N2ILK7BF.cjs} +4 -4
- package/dist/{chunk-6EX3I5P4.cjs → chunk-N74QRJGP.cjs} +6 -6
- package/dist/chunk-NFFHLX37.cjs +132 -0
- package/dist/chunk-NJSYWX7H.js +190 -0
- package/dist/{chunk-SH5PPVK7.cjs → chunk-NQN5LFN4.cjs} +165 -221
- package/dist/chunk-NTQRFOPP.cjs +56 -0
- package/dist/{chunk-YFWRJW4B.js → chunk-NWMJPTVL.js} +51 -55
- package/dist/{chunk-63ZGNR2T.cjs → chunk-OC6GV5QH.cjs} +42 -42
- package/dist/{chunk-7E7GCQCK.js → chunk-OG3MBHM3.js} +9 -3
- package/dist/chunk-OMNHTCS4.cjs +264 -0
- package/dist/chunk-OQXB6NNC.cjs +117 -0
- package/dist/{chunk-Y57W2CT5.cjs → chunk-OV46CCA2.cjs} +51 -55
- package/dist/{chunk-6PRZIHGL.cjs → chunk-OV6HHKLE.cjs} +21 -266
- package/dist/{chunk-C37BHB7N.cjs → chunk-P26YYPOO.cjs} +5 -5
- package/dist/{chunk-2BZHWUSR.cjs → chunk-P7JEKJTZ.cjs} +16 -16
- package/dist/{chunk-NGBXXZLL.cjs → chunk-PDXX5UI4.cjs} +45 -45
- package/dist/{chunk-FHQFPYV4.js → chunk-PJFTTSKE.js} +8 -7
- package/dist/{chunk-GVFJ6T4S.cjs → chunk-PVODJEJ7.cjs} +721 -8
- package/dist/{chunk-ZZ7RO2UQ.js → chunk-Q265VZJ4.js} +3 -3
- package/dist/{chunk-E7JP3BS3.cjs → chunk-Q47JEE2C.cjs} +4 -4
- package/dist/chunk-QBY7LRN2.js +281 -0
- package/dist/{chunk-Z6PMDS4G.js → chunk-QDQWKSU3.js} +1090 -53
- package/dist/{chunk-GH6C2QGW.cjs → chunk-QEDMOGF3.cjs} +857 -16
- package/dist/{chunk-5WUNN6ZN.cjs → chunk-QHSAVOOL.cjs} +24 -2
- package/dist/chunk-QJNCDVYM.cjs +137 -0
- package/dist/chunk-QM7FJB5W.js +4717 -0
- package/dist/chunk-QQFB4RT2.cjs +448 -0
- package/dist/chunk-QSYBHQAD.cjs +196 -0
- package/dist/{chunk-UGXHYIWT.cjs → chunk-QUJ3ZB55.cjs} +28 -28
- package/dist/{chunk-2YSNA2F2.cjs → chunk-QVJMDVYZ.cjs} +5 -5
- package/dist/chunk-RAJMAX6D.js +131 -0
- package/dist/{chunk-VVKVQZI6.js → chunk-RAN3ECAS.js} +3 -3
- package/dist/chunk-RKGUZBOC.js +79 -0
- package/dist/{chunk-HLFDZ35S.cjs → chunk-RRQIAJLQ.cjs} +8 -8
- package/dist/{chunk-PABONWKI.js → chunk-RXQNRZ5F.js} +3 -3
- package/dist/{chunk-7ZHYEITD.cjs → chunk-S4O7CFHQ.cjs} +10 -11
- package/dist/chunk-SE7ANBGN.js +128 -0
- package/dist/{chunk-X2AVEAZM.cjs → chunk-SJIRCTIS.cjs} +176 -2
- package/dist/{chunk-WXQ57LAO.js → chunk-SQXAZHDG.js} +4 -4
- package/dist/chunk-SR73L5ZP.cjs +84 -0
- package/dist/{chunk-OABEO6HH.js → chunk-SZOLTWWD.js} +2349 -214
- package/dist/{chunk-5JEU52DW.js → chunk-TPZ3BN2D.js} +3 -3
- package/dist/{chunk-QFU53KRH.js → chunk-TSTFYGGX.js} +4 -5
- package/dist/{chunk-EBS32AJI.cjs → chunk-TZCFKZ6Z.cjs} +5 -5
- package/dist/chunk-UCVZXQ63.js +724 -0
- package/dist/chunk-UGQ3QNV6.js +992 -0
- package/dist/chunk-UNMVGZVW.js +142 -0
- package/dist/{chunk-TEVX443G.js → chunk-UTUD6GJI.js} +178 -6
- package/dist/chunk-UXBYA7DV.cjs +155 -0
- package/dist/chunk-V6GXFSK7.cjs +443 -0
- package/dist/chunk-VHORVGCG.cjs +761 -0
- package/dist/{chunk-B4EKV6HQ.js → chunk-VKCTYLDN.js} +500 -442
- package/dist/{chunk-O3MGZDCT.cjs → chunk-VTEXJOSD.cjs} +63 -63
- package/dist/chunk-VVAAZITA.cjs +287 -0
- package/dist/{chunk-V7AKE5VT.cjs → chunk-W2GA3EQB.cjs} +435 -42
- package/dist/chunk-W4GABFCR.js +37 -0
- package/dist/chunk-WKEK4NCA.js +490 -0
- package/dist/{chunk-5A4TCHOC.cjs → chunk-WNYXT4TE.cjs} +4 -4
- package/dist/{chunk-S762UEV5.js → chunk-WTH23ISI.js} +6 -6
- package/dist/{chunk-BTKZGHAV.js → chunk-WWNCM473.js} +10 -6
- package/dist/{chunk-7X5PNIQJ.js → chunk-X3YFRH6K.js} +27 -25
- package/dist/{chunk-4YNYPHH3.cjs → chunk-X75H75UY.cjs} +2351 -213
- package/dist/{chunk-LYJJI7ZK.cjs → chunk-XCUDDFKC.cjs} +216 -9
- package/dist/chunk-YAO4HPJL.cjs +120 -0
- package/dist/chunk-YKY2JBER.cjs +9443 -0
- package/dist/chunk-YP5CHEYU.cjs +154 -0
- package/dist/{chunk-WRNEH5MO.js → chunk-YW3I2FQL.js} +18 -7
- package/dist/{chunk-BRNUPDHJ.js → chunk-Z557DVYN.js} +386 -19
- package/dist/{chunk-VSACG2AR.js → chunk-Z6LZUYZF.js} +21 -264
- package/dist/chunk-ZHPMP447.cjs +43 -0
- package/dist/{chunk-LODTHGST.cjs → chunk-ZK7KX5CD.cjs} +133 -70
- package/dist/{chunk-CCPSNT6B.cjs → chunk-ZRPALBQB.cjs} +5 -5
- package/dist/chunk-ZVFHPMC5.js +824 -0
- package/dist/chunk-ZVQMKUGJ.js +443 -0
- package/dist/cli/holoscript-runner.cjs +86 -48
- package/dist/cli/holoscript-runner.js +54 -16
- package/dist/codebase/index.cjs +1 -1
- package/dist/codebase/index.js +1 -1
- package/dist/compiler/agent-inference.cjs +11 -11
- package/dist/compiler/agent-inference.js +9 -6
- package/dist/compiler/android-xr.cjs +13 -12
- package/dist/compiler/android-xr.js +11 -10
- package/dist/compiler/android.cjs +12 -12
- package/dist/compiler/android.js +10 -10
- package/dist/compiler/business-quest.cjs +10 -10
- package/dist/compiler/business-quest.js +2 -2
- package/dist/compiler/coco.cjs +1 -1
- package/dist/compiler/coco.js +1 -1
- package/dist/compiler/context.cjs +9 -9
- package/dist/compiler/context.js +6 -6
- package/dist/compiler/daimon-seed.cjs +36 -0
- package/dist/compiler/daimon-seed.js +12 -0
- package/dist/compiler/domain-block-utils.cjs +205 -156
- package/dist/compiler/domain-block-utils.js +8 -7
- package/dist/compiler/dtdl.cjs +10 -10
- package/dist/compiler/dtdl.js +7 -7
- package/dist/compiler/gltf-pipeline.cjs +9 -9
- package/dist/compiler/gltf-pipeline.js +2 -2
- package/dist/compiler/godot.cjs +10 -9
- package/dist/compiler/godot.js +9 -8
- package/dist/compiler/incremental.cjs +11 -11
- package/dist/compiler/incremental.js +6 -6
- package/dist/compiler/index.cjs +2585 -3273
- package/dist/compiler/index.d.ts +149 -35
- package/dist/compiler/index.js +2197 -3102
- package/dist/compiler/ios.cjs +11 -11
- package/dist/compiler/ios.js +9 -9
- package/dist/compiler/llm-provider-capabilities.cjs +9 -9
- package/dist/compiler/llm-provider-capabilities.js +6 -6
- package/dist/compiler/nodetoy.cjs +1 -1
- package/dist/compiler/nodetoy.js +1 -1
- package/dist/compiler/openxr.cjs +11 -10
- package/dist/compiler/openxr.js +10 -9
- package/dist/compiler/remotion.cjs +1 -1
- package/dist/compiler/remotion.js +1 -1
- package/dist/compiler/reproducibility.cjs +1 -1
- package/dist/compiler/reproducibility.js +1 -1
- package/dist/compiler/sdf.cjs +11 -10
- package/dist/compiler/sdf.js +9 -8
- package/dist/compiler/semantic-scene.cjs +7 -7
- package/dist/compiler/semantic-scene.js +2 -2
- package/dist/compiler/state.cjs +9 -9
- package/dist/compiler/state.js +7 -7
- package/dist/compiler/trait-composition.cjs +11 -11
- package/dist/compiler/trait-composition.js +7 -7
- package/dist/compiler/traits/ProvenanceSemiring.d.ts +167 -0
- package/dist/compiler/traits/Semiring.d.ts +26 -0
- package/dist/compiler/unity.cjs +11 -10
- package/dist/compiler/unity.js +10 -9
- package/dist/compiler/unreal.cjs +12 -11
- package/dist/compiler/unreal.js +10 -9
- package/dist/compiler/urdf.cjs +18 -17
- package/dist/compiler/urdf.js +9 -8
- package/dist/compiler/usd-physics.cjs +11 -10
- package/dist/compiler/usd-physics.js +8 -7
- package/dist/compiler/visionos.cjs +11 -10
- package/dist/compiler/visionos.js +10 -9
- package/dist/compiler/vrchat.cjs +11 -10
- package/dist/compiler/vrchat.js +9 -8
- package/dist/compiler/wasm.cjs +14 -13
- package/dist/compiler/wasm.js +9 -8
- package/dist/compiler/webgpu.cjs +10 -9
- package/dist/compiler/webgpu.js +9 -8
- package/dist/constants.cjs +398 -0
- package/dist/constants.js +9 -0
- package/dist/coordinators/index.cjs +4 -1
- package/dist/coordinators/index.js +4 -1
- package/dist/debugger.cjs +11 -9
- package/dist/debugger.js +9 -7
- package/dist/{dist-ACXG6IH5.cjs → dist-GRMOP2UL.cjs} +341 -65
- package/dist/{dist-VD4L6V7Q.js → dist-ZBUKU2JG.js} +333 -63
- package/dist/entries/interop.cjs +23 -23
- package/dist/entries/interop.js +3 -3
- package/dist/entries/scripting.cjs +12 -11
- package/dist/entries/scripting.js +8 -7
- package/dist/evolution/index.cjs +66 -0
- package/dist/evolution/index.d.ts +162 -0
- package/dist/evolution/index.js +17 -0
- package/dist/hololand/index.cjs +41 -37
- package/dist/hololand/index.js +3 -3
- package/dist/index.cjs +12394 -3224
- package/dist/index.d.ts +260 -18
- package/dist/index.js +10755 -2182
- package/dist/keyword-registry/PluginKeywordRegistry.d.ts +138 -0
- package/dist/keyword-registry/index.cjs +29 -0
- package/dist/keyword-registry/index.d.ts +1 -0
- package/dist/keyword-registry/index.js +4 -0
- package/dist/math/tropical-spmv.cjs +11 -11
- package/dist/math/tropical-spmv.d.ts +1 -0
- package/dist/math/tropical-spmv.js +2 -2
- package/dist/math/tropicalSpmv.d.ts +43 -0
- package/dist/math/vec3.cjs +1 -1
- package/dist/math/vec3.js +1 -1
- package/dist/matter/StagedMatter.d.ts +82 -0
- package/dist/matter/index.cjs +17 -0
- package/dist/matter/index.d.ts +1 -0
- package/dist/matter/index.js +4 -0
- package/dist/{ml-dsa-Z7JDKW4L.js → ml-dsa-J6VKVT4K.js} +3 -3
- package/dist/{ml-dsa-FSKBTE3W.cjs → ml-dsa-MTIK4ZUQ.cjs} +23 -23
- package/dist/paper-0c-spike/index.cjs +1 -1
- package/dist/paper-0c-spike/index.js +1 -1
- package/dist/parameter-envelope/ParameterEnvelope.d.ts +128 -0
- package/dist/parameter-envelope/index.cjs +17 -0
- package/dist/parameter-envelope/index.d.ts +2 -0
- package/dist/parameter-envelope/index.js +4 -0
- package/dist/parser/HoloCompositionTypes.d.ts +2013 -0
- package/dist/parser/PipelineParser.d.ts +162 -0
- package/dist/parser.cjs +36 -20
- package/dist/parser.js +13 -9
- package/dist/plugin-manifest/ManifestAutoLoader.d.ts +35 -0
- package/dist/plugin-manifest/PluginManifest.d.ts +156 -0
- package/dist/plugin-manifest/index.cjs +25 -0
- package/dist/plugin-manifest/index.d.ts +2 -0
- package/dist/plugin-manifest/index.js +4 -0
- package/dist/plugin-solver-contract/PluginSolverContract.d.ts +288 -0
- package/dist/plugin-solver-contract/index.cjs +41 -0
- package/dist/plugin-solver-contract/index.d.ts +1 -0
- package/dist/plugin-solver-contract/index.js +4 -0
- package/dist/policy/ContentPolicyGate.d.ts +51 -0
- package/dist/policy/PolicyPack.d.ts +120 -0
- package/dist/policy/blocklist.d.ts +32 -0
- package/dist/policy/defaults.d.ts +44 -0
- package/dist/policy/index.cjs +106 -0
- package/dist/policy/index.d.ts +17 -0
- package/dist/policy/index.js +5 -0
- package/dist/policy/jsonLogic.d.ts +31 -0
- package/dist/policy/types.d.ts +174 -0
- package/dist/proof-composition/ProofCompositionLaw.d.ts +93 -0
- package/dist/proof-composition/index.cjs +25 -0
- package/dist/proof-composition/index.d.ts +1 -0
- package/dist/proof-composition/index.js +4 -0
- package/dist/receipts/hash-policy.d.ts +85 -0
- package/dist/reconstruction/index.cjs +75 -47
- package/dist/reconstruction/index.js +5 -5
- package/dist/runtime/plugin-trait-registrar.d.ts +36 -0
- package/dist/runtime.cjs +81 -79
- package/dist/runtime.js +9 -7
- package/dist/scene-presets-EDKYZ5GW.js +4 -0
- package/dist/scene-presets-NCW2CFRS.cjs +17 -0
- package/dist/self-improvement/index.cjs +1 -1
- package/dist/self-improvement/index.js +1 -1
- package/dist/{src-PT2FERDV.cjs → src-G3D7ZATQ.cjs} +545 -21
- package/dist/{src-J6CM4AUR.js → src-UXYA7HM6.js} +539 -16
- package/dist/storage/index.cjs +10 -10
- package/dist/storage/index.js +3 -3
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +1 -1
- package/dist/tools/index.cjs +3631 -0
- package/dist/tools/index.js +3581 -0
- package/dist/traitDocs/traitDocs.cjs +9 -9
- package/dist/traitDocs/traitDocs.d.ts +1 -0
- package/dist/traitDocs/traitDocs.js +3 -3
- package/dist/traits/ControlLoopTrait.d.ts +154 -0
- package/dist/traits/KinematicChainTrait.d.ts +116 -0
- package/dist/traits/SensorSamplingTrait.d.ts +154 -0
- package/dist/traits/TraitTypes.d.ts +270 -0
- package/dist/traits/TransactionTrait.d.ts +121 -0
- package/dist/traits/botanical-lotus.cjs +54 -50
- package/dist/traits/botanical-lotus.js +2 -5
- package/dist/traits/control-loop.cjs +21 -0
- package/dist/traits/control-loop.d.ts +1 -0
- package/dist/traits/control-loop.js +4 -0
- package/dist/traits/engines/cloth-verlet.d.ts +65 -0
- package/dist/traits/engines/index.cjs +19 -19
- package/dist/traits/engines/index.d.ts +15 -275
- package/dist/traits/engines/index.js +3 -3
- package/dist/traits/engines/motion-data-schema.d.ts +119 -0
- package/dist/traits/engines/motion-matching.d.ts +102 -0
- package/dist/traits/engines/noise.d.ts +25 -0
- package/dist/traits/engines/onnx-adapter.d.ts +173 -0
- package/dist/traits/engines/onnx-motion-matching.d.ts +163 -0
- package/dist/traits/engines/pfnn-network.d.ts +92 -0
- package/dist/traits/engines/synthetic-walk-cycle.d.ts +38 -0
- package/dist/traits/engines/tensor-ops.d.ts +15 -0
- package/dist/traits/index.cjs +2789 -1259
- package/dist/traits/index.d.ts +35 -0
- package/dist/traits/index.js +1692 -411
- package/dist/traits/kinematic-chain.cjs +25 -0
- package/dist/traits/kinematic-chain.d.ts +1 -0
- package/dist/traits/kinematic-chain.js +4 -0
- package/dist/traits/sensor-sampling.cjs +33 -0
- package/dist/traits/sensor-sampling.d.ts +1 -0
- package/dist/traits/sensor-sampling.js +4 -0
- package/dist/traits/simulation-solver-factory.cjs +1 -1
- package/dist/traits/simulation-solver-factory.js +1 -1
- package/dist/traits/transaction.cjs +29 -0
- package/dist/traits/transaction.d.ts +1 -0
- package/dist/traits/transaction.js +4 -0
- package/dist/traits/webcam-gaze.cjs +1 -1
- package/dist/traits/webcam-gaze.js +1 -1
- package/dist/type-checker.cjs +7 -6
- package/dist/type-checker.js +5 -4
- package/dist/types/AdvancedTypeSystem.d.ts +489 -0
- package/dist/types/HoloScriptPlus.d.ts +810 -0
- package/dist/types/base.d.ts +248 -0
- package/dist/types.d.ts +799 -0
- package/dist/world/index.cjs +3 -4
- package/dist/world/index.js +3 -4
- package/dist/world-model/index.cjs +1 -1
- package/dist/world-model/index.js +1 -1
- package/dist/wot/index.cjs +1 -1
- package/dist/wot/index.js +1 -1
- package/package.json +113 -46
- package/dist/GLTFPipeline-3EJLL3TS.cjs +0 -38
- package/dist/GLTFPipeline-3OWJV2VK.js +0 -17
- package/dist/HoloScriptPlusParser-ADWRY5OS.cjs +0 -698
- package/dist/HoloScriptPlusParser-JLJDXHSC.js +0 -693
- package/dist/HoloScriptPlusParser-QCGFPWIL.cjs +0 -27
- package/dist/HoloScriptPlusParser-WENAFEFV.js +0 -10
- package/dist/HoloScriptRuntime-GGRVEU4T.cjs +0 -19
- package/dist/HoloScriptRuntime-GJK6VJPH.js +0 -10
- package/dist/chunk-22Q5A6RV.js +0 -979
- package/dist/chunk-4C57PR42.js +0 -468
- package/dist/chunk-4W5G5QVL.cjs +0 -847
- package/dist/chunk-5ET6L4NS.js +0 -487
- package/dist/chunk-C4GSLCHE.cjs +0 -7153
- package/dist/chunk-F2G6CWFT.js +0 -7089
- package/dist/chunk-G6PNEASF.cjs +0 -814
- package/dist/chunk-GTA4Q3A3.js +0 -1491
- package/dist/chunk-HCCQLAA4.cjs +0 -74
- package/dist/chunk-HFSVMKM3.cjs +0 -72
- package/dist/chunk-KAIVDEIG.cjs +0 -4539
- package/dist/chunk-KQU64CIX.cjs +0 -1508
- package/dist/chunk-MSYSQ2AJ.js +0 -4533
- package/dist/chunk-NHJLP37F.js +0 -70
- package/dist/chunk-NHYRRAGI.cjs +0 -490
- package/dist/chunk-OIQYIIO3.cjs +0 -473
- package/dist/chunk-OL46QLBJ.js +0 -61
- package/dist/chunk-SKZPC5AG.cjs +0 -984
- package/dist/chunk-SLHLXUMO.js +0 -445
- package/dist/chunk-UOIGFQXC.cjs +0 -9750
- package/dist/chunk-UOL6Y5TD.cjs +0 -759
- package/dist/chunk-UVFI7XIR.cjs +0 -452
- package/dist/chunk-VEPGBETF.js +0 -844
- package/dist/chunk-XQ5MWMP2.js +0 -756
- package/dist/chunk-XT6JY5W5.js +0 -9684
- package/dist/chunk-YRRAUB35.js +0 -811
- package/dist/compiler/GasOptimizationAnalyzer.d.ts +0 -73
- package/dist/compiler/NFTMarketplaceCompiler.d.ts +0 -23
- package/dist/compiler/ar.cjs +0 -23
- package/dist/compiler/ar.js +0 -11
- package/dist/compiler/babylon.cjs +0 -21
- package/dist/compiler/babylon.js +0 -15
- package/dist/compiler/multi-layer.cjs +0 -24
- package/dist/compiler/multi-layer.js +0 -15
- package/dist/compiler/playcanvas.cjs +0 -19
- package/dist/compiler/playcanvas.js +0 -13
- package/dist/compiler/r3f.cjs +0 -39
- package/dist/compiler/r3f.d.ts +0 -22
- package/dist/compiler/r3f.js +0 -17
- package/dist/compiler/vrr.cjs +0 -24
- package/dist/compiler/vrr.js +0 -12
- package/dist/parser/NFTMarketplaceTypes.d.ts +0 -191
- package/dist/playwright-3AT3AKTV.cjs +0 -98673
- package/dist/playwright-VZPDVUEQ.js +0 -98660
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { init_DomainBlockCompilerMixin,
|
|
2
|
-
import { init_CompilerBase, CompilerBase } from './chunk-
|
|
3
|
-
import { __export, __esm } from './chunk-
|
|
1
|
+
import { init_DomainBlockCompilerMixin, datavizToWebGPU, compileDataVizBlock, compileMaterialBlock, materialToWebGPU, compileParticleBlock, compilePostProcessingBlock, compileProceduralBlock } from './chunk-5LVFTGKH.js';
|
|
2
|
+
import { init_CompilerBase, CompilerBase } from './chunk-DUG3OQAS.js';
|
|
3
|
+
import { __export, __esm } from './chunk-W4GABFCR.js';
|
|
4
4
|
import { ANSCapabilityPath } from '@holoscript/core-types/ans';
|
|
5
5
|
|
|
6
6
|
// src/compiler/WebGPUCompiler.ts
|
|
@@ -52,7 +52,10 @@ var init_WebGPUCompiler = __esm({
|
|
|
52
52
|
}
|
|
53
53
|
this.emit("");
|
|
54
54
|
this.emitDeviceInit();
|
|
55
|
+
this.emitGeometryHelpers();
|
|
56
|
+
this.emitShaderSources();
|
|
55
57
|
if (composition.environment) this.emitEnvironment(composition.environment);
|
|
58
|
+
this.emitCamera(composition.camera);
|
|
56
59
|
if (composition.objects) {
|
|
57
60
|
for (const obj of composition.objects) this.emitObject(obj);
|
|
58
61
|
}
|
|
@@ -62,10 +65,8 @@ var init_WebGPUCompiler = __esm({
|
|
|
62
65
|
if (composition.lights) {
|
|
63
66
|
for (const light of composition.lights) this.emitLight(light);
|
|
64
67
|
}
|
|
65
|
-
if (composition.camera) this.emitCamera(composition.camera);
|
|
66
68
|
if (this.options.enableCompute) this.emitComputeShaders(composition);
|
|
67
69
|
this.emitWebGPUDomainBlocks(composition);
|
|
68
|
-
this.emitShaderSources();
|
|
69
70
|
this.emitRenderLoop(composition);
|
|
70
71
|
return this.lines.join("\n");
|
|
71
72
|
}
|
|
@@ -74,23 +75,160 @@ var init_WebGPUCompiler = __esm({
|
|
|
74
75
|
if (domainBlocks.length === 0) return;
|
|
75
76
|
this.emit("");
|
|
76
77
|
this.emit("// === v4.2 Domain Blocks ===");
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
material:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
for (let i = 0; i < domainBlocks.length; i++) {
|
|
79
|
+
const block = domainBlocks[i];
|
|
80
|
+
const prefix = this.domainBlockVar(block, i);
|
|
81
|
+
switch (block.domain) {
|
|
82
|
+
case "material":
|
|
83
|
+
this.emitMaterialDomainBlock(block, prefix);
|
|
84
|
+
break;
|
|
85
|
+
case "dataviz":
|
|
86
|
+
this.emitMultiline(datavizToWebGPU(compileDataVizBlock(block), prefix));
|
|
87
|
+
break;
|
|
88
|
+
case "vfx":
|
|
89
|
+
this.emitParticleDomainBlock(block, prefix);
|
|
90
|
+
break;
|
|
91
|
+
case "postfx":
|
|
92
|
+
this.emitPostFXDomainBlock(block, prefix);
|
|
93
|
+
break;
|
|
94
|
+
case "procedural":
|
|
95
|
+
this.emitProceduralDomainBlock(block, prefix);
|
|
96
|
+
break;
|
|
97
|
+
default:
|
|
98
|
+
this.emitDomainMetadataBlock(block, prefix);
|
|
99
|
+
break;
|
|
91
100
|
}
|
|
101
|
+
this.emit("");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
emitMaterialDomainBlock(block, prefix) {
|
|
105
|
+
const mat = compileMaterialBlock(block);
|
|
106
|
+
this.emitMultiline(materialToWebGPU(mat, prefix));
|
|
107
|
+
if (Object.keys(mat.textureMaps).length > 0) {
|
|
108
|
+
this.emit(`const ${prefix}TextureMaps = ${this.json(mat.textureMaps)};`);
|
|
109
|
+
this.emit(`const ${prefix}Textures = await loadMaterialTextureSet(${prefix}TextureMaps);`);
|
|
110
|
+
this.emit(
|
|
111
|
+
`const ${prefix}TextureReceipt = { name: "${this.escapeStringValue(mat.name, "TypeScript")}", maps: Object.keys(${prefix}TextureMaps), loaded: Object.values(${prefix}Textures).filter((t) => t.loaded).length };`
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
emitParticleDomainBlock(block, prefix) {
|
|
116
|
+
const ps = compileParticleBlock(block);
|
|
117
|
+
const count = Math.max(
|
|
118
|
+
1,
|
|
119
|
+
Math.floor(
|
|
120
|
+
this.numberProp(block, ["max_particles", "maxParticles", "count", "rate"], 512)
|
|
121
|
+
)
|
|
122
|
+
);
|
|
123
|
+
const seed = this.hashSeed(`${ps.name}:${ps.keyword}:${count}`);
|
|
124
|
+
this.emit(`// Domain particles: ${this.escapeStringValue(ps.name, "TypeScript")}`);
|
|
125
|
+
this.emit(`const ${prefix}ParticleConfig = ${this.json({
|
|
126
|
+
name: ps.name,
|
|
127
|
+
keyword: ps.keyword,
|
|
128
|
+
traits: ps.traits,
|
|
129
|
+
properties: ps.properties,
|
|
130
|
+
modules: ps.modules
|
|
131
|
+
})};`);
|
|
132
|
+
this.emit(`const ${prefix}ParticleCount = ${count};`);
|
|
133
|
+
this.emit(`const ${prefix}ParticleData = makeParticleCloud(${prefix}ParticleCount, ${seed});`);
|
|
134
|
+
this.emit(
|
|
135
|
+
`const ${prefix}ParticleBuf = createBuffer(device, ${prefix}ParticleData, GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE);`
|
|
136
|
+
);
|
|
137
|
+
this.emit(`const ${prefix}ParticlePipeline = device.createRenderPipeline({`);
|
|
138
|
+
this.indent();
|
|
139
|
+
this.emit('layout: "auto",');
|
|
140
|
+
this.emit(
|
|
141
|
+
'vertex: { module: device.createShaderModule({ code: WGSL_PARTICLE_RENDER }), entryPoint: "vs_particle",'
|
|
142
|
+
);
|
|
143
|
+
this.emit(
|
|
144
|
+
' buffers: [{ arrayStride: 32, attributes: [{ shaderLocation: 0, offset: 0, format: "float32x3" }, { shaderLocation: 1, offset: 12, format: "float32x3" }, { shaderLocation: 2, offset: 24, format: "float32" }] }] },'
|
|
145
|
+
);
|
|
146
|
+
this.emit(
|
|
147
|
+
'fragment: { module: device.createShaderModule({ code: WGSL_PARTICLE_RENDER }), entryPoint: "fs_particle",'
|
|
148
|
+
);
|
|
149
|
+
this.emit(
|
|
150
|
+
' targets: [{ format, blend: { color: { srcFactor: "src-alpha", dstFactor: "one", operation: "add" }, alpha: { srcFactor: "zero", dstFactor: "one", operation: "add" } } }] },'
|
|
151
|
+
);
|
|
152
|
+
this.emit(
|
|
153
|
+
'primitive: { topology: "point-list" }, depthStencil: { format: "depth24plus", depthWriteEnabled: false, depthCompare: "less" },'
|
|
154
|
+
);
|
|
155
|
+
this.dedent();
|
|
156
|
+
this.emit("});");
|
|
157
|
+
}
|
|
158
|
+
emitPostFXDomainBlock(block, prefix) {
|
|
159
|
+
const pp = compilePostProcessingBlock(block);
|
|
160
|
+
this.emit(`// Domain post-processing: ${this.escapeStringValue(pp.name ?? block.name, "TypeScript")}`);
|
|
161
|
+
this.emit(`const ${prefix}PostFXConfig = ${this.json({
|
|
162
|
+
name: pp.name,
|
|
163
|
+
keyword: pp.keyword,
|
|
164
|
+
effects: pp.effects
|
|
165
|
+
})};`);
|
|
166
|
+
this.emit(`const ${prefix}PostFXPipeline = device.createRenderPipeline({`);
|
|
167
|
+
this.indent();
|
|
168
|
+
this.emit('layout: "auto",');
|
|
169
|
+
this.emit(
|
|
170
|
+
'vertex: { module: device.createShaderModule({ code: WGSL_POSTFX }), entryPoint: "vs_postfx" },'
|
|
171
|
+
);
|
|
172
|
+
this.emit(
|
|
173
|
+
'fragment: { module: device.createShaderModule({ code: WGSL_POSTFX }), entryPoint: "fs_postfx", targets: [{ format, blend: { color: { srcFactor: "src-alpha", dstFactor: "one-minus-src-alpha", operation: "add" }, alpha: { srcFactor: "one", dstFactor: "one-minus-src-alpha", operation: "add" } } }] },'
|
|
174
|
+
);
|
|
175
|
+
this.emit('primitive: { topology: "triangle-list" }, multisample: { count: MSAA_COUNT },');
|
|
176
|
+
this.dedent();
|
|
177
|
+
this.emit("});");
|
|
178
|
+
}
|
|
179
|
+
emitProceduralDomainBlock(block, prefix) {
|
|
180
|
+
const proc = compileProceduralBlock(block);
|
|
181
|
+
this.emit(`// Domain procedural: ${this.escapeStringValue(proc.name, "TypeScript")}`);
|
|
182
|
+
this.emit(`const ${prefix}ProceduralConfig = ${this.json({
|
|
183
|
+
name: proc.name,
|
|
184
|
+
keyword: proc.keyword,
|
|
185
|
+
genType: proc.genType,
|
|
186
|
+
seed: proc.seed,
|
|
187
|
+
density: proc.density,
|
|
188
|
+
scaleRange: proc.scaleRange,
|
|
189
|
+
noise: proc.noise,
|
|
190
|
+
sourceMesh: proc.sourceMesh,
|
|
191
|
+
traits: proc.traits,
|
|
192
|
+
properties: proc.properties
|
|
193
|
+
})};`);
|
|
194
|
+
this.emit(
|
|
195
|
+
`const ${prefix}ProceduralUniform = createBuffer(device, new Float32Array([${proc.seed ?? 1}, ${proc.density ?? 1}, ${this.numberProp(block, ["count"], 1)}, 0]), GPUBufferUsage.UNIFORM);`
|
|
196
|
+
);
|
|
197
|
+
if (block.keyword === "scatter" || block.keyword === "distribute" || block.properties?.count) {
|
|
198
|
+
const count = Math.max(1, Math.floor(this.numberProp(block, ["count"], 128)));
|
|
199
|
+
this.emit(`const ${prefix}ScatterInstanceCount = ${count};`);
|
|
200
|
+
this.emit(`const ${prefix}ScatterVertices = generateConeVertices(0.08, 0.36, 8);`);
|
|
201
|
+
this.emit(`const ${prefix}ScatterVBO = createBuffer(device, ${prefix}ScatterVertices, GPUBufferUsage.VERTEX);`);
|
|
202
|
+
this.emit(`const ${prefix}ScatterVertexCount = ${prefix}ScatterVertices.length / 6;`);
|
|
203
|
+
this.emit(`const ${prefix}ScatterPipeline = device.createRenderPipeline({`);
|
|
204
|
+
this.indent();
|
|
205
|
+
this.emit('layout: "auto",');
|
|
206
|
+
this.emit(
|
|
207
|
+
'vertex: { module: device.createShaderModule({ code: WGSL_SCATTER }), entryPoint: "vs_scatter",'
|
|
208
|
+
);
|
|
209
|
+
this.emit(
|
|
210
|
+
' buffers: [{ arrayStride: 24, attributes: [{ shaderLocation: 0, offset: 0, format: "float32x3" }, { shaderLocation: 1, offset: 12, format: "float32x3" }] }] },'
|
|
211
|
+
);
|
|
212
|
+
this.emit(
|
|
213
|
+
'fragment: { module: device.createShaderModule({ code: WGSL_SCATTER }), entryPoint: "fs_scatter", targets: [{ format }] },'
|
|
214
|
+
);
|
|
215
|
+
this.emit(
|
|
216
|
+
'primitive: { topology: "triangle-list", cullMode: "back" }, depthStencil: { format: "depth24plus", depthWriteEnabled: true, depthCompare: "less" }, multisample: { count: MSAA_COUNT },'
|
|
217
|
+
);
|
|
218
|
+
this.dedent();
|
|
219
|
+
this.emit("});");
|
|
92
220
|
}
|
|
93
221
|
}
|
|
222
|
+
emitDomainMetadataBlock(block, prefix) {
|
|
223
|
+
this.emit(`const ${prefix}DomainBlock = ${this.json({
|
|
224
|
+
domain: block.domain,
|
|
225
|
+
keyword: block.keyword,
|
|
226
|
+
name: block.name,
|
|
227
|
+
traits: block.traits,
|
|
228
|
+
properties: block.properties,
|
|
229
|
+
childCount: block.children?.length ?? 0
|
|
230
|
+
})};`);
|
|
231
|
+
}
|
|
94
232
|
// ─── Device Init ──────────────────────────────────────────────────────────
|
|
95
233
|
emitDeviceInit() {
|
|
96
234
|
this.emit("// === WebGPU Device Initialization ===");
|
|
@@ -98,6 +236,7 @@ var init_WebGPUCompiler = __esm({
|
|
|
98
236
|
this.emit("const adapter = await navigator.gpu.requestAdapter();");
|
|
99
237
|
this.emit('if (!adapter) throw new Error("WebGPU not supported");');
|
|
100
238
|
this.emit("const device = await adapter.requestDevice();");
|
|
239
|
+
this.emit('document.body.dataset.holoscriptWebgpu = "device-ready";');
|
|
101
240
|
this.emit('const context = canvas.getContext("webgpu") as GPUCanvasContext;');
|
|
102
241
|
this.emit("const format = navigator.gpu.getPreferredCanvasFormat();");
|
|
103
242
|
this.emit('context.configure({ device, format, alphaMode: "premultiplied" });');
|
|
@@ -126,6 +265,145 @@ var init_WebGPUCompiler = __esm({
|
|
|
126
265
|
);
|
|
127
266
|
this.dedent();
|
|
128
267
|
this.emit("}");
|
|
268
|
+
this.emit("function createFallbackTexture(device, rgba) {");
|
|
269
|
+
this.indent();
|
|
270
|
+
this.emit('const tex = device.createTexture({ size: [1, 1, 1], format: "rgba8unorm", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST });');
|
|
271
|
+
this.emit("device.queue.writeTexture({ texture: tex }, new Uint8Array(rgba), { bytesPerRow: 4 }, [1, 1, 1]);");
|
|
272
|
+
this.emit("return tex;");
|
|
273
|
+
this.dedent();
|
|
274
|
+
this.emit("}");
|
|
275
|
+
this.emit("async function loadTexture2D(src) {");
|
|
276
|
+
this.indent();
|
|
277
|
+
this.emit('const sampler = device.createSampler({ magFilter: "linear", minFilter: "linear", mipmapFilter: "linear", addressModeU: "repeat", addressModeV: "repeat" });');
|
|
278
|
+
this.emit("try {");
|
|
279
|
+
this.indent();
|
|
280
|
+
this.emit("const resp = await fetch(src);");
|
|
281
|
+
this.emit("if (!resp.ok) throw new Error(`texture fetch ${resp.status}`);");
|
|
282
|
+
this.emit("const bitmap = await createImageBitmap(await resp.blob());");
|
|
283
|
+
this.emit('const texture = device.createTexture({ size: [bitmap.width, bitmap.height, 1], format: "rgba8unorm", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT });');
|
|
284
|
+
this.emit("device.queue.copyExternalImageToTexture({ source: bitmap }, { texture }, [bitmap.width, bitmap.height]);");
|
|
285
|
+
this.emit("return { src, texture, view: texture.createView(), sampler, loaded: true };");
|
|
286
|
+
this.dedent();
|
|
287
|
+
this.emit("} catch {");
|
|
288
|
+
this.indent();
|
|
289
|
+
this.emit("const texture = createFallbackTexture(device, [255, 255, 255, 255]);");
|
|
290
|
+
this.emit("return { src, texture, view: texture.createView(), sampler, loaded: false };");
|
|
291
|
+
this.dedent();
|
|
292
|
+
this.emit("}");
|
|
293
|
+
this.dedent();
|
|
294
|
+
this.emit("}");
|
|
295
|
+
this.emit("async function loadMaterialTextureSet(maps) {");
|
|
296
|
+
this.indent();
|
|
297
|
+
this.emit("const entries = await Promise.all(Object.entries(maps).map(async ([kind, src]) => [kind, await loadTexture2D(src)]));");
|
|
298
|
+
this.emit("return Object.fromEntries(entries);");
|
|
299
|
+
this.dedent();
|
|
300
|
+
this.emit("}");
|
|
301
|
+
this.emit("const assetLoader = {");
|
|
302
|
+
this.indent();
|
|
303
|
+
this.emit("async load(src) {");
|
|
304
|
+
this.indent();
|
|
305
|
+
this.emit('return { src, kind: "external-model", loaded: false };');
|
|
306
|
+
this.dedent();
|
|
307
|
+
this.emit("},");
|
|
308
|
+
this.dedent();
|
|
309
|
+
this.emit("};");
|
|
310
|
+
this.emit("function makeParticleCloud(count, seed) {");
|
|
311
|
+
this.indent();
|
|
312
|
+
this.emit("let s = seed || 1;");
|
|
313
|
+
this.emit("const rnd = () => { s = (s * 1664525 + 1013904223) >>> 0; return s / 4294967296; };");
|
|
314
|
+
this.emit("const data = new Float32Array(count * 8);");
|
|
315
|
+
this.emit("for (let i = 0; i < count; i++) {");
|
|
316
|
+
this.indent();
|
|
317
|
+
this.emit("const o = i * 8;");
|
|
318
|
+
this.emit("data[o + 0] = rnd() * 1.8 - 0.9; data[o + 1] = rnd() * 1.2 - 0.6; data[o + 2] = rnd() * 1.8 - 0.9;");
|
|
319
|
+
this.emit("data[o + 3] = 0.0; data[o + 4] = 0.25 + rnd(); data[o + 5] = 0.0; data[o + 6] = rnd(); data[o + 7] = 0.0;");
|
|
320
|
+
this.dedent();
|
|
321
|
+
this.emit("}");
|
|
322
|
+
this.emit("return data;");
|
|
323
|
+
this.dedent();
|
|
324
|
+
this.emit("}");
|
|
325
|
+
this.emit("");
|
|
326
|
+
}
|
|
327
|
+
emitGeometryHelpers() {
|
|
328
|
+
this.emit("// === Geometry Helpers ===");
|
|
329
|
+
this.emit("function generateCubeVertices(size) {");
|
|
330
|
+
this.indent();
|
|
331
|
+
this.emit("const s = size / 2;");
|
|
332
|
+
this.emit("return new Float32Array([");
|
|
333
|
+
this.indent();
|
|
334
|
+
this.emit("-s,-s, s, 0,0,1, s,-s, s, 0,0,1, s, s, s, 0,0,1, -s,-s, s, 0,0,1, s, s, s, 0,0,1, -s, s, s, 0,0,1,");
|
|
335
|
+
this.emit(" s,-s,-s, 0,0,-1, -s,-s,-s, 0,0,-1, -s, s,-s, 0,0,-1, s,-s,-s, 0,0,-1, -s, s,-s, 0,0,-1, s, s,-s, 0,0,-1,");
|
|
336
|
+
this.emit("-s,-s,-s, -1,0,0, -s,-s, s, -1,0,0, -s, s, s, -1,0,0, -s,-s,-s, -1,0,0, -s, s, s, -1,0,0, -s, s,-s, -1,0,0,");
|
|
337
|
+
this.emit(" s,-s, s, 1,0,0, s,-s,-s, 1,0,0, s, s,-s, 1,0,0, s,-s, s, 1,0,0, s, s,-s, 1,0,0, s, s, s, 1,0,0,");
|
|
338
|
+
this.emit("-s, s, s, 0,1,0, s, s, s, 0,1,0, s, s,-s, 0,1,0, -s, s, s, 0,1,0, s, s,-s, 0,1,0, -s, s,-s, 0,1,0,");
|
|
339
|
+
this.emit("-s,-s,-s, 0,-1,0, s,-s,-s, 0,-1,0, s,-s, s, 0,-1,0, -s,-s,-s, 0,-1,0, s,-s, s, 0,-1,0, -s,-s, s, 0,-1,0");
|
|
340
|
+
this.dedent();
|
|
341
|
+
this.emit("]);");
|
|
342
|
+
this.dedent();
|
|
343
|
+
this.emit("}");
|
|
344
|
+
this.emit("function generatePlaneVertices(width, depth) {");
|
|
345
|
+
this.indent();
|
|
346
|
+
this.emit("const x = width / 2, z = depth / 2;");
|
|
347
|
+
this.emit("return new Float32Array([-x,0,-z,0,1,0, x,0,-z,0,1,0, x,0,z,0,1,0, -x,0,-z,0,1,0, x,0,z,0,1,0, -x,0,z,0,1,0]);");
|
|
348
|
+
this.dedent();
|
|
349
|
+
this.emit("}");
|
|
350
|
+
this.emit("function generateSphereVertices(radius, lat, lon) {");
|
|
351
|
+
this.indent();
|
|
352
|
+
this.emit("const rings = Math.max(3, lat | 0), segs = Math.max(3, lon | 0); const out = [];");
|
|
353
|
+
this.emit("const P = (ri, si) => {");
|
|
354
|
+
this.emit(" const phi = Math.PI * ri / rings, theta = 2 * Math.PI * si / segs;");
|
|
355
|
+
this.emit(" const nx = Math.sin(phi) * Math.cos(theta), ny = Math.cos(phi), nz = Math.sin(phi) * Math.sin(theta);");
|
|
356
|
+
this.emit(" return [nx * radius, ny * radius, nz * radius, nx, ny, nz];");
|
|
357
|
+
this.emit("};");
|
|
358
|
+
this.emit("for (let ri = 0; ri < rings; ri++) { for (let si = 0; si < segs; si++) {");
|
|
359
|
+
this.emit(" const a = P(ri, si), b = P(ri + 1, si), c = P(ri + 1, si + 1), d = P(ri, si + 1);");
|
|
360
|
+
this.emit(" out.push(...a, ...b, ...c, ...a, ...c, ...d);");
|
|
361
|
+
this.emit("} } return new Float32Array(out);");
|
|
362
|
+
this.dedent();
|
|
363
|
+
this.emit("}");
|
|
364
|
+
this.emit("function generateCylinderVertices(radius, height, segments) {");
|
|
365
|
+
this.indent();
|
|
366
|
+
this.emit("const segs = Math.max(3, segments | 0), hy = height / 2, out = [];");
|
|
367
|
+
this.emit("for (let i = 0; i < segs; i++) {");
|
|
368
|
+
this.emit(" const t0 = 2*Math.PI*i/segs, t1 = 2*Math.PI*(i+1)/segs;");
|
|
369
|
+
this.emit(" const c0 = Math.cos(t0), s0 = Math.sin(t0), c1 = Math.cos(t1), s1 = Math.sin(t1);");
|
|
370
|
+
this.emit(" const b0 = [radius*c0, -hy, radius*s0, c0, 0, s0], t0v = [radius*c0, hy, radius*s0, c0, 0, s0];");
|
|
371
|
+
this.emit(" const b1 = [radius*c1, -hy, radius*s1, c1, 0, s1], t1v = [radius*c1, hy, radius*s1, c1, 0, s1];");
|
|
372
|
+
this.emit(" out.push(...b0, ...b1, ...t1v, ...b0, ...t1v, ...t0v);");
|
|
373
|
+
this.emit(" out.push(0, hy, 0, 0, 1, 0, radius*c0, hy, radius*s0, 0, 1, 0, radius*c1, hy, radius*s1, 0, 1, 0);");
|
|
374
|
+
this.emit(" out.push(0, -hy, 0, 0, -1, 0, radius*c1, -hy, radius*s1, 0, -1, 0, radius*c0, -hy, radius*s0, 0, -1, 0);");
|
|
375
|
+
this.emit("} return new Float32Array(out);");
|
|
376
|
+
this.dedent();
|
|
377
|
+
this.emit("}");
|
|
378
|
+
this.emit("function generateConeVertices(radius, height, segments) {");
|
|
379
|
+
this.indent();
|
|
380
|
+
this.emit("const segs = Math.max(3, segments | 0), hy = height / 2, out = [];");
|
|
381
|
+
this.emit("const ny = radius / Math.hypot(radius, height) || 0, nyx = height / Math.hypot(radius, height) || 1;");
|
|
382
|
+
this.emit("for (let i = 0; i < segs; i++) {");
|
|
383
|
+
this.emit(" const t0 = 2*Math.PI*i/segs, t1 = 2*Math.PI*(i+1)/segs;");
|
|
384
|
+
this.emit(" const c0 = Math.cos(t0), s0 = Math.sin(t0), c1 = Math.cos(t1), s1 = Math.sin(t1);");
|
|
385
|
+
this.emit(" out.push(0, hy, 0, (c0+c1)*0.5*nyx, ny, (s0+s1)*0.5*nyx);");
|
|
386
|
+
this.emit(" out.push(radius*c0, -hy, radius*s0, c0*nyx, ny, s0*nyx);");
|
|
387
|
+
this.emit(" out.push(radius*c1, -hy, radius*s1, c1*nyx, ny, s1*nyx);");
|
|
388
|
+
this.emit(" out.push(0, -hy, 0, 0, -1, 0, radius*c1, -hy, radius*s1, 0, -1, 0, radius*c0, -hy, radius*s0, 0, -1, 0);");
|
|
389
|
+
this.emit("} return new Float32Array(out);");
|
|
390
|
+
this.dedent();
|
|
391
|
+
this.emit("}");
|
|
392
|
+
this.emit("function generateTorusVertices(radius, tube, radial, tubular) {");
|
|
393
|
+
this.indent();
|
|
394
|
+
this.emit("const R = Math.max(3, radial | 0), T = Math.max(3, tubular | 0), out = [];");
|
|
395
|
+
this.emit("const P = (ri, ti) => {");
|
|
396
|
+
this.emit(" const u = 2*Math.PI*ri/R, v = 2*Math.PI*ti/T;");
|
|
397
|
+
this.emit(" const cu = Math.cos(u), su = Math.sin(u), cv = Math.cos(v), sv = Math.sin(v);");
|
|
398
|
+
this.emit(" const x = (radius + tube*cv)*cu, y = tube*sv, z = (radius + tube*cv)*su;");
|
|
399
|
+
this.emit(" return [x, y, z, cv*cu, sv, cv*su];");
|
|
400
|
+
this.emit("};");
|
|
401
|
+
this.emit("for (let ri = 0; ri < R; ri++) { for (let ti = 0; ti < T; ti++) {");
|
|
402
|
+
this.emit(" const a = P(ri, ti), b = P(ri + 1, ti), c = P(ri + 1, ti + 1), d = P(ri, ti + 1);");
|
|
403
|
+
this.emit(" out.push(...a, ...b, ...c, ...a, ...c, ...d);");
|
|
404
|
+
this.emit("} } return new Float32Array(out);");
|
|
405
|
+
this.dedent();
|
|
406
|
+
this.emit("}");
|
|
129
407
|
this.emit("");
|
|
130
408
|
}
|
|
131
409
|
// ─── Environment ──────────────────────────────────────────────────────────
|
|
@@ -165,12 +443,11 @@ var init_WebGPUCompiler = __esm({
|
|
|
165
443
|
const isPointCloud = traits.some((t) => t.name === "point_cloud");
|
|
166
444
|
const isGpuParticle = traits.some((t) => isGpuParticleTraitName(t.name));
|
|
167
445
|
if (isModel && modelSrc) {
|
|
168
|
-
this.emit(`const ${v}
|
|
169
|
-
const pos = this.findObjProp(obj, "position");
|
|
170
|
-
const [px, py, pz] = Array.isArray(pos) ? pos : [0, 0, 0];
|
|
446
|
+
this.emit(`const ${v}Asset = await assetLoader.load("${modelSrc}");`);
|
|
171
447
|
this.emit(
|
|
172
|
-
|
|
448
|
+
`// Model asset "${this.escapeStringValue(modelSrc, "TypeScript")}" is tracked in ${v}Asset; fallback mesh keeps the render path defined.`
|
|
173
449
|
);
|
|
450
|
+
this.emitMeshObject(v, obj, "cube");
|
|
174
451
|
} else if (isModel) {
|
|
175
452
|
this.emit(`// WARNING: geometry "model" without source URL \u2014 placeholder cube`);
|
|
176
453
|
this.emitMeshObject(v, obj, "cube");
|
|
@@ -213,8 +490,10 @@ var init_WebGPUCompiler = __esm({
|
|
|
213
490
|
const [cr, cg, cb] = this.extractMaterialColor(material, color);
|
|
214
491
|
const rough = this.extractMaterialProp(material, "roughness", 0.5);
|
|
215
492
|
const metal = this.extractMaterialProp(material, "metalness", 0);
|
|
493
|
+
const [er, eg, eb] = this.extractEmissive(material, obj);
|
|
494
|
+
const emissiveStrength = this.extractMaterialProp(material, "emissive_intensity", 1);
|
|
216
495
|
this.emit(
|
|
217
|
-
`const ${v}Mat = createBuffer(device, new Float32Array([${cr},${cg},${cb},1.0, ${rough},${metal},0,0]), GPUBufferUsage.UNIFORM);`
|
|
496
|
+
`const ${v}Mat = createBuffer(device, new Float32Array([${cr},${cg},${cb},1.0, ${rough},${metal},${emissiveStrength},0, ${er},${eg},${eb},0]), GPUBufferUsage.UNIFORM);`
|
|
218
497
|
);
|
|
219
498
|
this.emit(`const ${v}Pipeline = device.createRenderPipeline({`);
|
|
220
499
|
this.indent();
|
|
@@ -238,7 +517,7 @@ var init_WebGPUCompiler = __esm({
|
|
|
238
517
|
`const ${v}Bind = device.createBindGroup({ layout: ${v}Pipeline.getBindGroupLayout(0), entries: [`
|
|
239
518
|
);
|
|
240
519
|
this.emit(
|
|
241
|
-
` { binding: 0, resource: { buffer: ${v}Model } }, { binding: 1, resource: { buffer: ${v}Mat } }] });`
|
|
520
|
+
` { binding: 0, resource: { buffer: ${v}Model } }, { binding: 1, resource: { buffer: ${v}Mat } }, { binding: 2, resource: { buffer: vpUniform } }] });`
|
|
242
521
|
);
|
|
243
522
|
}
|
|
244
523
|
emitGaussianSplatObject(v, obj) {
|
|
@@ -373,8 +652,8 @@ var init_WebGPUCompiler = __esm({
|
|
|
373
652
|
// ─── Camera ───────────────────────────────────────────────────────────────
|
|
374
653
|
emitCamera(cam) {
|
|
375
654
|
this.emit("// === Camera ===");
|
|
376
|
-
let fov = 60, near = 0.1, far = 1e3, pos = [
|
|
377
|
-
for (const prop of cam
|
|
655
|
+
let fov = 60, near = 0.1, far = 1e3, pos = [4, 3, 6], lookAt = [0, 0, 0];
|
|
656
|
+
for (const prop of cam?.properties ?? []) {
|
|
378
657
|
if (prop.key === "fov" || prop.key === "field_of_view") fov = prop.value;
|
|
379
658
|
else if (prop.key === "near") near = prop.value;
|
|
380
659
|
else if (prop.key === "far") far = prop.value;
|
|
@@ -386,13 +665,38 @@ var init_WebGPUCompiler = __esm({
|
|
|
386
665
|
this.emit(`const cameraNear = ${near}, cameraFar = ${far};`);
|
|
387
666
|
this.emit(`const cameraPos = new Float32Array([${pos.join(",")}]);`);
|
|
388
667
|
this.emit(`const cameraTarget = new Float32Array([${lookAt.join(",")}]);`);
|
|
389
|
-
this.emit("const
|
|
668
|
+
this.emit("const cameraUp = new Float32Array([0, 1, 0]);");
|
|
669
|
+
this.emit("const aspect = (canvas.width || 1) / (canvas.height || 1);");
|
|
670
|
+
this.emit("function mat4Multiply(a: Float32Array, b: Float32Array): Float32Array {");
|
|
671
|
+
this.indent();
|
|
672
|
+
this.emit("const o = new Float32Array(16);");
|
|
673
|
+
this.emit("for (let c = 0; c < 4; c++) { for (let r = 0; r < 4; r++) {");
|
|
674
|
+
this.emit(" o[c*4+r] = a[0*4+r]*b[c*4+0] + a[1*4+r]*b[c*4+1] + a[2*4+r]*b[c*4+2] + a[3*4+r]*b[c*4+3];");
|
|
675
|
+
this.emit("} } return o;");
|
|
676
|
+
this.dedent();
|
|
677
|
+
this.emit("}");
|
|
678
|
+
this.emit("function lookAtMatrix(eye: Float32Array, target: Float32Array, up: Float32Array): Float32Array {");
|
|
679
|
+
this.indent();
|
|
680
|
+
this.emit("const zx = eye[0]-target[0], zy = eye[1]-target[1], zz = eye[2]-target[2];");
|
|
681
|
+
this.emit("let zl = Math.hypot(zx, zy, zz) || 1; const fz = [zx/zl, zy/zl, zz/zl];");
|
|
682
|
+
this.emit("const xx = up[1]*fz[2]-up[2]*fz[1], xy = up[2]*fz[0]-up[0]*fz[2], xz = up[0]*fz[1]-up[1]*fz[0];");
|
|
683
|
+
this.emit("let xl = Math.hypot(xx, xy, xz) || 1; const rx = [xx/xl, xy/xl, xz/xl];");
|
|
684
|
+
this.emit("const uy = [fz[1]*rx[2]-fz[2]*rx[1], fz[2]*rx[0]-fz[0]*rx[2], fz[0]*rx[1]-fz[1]*rx[0]];");
|
|
685
|
+
this.emit("return new Float32Array([");
|
|
686
|
+
this.emit(" rx[0], uy[0], fz[0], 0,");
|
|
687
|
+
this.emit(" rx[1], uy[1], fz[1], 0,");
|
|
688
|
+
this.emit(" rx[2], uy[2], fz[2], 0,");
|
|
689
|
+
this.emit(" -(rx[0]*eye[0]+rx[1]*eye[1]+rx[2]*eye[2]),");
|
|
690
|
+
this.emit(" -(uy[0]*eye[0]+uy[1]*eye[1]+uy[2]*eye[2]),");
|
|
691
|
+
this.emit(" -(fz[0]*eye[0]+fz[1]*eye[1]+fz[2]*eye[2]), 1]);");
|
|
692
|
+
this.dedent();
|
|
693
|
+
this.emit("}");
|
|
390
694
|
this.emit("function buildViewProjection(): Float32Array {");
|
|
391
695
|
this.indent();
|
|
392
696
|
this.emit("const f = 1.0 / Math.tan(cameraFov / 2), ri = 1.0 / (cameraNear - cameraFar);");
|
|
393
|
-
this.emit(
|
|
394
|
-
|
|
395
|
-
);
|
|
697
|
+
this.emit("const proj = new Float32Array([f/aspect,0,0,0, 0,f,0,0, 0,0,cameraFar*ri,-1, 0,0,cameraNear*cameraFar*ri,0]);");
|
|
698
|
+
this.emit("const view = lookAtMatrix(cameraPos, cameraTarget, cameraUp);");
|
|
699
|
+
this.emit("return mat4Multiply(proj, view);");
|
|
396
700
|
this.dedent();
|
|
397
701
|
this.emit("}");
|
|
398
702
|
this.emit(
|
|
@@ -431,7 +735,7 @@ var init_WebGPUCompiler = __esm({
|
|
|
431
735
|
this.emit(
|
|
432
736
|
`const ${v}CustomCompute = device.createComputePipeline({ layout: "auto", compute: { module: device.createShaderModule({ code: WGSL_CUSTOM_${v.toUpperCase()} }), entryPoint: "${entry}" } });`
|
|
433
737
|
);
|
|
434
|
-
this.emit(`const ${v}Workgroups
|
|
738
|
+
this.emit(`const ${v}Workgroups = [${wg}];`);
|
|
435
739
|
}
|
|
436
740
|
}
|
|
437
741
|
this.emit("");
|
|
@@ -441,7 +745,9 @@ var init_WebGPUCompiler = __esm({
|
|
|
441
745
|
this.emit("// === WGSL Shader Sources ===");
|
|
442
746
|
this.emit("const WGSL_VERTEX = /* wgsl */`");
|
|
443
747
|
this.emit("struct Uniforms { model: mat4x4<f32> };");
|
|
748
|
+
this.emit("struct Camera { viewProj: mat4x4<f32> };");
|
|
444
749
|
this.emit("@group(0) @binding(0) var<uniform> u: Uniforms;");
|
|
750
|
+
this.emit("@group(0) @binding(2) var<uniform> cam: Camera;");
|
|
445
751
|
this.emit("struct VIn { @location(0) pos: vec3<f32>, @location(1) norm: vec3<f32> };");
|
|
446
752
|
this.emit(
|
|
447
753
|
"struct VOut { @builtin(position) clip: vec4<f32>, @location(0) wNorm: vec3<f32>, @location(1) wPos: vec3<f32> };"
|
|
@@ -449,17 +755,19 @@ var init_WebGPUCompiler = __esm({
|
|
|
449
755
|
this.emit("@vertex fn vs_main(i: VIn) -> VOut {");
|
|
450
756
|
this.emit(" var o: VOut; let w = u.model * vec4<f32>(i.pos, 1.0);");
|
|
451
757
|
this.emit(
|
|
452
|
-
" o.clip = w; o.wNorm = (u.model * vec4<f32>(i.norm, 0.0)).xyz; o.wPos = w.xyz; return o; }`;"
|
|
758
|
+
" o.clip = cam.viewProj * w; o.wNorm = normalize((u.model * vec4<f32>(i.norm, 0.0)).xyz); o.wPos = w.xyz; return o; }`;"
|
|
453
759
|
);
|
|
454
760
|
this.emit("");
|
|
455
761
|
this.emit("const WGSL_FRAGMENT = /* wgsl */`");
|
|
456
|
-
this.emit("struct Mat { color: vec4<f32>, rm: vec4<f32> };");
|
|
762
|
+
this.emit("struct Mat { color: vec4<f32>, rm: vec4<f32>, emissive: vec4<f32> };");
|
|
457
763
|
this.emit("@group(0) @binding(1) var<uniform> mat: Mat;");
|
|
458
764
|
this.emit("struct FIn { @location(0) wNorm: vec3<f32>, @location(1) wPos: vec3<f32> };");
|
|
459
765
|
this.emit("@fragment fn fs_main(i: FIn) -> @location(0) vec4<f32> {");
|
|
460
766
|
this.emit(" let N = normalize(i.wNorm); let L = normalize(vec3<f32>(1.0, 2.0, 1.5));");
|
|
461
767
|
this.emit(" let d = max(dot(N, L), 0.0) * (1.0 - mat.rm[0] * 0.5);");
|
|
462
|
-
this.emit("
|
|
768
|
+
this.emit(" let lit = mat.color.rgb * (0.15 + d);");
|
|
769
|
+
this.emit(" let emit = mat.emissive.rgb * mat.rm[2];");
|
|
770
|
+
this.emit(" return vec4<f32>(lit + emit, mat.color.a); }`;");
|
|
463
771
|
this.emit("");
|
|
464
772
|
this.emit("const WGSL_SPLAT = /* wgsl */`");
|
|
465
773
|
this.emit(
|
|
@@ -498,6 +806,25 @@ var init_WebGPUCompiler = __esm({
|
|
|
498
806
|
" let t = clamp(i.life, 0.0, 1.0); return vec4<f32>(mix(vec3(1.0,0.2,0.0), vec3(1.0,1.0,0.5), t), t*0.8); }`;"
|
|
499
807
|
);
|
|
500
808
|
this.emit("");
|
|
809
|
+
this.emit("const WGSL_SCATTER = /* wgsl */`");
|
|
810
|
+
this.emit("struct VIn { @location(0) pos: vec3<f32>, @location(1) norm: vec3<f32> };");
|
|
811
|
+
this.emit("struct VOut { @builtin(position) clip: vec4<f32>, @location(0) shade: f32 };");
|
|
812
|
+
this.emit("fn hash11(v: f32) -> f32 { return fract(sin(v * 12.9898) * 43758.5453); }");
|
|
813
|
+
this.emit("@vertex fn vs_scatter(i: VIn, @builtin(instance_index) instance: u32) -> VOut {");
|
|
814
|
+
this.emit(" let id = f32(instance);");
|
|
815
|
+
this.emit(" let x = hash11(id + 1.0) * 1.8 - 0.9; let z = hash11(id + 7.0) * 1.8 - 0.9;");
|
|
816
|
+
this.emit(" let scale = 0.35 + hash11(id + 13.0) * 0.45;");
|
|
817
|
+
this.emit(" var o: VOut; o.clip = vec4<f32>(i.pos.x * scale + x, i.pos.y * scale - 0.65, i.pos.z * scale + z, 1.0);");
|
|
818
|
+
this.emit(" o.shade = 0.45 + max(i.norm.y, 0.0) * 0.45; return o; }");
|
|
819
|
+
this.emit("@fragment fn fs_scatter(i: VOut) -> @location(0) vec4<f32> { return vec4<f32>(0.08 * i.shade, 0.34 * i.shade, 0.12 * i.shade, 1.0); }`;");
|
|
820
|
+
this.emit("");
|
|
821
|
+
this.emit("const WGSL_POSTFX = /* wgsl */`");
|
|
822
|
+
this.emit("struct VO { @builtin(position) pos: vec4<f32> };");
|
|
823
|
+
this.emit("@vertex fn vs_postfx(@builtin(vertex_index) vi: u32) -> VO {");
|
|
824
|
+
this.emit(" var p = array<vec2<f32>,3>(vec2(-1.0,-1.0), vec2(3.0,-1.0), vec2(-1.0,3.0));");
|
|
825
|
+
this.emit(" var o: VO; o.pos = vec4<f32>(p[vi], 0.0, 1.0); return o; }");
|
|
826
|
+
this.emit("@fragment fn fs_postfx() -> @location(0) vec4<f32> { return vec4<f32>(0.04, 0.08, 0.05, 0.18); }`;");
|
|
827
|
+
this.emit("");
|
|
501
828
|
this.emit("const WGSL_PARTICLE_COMPUTE = /* wgsl */`");
|
|
502
829
|
this.emit("struct P { pos: vec3<f32>, _p0: f32, vel: vec3<f32>, life: f32 };");
|
|
503
830
|
this.emit("@group(0) @binding(0) var<storage, read> pin: array<P>;");
|
|
@@ -578,8 +905,11 @@ var init_WebGPUCompiler = __esm({
|
|
|
578
905
|
for (const obj of group.objects) this.emitDrawCall(obj);
|
|
579
906
|
}
|
|
580
907
|
}
|
|
908
|
+
this.emitDomainBlockDrawCalls(composition, false);
|
|
909
|
+
this.emitDomainBlockDrawCalls(composition, true);
|
|
581
910
|
this.emit("rp.end();");
|
|
582
911
|
this.emit("device.queue.submit([enc.finish()]);");
|
|
912
|
+
this.emit("document.body.dataset.holoscriptWebgpuFrame = String(frameCount);");
|
|
583
913
|
this.emit("requestAnimationFrame(frame);");
|
|
584
914
|
this.dedent();
|
|
585
915
|
this.emit("}");
|
|
@@ -605,10 +935,37 @@ var init_WebGPUCompiler = __esm({
|
|
|
605
935
|
for (const child of obj.children) this.emitDrawCall(child);
|
|
606
936
|
}
|
|
607
937
|
}
|
|
938
|
+
emitDomainBlockDrawCalls(composition, postFxOnly) {
|
|
939
|
+
const blocks = composition.domainBlocks ?? [];
|
|
940
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
941
|
+
const block = blocks[i];
|
|
942
|
+
const prefix = this.domainBlockVar(block, i);
|
|
943
|
+
if (block.domain === "postfx") {
|
|
944
|
+
if (postFxOnly) {
|
|
945
|
+
this.emit(`rp.setPipeline(${prefix}PostFXPipeline); rp.draw(3);`);
|
|
946
|
+
}
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
if (postFxOnly) continue;
|
|
950
|
+
if (block.domain === "vfx") {
|
|
951
|
+
this.emit(
|
|
952
|
+
`rp.setPipeline(${prefix}ParticlePipeline); rp.setVertexBuffer(0, ${prefix}ParticleBuf); rp.draw(${prefix}ParticleCount);`
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
if (block.domain === "procedural" && (block.keyword === "scatter" || block.keyword === "distribute" || block.properties?.count)) {
|
|
956
|
+
this.emit(
|
|
957
|
+
`rp.setPipeline(${prefix}ScatterPipeline); rp.setVertexBuffer(0, ${prefix}ScatterVBO); rp.draw(${prefix}ScatterVertexCount, ${prefix}ScatterInstanceCount);`
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
608
962
|
// ─── Helpers ──────────────────────────────────────────────────────────────
|
|
609
963
|
emit(line) {
|
|
610
964
|
this.lines.push(this.options.indent.repeat(this.indentLevel) + line);
|
|
611
965
|
}
|
|
966
|
+
emitMultiline(code) {
|
|
967
|
+
for (const line of code.split("\n")) this.emit(line);
|
|
968
|
+
}
|
|
612
969
|
indent() {
|
|
613
970
|
this.indentLevel++;
|
|
614
971
|
}
|
|
@@ -618,6 +975,33 @@ var init_WebGPUCompiler = __esm({
|
|
|
618
975
|
sanitizeName(name) {
|
|
619
976
|
return name.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
620
977
|
}
|
|
978
|
+
domainBlockVar(block, index) {
|
|
979
|
+
const raw = `${block.domain}_${block.keyword}_${block.name || index}`;
|
|
980
|
+
const safe = this.sanitizeName(raw);
|
|
981
|
+
return `db${index}_${safe || "domain"}`;
|
|
982
|
+
}
|
|
983
|
+
json(value) {
|
|
984
|
+
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
985
|
+
}
|
|
986
|
+
numberProp(block, keys, fallback) {
|
|
987
|
+
for (const key of keys) {
|
|
988
|
+
const value = block.properties?.[key];
|
|
989
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
990
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
991
|
+
const parsed = Number(value);
|
|
992
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
return fallback;
|
|
996
|
+
}
|
|
997
|
+
hashSeed(value) {
|
|
998
|
+
let h = 2166136261;
|
|
999
|
+
for (let i = 0; i < value.length; i++) {
|
|
1000
|
+
h ^= value.charCodeAt(i);
|
|
1001
|
+
h = Math.imul(h, 16777619);
|
|
1002
|
+
}
|
|
1003
|
+
return h >>> 0;
|
|
1004
|
+
}
|
|
621
1005
|
findObjProp(obj, key) {
|
|
622
1006
|
return obj.properties?.find((p) => p.key === key)?.value;
|
|
623
1007
|
}
|
|
@@ -648,6 +1032,15 @@ var init_WebGPUCompiler = __esm({
|
|
|
648
1032
|
}
|
|
649
1033
|
return fallback;
|
|
650
1034
|
}
|
|
1035
|
+
extractEmissive(material, obj) {
|
|
1036
|
+
const objEmissive = this.findObjProp(obj, "emissive");
|
|
1037
|
+
if (objEmissive !== void 0) return this.parseColor(objEmissive);
|
|
1038
|
+
if (material && typeof material === "object" && !Array.isArray(material)) {
|
|
1039
|
+
const m = material;
|
|
1040
|
+
if (m.emissive !== void 0) return this.parseColor(m.emissive);
|
|
1041
|
+
}
|
|
1042
|
+
return [0, 0, 0];
|
|
1043
|
+
}
|
|
651
1044
|
geometryVertexDataFn(meshType) {
|
|
652
1045
|
const map = {
|
|
653
1046
|
sphere: "generateSphereVertices(0.5, 16, 16)",
|
|
@@ -665,5 +1058,5 @@ var init_WebGPUCompiler = __esm({
|
|
|
665
1058
|
});
|
|
666
1059
|
|
|
667
1060
|
export { WebGPUCompiler, WebGPUCompiler_exports, init_WebGPUCompiler };
|
|
668
|
-
//# sourceMappingURL=chunk-
|
|
669
|
-
//# sourceMappingURL=chunk-
|
|
1061
|
+
//# sourceMappingURL=chunk-KEYG7HGY.js.map
|
|
1062
|
+
//# sourceMappingURL=chunk-KEYG7HGY.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-
|
|
2
|
-
import { __export, __esm } from './chunk-
|
|
1
|
+
import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-DUG3OQAS.js';
|
|
2
|
+
import { __export, __esm } from './chunk-W4GABFCR.js';
|
|
3
3
|
|
|
4
4
|
// src/compiler/StateCompiler.ts
|
|
5
5
|
var StateCompiler_exports = {};
|
|
@@ -109,5 +109,5 @@ var init_StateCompiler = __esm({
|
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
export { StateCompiler, StateCompiler_exports, UnauthorizedStateCompilerAccessError, init_StateCompiler };
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-KFVNCW4Q.js.map
|
|
113
|
+
//# sourceMappingURL=chunk-KFVNCW4Q.js.map
|