shaders 3.2.475 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (753) hide show
  1. package/LICENSE +21 -142
  2. package/README.md +192 -19
  3. package/dist/cli.js +2 -2
  4. package/dist/core/{AngularBlur-Cx1HVeYk.js → AngularBlur-BEBs-lRR.js} +2 -3
  5. package/dist/core/{Arc-D3FuqnDL.js → Arc-D-WnjM7T.js} +1 -3
  6. package/dist/core/{Ascii-Dhn0H0LB.js → Ascii-BGPIwMc3.js} +2 -5
  7. package/dist/core/{Aurora-BUfyvIyq.js → Aurora-DqJBPdMQ.js} +2 -11
  8. package/dist/core/{BarShift-v3D-9Lx4.js → BarShift-BcCOweUh.js} +2 -3
  9. package/dist/core/{BarnDoors-C5g6Sbze.js → BarnDoors-B9B-AmCV.js} +2 -3
  10. package/dist/core/{Beam-CV5g8m92.js → Beam-QG_9OS8I.js} +2 -3
  11. package/dist/core/{Bend-BFWQSHF7.js → Bend-Cy9VAowL.js} +1 -2
  12. package/dist/core/{Blob-CLvqov4O.js → Blob-C3txJeW0.js} +2 -10
  13. package/dist/core/{BlockDissolve-DER9y4PE.js → BlockDissolve-C1SFUys7.js} +2 -3
  14. package/dist/core/{BlockNoise-DpXWJkDL.js → BlockNoise-Cm3y8hce.js} +2 -4
  15. package/dist/core/{BlueNoise-CSQPDpkm.js → BlueNoise-BCLObOMm.js} +2 -4
  16. package/dist/core/{Blur-B-Tg7Sfr.js → Blur-Dg29SnXd.js} +1 -2
  17. package/dist/core/{Boids-BZo85-QR.js → Boids-rsGsPN5h.js} +2 -5
  18. package/dist/core/{BokehBlur-B1tY-T6q.js → BokehBlur-rFSFEnb0.js} +2 -3
  19. package/dist/core/{BrickPattern-DVhe3RgK.js → BrickPattern-DqN6JKEN.js} +2 -3
  20. package/dist/core/{BrightnessContrast-DBLjHzyE.js → BrightnessContrast-J9fCSBiC.js} +1 -3
  21. package/dist/core/{BrushedMetal-CpXTd3nZ.js → BrushedMetal-74wSZKjG.js} +3 -8
  22. package/dist/core/{Bulge-CHcE-9Oo.js → Bulge-BIk0oq8j.js} +1 -2
  23. package/dist/core/{CRTScreen-CyBtBJS4.js → CRTScreen-hEH-JNRd.js} +2 -3
  24. package/dist/core/{CarbonFiber-DK-0jUEs.js → CarbonFiber-CZdUDvRU.js} +3 -7
  25. package/dist/core/{Chalkboard-PmgH_OhS.js → Chalkboard-CClJHqvs.js} +2 -3
  26. package/dist/core/{ChannelBlur-J3MHHcGy.js → ChannelBlur-BEuEwQOC.js} +1 -2
  27. package/dist/core/{CheckerWipe-Dj2kjjDA.js → CheckerWipe-KuAWj2qg.js} +2 -3
  28. package/dist/core/{Checkerboard-eFWETR1S.js → Checkerboard-Rq9ze1W3.js} +2 -3
  29. package/dist/core/{Chevron-ColsT0Fy.js → Chevron-C1j6X2Ye.js} +2 -3
  30. package/dist/core/{ChromaFlow-DrdCgPGz.js → ChromaFlow-BgsCUYIl.js} +2 -5
  31. package/dist/core/{ChromaticAberration-C_It6mLf.js → ChromaticAberration-2_4tjQ0u.js} +2 -4
  32. package/dist/core/{Chrome-2WZpUHiT.js → Chrome-Be3z6C5i.js} +4 -10
  33. package/dist/core/{Circle-C-AKxSw4.js → Circle-e_qQI3tU.js} +1 -3
  34. package/dist/core/{ColorWheel-DfF0tqXE.js → ColorWheel-s5ep1H7d.js} +2 -3
  35. package/dist/core/{CompressionArtifacts-Zvwlutd7.js → CompressionArtifacts-OE9U9Qrq.js} +1 -3
  36. package/dist/core/{ConcentricSpin-tC8mylMA.js → ConcentricSpin-CLE_5yCJ.js} +1 -2
  37. package/dist/core/{ConicGradient-CNYvyjSs.js → ConicGradient-Cji2SgVO.js} +2 -4
  38. package/dist/core/{ContourLines-C4642NJd.js → ContourLines-wpPK00cF.js} +2 -3
  39. package/dist/core/{CornerPin-BF5gFRv9.js → CornerPin-gYU0Uf2m.js} +2 -3
  40. package/dist/core/{Crescent-wC0IwPjx.js → Crescent-viNc7Unp.js} +1 -2
  41. package/dist/core/{Cross-BO7JQKSq.js → Cross-DyQSsw_k.js} +1 -2
  42. package/dist/core/{Crystal-BK3ifbmV.js → Crystal-Vjj8azWg.js} +4 -9
  43. package/dist/core/{CurlNoise-UbI-Zda_.js → CurlNoise-C7PHjDht.js} +2 -4
  44. package/dist/core/{CursorRipples-rJlfKhyh.js → CursorRipples-BzPPNkA3.js} +3 -39
  45. package/dist/core/{CursorTrail-BuyQdFKJ.js → CursorTrail-cBj0AuQA.js} +2 -4
  46. package/dist/core/{DataMosh-C_ZI55Qq.js → DataMosh-5Yr9TyVx.js} +1 -3
  47. package/dist/core/{DiamondGradient-CPhUCUoq.js → DiamondGradient-DZM7HwF5.js} +2 -4
  48. package/dist/core/{DiamondWipe-y6uIpJM4.js → DiamondWipe-CqeT7lCt.js} +2 -3
  49. package/dist/core/{DiffuseBlur-BNxowfOL.js → DiffuseBlur-Y5hSDTZF.js} +2 -3
  50. package/dist/core/{DisplacementMap-BuM2b1nC.js → DisplacementMap-FobRx5Ie.js} +2 -3
  51. package/dist/core/{Dither-Bt1qdRag.js → Dither-50rqHpt9.js} +2 -3
  52. package/dist/core/{DotGrid-DJFnwMVS.js → DotGrid-B6AGLUbR.js} +3 -4
  53. package/dist/core/{DropShadow-C-IfgfyH.js → DropShadow-CEPpgatB.js} +2 -3
  54. package/dist/core/{Duotone-DML_9JhJ.js → Duotone-D76Kp7Pb.js} +2 -3
  55. package/dist/core/{Ellipse-BuNUnN8D.js → Ellipse-BGod1LeG.js} +1 -2
  56. package/dist/core/{Emboss-DvKk4zwp.js → Emboss-DMNFb_ww.js} +3 -6
  57. package/dist/core/{Engraving-DPFVnIjD.js → Engraving-Dj7bCATQ.js} +2 -3
  58. package/dist/core/{ErosionNoise-j_b7a5cl.js → ErosionNoise-4O68wJQZ.js} +2 -4
  59. package/dist/core/{Exposure-DALA5K55.js → Exposure-h-vapOpj.js} +1 -3
  60. package/dist/core/{FallingLines-CeMOKpxK.js → FallingLines-Dzop_89k.js} +2 -3
  61. package/dist/core/{FilmGrain-DsDYCjjs.js → FilmGrain-Bs8PCfdf.js} +1 -3
  62. package/dist/core/{FilmStock-DtDMkwF6.js → FilmStock-DBjVo6rL.js} +1 -4
  63. package/dist/core/{Flip-B9Av9MVn.js → Flip-CfrS4KfZ.js} +2 -3
  64. package/dist/core/{FloatingParticles-BcMOBX1m.js → FloatingParticles-D1R2tD2J.js} +2 -5
  65. package/dist/core/{FlowField-BunLIU80.js → FlowField-Slirm5AI.js} +2 -3
  66. package/dist/core/{Flower-CvqBYUCU.js → Flower-Ddlut7QZ.js} +1 -2
  67. package/dist/core/{FlowingGradient-DQ284uMb.js → FlowingGradient-CwIgTtbj.js} +2 -7
  68. package/dist/core/{FlutedGlass-BP7av96Y.js → FlutedGlass-CMMy2GJ5.js} +2 -4
  69. package/dist/core/{Fog-DyyljY9e.js → Fog-DjjUkcTZ.js} +2 -4
  70. package/dist/core/{Form3D-x-G-Lz4z.js → Form3D-DQDOHWpC.js} +2 -4
  71. package/dist/core/{FractalNoise-DTgEv-Hq.js → FractalNoise-BjI3IOIj.js} +2 -4
  72. package/dist/core/{Frost-BhMELsXw.js → Frost-CK12HnL1.js} +3 -8
  73. package/dist/core/{GaborNoise-B7kmxcRZ.js → GaborNoise-DKEIvvRJ.js} +3 -5
  74. package/dist/core/{Glass-BMCOKCUL.js → Glass-CzcOVD5Y.js} +3 -8
  75. package/dist/core/{GlassTiles-DgVooh8h.js → GlassTiles-gjhc563g.js} +1 -2
  76. package/dist/core/{Glitch-D0pvMdGd.js → Glitch-C_XAWltC.js} +1 -2
  77. package/dist/core/{Glow-CJ3i0al6.js → Glow-CrYCanBI.js} +1 -3
  78. package/dist/core/{Godrays-DOV1VQ9x.js → Godrays-BBTMOVLP.js} +2 -3
  79. package/dist/core/{Goo-sMwsU21Y.js → Goo-Brhjk8aS.js} +3 -8
  80. package/dist/core/{GradientMap-CCuimQDS.js → GradientMap-C5325QWw.js} +2 -4
  81. package/dist/core/{Grayscale-DR1xnpde.js → Grayscale-dPjs-wvf.js} +1 -2
  82. package/dist/core/{Grid-CCUodqje.js → Grid-UjEd3O76.js} +3 -4
  83. package/dist/core/{GridDistortion-DUnC2Z_Y.js → GridDistortion-vVgYya1U.js} +1 -5
  84. package/dist/core/{Group--MS8ZNKg.js → Group-KVdmAi5g.js} +1 -1
  85. package/dist/core/{HTMLInCanvas-D_Rc6bs1.js → HTMLInCanvas-CKr2u76R.js} +1 -2
  86. package/dist/core/{Halftone-CG1LNQkk.js → Halftone-pRV3TRUW.js} +2 -3
  87. package/dist/core/{Heart-qPxh2CWp.js → Heart-CX7MvvHZ.js} +1 -2
  88. package/dist/core/{Heatmap-BZDfR2vC.js → Heatmap-Dn6qyd2e.js} +3 -8
  89. package/dist/core/{HexGrid-DquaiXLF.js → HexGrid-BIfYhkfV.js} +3 -4
  90. package/dist/core/{Hologram-JAXPZFx0.js → Hologram-ou27baPQ.js} +3 -7
  91. package/dist/core/{Holographic-BBHJp93D.js → Holographic-CiHdBSMg.js} +3 -7
  92. package/dist/core/{HueShift-a1Hl7gFy.js → HueShift-CG7pcXfg.js} +1 -3
  93. package/dist/core/{ImageTexture-CLW3uX1b.js → ImageTexture-BiZuU58C.js} +1 -2
  94. package/dist/core/{InkFlow-Dfd_5vYf.js → InkFlow-D9_L7opB.js} +2 -5
  95. package/dist/core/{Invert-DBEURmcL.js → Invert-CHEaiQZO.js} +1 -2
  96. package/dist/core/{IrisWipe-DTlGb8v-.js → IrisWipe-x22vOQHm.js} +2 -3
  97. package/dist/core/Irradiance-7yq2K87_.js +389 -0
  98. package/dist/core/{IsometricCubes-BgmQXJXU.js → IsometricCubes-CkPGWr7M.js} +2 -3
  99. package/dist/core/{Kaleidoscope-0adfaQ5F.js → Kaleidoscope-CEC5m1Ww.js} +1 -2
  100. package/dist/core/{KeyFrames-BqANGVzW.js → KeyFrames-BMGEZsAZ.js} +2 -3
  101. package/dist/core/{LensDistortion-DVRKCZv8.js → LensDistortion-DKo8PiO5.js} +2 -3
  102. package/dist/core/{LensFlare-C41jY4jH.js → LensFlare-DMS-NUtK.js} +2 -3
  103. package/dist/core/LightEdge-DxmnCRls.js +315 -0
  104. package/dist/core/{LightLeak-GWrDFcI_.js → LightLeak-yoEsZtYg.js} +2 -4
  105. package/dist/core/{Line-DuV7dLdM.js → Line-D17XDUjO.js} +2 -3
  106. package/dist/core/{LinearBlur-Bft2CjmO.js → LinearBlur-CiyjPTUH.js} +2 -3
  107. package/dist/core/{LinearGradient-BzIE4ReW.js → LinearGradient-DfjKG70q.js} +2 -4
  108. package/dist/core/{LinearWipe-ArRG9OCp.js → LinearWipe-D9CtBg6S.js} +2 -3
  109. package/dist/core/{LiquidMetal-BgvfhyiQ.js → LiquidMetal-8EG6DwV6.js} +3 -8
  110. package/dist/core/{Liquify-B6EigQqP.js → Liquify-BySXF1OB.js} +1 -4
  111. package/dist/core/{MagneticFilings-Dj35dlIq.js → MagneticFilings-DNESH3Zs.js} +2 -5
  112. package/dist/core/{Marble-0kfSSCDj.js → Marble-C9WvdxrP.js} +2 -7
  113. package/dist/core/{MeshGradient-DY_rUhFv.js → MeshGradient-d9--RXOU.js} +2 -10
  114. package/dist/core/{Mirror-C1AIyKmb.js → Mirror-1V2FF2kD.js} +1 -2
  115. package/dist/core/{MultiPointGradient-B9z1J-d8.js → MultiPointGradient-cRA9ytgL.js} +2 -3
  116. package/dist/core/{Nebula-mZDwq-yl.js → Nebula-BRV-q74y.js} +4 -87
  117. package/dist/core/{Neon-CyQE26dS.js → Neon-4PemK9Rj.js} +3 -6
  118. package/dist/core/{NoiseDissolve-DQbBbxlP.js → NoiseDissolve-B7LgD46G.js} +2 -3
  119. package/dist/core/{ObjectTracker-CZd20LeZ.js → ObjectTracker-CdzDxhpy.js} +2 -3
  120. package/dist/core/{Obsidian-CjKezopV.js → Obsidian-2J1eX9kT.js} +3 -9
  121. package/dist/core/{PagePeel-ulnjqZzc.js → PagePeel-D-ziraOm.js} +1 -2
  122. package/dist/core/{Paper-c_1INiUk.js → Paper-BxzCLyzB.js} +1 -2
  123. package/dist/core/{Parallelogram-CnjzV4-0.js → Parallelogram-D4OflTwn.js} +1 -2
  124. package/dist/core/{ParticleField-yJztI6Ts.js → ParticleField-tWNicEDO.js} +1 -4
  125. package/dist/core/{ParticleFlow-DJYrNrb8.js → ParticleFlow-BiEYFyWR.js} +2 -6
  126. package/dist/core/{Particles-kT-8Aj5V.js → Particles-B7W4yWgo.js} +3 -7
  127. package/dist/core/{PerlinNoise-C_Pczp28.js → PerlinNoise-C-irUxp9.js} +3 -5
  128. package/dist/core/{Perspective-BrbfuYVk.js → Perspective-DlnAW-pe.js} +2 -3
  129. package/dist/core/{PixelSort-DoTMcLz4.js → PixelSort-BBOTYuOE.js} +1 -4
  130. package/dist/core/{PixelThrow-B8pxI6sI.js → PixelThrow-DCJb9Lxd.js} +2 -4
  131. package/dist/core/{Pixelate-DCU9U9Wb.js → Pixelate-CZdwB--K.js} +1 -2
  132. package/dist/core/{Plasma-Xe1I1Mmb.js → Plasma-CTOQJeqy.js} +2 -4
  133. package/dist/core/{Plastic-Ce9dVqPq.js → Plastic-DvyH9x-4.js} +3 -8
  134. package/dist/core/{PolarCoordinates-mtOsxdGf.js → PolarCoordinates-XhdDAOD0.js} +1 -2
  135. package/dist/core/{Polygon-Cv63keGU.js → Polygon-CLohB-Ly.js} +2 -4
  136. package/dist/core/{Posterize-QhGDzUuf.js → Posterize-BAQfnvmK.js} +1 -2
  137. package/dist/core/{Prism-DOXMcTrS.js → Prism-DJVCVAXX.js} +2 -6
  138. package/dist/core/{ProgressiveBlur-sSQrxqcr.js → ProgressiveBlur-Dirva1on.js} +2 -3
  139. package/dist/core/{RadialGradient-DWTDAQnq.js → RadialGradient-DuSKR8Ds.js} +2 -4
  140. package/dist/core/{RadialWipe-HfofRhY0.js → RadialWipe-n8tON7x2.js} +2 -3
  141. package/dist/core/{RandomBars-DspX9Utc.js → RandomBars-BYouiIgQ.js} +2 -3
  142. package/dist/core/{ReactionDiffusion-GsRfnqUY.js → ReactionDiffusion-CHDd3y2q.js} +2 -5
  143. package/dist/core/{RectangularCoordinates-DhPRrTPT.js → RectangularCoordinates-CYFfCawa.js} +1 -2
  144. package/dist/core/{ReflectivePlane-ej7XTkZ-.js → ReflectivePlane-DFTl5U9q.js} +2 -3
  145. package/dist/core/Repeater-CnbzXuAe.js +473 -0
  146. package/dist/core/{Ring-CC1LC05E.js → Ring-CGkHVSVd.js} +1 -2
  147. package/dist/core/{RippleWipe-CmmIx59a.js → RippleWipe-DLjPzY6u.js} +2 -3
  148. package/dist/core/{Ripples-ColS9_ej.js → Ripples-C2tITU62.js} +2 -3
  149. package/dist/core/{RoundedRect-BCL_4FLA.js → RoundedRect-sfNTUaCY.js} +1 -2
  150. package/dist/core/{Saturation-E77lSl0T.js → Saturation-BRkifYWj.js} +1 -3
  151. package/dist/core/{Scratches-ZHohp7K4.js → Scratches-D87O5C2K.js} +2 -4
  152. package/dist/core/{Sharpness-CgNxIvCA.js → Sharpness-BGv613Zw.js} +1 -3
  153. package/dist/core/Shatter-DuyCFU1f.js +328 -0
  154. package/dist/core/{SimplexNoise-CZf812YP.js → SimplexNoise-CQJvmqd-.js} +2 -4
  155. package/dist/core/{SineWave-CVHPlsdX.js → SineWave-BfOgSGMP.js} +2 -3
  156. package/dist/core/{SliceWipe-4Y_DLO0N.js → SliceWipe-CD_D99sl.js} +1 -2
  157. package/dist/core/{Smoke-CzjvGgBl.js → Smoke-BDQYKRP1.js} +2 -4
  158. package/dist/core/{SmokeFill-DkMjXE-D.js → SmokeFill-CPnzQtQv.js} +3 -8
  159. package/dist/core/{SmokeFlow-DQMNHV2s.js → SmokeFlow-BkPMjZq8.js} +2 -4
  160. package/dist/core/{Solarize-DmhOkKoO.js → Solarize-DSiS32QS.js} +1 -3
  161. package/dist/core/{SolidColor-CyYoqgG3.js → SolidColor-DEKpgy1c.js} +2 -3
  162. package/dist/core/Sparkle-BZur6gPW.js +178 -0
  163. package/dist/core/{Spherize-D2gNetxE.js → Spherize-D9Yg4n6O.js} +2 -3
  164. package/dist/core/{Spiral-BCO6OJXU.js → Spiral-BCacfEpT.js} +2 -3
  165. package/dist/core/{Star-9JERbdHT.js → Star-Dnw1ihk7.js} +1 -2
  166. package/dist/core/{Stone-92McvPwz.js → Stone-Cje-_vAg.js} +1 -3
  167. package/dist/core/{Strands-B6NfRExJ.js → Strands-CFRxS1G_.js} +2 -4
  168. package/dist/core/{Stretch-DbUOkCav.js → Stretch-DXVhfIqO.js} +1 -2
  169. package/dist/core/{Stripes-BG2zbwGV.js → Stripes-CCADWwyq.js} +2 -3
  170. package/dist/core/{StudioBackground-tpZpD080.js → StudioBackground-BlzYNAsu.js} +2 -6
  171. package/dist/core/{SunBurst-BMH4MKRL.js → SunBurst-CmWbI18r.js} +2 -3
  172. package/dist/core/{Surface3D-DUZMTBel.js → Surface3D-Dmh98-0V.js} +2 -6
  173. package/dist/core/{Swirl-CzOPAKx8.js → Swirl-CzI1qSVc.js} +2 -4
  174. package/dist/core/{Teardrop-aOr2VYQI.js → Teardrop-D24uulL0.js} +1 -2
  175. package/dist/core/{Text-CV3Lr3m0.js → Text-CrZKvBw6.js} +2 -6
  176. package/dist/core/{ThinFilm-CYOodpsx.js → ThinFilm-D7R2dt1O.js} +3 -6
  177. package/dist/core/{TiltShift-Cv80ZHW3.js → TiltShift-AMMDZBvf.js} +2 -3
  178. package/dist/core/{TimeTrail-fvJO2a1q.js → TimeTrail-BCYDP2ep.js} +2 -6
  179. package/dist/core/{Tint-D4m85tFF.js → Tint-DHb5wBN5.js} +2 -3
  180. package/dist/core/{Trapezoid-B-PkXCCJ.js → Trapezoid-CL5Fxvq7.js} +1 -2
  181. package/dist/core/{TriangularGrid-hMfK10up.js → TriangularGrid-Bp-SJS-H.js} +2 -3
  182. package/dist/core/{Tritone-n1wNQ1dI.js → Tritone-C0nx7OdC.js} +2 -3
  183. package/dist/core/{Truchet-BhmcbIE9.js → Truchet-DCetyDaq.js} +2 -3
  184. package/dist/core/{Twirl-D8gALHXr.js → Twirl-D_mv9KEi.js} +1 -2
  185. package/dist/core/{VHS-CaqSB2Op.js → VHS-Cp9aDjti.js} +1 -2
  186. package/dist/core/{VenetianBlinds-B1-WjIeY.js → VenetianBlinds-DUyvaT5w.js} +2 -3
  187. package/dist/core/{Vesica-Gh1CMA7n.js → Vesica-BpzrTPTA.js} +1 -2
  188. package/dist/core/{Vibrance-ixBSdj4B.js → Vibrance-DW3J-pvW.js} +1 -3
  189. package/dist/core/{VideoTexture-DVQ1YsW2.js → VideoTexture-zoKsSrex.js} +1 -2
  190. package/dist/core/{Vignette-B9v8l0So.js → Vignette-KKbP3qdZ.js} +2 -5
  191. package/dist/core/{Voronoi-CIHogO9V.js → Voronoi-Bp2-U6lm.js} +2 -5
  192. package/dist/core/Voxels-B3e3LHH5.js +469 -0
  193. package/dist/core/{Water-Dh4UB4UF.js → Water-CoYwvqKx.js} +3 -8
  194. package/dist/core/{Watercolor-C70_K8Lv.js → Watercolor-DUNjSIN1.js} +2 -4
  195. package/dist/core/{WaveDistortion-BCKxUa-p.js → WaveDistortion-Dp8ws0z1.js} +1 -2
  196. package/dist/core/{Waveform-BKMFhH8R.js → Waveform-DDBLB6zu.js} +2 -9
  197. package/dist/core/{WaveletNoise-CFpncHiR.js → WaveletNoise-CpBkzfRT.js} +2 -4
  198. package/dist/core/{Weave-CYgbepeB.js → Weave-cWkvSEAy.js} +2 -3
  199. package/dist/core/{WebcamTexture-B0vkMk_l.js → WebcamTexture-D484SXSE.js} +1 -2
  200. package/dist/core/{Wool-CLkJUMng.js → Wool-C9L7O9fD.js} +1 -3
  201. package/dist/core/{WorleyNoise-BxznxOxV.js → WorleyNoise-B5j5lDQZ.js} +2 -3
  202. package/dist/core/{ZoomBlur-DtujxMsW.js → ZoomBlur-bPC1dBu2.js} +2 -3
  203. package/dist/core/customShaders.d.ts +71 -0
  204. package/dist/core/customShaders.d.ts.map +1 -0
  205. package/dist/core/docs-manifest.json +29177 -0
  206. package/dist/core/gpu/composer.d.ts +2 -0
  207. package/dist/core/gpu/composer.d.ts.map +1 -1
  208. package/dist/core/gpu/contract.d.ts +15 -0
  209. package/dist/core/gpu/contract.d.ts.map +1 -1
  210. package/dist/core/gpu/frame.d.ts +5 -2
  211. package/dist/core/gpu/frame.d.ts.map +1 -1
  212. package/dist/core/gpu/index.d.ts.map +1 -1
  213. package/dist/core/gpu/kit/waves.d.ts +6 -0
  214. package/dist/core/gpu/kit/waves.d.ts.map +1 -1
  215. package/dist/core/gpu/scaffolds/sdfShape.d.ts +1 -1
  216. package/dist/core/gpu/scaffolds/sdfShape.d.ts.map +1 -1
  217. package/dist/core/gpu/support.d.ts +12 -0
  218. package/dist/core/gpu/support.d.ts.map +1 -1
  219. package/dist/core/index.d.ts +3 -2
  220. package/dist/core/index.d.ts.map +1 -1
  221. package/dist/core/index.js +238 -255
  222. package/dist/core/llms.txt +1558 -0
  223. package/dist/core/{noiseColor-_P7nIu_L.js → noiseColor-D_bPhJ4m.js} +2 -2
  224. package/dist/core/presetRenderer.d.ts +4 -0
  225. package/dist/core/presetRenderer.d.ts.map +1 -1
  226. package/dist/core/registry.js +204 -248
  227. package/dist/core/shaderRegistry-BaozBFyh.js +445 -0
  228. package/dist/core/shaderRegistry.d.ts.map +1 -1
  229. package/dist/core/shaders/AngularBlur/index.d.ts +1 -1
  230. package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
  231. package/dist/core/shaders/AngularBlur/index.js +4 -10
  232. package/dist/core/shaders/Arc/index.js +4 -6
  233. package/dist/core/shaders/Ascii/index.d.ts +1 -1
  234. package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
  235. package/dist/core/shaders/Ascii/index.js +4 -11
  236. package/dist/core/shaders/Aurora/index.js +4 -21
  237. package/dist/core/shaders/BarShift/index.js +4 -8
  238. package/dist/core/shaders/BarnDoors/index.js +4 -7
  239. package/dist/core/shaders/Beam/index.js +4 -11
  240. package/dist/core/shaders/Bend/index.js +4 -8
  241. package/dist/core/shaders/Blob/index.js +4 -18
  242. package/dist/core/shaders/BlockDissolve/index.js +4 -7
  243. package/dist/core/shaders/BlockNoise/index.d.ts +1 -1
  244. package/dist/core/shaders/BlockNoise/index.d.ts.map +1 -1
  245. package/dist/core/shaders/BlockNoise/index.js +5 -14
  246. package/dist/core/shaders/BlueNoise/index.d.ts +1 -1
  247. package/dist/core/shaders/BlueNoise/index.d.ts.map +1 -1
  248. package/dist/core/shaders/BlueNoise/index.js +5 -14
  249. package/dist/core/shaders/Blur/index.d.ts +1 -1
  250. package/dist/core/shaders/Blur/index.d.ts.map +1 -1
  251. package/dist/core/shaders/Blur/index.js +4 -10
  252. package/dist/core/shaders/Boids/index.js +4 -9
  253. package/dist/core/shaders/BokehBlur/index.js +4 -10
  254. package/dist/core/shaders/BrickPattern/index.d.ts +1 -1
  255. package/dist/core/shaders/BrickPattern/index.d.ts.map +1 -1
  256. package/dist/core/shaders/BrickPattern/index.js +4 -13
  257. package/dist/core/shaders/BrightnessContrast/index.js +4 -7
  258. package/dist/core/shaders/BrushedMetal/index.js +4 -11
  259. package/dist/core/shaders/Bulge/index.js +4 -8
  260. package/dist/core/shaders/CRTScreen/index.d.ts +2 -2
  261. package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
  262. package/dist/core/shaders/CRTScreen/index.js +4 -10
  263. package/dist/core/shaders/CarbonFiber/index.js +4 -11
  264. package/dist/core/shaders/Chalkboard/index.d.ts +1 -1
  265. package/dist/core/shaders/Chalkboard/index.d.ts.map +1 -1
  266. package/dist/core/shaders/Chalkboard/index.js +4 -9
  267. package/dist/core/shaders/ChannelBlur/index.d.ts +1 -1
  268. package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
  269. package/dist/core/shaders/ChannelBlur/index.js +4 -10
  270. package/dist/core/shaders/CheckerWipe/index.js +4 -7
  271. package/dist/core/shaders/Checkerboard/index.d.ts +1 -1
  272. package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
  273. package/dist/core/shaders/Checkerboard/index.js +4 -13
  274. package/dist/core/shaders/Chevron/index.d.ts +1 -1
  275. package/dist/core/shaders/Chevron/index.d.ts.map +1 -1
  276. package/dist/core/shaders/Chevron/index.js +4 -13
  277. package/dist/core/shaders/ChromaFlow/index.js +4 -8
  278. package/dist/core/shaders/ChromaticAberration/index.js +4 -11
  279. package/dist/core/shaders/Chrome/index.js +4 -10
  280. package/dist/core/shaders/Circle/index.js +4 -6
  281. package/dist/core/shaders/ColorWheel/index.js +4 -11
  282. package/dist/core/shaders/CompressionArtifacts/index.js +4 -7
  283. package/dist/core/shaders/ConcentricSpin/index.js +4 -8
  284. package/dist/core/shaders/ConicGradient/index.js +4 -11
  285. package/dist/core/shaders/ContourLines/index.js +4 -6
  286. package/dist/core/shaders/CornerPin/index.js +4 -8
  287. package/dist/core/shaders/Crescent/index.js +4 -5
  288. package/dist/core/shaders/Cross/index.js +4 -5
  289. package/dist/core/shaders/Crystal/index.js +4 -11
  290. package/dist/core/shaders/CurlNoise/index.d.ts +1 -1
  291. package/dist/core/shaders/CurlNoise/index.d.ts.map +1 -1
  292. package/dist/core/shaders/CurlNoise/index.js +5 -14
  293. package/dist/core/shaders/CursorRipples/index.js +4 -7
  294. package/dist/core/shaders/CursorTrail/index.js +4 -7
  295. package/dist/core/shaders/DataMosh/index.js +4 -7
  296. package/dist/core/shaders/DiamondGradient/index.js +4 -11
  297. package/dist/core/shaders/DiamondWipe/index.js +4 -7
  298. package/dist/core/shaders/DiffuseBlur/index.d.ts +1 -1
  299. package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
  300. package/dist/core/shaders/DiffuseBlur/index.js +4 -10
  301. package/dist/core/shaders/DisplacementMap/index.js +4 -8
  302. package/dist/core/shaders/Dither/index.d.ts +1 -1
  303. package/dist/core/shaders/Dither/index.d.ts.map +1 -1
  304. package/dist/core/shaders/Dither/index.js +4 -13
  305. package/dist/core/shaders/DotGrid/index.d.ts +2 -2
  306. package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
  307. package/dist/core/shaders/DotGrid/index.js +4 -13
  308. package/dist/core/shaders/DropShadow/index.d.ts +1 -1
  309. package/dist/core/shaders/DropShadow/index.d.ts.map +1 -1
  310. package/dist/core/shaders/DropShadow/index.js +4 -10
  311. package/dist/core/shaders/Duotone/index.js +4 -6
  312. package/dist/core/shaders/Ellipse/index.js +4 -5
  313. package/dist/core/shaders/Emboss/index.js +4 -9
  314. package/dist/core/shaders/Engraving/index.js +4 -9
  315. package/dist/core/shaders/ErosionNoise/index.d.ts +1 -1
  316. package/dist/core/shaders/ErosionNoise/index.d.ts.map +1 -1
  317. package/dist/core/shaders/ErosionNoise/index.js +5 -14
  318. package/dist/core/shaders/Exposure/index.js +4 -7
  319. package/dist/core/shaders/FallingLines/index.d.ts +1 -1
  320. package/dist/core/shaders/FallingLines/index.d.ts.map +1 -1
  321. package/dist/core/shaders/FallingLines/index.js +4 -13
  322. package/dist/core/shaders/FilmGrain/index.js +4 -7
  323. package/dist/core/shaders/FilmStock/index.js +4 -13
  324. package/dist/core/shaders/Flip/index.js +4 -8
  325. package/dist/core/shaders/FloatingParticles/index.d.ts +1 -1
  326. package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
  327. package/dist/core/shaders/FloatingParticles/index.js +4 -9
  328. package/dist/core/shaders/FlowField/index.js +4 -8
  329. package/dist/core/shaders/Flower/index.js +4 -5
  330. package/dist/core/shaders/FlowingGradient/index.js +4 -15
  331. package/dist/core/shaders/FlutedGlass/index.js +4 -11
  332. package/dist/core/shaders/Fog/index.js +4 -7
  333. package/dist/core/shaders/Form3D/index.js +4 -7
  334. package/dist/core/shaders/FractalNoise/index.d.ts +1 -1
  335. package/dist/core/shaders/FractalNoise/index.d.ts.map +1 -1
  336. package/dist/core/shaders/FractalNoise/index.js +4 -13
  337. package/dist/core/shaders/Frost/index.js +4 -11
  338. package/dist/core/shaders/GaborNoise/index.d.ts +2 -2
  339. package/dist/core/shaders/GaborNoise/index.d.ts.map +1 -1
  340. package/dist/core/shaders/GaborNoise/index.js +5 -14
  341. package/dist/core/shaders/Glass/index.js +4 -11
  342. package/dist/core/shaders/GlassTiles/index.d.ts +1 -1
  343. package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
  344. package/dist/core/shaders/GlassTiles/index.js +4 -8
  345. package/dist/core/shaders/Glitch/index.d.ts +1 -1
  346. package/dist/core/shaders/Glitch/index.d.ts.map +1 -1
  347. package/dist/core/shaders/Glitch/index.js +4 -10
  348. package/dist/core/shaders/Glow/index.d.ts +1 -1
  349. package/dist/core/shaders/Glow/index.d.ts.map +1 -1
  350. package/dist/core/shaders/Glow/index.js +4 -11
  351. package/dist/core/shaders/Godrays/index.js +4 -12
  352. package/dist/core/shaders/Goo/index.js +4 -11
  353. package/dist/core/shaders/GradientMap/index.js +4 -7
  354. package/dist/core/shaders/Grayscale/index.js +4 -6
  355. package/dist/core/shaders/Grid/index.d.ts +2 -2
  356. package/dist/core/shaders/Grid/index.d.ts.map +1 -1
  357. package/dist/core/shaders/Grid/index.js +4 -13
  358. package/dist/core/shaders/GridDistortion/index.js +4 -11
  359. package/dist/core/shaders/Group/index.js +4 -6
  360. package/dist/core/shaders/HTMLInCanvas/index.js +4 -7
  361. package/dist/core/shaders/Halftone/index.d.ts +1 -1
  362. package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
  363. package/dist/core/shaders/Halftone/index.js +4 -13
  364. package/dist/core/shaders/Heart/index.js +4 -5
  365. package/dist/core/shaders/Heatmap/index.js +4 -11
  366. package/dist/core/shaders/HexGrid/index.d.ts +2 -2
  367. package/dist/core/shaders/HexGrid/index.d.ts.map +1 -1
  368. package/dist/core/shaders/HexGrid/index.js +4 -13
  369. package/dist/core/shaders/Hologram/index.js +4 -10
  370. package/dist/core/shaders/Holographic/index.js +4 -10
  371. package/dist/core/shaders/HueShift/index.js +4 -7
  372. package/dist/core/shaders/ImageTexture/index.js +4 -6
  373. package/dist/core/shaders/InkFlow/index.js +4 -8
  374. package/dist/core/shaders/Invert/index.js +4 -6
  375. package/dist/core/shaders/IrisWipe/index.js +4 -7
  376. package/dist/core/shaders/Irradiance/index.js +4 -13
  377. package/dist/core/shaders/IsometricCubes/index.d.ts +1 -1
  378. package/dist/core/shaders/IsometricCubes/index.d.ts.map +1 -1
  379. package/dist/core/shaders/IsometricCubes/index.js +4 -13
  380. package/dist/core/shaders/Kaleidoscope/index.js +4 -8
  381. package/dist/core/shaders/KeyFrames/index.js +4 -10
  382. package/dist/core/shaders/LensDistortion/index.js +4 -6
  383. package/dist/core/shaders/LensFlare/index.d.ts +1 -1
  384. package/dist/core/shaders/LensFlare/index.d.ts.map +1 -1
  385. package/dist/core/shaders/LensFlare/index.js +4 -12
  386. package/dist/core/shaders/LightEdge/index.js +4 -10
  387. package/dist/core/shaders/LightLeak/index.js +4 -12
  388. package/dist/core/shaders/Line/index.js +4 -10
  389. package/dist/core/shaders/LinearBlur/index.d.ts +1 -1
  390. package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
  391. package/dist/core/shaders/LinearBlur/index.js +4 -10
  392. package/dist/core/shaders/LinearGradient/index.js +4 -11
  393. package/dist/core/shaders/LinearWipe/index.js +4 -7
  394. package/dist/core/shaders/LiquidMetal/index.js +4 -11
  395. package/dist/core/shaders/Liquify/index.js +4 -10
  396. package/dist/core/shaders/MagneticFilings/index.js +4 -9
  397. package/dist/core/shaders/Marble/index.d.ts +1 -1
  398. package/dist/core/shaders/Marble/index.d.ts.map +1 -1
  399. package/dist/core/shaders/Marble/index.js +4 -15
  400. package/dist/core/shaders/MeshGradient/index.js +4 -17
  401. package/dist/core/shaders/Mirror/index.js +4 -8
  402. package/dist/core/shaders/MultiPointGradient/index.js +4 -11
  403. package/dist/core/shaders/Nebula/index.js +4 -13
  404. package/dist/core/shaders/Neon/index.js +4 -9
  405. package/dist/core/shaders/NoiseDissolve/index.js +4 -7
  406. package/dist/core/shaders/ObjectTracker/index.js +4 -10
  407. package/dist/core/shaders/Obsidian/index.js +4 -15
  408. package/dist/core/shaders/PagePeel/index.js +4 -10
  409. package/dist/core/shaders/Paper/index.d.ts +1 -1
  410. package/dist/core/shaders/Paper/index.d.ts.map +1 -1
  411. package/dist/core/shaders/Paper/index.js +4 -8
  412. package/dist/core/shaders/Parallelogram/index.js +4 -5
  413. package/dist/core/shaders/ParticleField/index.js +4 -9
  414. package/dist/core/shaders/ParticleFlow/index.js +4 -10
  415. package/dist/core/shaders/Particles/index.js +4 -9
  416. package/dist/core/shaders/PerlinNoise/index.d.ts +2 -2
  417. package/dist/core/shaders/PerlinNoise/index.d.ts.map +1 -1
  418. package/dist/core/shaders/PerlinNoise/index.js +5 -14
  419. package/dist/core/shaders/Perspective/index.js +4 -8
  420. package/dist/core/shaders/PixelSort/index.js +4 -8
  421. package/dist/core/shaders/PixelThrow/index.js +4 -8
  422. package/dist/core/shaders/Pixelate/index.d.ts +1 -1
  423. package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
  424. package/dist/core/shaders/Pixelate/index.js +4 -10
  425. package/dist/core/shaders/Plasma/index.js +4 -11
  426. package/dist/core/shaders/Plastic/index.js +4 -11
  427. package/dist/core/shaders/PolarCoordinates/index.js +4 -8
  428. package/dist/core/shaders/Polygon/index.js +4 -6
  429. package/dist/core/shaders/Posterize/index.js +4 -6
  430. package/dist/core/shaders/Prism/index.js +4 -12
  431. package/dist/core/shaders/ProgressiveBlur/index.d.ts +1 -1
  432. package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
  433. package/dist/core/shaders/ProgressiveBlur/index.js +4 -10
  434. package/dist/core/shaders/RadialGradient/index.js +4 -11
  435. package/dist/core/shaders/RadialWipe/index.js +4 -7
  436. package/dist/core/shaders/RandomBars/index.js +4 -7
  437. package/dist/core/shaders/ReactionDiffusion/index.js +4 -8
  438. package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
  439. package/dist/core/shaders/ReflectivePlane/index.js +4 -10
  440. package/dist/core/shaders/Repeater/index.js +4 -5
  441. package/dist/core/shaders/Ring/index.js +4 -5
  442. package/dist/core/shaders/RippleWipe/index.js +4 -7
  443. package/dist/core/shaders/Ripples/index.d.ts +1 -1
  444. package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
  445. package/dist/core/shaders/Ripples/index.js +4 -13
  446. package/dist/core/shaders/RoundedRect/index.js +4 -5
  447. package/dist/core/shaders/Saturation/index.js +4 -7
  448. package/dist/core/shaders/Scratches/index.d.ts +1 -1
  449. package/dist/core/shaders/Scratches/index.d.ts.map +1 -1
  450. package/dist/core/shaders/Scratches/index.js +5 -14
  451. package/dist/core/shaders/Sharpness/index.d.ts +1 -1
  452. package/dist/core/shaders/Sharpness/index.d.ts.map +1 -1
  453. package/dist/core/shaders/Sharpness/index.js +4 -11
  454. package/dist/core/shaders/Shatter/index.js +4 -6
  455. package/dist/core/shaders/SimplexNoise/index.d.ts +1 -1
  456. package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
  457. package/dist/core/shaders/SimplexNoise/index.js +5 -14
  458. package/dist/core/shaders/SineWave/index.js +4 -10
  459. package/dist/core/shaders/SliceWipe/index.js +4 -8
  460. package/dist/core/shaders/Smoke/index.js +4 -7
  461. package/dist/core/shaders/SmokeFill/index.js +4 -10
  462. package/dist/core/shaders/SmokeFlow/index.js +4 -7
  463. package/dist/core/shaders/Solarize/index.js +4 -7
  464. package/dist/core/shaders/SolidColor/index.js +4 -11
  465. package/dist/core/shaders/Sparkle/index.d.ts +57 -0
  466. package/dist/core/shaders/Sparkle/index.d.ts.map +1 -0
  467. package/dist/core/shaders/Sparkle/index.js +5 -0
  468. package/dist/core/shaders/Spherize/index.d.ts +1 -1
  469. package/dist/core/shaders/Spherize/index.d.ts.map +1 -1
  470. package/dist/core/shaders/Spherize/index.js +4 -10
  471. package/dist/core/shaders/Spiral/index.js +4 -11
  472. package/dist/core/shaders/Star/index.js +4 -5
  473. package/dist/core/shaders/Stone/index.d.ts +1 -1
  474. package/dist/core/shaders/Stone/index.d.ts.map +1 -1
  475. package/dist/core/shaders/Stone/index.js +4 -14
  476. package/dist/core/shaders/Strands/index.d.ts +1 -1
  477. package/dist/core/shaders/Strands/index.d.ts.map +1 -1
  478. package/dist/core/shaders/Strands/index.js +4 -13
  479. package/dist/core/shaders/Stretch/index.js +4 -8
  480. package/dist/core/shaders/Stripes/index.d.ts +1 -1
  481. package/dist/core/shaders/Stripes/index.d.ts.map +1 -1
  482. package/dist/core/shaders/Stripes/index.js +4 -13
  483. package/dist/core/shaders/StudioBackground/index.js +4 -14
  484. package/dist/core/shaders/SunBurst/index.js +4 -12
  485. package/dist/core/shaders/Surface3D/index.js +4 -8
  486. package/dist/core/shaders/Swirl/index.js +4 -11
  487. package/dist/core/shaders/Teardrop/index.js +4 -5
  488. package/dist/core/shaders/Text/index.js +4 -12
  489. package/dist/core/shaders/ThinFilm/index.js +4 -9
  490. package/dist/core/shaders/TiltShift/index.d.ts +1 -1
  491. package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
  492. package/dist/core/shaders/TiltShift/index.js +4 -10
  493. package/dist/core/shaders/TimeTrail/index.js +4 -8
  494. package/dist/core/shaders/Tint/index.js +4 -6
  495. package/dist/core/shaders/Trapezoid/index.js +4 -5
  496. package/dist/core/shaders/TriangularGrid/index.d.ts +1 -1
  497. package/dist/core/shaders/TriangularGrid/index.d.ts.map +1 -1
  498. package/dist/core/shaders/TriangularGrid/index.js +4 -13
  499. package/dist/core/shaders/Tritone/index.js +4 -6
  500. package/dist/core/shaders/Truchet/index.d.ts +1 -1
  501. package/dist/core/shaders/Truchet/index.d.ts.map +1 -1
  502. package/dist/core/shaders/Truchet/index.js +4 -13
  503. package/dist/core/shaders/Twirl/index.js +4 -8
  504. package/dist/core/shaders/VHS/index.d.ts +1 -1
  505. package/dist/core/shaders/VHS/index.d.ts.map +1 -1
  506. package/dist/core/shaders/VHS/index.js +4 -10
  507. package/dist/core/shaders/VenetianBlinds/index.js +4 -7
  508. package/dist/core/shaders/Vesica/index.js +4 -5
  509. package/dist/core/shaders/Vibrance/index.js +4 -7
  510. package/dist/core/shaders/VideoTexture/index.js +4 -6
  511. package/dist/core/shaders/Vignette/index.js +4 -8
  512. package/dist/core/shaders/Voronoi/index.d.ts +1 -1
  513. package/dist/core/shaders/Voronoi/index.d.ts.map +1 -1
  514. package/dist/core/shaders/Voronoi/index.js +4 -13
  515. package/dist/core/shaders/Voxels/index.js +4 -14
  516. package/dist/core/shaders/Water/index.js +4 -11
  517. package/dist/core/shaders/Watercolor/index.d.ts +1 -1
  518. package/dist/core/shaders/Watercolor/index.d.ts.map +1 -1
  519. package/dist/core/shaders/Watercolor/index.js +4 -10
  520. package/dist/core/shaders/WaveDistortion/index.js +4 -8
  521. package/dist/core/shaders/Waveform/index.js +4 -16
  522. package/dist/core/shaders/WaveletNoise/index.d.ts +1 -1
  523. package/dist/core/shaders/WaveletNoise/index.d.ts.map +1 -1
  524. package/dist/core/shaders/WaveletNoise/index.js +5 -14
  525. package/dist/core/shaders/Weave/index.d.ts +1 -1
  526. package/dist/core/shaders/Weave/index.d.ts.map +1 -1
  527. package/dist/core/shaders/Weave/index.js +4 -13
  528. package/dist/core/shaders/WebcamTexture/index.js +4 -6
  529. package/dist/core/shaders/Wool/index.d.ts +1 -1
  530. package/dist/core/shaders/Wool/index.d.ts.map +1 -1
  531. package/dist/core/shaders/Wool/index.js +4 -14
  532. package/dist/core/shaders/WorleyNoise/index.d.ts +1 -1
  533. package/dist/core/shaders/WorleyNoise/index.d.ts.map +1 -1
  534. package/dist/core/shaders/WorleyNoise/index.js +4 -13
  535. package/dist/core/shaders/ZoomBlur/index.d.ts +1 -1
  536. package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
  537. package/dist/core/shaders/ZoomBlur/index.js +4 -10
  538. package/dist/core/std/effects/blurs.d.ts +656 -138
  539. package/dist/core/std/effects/blurs.d.ts.map +1 -1
  540. package/dist/core/std/effects/color.d.ts +209 -32
  541. package/dist/core/std/effects/color.d.ts.map +1 -1
  542. package/dist/core/std/effects/edgeGlow.d.ts +86 -17
  543. package/dist/core/std/effects/edgeGlow.d.ts.map +1 -1
  544. package/dist/core/std/effects/fracture.d.ts +72 -8
  545. package/dist/core/std/effects/fracture.d.ts.map +1 -1
  546. package/dist/core/std/effects/index.d.ts +15 -0
  547. package/dist/core/std/effects/index.d.ts.map +1 -0
  548. package/dist/core/std/effects/instances.d.ts +87 -8
  549. package/dist/core/std/effects/instances.d.ts.map +1 -1
  550. package/dist/core/std/effects/lens.d.ts +48 -12
  551. package/dist/core/std/effects/lens.d.ts.map +1 -1
  552. package/dist/core/std/effects/overlay.d.ts +63 -22
  553. package/dist/core/std/effects/overlay.d.ts.map +1 -1
  554. package/dist/core/std/effects/pointerFields.d.ts +45 -20
  555. package/dist/core/std/effects/pointerFields.d.ts.map +1 -1
  556. package/dist/core/std/effects/reveal.d.ts +118 -40
  557. package/dist/core/std/effects/reveal.d.ts.map +1 -1
  558. package/dist/core/std/effects/stylize.d.ts +139 -70
  559. package/dist/core/std/effects/stylize.d.ts.map +1 -1
  560. package/dist/core/std/filter.d.ts +72 -12
  561. package/dist/core/std/filter.d.ts.map +1 -1
  562. package/dist/core/std/frames.d.ts +91 -24
  563. package/dist/core/std/frames.d.ts.map +1 -1
  564. package/dist/core/std/index.d.ts +46 -8
  565. package/dist/core/std/index.d.ts.map +1 -1
  566. package/dist/core/std/index.js +4 -0
  567. package/dist/core/std/invoke.d.ts +107 -12
  568. package/dist/core/std/invoke.d.ts.map +1 -1
  569. package/dist/core/std/lists.d.ts +40 -10
  570. package/dist/core/std/lists.d.ts.map +1 -1
  571. package/dist/core/std/lower.d.ts +73 -1
  572. package/dist/core/std/lower.d.ts.map +1 -1
  573. package/dist/core/std/mask.d.ts +60 -17
  574. package/dist/core/std/mask.d.ts.map +1 -1
  575. package/dist/core/std/math.d.ts +484 -9
  576. package/dist/core/std/math.d.ts.map +1 -1
  577. package/dist/core/std/motion.d.ts +130 -10
  578. package/dist/core/std/motion.d.ts.map +1 -1
  579. package/dist/core/std/paint/compose.d.ts +57 -16
  580. package/dist/core/std/paint/compose.d.ts.map +1 -1
  581. package/dist/core/std/paint/fields.d.ts +376 -93
  582. package/dist/core/std/paint/fields.d.ts.map +1 -1
  583. package/dist/core/std/paint/figures.d.ts +32 -17
  584. package/dist/core/std/paint/figures.d.ts.map +1 -1
  585. package/dist/core/std/paint/gradients.d.ts +58 -25
  586. package/dist/core/std/paint/gradients.d.ts.map +1 -1
  587. package/dist/core/std/paint/light.d.ts +501 -77
  588. package/dist/core/std/paint/light.d.ts.map +1 -1
  589. package/dist/core/std/paint/materials.d.ts +678 -151
  590. package/dist/core/std/paint/materials.d.ts.map +1 -1
  591. package/dist/core/std/paint/media.d.ts +47 -32
  592. package/dist/core/std/paint/media.d.ts.map +1 -1
  593. package/dist/core/std/paint/noise.d.ts +436 -87
  594. package/dist/core/std/paint/noise.d.ts.map +1 -1
  595. package/dist/core/std/paint/patterns.d.ts +473 -91
  596. package/dist/core/std/paint/patterns.d.ts.map +1 -1
  597. package/dist/core/std/paint/radiance.d.ts +75 -29
  598. package/dist/core/std/paint/radiance.d.ts.map +1 -1
  599. package/dist/core/std/paint/volume.d.ts +68 -27
  600. package/dist/core/std/paint/volume.d.ts.map +1 -1
  601. package/dist/core/std/paint/voxels.d.ts +46 -26
  602. package/dist/core/std/paint/voxels.d.ts.map +1 -1
  603. package/dist/core/std/shape.d.ts +195 -1
  604. package/dist/core/std/shape.d.ts.map +1 -1
  605. package/dist/core/std/signal.d.ts +55 -15
  606. package/dist/core/std/signal.d.ts.map +1 -1
  607. package/dist/core/std/sim/agentForces.d.ts +441 -99
  608. package/dist/core/std/sim/agentForces.d.ts.map +1 -1
  609. package/dist/core/std/sim/agentFrame.d.ts +94 -20
  610. package/dist/core/std/sim/agentFrame.d.ts.map +1 -1
  611. package/dist/core/std/sim/agentRender.d.ts +187 -60
  612. package/dist/core/std/sim/agentRender.d.ts.map +1 -1
  613. package/dist/core/std/sim/agents.d.ts +99 -28
  614. package/dist/core/std/sim/agents.d.ts.map +1 -1
  615. package/dist/core/std/sim/feedback.d.ts +40 -19
  616. package/dist/core/std/sim/feedback.d.ts.map +1 -1
  617. package/dist/core/std/sim/fluids.d.ts +127 -63
  618. package/dist/core/std/sim/fluids.d.ts.map +1 -1
  619. package/dist/core/std/sim/grids.d.ts +200 -48
  620. package/dist/core/std/sim/grids.d.ts.map +1 -1
  621. package/dist/core/std/sim/index.d.ts +14 -0
  622. package/dist/core/std/sim/index.d.ts.map +1 -0
  623. package/dist/core/std/sim/shapeFields.d.ts +56 -0
  624. package/dist/core/std/sim/shapeFields.d.ts.map +1 -1
  625. package/dist/core/std/sim.d.ts +112 -10
  626. package/dist/core/std/sim.d.ts.map +1 -1
  627. package/dist/core/std/slots.d.ts +72 -6
  628. package/dist/core/std/slots.d.ts.map +1 -1
  629. package/dist/core/std/types.d.ts +97 -60
  630. package/dist/core/std/types.d.ts.map +1 -1
  631. package/dist/core/std/values.d.ts +33 -14
  632. package/dist/core/std/values.d.ts.map +1 -1
  633. package/dist/core/std/warps.d.ts +221 -76
  634. package/dist/core/std/warps.d.ts.map +1 -1
  635. package/dist/core/std/wgsl.d.ts +115 -0
  636. package/dist/core/std/wgsl.d.ts.map +1 -0
  637. package/dist/core/std-ClftfWpF.js +218889 -0
  638. package/dist/core/{support-GJphyuEe.js → support-D3W86vgR.js} +11 -1
  639. package/dist/core/telemetry/index.js +1 -1
  640. package/dist/core/utilities/transformations/index.js +1 -1
  641. package/dist/js/bundle.js +182 -180
  642. package/dist/js/createShader.d.ts.map +1 -1
  643. package/dist/js/createShader.js +4 -3
  644. package/dist/js/types.d.ts +5 -0
  645. package/dist/js/types.d.ts.map +1 -1
  646. package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
  647. package/dist/js/utils/generatePresetCode.js +35 -22
  648. package/dist/react/CustomShader.js +178 -0
  649. package/dist/react/Preview.js +1 -0
  650. package/dist/react/Shader.js +1 -1
  651. package/dist/react/Sparkle.js +226 -0
  652. package/dist/react/bundle.js +178 -176
  653. package/dist/react/components/Sparkle.d.ts +41 -0
  654. package/dist/react/components/Sparkle.d.ts.map +1 -0
  655. package/dist/react/engine/CustomShader.d.ts +37 -0
  656. package/dist/react/engine/CustomShader.d.ts.map +1 -0
  657. package/dist/react/engine/Preview.d.ts.map +1 -1
  658. package/dist/react/index.d.ts +5 -0
  659. package/dist/react/index.d.ts.map +1 -1
  660. package/dist/react/index.js +4 -2
  661. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  662. package/dist/react/utils/generatePresetCode.js +35 -22
  663. package/dist/registry.js +310 -58
  664. package/dist/solid/components/Sparkle.d.ts +38 -0
  665. package/dist/solid/components/Sparkle.d.ts.map +1 -0
  666. package/dist/solid/components/Sparkle.js +232 -0
  667. package/dist/solid/engine/CustomShader.d.ts +35 -0
  668. package/dist/solid/engine/CustomShader.d.ts.map +1 -0
  669. package/dist/solid/engine/CustomShader.js +160 -0
  670. package/dist/solid/engine/Preview.d.ts.map +1 -1
  671. package/dist/solid/engine/Preview.js +319 -317
  672. package/dist/solid/engine/Shader.js +1 -1
  673. package/dist/solid/index.d.ts +5 -0
  674. package/dist/solid/index.d.ts.map +1 -1
  675. package/dist/solid/index.js +95 -86
  676. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  677. package/dist/solid/utils/generatePresetCode.js +35 -22
  678. package/dist/svelte/components/Sparkle.svelte.d.ts +28 -0
  679. package/dist/svelte/engine/CustomShader.svelte.d.ts +40 -0
  680. package/dist/svelte/index.d.ts +4 -0
  681. package/dist/svelte/index.js +1237 -877
  682. package/dist/svelte/source/components/Sparkle.svelte +352 -0
  683. package/dist/svelte/source/engine/CustomShader.svelte +216 -0
  684. package/dist/svelte/source/engine/Preview.svelte +5 -3
  685. package/dist/svelte/source/index.js +4 -0
  686. package/dist/svelte/utils/generatePresetCode.js +35 -22
  687. package/dist/vue/CustomShader.js +3 -0
  688. package/dist/vue/CustomShader.vue_vue_type_script_setup_true_lang.js +173 -0
  689. package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
  690. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  691. package/dist/vue/Sparkle.js +3 -0
  692. package/dist/vue/Sparkle.vue_vue_type_script_setup_true_lang.js +233 -0
  693. package/dist/vue/components/Sparkle.vue.d.ts +63 -0
  694. package/dist/vue/components/Sparkle.vue.d.ts.map +1 -0
  695. package/dist/vue/index.d.ts +4 -0
  696. package/dist/vue/index.d.ts.map +1 -1
  697. package/dist/vue/index.js +4 -2
  698. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  699. package/dist/vue/utils/generatePresetCode.js +35 -22
  700. package/package.json +27 -2
  701. package/dist/core/Irradiance-DtC4tqNu.js +0 -4191
  702. package/dist/core/LightEdge-BV9bO8YB.js +0 -2339
  703. package/dist/core/Repeater-DU_EhoxD.js +0 -762
  704. package/dist/core/Shatter-DYKKCVD8.js +0 -1479
  705. package/dist/core/Voxels-LEG0c9YC.js +0 -8547
  706. package/dist/core/agents-CdLlm-5E.js +0 -5357
  707. package/dist/core/agents-DZaZ4n9_.js +0 -15709
  708. package/dist/core/blur-CrEChFnm.js +0 -8015
  709. package/dist/core/blurs-D5a6ad3o.js +0 -1751
  710. package/dist/core/canvasRaster-DDBkrdY8.js +0 -80
  711. package/dist/core/color-CY5teMWa.js +0 -3619
  712. package/dist/core/compose-DNU_Ut36.js +0 -46
  713. package/dist/core/device-m0ud8-Fn.js +0 -10
  714. package/dist/core/feedback-yfT0pT6A.js +0 -46
  715. package/dist/core/fields-CXwmEUsd.js +0 -475
  716. package/dist/core/figures-BRYcB-p2.js +0 -48
  717. package/dist/core/filter-BrhpSs3Z.js +0 -23
  718. package/dist/core/fluids-CBhAiGAx.js +0 -226
  719. package/dist/core/fonts-BUXTd9qb.js +0 -59
  720. package/dist/core/frames-Clw8-BpA.js +0 -78
  721. package/dist/core/glass-DIEus1UY.js +0 -2532
  722. package/dist/core/gradientPaints-Cx2bT20T.js +0 -6564
  723. package/dist/core/gradients-C15o7_xy.js +0 -159
  724. package/dist/core/grids-Cv99xcJg.js +0 -151
  725. package/dist/core/lens-ChO_HVpe.js +0 -352
  726. package/dist/core/light-Bba_Pie_.js +0 -271
  727. package/dist/core/lightfields-D120ZvMt.js +0 -2255
  728. package/dist/core/lower-DtoDQ7hV.js +0 -49452
  729. package/dist/core/mask-6rnSCir2.js +0 -28
  730. package/dist/core/materials-BjsiWqS0.js +0 -2944
  731. package/dist/core/math-7PlusTFx.js +0 -56
  732. package/dist/core/media-CgWmWvGq.js +0 -832
  733. package/dist/core/mediaLifecycle-BTPb5i1-.js +0 -320
  734. package/dist/core/motionBlur-DzaHMq9p.js +0 -6766
  735. package/dist/core/noise-G7a5U0ar.js +0 -546
  736. package/dist/core/noisePaints-B_axPpuv.js +0 -3619
  737. package/dist/core/noiseStylize-CUrW_HiC.js +0 -65
  738. package/dist/core/overlay-W4DAsSzP.js +0 -4712
  739. package/dist/core/patterns-RTt6Fek8.js +0 -9723
  740. package/dist/core/pointerFields-Ch_-cbCV.js +0 -2339
  741. package/dist/core/porters-CQwDd2t4.js +0 -30201
  742. package/dist/core/reveal-dbBiS7gE.js +0 -1688
  743. package/dist/core/sdf3d-BMqCSSPB.js +0 -21082
  744. package/dist/core/shaderRegistry-Bs0XOv9A.js +0 -443
  745. package/dist/core/shape-B2CoDi6l.js +0 -20
  746. package/dist/core/shapePaints-7HrXeLYX.js +0 -3354
  747. package/dist/core/signal-emJuvOI3.js +0 -34
  748. package/dist/core/slots-BqIef2iV.js +0 -32
  749. package/dist/core/stylize-CiN0ZaMu.js +0 -4541
  750. package/dist/core/tone-CsRho9qb.js +0 -763
  751. package/dist/core/warpMaps-Dbuleg2M.js +0 -10773
  752. package/dist/core/warps-gIr3RmZV.js +0 -276
  753. /package/dist/core/{transformations-CzFmhZww.js → transformations-P50Uo_Ju.js} +0 -0
@@ -1,4712 +0,0 @@
1
- import { Ar as vec2u, Bn as TWO_PI$1, Br as struct, Cr as sin, Gn as typegpu_default, Jr as i32, Kn as textureDimensions, Lr as texture2d, Mr as vec4f, Ot as unpremultiplyAlpha, Rr as textureStorage2d, Tr as sqrt, Yn as textureStore, Yr as u32, _r as mix, ar as clamp, at as ZERO, er as select, fr as floor, gr as min, gt as formatFloat, hr as max, ht as Expr, lr as exp, or as cos, pr as fract, q as createGuardedCompute, qn as textureLoad, qr as f32, tr as abs } from "./lower-DtoDQ7hV.js";
2
- import { St as createFeedbackTrailSim } from "./porters-CQwDd2t4.js";
3
- import { t as createSwappableMediaTexture } from "./mediaLifecycle-BTPb5i1-.js";
4
- import { n as createFontDependentRaster, r as createRasterInvalidator, t as createCanvasRasterTarget } from "./canvasRaster-DDBkrdY8.js";
5
- import { n as loadGoogleFont } from "./fonts-BUXTd9qb.js";
6
- var L = formatFloat;
7
- function overPremul(dst, rgb, a) {
8
- return `{ let av = clamp(${a}, 0.0, 1.0); ${dst} = vec4f((${rgb}) * av + ${dst}.rgb * (1.0 - av), av + ${dst}.a * (1.0 - av)); }`;
9
- }
10
- function roundRectSD(names, opts) {
11
- const { q, sd } = names;
12
- const { pp, half, radius } = opts;
13
- if (radius === void 0) return [`let ${q} = abs(${pp}) - ${half};`, `let ${sd} = length(max(${q}, vec2f(0.0))) + min(max(${q}.x, ${q}.y), ${L(0)});`];
14
- return [`let ${q} = abs(${pp}) - ${half} + ${radius};`, `let ${sd} = length(max(${q}, vec2f(0.0))) + min(max(${q}.x, ${q}.y), ${L(0)}) - ${radius};`];
15
- }
16
- function cornerBracketMask(names, opts) {
17
- const { bl, inCorner } = names;
18
- const { blInit, px, py, hx, hy, stroke } = opts;
19
- return [
20
- `let ${bl} = ${blInit};`,
21
- `let ${inCorner} = abs(${px}) > ${hx} - ${bl} && abs(${py}) > ${hy} - ${bl};`,
22
- `${stroke} = ${stroke} * select(${L(0)}, ${L(1)}, ${inCorner});`
23
- ];
24
- }
25
- function straightFromPremul(dst) {
26
- return `vec4f(${dst}.rgb / max(${dst}.a, ${L(1e-4)}), ${dst}.a)`;
27
- }
28
- var ATLAS_GLYPHS = "0123456789x%";
29
- var ATLAS_SLOTS = 16;
30
- var ATLAS_CELL_W = 64;
31
- var ATLAS_CELL_H = 96;
32
- var ATLAS_W = ATLAS_SLOTS * ATLAS_CELL_W;
33
- var ATLAS_H = ATLAS_CELL_H;
34
- var WALK_SCAN = 3;
35
- var LEAF_SCAN = 4;
36
- var LUM = "vec3f(0.299, 0.587, 0.114)";
37
- var num$1 = (v, f) => typeof v === "number" ? v : f;
38
- function createGlyphStripAtlas(params, opts = {}) {
39
- const { getCpuValue } = params;
40
- const glyphTex = createSwappableMediaTexture(params, {
41
- label: opts.label ?? "GlyphStrip:atlas",
42
- initial: {
43
- width: ATLAS_W,
44
- height: ATLAS_H
45
- }
46
- });
47
- const target = createCanvasRasterTarget(params, { contextAttributes: { willReadFrequently: true } });
48
- const readFont = () => ({
49
- family: String(getCpuValue(opts.familyProp ?? "fontFamily") ?? "Inter"),
50
- weight: num$1(getCpuValue(opts.weightProp ?? "fontWeight"), 500)
51
- });
52
- const build = (family, weight) => {
53
- if (glyphTex.disposed) return;
54
- const c = target.canvas() ? target.context() : target.resize(ATLAS_W, ATLAS_H);
55
- if (!c) return;
56
- c.clearRect(0, 0, ATLAS_W, ATLAS_H);
57
- c.fillStyle = "#ffffff";
58
- c.font = `${weight} ${Math.round(ATLAS_CELL_H * .62)}px "${family}", ui-monospace, monospace`;
59
- c.textAlign = "center";
60
- c.textBaseline = "middle";
61
- const glyphs = opts.glyphs ?? ATLAS_GLYPHS;
62
- for (let i = 0; i < glyphs.length; i++) c.fillText(glyphs[i], i * ATLAS_CELL_W + ATLAS_CELL_W / 2, ATLAS_CELL_H / 2 + 1);
63
- glyphTex.write(target.canvas());
64
- };
65
- const fp0 = readFont();
66
- build(fp0.family, fp0.weight);
67
- const rebuild = () => {
68
- const fp = readFont();
69
- build(fp.family, fp.weight);
70
- };
71
- const font = createFontDependentRaster({
72
- key: () => {
73
- const fp = readFont();
74
- return `${fp.family}|${fp.weight}`;
75
- },
76
- load: () => {
77
- const fp = readFont();
78
- return loadGoogleFont(fp.family, fp.weight);
79
- },
80
- onLoaded: rebuild
81
- });
82
- setTimeout(() => font.ensure(), 0);
83
- createRasterInvalidator(params, {
84
- initialKey: `${fp0.family}|${fp0.weight}`,
85
- minIntervalMs: 100,
86
- key: () => {
87
- const fp = readFont();
88
- return `${fp.family}|${fp.weight}`;
89
- },
90
- run: () => {
91
- rebuild();
92
- font.ensure();
93
- }
94
- });
95
- return glyphTex.kit;
96
- }
97
- function contentPredicate(f, sVar, uVar) {
98
- const { p, L: L$1, modeStr } = f;
99
- if (modeStr === "alpha") return `${sVar}.a > ${p}_thr`;
100
- if (modeStr === "bright") return `dot(${uVar}.rgb, ${LUM}) > ${p}_thr && ${sVar}.a > ${L$1(.02)}`;
101
- if (modeStr === "dark") return `dot(${uVar}.rgb, ${LUM}) < ${p}_thr && ${sVar}.a > ${L$1(.5)}`;
102
- if (modeStr === "red") return `${uVar}.r > ${p}_thr && ${uVar}.r >= ${uVar}.g && ${uVar}.r >= ${uVar}.b && ${sVar}.a > ${L$1(.02)}`;
103
- if (modeStr === "green") return `${uVar}.g > ${p}_thr && ${uVar}.g >= ${uVar}.r && ${uVar}.g >= ${uVar}.b && ${sVar}.a > ${L$1(.02)}`;
104
- return `${uVar}.b > ${p}_thr && ${uVar}.b >= ${uVar}.r && ${uVar}.b >= ${uVar}.g && ${sVar}.a > ${L$1(.02)}`;
105
- }
106
- function cellScanStmts(f, sfx, originX, originY, sizeV, N, wantBounds) {
107
- const { p, L: L$1, s, sampleChild, UN, modeStr } = f;
108
- s.push(`var ${sfx}_cnt = ${L$1(0)};`);
109
- if (wantBounds) s.push(`var ${sfx}_minX = ${L$1(1e9)}; var ${sfx}_maxX = ${L$1(-1e9)}; var ${sfx}_minY = ${L$1(1e9)}; var ${sfx}_maxY = ${L$1(-1e9)};`);
110
- const inv = 1 / N;
111
- let k = 0;
112
- for (let sy = 0; sy < N; sy++) for (let sx = 0; sx < N; sx++) {
113
- const pxX = `${sfx}_px${k}x`;
114
- const pxY = `${sfx}_px${k}y`;
115
- s.push(`let ${pxX} = ${originX} + ${sizeV} * ${L$1((sx + .5) * inv)};`);
116
- s.push(`let ${pxY} = ${originY} + ${sizeV} * ${L$1((sy + .5) * inv)};`);
117
- s.push(`let ${sfx}_s${k} = ${sampleChild(`vec2f(${pxX}, ${pxY}) / ${p}_res`)};`);
118
- if (modeStr !== "alpha") s.push(`let ${sfx}_u${k} = ${UN}(${sfx}_s${k});`);
119
- s.push(`let ${sfx}_c${k} = ${contentPredicate(f, `${sfx}_s${k}`, `${sfx}_u${k}`)};`);
120
- s.push(`${sfx}_cnt = ${sfx}_cnt + select(${L$1(0)}, ${L$1(1)}, ${sfx}_c${k});`);
121
- if (wantBounds) {
122
- s.push(`${sfx}_minX = select(${sfx}_minX, min(${sfx}_minX, ${pxX}), ${sfx}_c${k});`);
123
- s.push(`${sfx}_maxX = select(${sfx}_maxX, max(${sfx}_maxX, ${pxX}), ${sfx}_c${k});`);
124
- s.push(`${sfx}_minY = select(${sfx}_minY, min(${sfx}_minY, ${pxY}), ${sfx}_c${k});`);
125
- s.push(`${sfx}_maxY = select(${sfx}_maxY, max(${sfx}_maxY, ${pxY}), ${sfx}_c${k});`);
126
- }
127
- k++;
128
- }
129
- s.push(`let ${sfx}_coverage = ${sfx}_cnt / ${L$1(N * N)};`);
130
- }
131
- function partitionWalkStmts(f, layoutStr, D) {
132
- const { p, L: L$1, s } = f;
133
- s.push(`var ${p}_origin = floor(${p}_fragPx / ${p}_cellPx) * ${p}_cellPx;`);
134
- s.push(`var ${p}_size = ${p}_cellPx;`);
135
- for (let lvl = 0; lvl < D; lvl++) {
136
- const sfx = `${p}_w${lvl}`;
137
- if (layoutStr === "mosaic") {
138
- s.push(`let ${sfx}_cellIx = ${p}_origin / ${p}_size;`);
139
- s.push(`let ${sfx}_doSplit = fract(sin(dot(${sfx}_cellIx, vec2f(${L$1(127.1)}, ${L$1(311.7)})) + ${L$1(lvl * 53.13)}) * ${L$1(43758.5453)}) > ${L$1(.5)};`);
140
- } else {
141
- cellScanStmts(f, sfx, `${p}_origin.x`, `${p}_origin.y`, `${p}_size`, WALK_SCAN, false);
142
- s.push(`let ${sfx}_doSplit = ${sfx}_coverage > ${L$1(.02)} && ${sfx}_coverage < ${L$1(.98)};`);
143
- }
144
- s.push(`let ${sfx}_half = ${p}_size * ${L$1(.5)};`);
145
- s.push(`let ${sfx}_qx = step(${p}_origin.x + ${sfx}_half, ${p}_fragPx.x);`);
146
- s.push(`let ${sfx}_qy = step(${p}_origin.y + ${sfx}_half, ${p}_fragPx.y);`);
147
- s.push(`let ${sfx}_childOrigin = vec2f(${p}_origin.x + ${sfx}_qx * ${sfx}_half, ${p}_origin.y + ${sfx}_qy * ${sfx}_half);`);
148
- s.push(`${p}_origin = select(${p}_origin, ${sfx}_childOrigin, ${sfx}_doSplit);`);
149
- s.push(`${p}_size = select(${p}_size, ${sfx}_half, ${sfx}_doSplit);`);
150
- }
151
- }
152
- function contentBBoxStmts(f) {
153
- const { p, L: L$1, s } = f;
154
- cellScanStmts(f, `${p}_leaf`, `${p}_origin.x`, `${p}_origin.y`, `${p}_size`, LEAF_SCAN, true);
155
- s.push(`let ${p}_halfStep = ${p}_size / ${L$1(LEAF_SCAN)} * ${L$1(.5)};`);
156
- s.push(`let ${p}_innerMinX = ${p}_origin.x + ${p}_boxInset;`);
157
- s.push(`let ${p}_innerMaxX = max(${p}_origin.x + ${p}_size - ${p}_boxInset, ${p}_innerMinX);`);
158
- s.push(`let ${p}_innerMinY = ${p}_origin.y + ${p}_boxInset;`);
159
- s.push(`let ${p}_innerMaxY = max(${p}_origin.y + ${p}_size - ${p}_boxInset, ${p}_innerMinY);`);
160
- s.push(`let ${p}_bMinX = clamp(${p}_leaf_minX - ${p}_halfStep, ${p}_innerMinX, ${p}_innerMaxX);`);
161
- s.push(`let ${p}_bMaxX = clamp(${p}_leaf_maxX + ${p}_halfStep, ${p}_innerMinX, ${p}_innerMaxX);`);
162
- s.push(`let ${p}_bMinY = clamp(${p}_leaf_minY - ${p}_halfStep, ${p}_innerMinY, ${p}_innerMaxY);`);
163
- s.push(`let ${p}_bMaxY = clamp(${p}_leaf_maxY + ${p}_halfStep, ${p}_innerMinY, ${p}_innerMaxY);`);
164
- s.push(`let ${p}_boxW = ${p}_bMaxX - ${p}_bMinX;`);
165
- s.push(`let ${p}_boxH = ${p}_bMaxY - ${p}_bMinY;`);
166
- s.push(`let ${p}_detected = ${p}_leaf_coverage > ${L$1(.02)} && ${p}_boxW > ${p}_minSize && ${p}_boxH > ${p}_minSize;`);
167
- s.push(`let ${p}_detF = select(${L$1(0)}, ${L$1(1)}, ${p}_detected);`);
168
- }
169
- function detectionBoxStmts(f, cornerStyle) {
170
- const { p, U, L: L$1, s } = f;
171
- s.push(`let ${p}_center = vec2f((${p}_bMinX + ${p}_bMaxX) * ${L$1(.5)}, (${p}_bMinY + ${p}_bMaxY) * ${L$1(.5)});`);
172
- s.push(`let ${p}_halfB = vec2f(${p}_boxW * ${L$1(.5)}, ${p}_boxH * ${L$1(.5)});`);
173
- const cRExpr = cornerStyle ? L$1(0) : `${p}_cornerRadiusPx`;
174
- s.push(`let ${p}_cR = max(min(min(${cRExpr}, ${p}_halfB.x), ${p}_halfB.y), ${L$1(0)});`);
175
- s.push(`let ${p}_pp = ${p}_fragPx - ${p}_center;`);
176
- s.push(...roundRectSD({
177
- q: `${p}_q`,
178
- sd: `${p}_sd`
179
- }, {
180
- pp: `${p}_pp`,
181
- half: `${p}_halfB`,
182
- radius: `${p}_cR`
183
- }));
184
- s.push(`let ${p}_fillA = (${L$1(1)} - smoothstep(${L$1(0)}, ${p}_aa, ${p}_sd)) * ${U("fillColor")}.a * ${p}_detF;`);
185
- s.push(`var ${p}_strokeA = ${L$1(1)} - smoothstep(${L$1(0)}, ${p}_aa, abs(${p}_sd) - ${p}_lineHalf);`);
186
- if (cornerStyle) s.push(...cornerBracketMask({
187
- bl: `${p}_bl`,
188
- inCorner: `${p}_inCorner`
189
- }, {
190
- blInit: `min(${p}_halfB.x, ${p}_halfB.y) * ${L$1(.35)}`,
191
- px: `${p}_pp.x`,
192
- py: `${p}_pp.y`,
193
- hx: `${p}_halfB.x`,
194
- hy: `${p}_halfB.y`,
195
- stroke: `${p}_strokeA`
196
- }));
197
- s.push(`${p}_strokeA = ${p}_strokeA * ${U("strokeColor")}.a * ${p}_detF;`);
198
- s.push(overPremul(`${p}_dst`, `${U("fillColor")}.rgb`, `${p}_fillA`));
199
- s.push(overPremul(`${p}_dst`, `${U("strokeColor")}.rgb`, `${p}_strokeA`));
200
- }
201
- const digitsOf = (L$1, v) => `(${L$1(1)} + step(${L$1(10)}, ${v}) + step(${L$1(100)}, ${v}) + step(${L$1(1e3)}, ${v}) + step(${L$1(1e4)}, ${v}))`;
202
- const digitAt = (L$1, v, e) => {
203
- const x = `floor(${v} / pow(${L$1(10)}, ${e}))`;
204
- return `(${x} - ${L$1(10)} * floor((${x}) / ${L$1(10)}))`;
205
- };
206
- function glyphPillLabelStmts(f, opts) {
207
- const { p, U, L: L$1, s } = f;
208
- const { labelStr, labelPos, atlasKey } = opts;
209
- s.push(`let ${p}_textH = max(${U("fontSize")} * ${p}_res.y, ${L$1(1)});`);
210
- s.push(`let ${p}_glyphW = ${p}_textH * ${L$1(ATLAS_CELL_W / ATLAS_CELL_H)};`);
211
- s.push(`let ${p}_advance = ${p}_glyphW + ${p}_textH * ${U("letterSpacing")};`);
212
- s.push(`let ${p}_padX = ${p}_textH * ${L$1(.38)};`);
213
- s.push(`let ${p}_padY = ${p}_textH * ${L$1(.24)};`);
214
- s.push(`let ${p}_gap = ${p}_textH * ${L$1(.28)};`);
215
- if (labelStr === "dimensions") {
216
- s.push(`let ${p}_w = clamp(floor(${p}_boxW + ${L$1(.5)}), ${L$1(1)}, ${L$1(99999)});`);
217
- s.push(`let ${p}_h = clamp(floor(${p}_boxH + ${L$1(.5)}), ${L$1(1)}, ${L$1(99999)});`);
218
- s.push(`let ${p}_dw = ${digitsOf(L$1, `${p}_w`)};`);
219
- s.push(`let ${p}_dh = ${digitsOf(L$1, `${p}_h`)};`);
220
- s.push(`let ${p}_total = ${p}_dw + ${L$1(1)} + ${p}_dh;`);
221
- } else {
222
- s.push(`let ${p}_pc = clamp(floor(${p}_leaf_coverage * ${L$1(100)} + ${L$1(.5)}), ${L$1(0)}, ${L$1(100)});`);
223
- s.push(`let ${p}_dp = ${digitsOf(L$1, `${p}_pc`)};`);
224
- s.push(`let ${p}_total = ${p}_dp + ${L$1(1)};`);
225
- }
226
- s.push(`let ${p}_labelW = ${p}_total * ${p}_advance + ${p}_padX * ${L$1(2)};`);
227
- s.push(`let ${p}_labelH = ${p}_textH + ${p}_padY * ${L$1(2)};`);
228
- const isRight = labelPos === 1 || labelPos === 3;
229
- const isTop = labelPos === 2 || labelPos === 3;
230
- s.push(`let ${p}_inset = ${U("labelInset")} > ${L$1(.5)};`);
231
- const leftIn = isRight ? `${p}_bMaxX - ${p}_labelW - ${p}_gap` : `${p}_bMinX + ${p}_gap`;
232
- const leftOut = isRight ? `${p}_bMaxX - ${p}_labelW` : `${p}_bMinX`;
233
- s.push(`var ${p}_labelLeft = select(${leftOut}, ${leftIn}, ${p}_inset);`);
234
- const topIn = isTop ? `${p}_bMinY + ${p}_gap` : `${p}_bMaxY - ${p}_labelH - ${p}_gap`;
235
- const topOut = isTop ? `${p}_bMinY - ${p}_labelH - ${p}_gap` : `${p}_bMaxY + ${p}_gap`;
236
- s.push(`var ${p}_labelTop = select(${topOut}, ${topIn}, ${p}_inset);`);
237
- s.push(`let ${p}_cellMaxX = ${p}_origin.x + ${p}_size;`);
238
- s.push(`let ${p}_cellMaxY = ${p}_origin.y + ${p}_size;`);
239
- s.push(`${p}_labelLeft = clamp(${p}_labelLeft, ${p}_origin.x, max(${p}_cellMaxX - ${p}_labelW, ${p}_origin.x));`);
240
- s.push(`${p}_labelTop = clamp(${p}_labelTop, ${p}_origin.y, max(${p}_cellMaxY - ${p}_labelH, ${p}_origin.y));`);
241
- s.push(`let ${p}_labelCenter = vec2f(${p}_labelLeft + ${p}_labelW * ${L$1(.5)}, ${p}_labelTop + ${p}_labelH * ${L$1(.5)});`);
242
- s.push(`let ${p}_pillHalf = vec2f(${p}_labelW * ${L$1(.5)}, ${p}_labelH * ${L$1(.5)});`);
243
- s.push(`let ${p}_pillR = max(min(min(${U("labelRadius")} * ${p}_scaleFactor, ${p}_pillHalf.x), ${p}_pillHalf.y), ${L$1(0)});`);
244
- s.push(`let ${p}_pillP = ${p}_fragPx - ${p}_labelCenter;`);
245
- s.push(...roundRectSD({
246
- q: `${p}_pillQ`,
247
- sd: `${p}_pillSD`
248
- }, {
249
- pp: `${p}_pillP`,
250
- half: `${p}_pillHalf`,
251
- radius: `${p}_pillR`
252
- }));
253
- s.push(`let ${p}_pillA = (${L$1(1)} - smoothstep(${L$1(0)}, ${p}_aa, ${p}_pillSD)) * ${U("labelBackgroundColor")}.a * ${p}_detF;`);
254
- s.push(overPremul(`${p}_dst`, `${U("labelBackgroundColor")}.rgb`, `${p}_pillA`));
255
- s.push(`let ${p}_rel = ${p}_fragPx.x - ${p}_labelLeft - ${p}_padX;`);
256
- s.push(`let ${p}_slot = floor(${p}_rel / ${p}_advance);`);
257
- s.push(`let ${p}_within = fract(${p}_rel / ${p}_advance);`);
258
- s.push(`let ${p}_uInChar = ${p}_within * (${p}_advance / ${p}_glyphW);`);
259
- s.push(`let ${p}_vInChar = (${p}_fragPx.y - ${p}_labelTop - ${p}_padY) / ${p}_textH;`);
260
- if (labelStr === "dimensions") {
261
- s.push(`let ${p}_wDigit = ${digitAt(L$1, `${p}_w`, `${p}_dw - ${L$1(1)} - ${p}_slot`)};`);
262
- s.push(`let ${p}_hDigit = ${digitAt(L$1, `${p}_h`, `${p}_dh + ${p}_dw - ${p}_slot`)};`);
263
- s.push(`var ${p}_g = ${p}_hDigit;`);
264
- s.push(`${p}_g = select(${p}_g, ${L$1(10)}, ${p}_slot == ${p}_dw);`);
265
- s.push(`${p}_g = select(${p}_g, ${p}_wDigit, ${p}_slot < ${p}_dw);`);
266
- } else s.push(`var ${p}_g = select(${L$1(11)}, ${digitAt(L$1, `${p}_pc`, `${p}_dp - ${L$1(1)} - ${p}_slot`)}, ${p}_slot < ${p}_dp);`);
267
- s.push(`let ${p}_atlasU = (${p}_g + clamp(${p}_uInChar, ${L$1(0)}, ${L$1(1)})) / ${L$1(ATLAS_SLOTS)};`);
268
- s.push(`let ${p}_glyphCov = textureSampleLevel(tex.$.${atlasKey}, samp.$.linearClamp, vec2f(${p}_atlasU, ${p}_vInChar), 0.0).a;`);
269
- s.push(`let ${p}_inText = ${p}_rel >= ${L$1(0)} && ${p}_slot >= ${L$1(0)} && ${p}_slot < ${p}_total && ${p}_uInChar <= ${L$1(1)} && ${p}_vInChar >= ${L$1(0)} && ${p}_vInChar <= ${L$1(1)};`);
270
- s.push(`let ${p}_textA = ${p}_glyphCov * select(${L$1(0)}, ${L$1(1)}, ${p}_inText) * ${U("labelColor")}.a * ${p}_detF;`);
271
- s.push(overPremul(`${p}_dst`, `${U("labelColor")}.rgb`, `${p}_textA`));
272
- }
273
- const diamondStamp = (f) => {
274
- const { p, U, L: L$1, s } = f;
275
- s.push(`let dsz = ${p}_ms * ${L$1(.16)};`);
276
- s.push(`let dSd = (abs(dp.x) + abs(dp.y)) * ${L$1(.7071)} - dsz;`);
277
- s.push(overPremul(`${p}_dst`, `${U("keyframeColor")}.rgb`, `(${L$1(1)} - smoothstep(${L$1(0)}, ${p}_aa, dSd)) * ${U("keyframeColor")}.a * fade * ${U("trail")}`));
278
- };
279
- function pathSegmentStamp(every) {
280
- return (f) => {
281
- const { p, U, L: L$1, s } = f;
282
- s.push(`let validP = select(${L$1(0)}, ${L$1(1)}, abs(ePrev.w - mta.z) < ${L$1(.5)}) * select(${L$1(0)}, ${L$1(1)}, ePrev.z > ${L$1(.5)});`);
283
- s.push(`let stampGap = abs(e.z - ePrev.z);`);
284
- s.push(`let contiguous = select(${L$1(0)}, ${L$1(1)}, stampGap < ${L$1(every * 1.5)});`);
285
- s.push(`let epp = vec2f(ePrev.x * ${p}_res.x, ePrev.y * ${p}_res.y);`);
286
- s.push(`let pa = ${p}_px - epp; let ba = ep - epp;`);
287
- s.push(`let h = clamp(dot(pa, ba) / max(dot(ba, ba), ${L$1(1e-4)}), ${L$1(0)}, ${L$1(1)});`);
288
- s.push(`let segD = length(pa - ba * h);`);
289
- s.push(overPremul(`${p}_dst`, `${U("pathColor")}.rgb`, `(${L$1(1)} - smoothstep(${p}_lw * ${L$1(.4)}, ${p}_lw * ${L$1(.4)} + ${p}_aa, segD)) * ${U("pathColor")}.a * fade * validP * contiguous * ${U("trail")} * ${L$1(.8)}`));
290
- };
291
- }
292
- function ringTrailStmts(f, slots) {
293
- const { p, U, L: L$1, s } = f;
294
- const maxAge = slots.len * slots.every;
295
- s.push(`if (${U("trail")} > ${L$1(.001)}) {`);
296
- s.push(`var ePrev = ${slots.load(`${2 + slots.len - 1}u`)};`);
297
- s.push(`for (var j = 0u; j < ${slots.len}u; j = j + 1u) {`);
298
- s.push(`let e = ${slots.load("2u + j")};`);
299
- s.push(`let valid = select(${L$1(0)}, ${L$1(1)}, abs(e.w - mta.z) < ${L$1(.5)}) * select(${L$1(0)}, ${L$1(1)}, e.z > ${L$1(.5)});`);
300
- s.push(`let age = head.z - e.z;`);
301
- s.push(`let fade = clamp(${L$1(1)} - age / ${L$1(maxAge)}, ${L$1(0)}, ${L$1(1)}) * valid;`);
302
- s.push(`let ep = vec2f(e.x * ${p}_res.x, e.y * ${p}_res.y);`);
303
- s.push(`let dp = ${p}_px - ep;`);
304
- for (const stage of slots.stages) stage(f);
305
- s.push(`ePrev = e;`);
306
- s.push(`}`);
307
- s.push(`}`);
308
- }
309
- const bracketGizmo = (f) => {
310
- const { p, U, L: L$1, s } = f;
311
- s.push(`let gp = ${p}_px - tp;`);
312
- s.push(`let hlf = ${p}_ms * ${L$1(.5)};`);
313
- s.push(...roundRectSD({
314
- q: `q`,
315
- sd: `boxSd`
316
- }, {
317
- pp: `gp`,
318
- half: `vec2f(hlf)`
319
- }));
320
- s.push(`var strokeA = ${L$1(1)} - smoothstep(${L$1(0)}, ${p}_aa, abs(boxSd) - ${p}_lw * ${L$1(.5)});`);
321
- s.push(...cornerBracketMask({
322
- bl: `bl`,
323
- inCorner: `inCorner`
324
- }, {
325
- blInit: `hlf * ${L$1(.45)}`,
326
- px: `gp.x`,
327
- py: `gp.y`,
328
- hx: `hlf`,
329
- hy: `hlf`,
330
- stroke: `strokeA`
331
- }));
332
- s.push(overPremul(`${p}_dst`, `${U("markerColor")}.rgb`, `strokeA * ${U("markerColor")}.a * searching`));
333
- s.push(`let tick = hlf * ${L$1(.55)};`);
334
- s.push(`let chH = ${L$1(1)} - smoothstep(${L$1(0)}, ${p}_aa, max(abs(gp.y) - ${p}_lw * ${L$1(.5)}, abs(gp.x) - tick));`);
335
- s.push(`let chV = ${L$1(1)} - smoothstep(${L$1(0)}, ${p}_aa, max(abs(gp.x) - ${p}_lw * ${L$1(.5)}, abs(gp.y) - tick));`);
336
- s.push(overPremul(`${p}_dst`, `${U("markerColor")}.rgb`, `max(chH, chV) * ${L$1(.55)} * ${U("markerColor")}.a * searching`));
337
- s.push(overPremul(`${p}_dst`, `vec3f(1.0, 1.0, 1.0)`, `(${L$1(1)} - smoothstep(${p}_lw, ${p}_lw + ${p}_aa, length(gp))) * searching`));
338
- };
339
- var MAX_TRACKERS = 64;
340
- var TRAIL_LEN = 12;
341
- var TRAIL_EVERY = 8;
342
- var AABB_COL = 14;
343
- var STATE_W = AABB_COL + 1;
344
- var STATE_FORMAT = "rgba32float";
345
- var FEAT_GRID = 96;
346
- var TWO_PI = TWO_PI$1;
347
- var TrackParams = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(struct({
348
- dt: f32,
349
- trackersF: f32,
350
- agility: f32,
351
- threshold: f32,
352
- variance: f32,
353
- lifespan: f32
354
- }), "TrackParams");
355
- var featureLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
356
- src: { texture: texture2d(f32) },
357
- grid: { storageTexture: textureStorage2d(STATE_FORMAT, "write-only") },
358
- params: { uniform: TrackParams }
359
- }), "featureLayout");
360
- var trackLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
361
- src: { texture: texture2d(f32) },
362
- featGrid: {
363
- texture: texture2d(f32),
364
- sampleType: "unfilterable-float"
365
- },
366
- prev: {
367
- texture: texture2d(f32),
368
- sampleType: "unfilterable-float"
369
- },
370
- next: { storageTexture: textureStorage2d(STATE_FORMAT, "write-only") },
371
- present: { storageTexture: textureStorage2d(STATE_FORMAT, "write-only") },
372
- params: { uniform: TrackParams }
373
- }), "trackLayout");
374
- const trackHash = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.fn([f32], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((x) => {
375
- "use gpu";
376
- return fract(__tsover_mul(sin(x), 43758.5453123));
377
- }), {
378
- v: 2,
379
- name: void 0,
380
- ast: {
381
- "params": [{
382
- "type": "i",
383
- "name": "x"
384
- }],
385
- "body": [0, [[10, [
386
- 6,
387
- "std.fract",
388
- [[
389
- 1,
390
- [
391
- 6,
392
- "std.sin",
393
- ["x"]
394
- ],
395
- "*",
396
- [5, "43758.5453123"]
397
- ]]
398
- ]]]]
399
- },
400
- externals: {
401
- "std.fract": () => fract,
402
- "std.sin": () => sin
403
- }
404
- }) && $.f)({})), "trackHash");
405
- function featureScoreFn(mode) {
406
- return typegpu_default.fn([vec4f], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((c) => {
407
- "use gpu";
408
- const a = max(c.w, 1e-4);
409
- const lumaU = clamp(__tsover_div(__tsover_add(__tsover_add(__tsover_mul(c.x, .299), __tsover_mul(c.y, .587)), __tsover_mul(c.z, .114)), a), 0, 1);
410
- let score = f32(0);
411
- if (mode === "alpha") score = c.w;
412
- else if (mode === "dark") score = __tsover_mul(__tsover_sub(1, lumaU), select(f32(0), f32(1), c.w > .5));
413
- else if (mode === "red") score = __tsover_mul(__tsover_mul(__tsover_mul(clamp(__tsover_div(c.x, a), 0, 1), select(f32(0), f32(1), c.x >= c.y)), select(f32(0), f32(1), c.x >= c.z)), select(f32(0), f32(1), c.w > .02));
414
- else if (mode === "green") score = __tsover_mul(__tsover_mul(__tsover_mul(clamp(__tsover_div(c.y, a), 0, 1), select(f32(0), f32(1), c.y >= c.x)), select(f32(0), f32(1), c.y >= c.z)), select(f32(0), f32(1), c.w > .02));
415
- else if (mode === "blue") score = __tsover_mul(__tsover_mul(__tsover_mul(clamp(__tsover_div(c.z, a), 0, 1), select(f32(0), f32(1), c.z >= c.x)), select(f32(0), f32(1), c.z >= c.y)), select(f32(0), f32(1), c.w > .02));
416
- else score = __tsover_mul(lumaU, select(f32(0), f32(1), c.w > .02));
417
- return score;
418
- }), {
419
- v: 2,
420
- name: void 0,
421
- ast: {
422
- "params": [{
423
- "type": "i",
424
- "name": "c"
425
- }],
426
- "body": [0, [
427
- [
428
- 13,
429
- "a",
430
- [
431
- 6,
432
- "std.max",
433
- [[
434
- 7,
435
- "c",
436
- "w"
437
- ], [5, "0.0001"]]
438
- ]
439
- ],
440
- [
441
- 13,
442
- "lumaU",
443
- [
444
- 6,
445
- "std.clamp",
446
- [
447
- [
448
- 1,
449
- [
450
- 1,
451
- [
452
- 1,
453
- [
454
- 1,
455
- [
456
- 7,
457
- "c",
458
- "x"
459
- ],
460
- "*",
461
- [5, "0.299"]
462
- ],
463
- "+",
464
- [
465
- 1,
466
- [
467
- 7,
468
- "c",
469
- "y"
470
- ],
471
- "*",
472
- [5, "0.587"]
473
- ]
474
- ],
475
- "+",
476
- [
477
- 1,
478
- [
479
- 7,
480
- "c",
481
- "z"
482
- ],
483
- "*",
484
- [5, "0.114"]
485
- ]
486
- ],
487
- "/",
488
- "a"
489
- ],
490
- [5, "0"],
491
- [5, "1"]
492
- ]
493
- ]
494
- ],
495
- [
496
- 12,
497
- "score",
498
- [
499
- 6,
500
- "d.f32",
501
- [[5, "0"]]
502
- ]
503
- ],
504
- [
505
- 11,
506
- [
507
- 1,
508
- "mode",
509
- "===",
510
- [103, "alpha"]
511
- ],
512
- [
513
- 2,
514
- "score",
515
- "=",
516
- [
517
- 7,
518
- "c",
519
- "w"
520
- ]
521
- ],
522
- [
523
- 11,
524
- [
525
- 1,
526
- "mode",
527
- "===",
528
- [103, "dark"]
529
- ],
530
- [
531
- 2,
532
- "score",
533
- "=",
534
- [
535
- 1,
536
- [
537
- 1,
538
- [5, "1"],
539
- "-",
540
- "lumaU"
541
- ],
542
- "*",
543
- [
544
- 6,
545
- "std.select",
546
- [
547
- [
548
- 6,
549
- "d.f32",
550
- [[5, "0"]]
551
- ],
552
- [
553
- 6,
554
- "d.f32",
555
- [[5, "1"]]
556
- ],
557
- [
558
- 1,
559
- [
560
- 7,
561
- "c",
562
- "w"
563
- ],
564
- ">",
565
- [5, "0.5"]
566
- ]
567
- ]
568
- ]
569
- ]
570
- ],
571
- [
572
- 11,
573
- [
574
- 1,
575
- "mode",
576
- "===",
577
- [103, "red"]
578
- ],
579
- [
580
- 2,
581
- "score",
582
- "=",
583
- [
584
- 1,
585
- [
586
- 1,
587
- [
588
- 1,
589
- [
590
- 6,
591
- "std.clamp",
592
- [
593
- [
594
- 1,
595
- [
596
- 7,
597
- "c",
598
- "x"
599
- ],
600
- "/",
601
- "a"
602
- ],
603
- [5, "0"],
604
- [5, "1"]
605
- ]
606
- ],
607
- "*",
608
- [
609
- 6,
610
- "std.select",
611
- [
612
- [
613
- 6,
614
- "d.f32",
615
- [[5, "0"]]
616
- ],
617
- [
618
- 6,
619
- "d.f32",
620
- [[5, "1"]]
621
- ],
622
- [
623
- 1,
624
- [
625
- 7,
626
- "c",
627
- "x"
628
- ],
629
- ">=",
630
- [
631
- 7,
632
- "c",
633
- "y"
634
- ]
635
- ]
636
- ]
637
- ]
638
- ],
639
- "*",
640
- [
641
- 6,
642
- "std.select",
643
- [
644
- [
645
- 6,
646
- "d.f32",
647
- [[5, "0"]]
648
- ],
649
- [
650
- 6,
651
- "d.f32",
652
- [[5, "1"]]
653
- ],
654
- [
655
- 1,
656
- [
657
- 7,
658
- "c",
659
- "x"
660
- ],
661
- ">=",
662
- [
663
- 7,
664
- "c",
665
- "z"
666
- ]
667
- ]
668
- ]
669
- ]
670
- ],
671
- "*",
672
- [
673
- 6,
674
- "std.select",
675
- [
676
- [
677
- 6,
678
- "d.f32",
679
- [[5, "0"]]
680
- ],
681
- [
682
- 6,
683
- "d.f32",
684
- [[5, "1"]]
685
- ],
686
- [
687
- 1,
688
- [
689
- 7,
690
- "c",
691
- "w"
692
- ],
693
- ">",
694
- [5, "0.02"]
695
- ]
696
- ]
697
- ]
698
- ]
699
- ],
700
- [
701
- 11,
702
- [
703
- 1,
704
- "mode",
705
- "===",
706
- [103, "green"]
707
- ],
708
- [
709
- 2,
710
- "score",
711
- "=",
712
- [
713
- 1,
714
- [
715
- 1,
716
- [
717
- 1,
718
- [
719
- 6,
720
- "std.clamp",
721
- [
722
- [
723
- 1,
724
- [
725
- 7,
726
- "c",
727
- "y"
728
- ],
729
- "/",
730
- "a"
731
- ],
732
- [5, "0"],
733
- [5, "1"]
734
- ]
735
- ],
736
- "*",
737
- [
738
- 6,
739
- "std.select",
740
- [
741
- [
742
- 6,
743
- "d.f32",
744
- [[5, "0"]]
745
- ],
746
- [
747
- 6,
748
- "d.f32",
749
- [[5, "1"]]
750
- ],
751
- [
752
- 1,
753
- [
754
- 7,
755
- "c",
756
- "y"
757
- ],
758
- ">=",
759
- [
760
- 7,
761
- "c",
762
- "x"
763
- ]
764
- ]
765
- ]
766
- ]
767
- ],
768
- "*",
769
- [
770
- 6,
771
- "std.select",
772
- [
773
- [
774
- 6,
775
- "d.f32",
776
- [[5, "0"]]
777
- ],
778
- [
779
- 6,
780
- "d.f32",
781
- [[5, "1"]]
782
- ],
783
- [
784
- 1,
785
- [
786
- 7,
787
- "c",
788
- "y"
789
- ],
790
- ">=",
791
- [
792
- 7,
793
- "c",
794
- "z"
795
- ]
796
- ]
797
- ]
798
- ]
799
- ],
800
- "*",
801
- [
802
- 6,
803
- "std.select",
804
- [
805
- [
806
- 6,
807
- "d.f32",
808
- [[5, "0"]]
809
- ],
810
- [
811
- 6,
812
- "d.f32",
813
- [[5, "1"]]
814
- ],
815
- [
816
- 1,
817
- [
818
- 7,
819
- "c",
820
- "w"
821
- ],
822
- ">",
823
- [5, "0.02"]
824
- ]
825
- ]
826
- ]
827
- ]
828
- ],
829
- [
830
- 11,
831
- [
832
- 1,
833
- "mode",
834
- "===",
835
- [103, "blue"]
836
- ],
837
- [
838
- 2,
839
- "score",
840
- "=",
841
- [
842
- 1,
843
- [
844
- 1,
845
- [
846
- 1,
847
- [
848
- 6,
849
- "std.clamp",
850
- [
851
- [
852
- 1,
853
- [
854
- 7,
855
- "c",
856
- "z"
857
- ],
858
- "/",
859
- "a"
860
- ],
861
- [5, "0"],
862
- [5, "1"]
863
- ]
864
- ],
865
- "*",
866
- [
867
- 6,
868
- "std.select",
869
- [
870
- [
871
- 6,
872
- "d.f32",
873
- [[5, "0"]]
874
- ],
875
- [
876
- 6,
877
- "d.f32",
878
- [[5, "1"]]
879
- ],
880
- [
881
- 1,
882
- [
883
- 7,
884
- "c",
885
- "z"
886
- ],
887
- ">=",
888
- [
889
- 7,
890
- "c",
891
- "x"
892
- ]
893
- ]
894
- ]
895
- ]
896
- ],
897
- "*",
898
- [
899
- 6,
900
- "std.select",
901
- [
902
- [
903
- 6,
904
- "d.f32",
905
- [[5, "0"]]
906
- ],
907
- [
908
- 6,
909
- "d.f32",
910
- [[5, "1"]]
911
- ],
912
- [
913
- 1,
914
- [
915
- 7,
916
- "c",
917
- "z"
918
- ],
919
- ">=",
920
- [
921
- 7,
922
- "c",
923
- "y"
924
- ]
925
- ]
926
- ]
927
- ]
928
- ],
929
- "*",
930
- [
931
- 6,
932
- "std.select",
933
- [
934
- [
935
- 6,
936
- "d.f32",
937
- [[5, "0"]]
938
- ],
939
- [
940
- 6,
941
- "d.f32",
942
- [[5, "1"]]
943
- ],
944
- [
945
- 1,
946
- [
947
- 7,
948
- "c",
949
- "w"
950
- ],
951
- ">",
952
- [5, "0.02"]
953
- ]
954
- ]
955
- ]
956
- ]
957
- ],
958
- [
959
- 2,
960
- "score",
961
- "=",
962
- [
963
- 1,
964
- "lumaU",
965
- "*",
966
- [
967
- 6,
968
- "std.select",
969
- [
970
- [
971
- 6,
972
- "d.f32",
973
- [[5, "0"]]
974
- ],
975
- [
976
- 6,
977
- "d.f32",
978
- [[5, "1"]]
979
- ],
980
- [
981
- 1,
982
- [
983
- 7,
984
- "c",
985
- "w"
986
- ],
987
- ">",
988
- [5, "0.02"]
989
- ]
990
- ]
991
- ]
992
- ]
993
- ]
994
- ]
995
- ]
996
- ]
997
- ]
998
- ],
999
- [10, "score"]
1000
- ]]
1001
- },
1002
- externals: {
1003
- "std.max": () => max,
1004
- "std.clamp": () => clamp,
1005
- "d.f32": () => f32,
1006
- "mode": () => mode,
1007
- "std.select": () => select
1008
- }
1009
- }) && $.f)({})).$name(`featureScore_${mode}`);
1010
- }
1011
- function buildFeatureGridKernel(scoreFn) {
1012
- return typegpu_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((gx, gy) => {
1013
- "use gpu";
1014
- const srcDims = textureDimensions(featureLayout.$.src);
1015
- const srcW = f32(srcDims.x);
1016
- const srcH = f32(srcDims.y);
1017
- const g = f32(FEAT_GRID);
1018
- const cu = __tsover_div(__tsover_add(f32(gx), .5), g);
1019
- const cv = __tsover_div(__tsover_add(f32(gy), .5), g);
1020
- const q = __tsover_div(.25, g);
1021
- let score = f32(0);
1022
- for (let sy = 0; sy < 2; sy++) for (let sx = 0; sx < 2; sx++) {
1023
- const u = __tsover_add(cu, __tsover_mul(__tsover_mul(__tsover_sub(f32(sx), .5), 2), q));
1024
- const v = __tsover_add(cv, __tsover_mul(__tsover_mul(__tsover_sub(f32(sy), .5), 2), q));
1025
- const tx = u32(clamp(__tsover_mul(u, srcW), f32(0), __tsover_sub(srcW, 1)));
1026
- const ty = u32(clamp(__tsover_mul(v, srcH), f32(0), __tsover_sub(srcH, 1)));
1027
- score = max(score, scoreFn(textureLoad(featureLayout.$.src, vec2u(tx, ty), 0)));
1028
- }
1029
- textureStore(featureLayout.$.grid, vec2u(gx, gy), vec4f(score, 0, 0, 1));
1030
- }), {
1031
- v: 2,
1032
- name: void 0,
1033
- ast: {
1034
- "params": [{
1035
- "type": "i",
1036
- "name": "gx"
1037
- }, {
1038
- "type": "i",
1039
- "name": "gy"
1040
- }],
1041
- "body": [0, [
1042
- [
1043
- 13,
1044
- "srcDims",
1045
- [
1046
- 6,
1047
- "std.textureDimensions",
1048
- [[
1049
- 7,
1050
- [
1051
- 7,
1052
- "featureLayout",
1053
- "$"
1054
- ],
1055
- "src"
1056
- ]]
1057
- ]
1058
- ],
1059
- [
1060
- 13,
1061
- "srcW",
1062
- [
1063
- 6,
1064
- "d.f32",
1065
- [[
1066
- 7,
1067
- "srcDims",
1068
- "x"
1069
- ]]
1070
- ]
1071
- ],
1072
- [
1073
- 13,
1074
- "srcH",
1075
- [
1076
- 6,
1077
- "d.f32",
1078
- [[
1079
- 7,
1080
- "srcDims",
1081
- "y"
1082
- ]]
1083
- ]
1084
- ],
1085
- [
1086
- 13,
1087
- "g",
1088
- [
1089
- 6,
1090
- "d.f32",
1091
- ["FEAT_GRID"]
1092
- ]
1093
- ],
1094
- [
1095
- 13,
1096
- "cu",
1097
- [
1098
- 1,
1099
- [
1100
- 1,
1101
- [
1102
- 6,
1103
- "d.f32",
1104
- ["gx"]
1105
- ],
1106
- "+",
1107
- [5, "0.5"]
1108
- ],
1109
- "/",
1110
- "g"
1111
- ]
1112
- ],
1113
- [
1114
- 13,
1115
- "cv",
1116
- [
1117
- 1,
1118
- [
1119
- 1,
1120
- [
1121
- 6,
1122
- "d.f32",
1123
- ["gy"]
1124
- ],
1125
- "+",
1126
- [5, "0.5"]
1127
- ],
1128
- "/",
1129
- "g"
1130
- ]
1131
- ],
1132
- [
1133
- 13,
1134
- "q",
1135
- [
1136
- 1,
1137
- [5, "0.25"],
1138
- "/",
1139
- "g"
1140
- ]
1141
- ],
1142
- [
1143
- 12,
1144
- "score",
1145
- [
1146
- 6,
1147
- "d.f32",
1148
- [[5, "0"]]
1149
- ]
1150
- ],
1151
- [
1152
- 14,
1153
- [
1154
- 12,
1155
- "sy",
1156
- [5, "0"]
1157
- ],
1158
- [
1159
- 1,
1160
- "sy",
1161
- "<",
1162
- [5, "2"]
1163
- ],
1164
- [
1165
- 102,
1166
- "++",
1167
- "sy"
1168
- ],
1169
- [0, [[
1170
- 14,
1171
- [
1172
- 12,
1173
- "sx",
1174
- [5, "0"]
1175
- ],
1176
- [
1177
- 1,
1178
- "sx",
1179
- "<",
1180
- [5, "2"]
1181
- ],
1182
- [
1183
- 102,
1184
- "++",
1185
- "sx"
1186
- ],
1187
- [0, [
1188
- [
1189
- 13,
1190
- "u",
1191
- [
1192
- 1,
1193
- "cu",
1194
- "+",
1195
- [
1196
- 1,
1197
- [
1198
- 1,
1199
- [
1200
- 1,
1201
- [
1202
- 6,
1203
- "d.f32",
1204
- ["sx"]
1205
- ],
1206
- "-",
1207
- [5, "0.5"]
1208
- ],
1209
- "*",
1210
- [5, "2"]
1211
- ],
1212
- "*",
1213
- "q"
1214
- ]
1215
- ]
1216
- ],
1217
- [
1218
- 13,
1219
- "v",
1220
- [
1221
- 1,
1222
- "cv",
1223
- "+",
1224
- [
1225
- 1,
1226
- [
1227
- 1,
1228
- [
1229
- 1,
1230
- [
1231
- 6,
1232
- "d.f32",
1233
- ["sy"]
1234
- ],
1235
- "-",
1236
- [5, "0.5"]
1237
- ],
1238
- "*",
1239
- [5, "2"]
1240
- ],
1241
- "*",
1242
- "q"
1243
- ]
1244
- ]
1245
- ],
1246
- [
1247
- 13,
1248
- "tx",
1249
- [
1250
- 6,
1251
- "d.u32",
1252
- [[
1253
- 6,
1254
- "std.clamp",
1255
- [
1256
- [
1257
- 1,
1258
- "u",
1259
- "*",
1260
- "srcW"
1261
- ],
1262
- [
1263
- 6,
1264
- "d.f32",
1265
- [[5, "0"]]
1266
- ],
1267
- [
1268
- 1,
1269
- "srcW",
1270
- "-",
1271
- [5, "1"]
1272
- ]
1273
- ]
1274
- ]]
1275
- ]
1276
- ],
1277
- [
1278
- 13,
1279
- "ty",
1280
- [
1281
- 6,
1282
- "d.u32",
1283
- [[
1284
- 6,
1285
- "std.clamp",
1286
- [
1287
- [
1288
- 1,
1289
- "v",
1290
- "*",
1291
- "srcH"
1292
- ],
1293
- [
1294
- 6,
1295
- "d.f32",
1296
- [[5, "0"]]
1297
- ],
1298
- [
1299
- 1,
1300
- "srcH",
1301
- "-",
1302
- [5, "1"]
1303
- ]
1304
- ]
1305
- ]]
1306
- ]
1307
- ],
1308
- [
1309
- 2,
1310
- "score",
1311
- "=",
1312
- [
1313
- 6,
1314
- "std.max",
1315
- ["score", [
1316
- 6,
1317
- "scoreFn",
1318
- [[
1319
- 6,
1320
- "std.textureLoad",
1321
- [
1322
- [
1323
- 7,
1324
- [
1325
- 7,
1326
- "featureLayout",
1327
- "$"
1328
- ],
1329
- "src"
1330
- ],
1331
- [
1332
- 6,
1333
- "d.vec2u",
1334
- ["tx", "ty"]
1335
- ],
1336
- [5, "0"]
1337
- ]
1338
- ]]
1339
- ]]
1340
- ]
1341
- ]
1342
- ]]
1343
- ]]]
1344
- ],
1345
- [
1346
- 6,
1347
- "std.textureStore",
1348
- [
1349
- [
1350
- 7,
1351
- [
1352
- 7,
1353
- "featureLayout",
1354
- "$"
1355
- ],
1356
- "grid"
1357
- ],
1358
- [
1359
- 6,
1360
- "d.vec2u",
1361
- ["gx", "gy"]
1362
- ],
1363
- [
1364
- 6,
1365
- "d.vec4f",
1366
- [
1367
- "score",
1368
- [5, "0"],
1369
- [5, "0"],
1370
- [5, "1"]
1371
- ]
1372
- ]
1373
- ]
1374
- ]
1375
- ]]
1376
- },
1377
- externals: {
1378
- "std.textureDimensions": () => textureDimensions,
1379
- "featureLayout": () => featureLayout,
1380
- "d.f32": () => f32,
1381
- "FEAT_GRID": () => FEAT_GRID,
1382
- "d.u32": () => u32,
1383
- "std.clamp": () => clamp,
1384
- "std.max": () => max,
1385
- "scoreFn": () => scoreFn,
1386
- "std.textureLoad": () => textureLoad,
1387
- "d.vec2u": () => vec2u,
1388
- "std.textureStore": () => textureStore,
1389
- "d.vec4f": () => vec4f
1390
- }
1391
- }) && $.f)({})).$name("featureGridScan");
1392
- }
1393
- function buildPursuitKernel(mode, scoreFn) {
1394
- const score = scoreFn ?? featureScoreFn(mode);
1395
- return typegpu_default.fn([u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((ti) => {
1396
- "use gpu";
1397
- const P = trackLayout.$.params;
1398
- const iF = f32(ti);
1399
- const head = textureLoad(trackLayout.$.prev, vec2u(u32(0), ti), 0);
1400
- const meta = textureLoad(trackLayout.$.prev, vec2u(u32(1), ti), 0);
1401
- let posX = head.x;
1402
- let posY = head.y;
1403
- let frame = head.z;
1404
- let genStart = __tsover_sub(head.w, 1);
1405
- let missStreak = meta.x;
1406
- let gen = meta.z;
1407
- let crowdStreak = meta.w;
1408
- if (head.w < .5) {
1409
- posX = __tsover_add(.15, __tsover_mul(.7, trackHash(__tsover_add(__tsover_mul(iF, 7.31), 1.3))));
1410
- posY = __tsover_add(.15, __tsover_mul(.7, trackHash(__tsover_add(__tsover_mul(iF, 11.93), 4.7))));
1411
- frame = f32(0);
1412
- genStart = f32(0);
1413
- missStreak = f32(0);
1414
- gen = f32(1);
1415
- }
1416
- frame = __tsover_add(frame, 1);
1417
- const minFeat = max(P.threshold, .02);
1418
- const Lpref = max(__tsover_sub(1, __tsover_mul(P.variance, trackHash(__tsover_add(__tsover_add(__tsover_mul(iF, 6.13), __tsover_mul(gen, .37)), 2.9)))), minFeat);
1419
- const srcDims = textureDimensions(trackLayout.$.src);
1420
- const srcW = f32(srcDims.x);
1421
- const srcH = f32(srcDims.y);
1422
- const radius = __tsover_add(.035, __tsover_mul(.11, P.agility));
1423
- let sumW = f32(0);
1424
- let sumX = f32(0);
1425
- let sumY = f32(0);
1426
- for (let dy = -3; dy <= 3; dy++) for (let dx = -3; dx <= 3; dx++) {
1427
- const ox = __tsover_mul(__tsover_div(f32(dx), 3), radius);
1428
- const oy = __tsover_mul(__tsover_div(f32(dy), 3), radius);
1429
- const cx01 = clamp(__tsover_add(posX, ox), .02, .98);
1430
- const cy01 = clamp(__tsover_add(posY, oy), .02, .98);
1431
- const tx = u32(clamp(__tsover_mul(cx01, srcW), f32(0), __tsover_sub(srcW, 1)));
1432
- const ty = u32(clamp(__tsover_mul(cy01, srcH), f32(0), __tsover_sub(srcH, 1)));
1433
- const s = score(textureLoad(trackLayout.$.src, vec2u(tx, ty), 0));
1434
- const gate = select(f32(0), f32(1), s > minFeat);
1435
- const dBand = __tsover_sub(s, Lpref);
1436
- const aff = __tsover_mul(exp(__tsover_mul(__tsover_mul(dBand, dBand), -24)), gate);
1437
- const off = __tsover_div(sqrt(__tsover_add(__tsover_mul(ox, ox), __tsover_mul(oy, oy))), max(radius, .001));
1438
- const w = __tsover_mul(aff, __tsover_sub(1, __tsover_mul(.3, off)));
1439
- sumW = __tsover_add(sumW, w);
1440
- sumX = __tsover_add(sumX, __tsover_mul(cx01, w));
1441
- sumY = __tsover_add(sumY, __tsover_mul(cy01, w));
1442
- }
1443
- const locked = sumW > .8;
1444
- let bestX = posX;
1445
- let bestY = posY;
1446
- if (locked) {
1447
- bestX = __tsover_div(sumX, sumW);
1448
- bestY = __tsover_div(sumY, sumW);
1449
- }
1450
- missStreak = select(__tsover_add(missStreak, 1), f32(0), locked);
1451
- if (!locked) {
1452
- const g = f32(FEAT_GRID);
1453
- let bestW = f32(0);
1454
- let tgtX = posX;
1455
- let tgtY = posY;
1456
- for (let gy = 0; gy < FEAT_GRID; gy++) for (let gx = 0; gx < FEAT_GRID; gx++) {
1457
- const cs = textureLoad(trackLayout.$.featGrid, vec2u(u32(gx), u32(gy)), 0).x;
1458
- const cGate = select(f32(0), f32(1), cs > minFeat);
1459
- const dB = __tsover_sub(cs, Lpref);
1460
- const aff = __tsover_mul(exp(__tsover_mul(__tsover_mul(dB, dB), -14)), cGate);
1461
- const cx = __tsover_div(__tsover_add(f32(gx), .5), g);
1462
- const cy = __tsover_div(__tsover_add(f32(gy), .5), g);
1463
- const ddx = __tsover_sub(cx, posX);
1464
- const ddy = __tsover_sub(cy, posY);
1465
- const pref = __tsover_add(.6, __tsover_mul(.8, trackHash(__tsover_add(__tsover_add(__tsover_mul(iF, 3.17), __tsover_mul(f32(gx), 13.71)), __tsover_mul(f32(gy), 29.37)))));
1466
- const wgt = __tsover_div(__tsover_mul(aff, pref), __tsover_add(1, __tsover_mul(5, __tsover_add(__tsover_mul(ddx, ddx), __tsover_mul(ddy, ddy)))));
1467
- if (wgt > bestW) {
1468
- bestW = wgt;
1469
- tgtX = cx;
1470
- tgtY = cy;
1471
- }
1472
- }
1473
- if (bestW > .02) {
1474
- bestX = clamp(__tsover_add(tgtX, __tsover_div(__tsover_sub(trackHash(__tsover_add(__tsover_mul(iF, 5.77), __tsover_mul(gen, 2.13))), .5), g)), .02, .98);
1475
- bestY = clamp(__tsover_add(tgtY, __tsover_div(__tsover_sub(trackHash(__tsover_add(__tsover_mul(iF, 8.31), __tsover_mul(gen, 4.97))), .5), g)), .02, .98);
1476
- } else {
1477
- const ang = __tsover_add(__tsover_mul(trackHash(__tsover_add(__tsover_mul(iF, 13.77), __tsover_mul(gen, 3.19))), TWO_PI), __tsover_mul(sin(__tsover_add(__tsover_mul(frame, .02), iF)), 1.4));
1478
- bestX = clamp(__tsover_add(posX, __tsover_mul(cos(ang), .08)), .03, .97);
1479
- bestY = clamp(__tsover_add(posY, __tsover_mul(sin(ang), .08)), .03, .97);
1480
- }
1481
- }
1482
- const maxStep = __tsover_mul(P.dt, __tsover_add(.15, __tsover_mul(1.4, P.agility)));
1483
- const dX = __tsover_sub(bestX, posX);
1484
- const dY = __tsover_sub(bestY, posY);
1485
- const dist = sqrt(__tsover_add(__tsover_mul(dX, dX), __tsover_mul(dY, dY)));
1486
- const stepK = min(f32(1), __tsover_div(maxStep, max(dist, 1e-5)));
1487
- posX = __tsover_add(posX, __tsover_mul(dX, stepK));
1488
- posY = __tsover_add(posY, __tsover_mul(dY, stepK));
1489
- let crowded = f32(0);
1490
- const iN = i32(ti);
1491
- for (let k = 0; k < iN; k++) {
1492
- const kF = f32(k);
1493
- const other = textureLoad(trackLayout.$.prev, vec2u(u32(0), u32(k)), 0);
1494
- const odx = __tsover_sub(other.x, posX);
1495
- const ody = __tsover_sub(other.y, posY);
1496
- const near = select(f32(0), f32(1), sqrt(__tsover_add(__tsover_mul(odx, odx), __tsover_mul(ody, ody))) < .022);
1497
- crowded = max(crowded, __tsover_mul(__tsover_mul(near, other.w), select(f32(0), f32(1), kF < P.trackersF)));
1498
- }
1499
- crowdStreak = select(f32(0), __tsover_add(crowdStreak, 1), crowded > .5);
1500
- if (crowdStreak > 30) {
1501
- const hopAng = __tsover_mul(trackHash(__tsover_add(__tsover_add(__tsover_mul(iF, 9.13), __tsover_mul(gen, 5.77)), 2.3)), TWO_PI);
1502
- const hopDist = __tsover_add(.05, __tsover_mul(.08, trackHash(__tsover_add(__tsover_mul(iF, 4.71), __tsover_mul(gen, 8.11)))));
1503
- posX = clamp(__tsover_add(posX, __tsover_mul(cos(hopAng), hopDist)), .03, .97);
1504
- posY = clamp(__tsover_add(posY, __tsover_mul(sin(hopAng), hopDist)), .03, .97);
1505
- gen = __tsover_add(gen, 1);
1506
- genStart = frame;
1507
- missStreak = f32(0);
1508
- crowdStreak = f32(0);
1509
- }
1510
- const lifeFrames = __tsover_mul(__tsover_mul(P.lifespan, 60), __tsover_add(.7, __tsover_mul(.6, trackHash(__tsover_add(__tsover_mul(iF, 4.77), __tsover_mul(gen, 1.31))))));
1511
- const expired = __tsover_mul(select(f32(0), f32(1), __tsover_sub(frame, genStart) > lifeFrames), select(f32(0), f32(1), P.lifespan > .01));
1512
- const lost = select(f32(0), f32(1), missStreak > 90);
1513
- if (__tsover_add(expired, lost) > .5) {
1514
- posX = __tsover_add(.1, __tsover_mul(.8, trackHash(__tsover_add(__tsover_add(__tsover_mul(iF, 7.31), __tsover_mul(gen, 13.7)), __tsover_mul(frame, .013)))));
1515
- posY = __tsover_add(.1, __tsover_mul(.8, trackHash(__tsover_add(__tsover_add(__tsover_mul(iF, 11.93), __tsover_mul(gen, 17.3)), __tsover_mul(frame, .019)))));
1516
- gen = __tsover_add(gen, 1);
1517
- genStart = frame;
1518
- missStreak = f32(0);
1519
- crowdStreak = f32(0);
1520
- }
1521
- const writeIdx = __tsover_mod(floor(__tsover_div(frame, f32(TRAIL_EVERY))), f32(TRAIL_LEN));
1522
- const shouldWrite = select(f32(0), f32(1), __tsover_mod(frame, f32(TRAIL_EVERY)) < .5);
1523
- let bbMinX = posX;
1524
- let bbMinY = posY;
1525
- let bbMaxX = posX;
1526
- let bbMaxY = posY;
1527
- for (let j = 0; j < TRAIL_LEN; j++) {
1528
- const jF = f32(j);
1529
- let e = textureLoad(trackLayout.$.prev, vec2u(u32(__tsover_add(2, j)), ti), 0);
1530
- const isSlot = select(f32(0), f32(1), abs(__tsover_sub(jF, writeIdx)) < .5);
1531
- const doWrite = __tsover_mul(isSlot, shouldWrite);
1532
- e = mix(e, vec4f(posX, posY, frame, gen), doWrite);
1533
- textureStore(trackLayout.$.next, vec2u(u32(__tsover_add(2, j)), ti), e);
1534
- textureStore(trackLayout.$.present, vec2u(u32(__tsover_add(2, j)), ti), e);
1535
- const live = __tsover_mul(select(f32(0), f32(1), abs(__tsover_sub(e.w, gen)) < .5), select(f32(0), f32(1), e.z > .5));
1536
- bbMinX = min(bbMinX, mix(posX, e.x, live));
1537
- bbMinY = min(bbMinY, mix(posY, e.y, live));
1538
- bbMaxX = max(bbMaxX, mix(posX, e.x, live));
1539
- bbMaxY = max(bbMaxY, mix(posY, e.y, live));
1540
- }
1541
- const bbOut = vec4f(bbMinX, bbMinY, bbMaxX, bbMaxY);
1542
- textureStore(trackLayout.$.next, vec2u(u32(AABB_COL), ti), bbOut);
1543
- textureStore(trackLayout.$.present, vec2u(u32(AABB_COL), ti), bbOut);
1544
- const headOut = vec4f(posX, posY, frame, __tsover_add(genStart, 1));
1545
- const metaOut = vec4f(missStreak, sumW, gen, crowdStreak);
1546
- textureStore(trackLayout.$.next, vec2u(u32(0), ti), headOut);
1547
- textureStore(trackLayout.$.present, vec2u(u32(0), ti), headOut);
1548
- textureStore(trackLayout.$.next, vec2u(u32(1), ti), metaOut);
1549
- textureStore(trackLayout.$.present, vec2u(u32(1), ti), metaOut);
1550
- }), {
1551
- v: 2,
1552
- name: void 0,
1553
- ast: {
1554
- "params": [{
1555
- "type": "i",
1556
- "name": "ti"
1557
- }],
1558
- "body": [0, [
1559
- [
1560
- 13,
1561
- "P",
1562
- [
1563
- 7,
1564
- [
1565
- 7,
1566
- "trackLayout",
1567
- "$"
1568
- ],
1569
- "params"
1570
- ]
1571
- ],
1572
- [
1573
- 13,
1574
- "iF",
1575
- [
1576
- 6,
1577
- "d.f32",
1578
- ["ti"]
1579
- ]
1580
- ],
1581
- [
1582
- 13,
1583
- "head",
1584
- [
1585
- 6,
1586
- "std.textureLoad",
1587
- [
1588
- [
1589
- 7,
1590
- [
1591
- 7,
1592
- "trackLayout",
1593
- "$"
1594
- ],
1595
- "prev"
1596
- ],
1597
- [
1598
- 6,
1599
- "d.vec2u",
1600
- [[
1601
- 6,
1602
- "d.u32",
1603
- [[5, "0"]]
1604
- ], "ti"]
1605
- ],
1606
- [5, "0"]
1607
- ]
1608
- ]
1609
- ],
1610
- [
1611
- 13,
1612
- "meta",
1613
- [
1614
- 6,
1615
- "std.textureLoad",
1616
- [
1617
- [
1618
- 7,
1619
- [
1620
- 7,
1621
- "trackLayout",
1622
- "$"
1623
- ],
1624
- "prev"
1625
- ],
1626
- [
1627
- 6,
1628
- "d.vec2u",
1629
- [[
1630
- 6,
1631
- "d.u32",
1632
- [[5, "1"]]
1633
- ], "ti"]
1634
- ],
1635
- [5, "0"]
1636
- ]
1637
- ]
1638
- ],
1639
- [
1640
- 12,
1641
- "posX",
1642
- [
1643
- 7,
1644
- "head",
1645
- "x"
1646
- ]
1647
- ],
1648
- [
1649
- 12,
1650
- "posY",
1651
- [
1652
- 7,
1653
- "head",
1654
- "y"
1655
- ]
1656
- ],
1657
- [
1658
- 12,
1659
- "frame",
1660
- [
1661
- 7,
1662
- "head",
1663
- "z"
1664
- ]
1665
- ],
1666
- [
1667
- 12,
1668
- "genStart",
1669
- [
1670
- 1,
1671
- [
1672
- 7,
1673
- "head",
1674
- "w"
1675
- ],
1676
- "-",
1677
- [5, "1"]
1678
- ]
1679
- ],
1680
- [
1681
- 12,
1682
- "missStreak",
1683
- [
1684
- 7,
1685
- "meta",
1686
- "x"
1687
- ]
1688
- ],
1689
- [
1690
- 12,
1691
- "gen",
1692
- [
1693
- 7,
1694
- "meta",
1695
- "z"
1696
- ]
1697
- ],
1698
- [
1699
- 12,
1700
- "crowdStreak",
1701
- [
1702
- 7,
1703
- "meta",
1704
- "w"
1705
- ]
1706
- ],
1707
- [
1708
- 11,
1709
- [
1710
- 1,
1711
- [
1712
- 7,
1713
- "head",
1714
- "w"
1715
- ],
1716
- "<",
1717
- [5, "0.5"]
1718
- ],
1719
- [0, [
1720
- [
1721
- 2,
1722
- "posX",
1723
- "=",
1724
- [
1725
- 1,
1726
- [5, "0.15"],
1727
- "+",
1728
- [
1729
- 1,
1730
- [5, "0.7"],
1731
- "*",
1732
- [
1733
- 6,
1734
- "trackHash",
1735
- [[
1736
- 1,
1737
- [
1738
- 1,
1739
- "iF",
1740
- "*",
1741
- [5, "7.31"]
1742
- ],
1743
- "+",
1744
- [5, "1.3"]
1745
- ]]
1746
- ]
1747
- ]
1748
- ]
1749
- ],
1750
- [
1751
- 2,
1752
- "posY",
1753
- "=",
1754
- [
1755
- 1,
1756
- [5, "0.15"],
1757
- "+",
1758
- [
1759
- 1,
1760
- [5, "0.7"],
1761
- "*",
1762
- [
1763
- 6,
1764
- "trackHash",
1765
- [[
1766
- 1,
1767
- [
1768
- 1,
1769
- "iF",
1770
- "*",
1771
- [5, "11.93"]
1772
- ],
1773
- "+",
1774
- [5, "4.7"]
1775
- ]]
1776
- ]
1777
- ]
1778
- ]
1779
- ],
1780
- [
1781
- 2,
1782
- "frame",
1783
- "=",
1784
- [
1785
- 6,
1786
- "d.f32",
1787
- [[5, "0"]]
1788
- ]
1789
- ],
1790
- [
1791
- 2,
1792
- "genStart",
1793
- "=",
1794
- [
1795
- 6,
1796
- "d.f32",
1797
- [[5, "0"]]
1798
- ]
1799
- ],
1800
- [
1801
- 2,
1802
- "missStreak",
1803
- "=",
1804
- [
1805
- 6,
1806
- "d.f32",
1807
- [[5, "0"]]
1808
- ]
1809
- ],
1810
- [
1811
- 2,
1812
- "gen",
1813
- "=",
1814
- [
1815
- 6,
1816
- "d.f32",
1817
- [[5, "1"]]
1818
- ]
1819
- ]
1820
- ]]
1821
- ],
1822
- [
1823
- 2,
1824
- "frame",
1825
- "=",
1826
- [
1827
- 1,
1828
- "frame",
1829
- "+",
1830
- [5, "1"]
1831
- ]
1832
- ],
1833
- [
1834
- 13,
1835
- "minFeat",
1836
- [
1837
- 6,
1838
- "std.max",
1839
- [[
1840
- 7,
1841
- "P",
1842
- "threshold"
1843
- ], [5, "0.02"]]
1844
- ]
1845
- ],
1846
- [
1847
- 13,
1848
- "Lpref",
1849
- [
1850
- 6,
1851
- "std.max",
1852
- [[
1853
- 1,
1854
- [5, "1"],
1855
- "-",
1856
- [
1857
- 1,
1858
- [
1859
- 7,
1860
- "P",
1861
- "variance"
1862
- ],
1863
- "*",
1864
- [
1865
- 6,
1866
- "trackHash",
1867
- [[
1868
- 1,
1869
- [
1870
- 1,
1871
- [
1872
- 1,
1873
- "iF",
1874
- "*",
1875
- [5, "6.13"]
1876
- ],
1877
- "+",
1878
- [
1879
- 1,
1880
- "gen",
1881
- "*",
1882
- [5, "0.37"]
1883
- ]
1884
- ],
1885
- "+",
1886
- [5, "2.9"]
1887
- ]]
1888
- ]
1889
- ]
1890
- ], "minFeat"]
1891
- ]
1892
- ],
1893
- [
1894
- 13,
1895
- "srcDims",
1896
- [
1897
- 6,
1898
- "std.textureDimensions",
1899
- [[
1900
- 7,
1901
- [
1902
- 7,
1903
- "trackLayout",
1904
- "$"
1905
- ],
1906
- "src"
1907
- ]]
1908
- ]
1909
- ],
1910
- [
1911
- 13,
1912
- "srcW",
1913
- [
1914
- 6,
1915
- "d.f32",
1916
- [[
1917
- 7,
1918
- "srcDims",
1919
- "x"
1920
- ]]
1921
- ]
1922
- ],
1923
- [
1924
- 13,
1925
- "srcH",
1926
- [
1927
- 6,
1928
- "d.f32",
1929
- [[
1930
- 7,
1931
- "srcDims",
1932
- "y"
1933
- ]]
1934
- ]
1935
- ],
1936
- [
1937
- 13,
1938
- "radius",
1939
- [
1940
- 1,
1941
- [5, "0.035"],
1942
- "+",
1943
- [
1944
- 1,
1945
- [5, "0.11"],
1946
- "*",
1947
- [
1948
- 7,
1949
- "P",
1950
- "agility"
1951
- ]
1952
- ]
1953
- ]
1954
- ],
1955
- [
1956
- 12,
1957
- "sumW",
1958
- [
1959
- 6,
1960
- "d.f32",
1961
- [[5, "0"]]
1962
- ]
1963
- ],
1964
- [
1965
- 12,
1966
- "sumX",
1967
- [
1968
- 6,
1969
- "d.f32",
1970
- [[5, "0"]]
1971
- ]
1972
- ],
1973
- [
1974
- 12,
1975
- "sumY",
1976
- [
1977
- 6,
1978
- "d.f32",
1979
- [[5, "0"]]
1980
- ]
1981
- ],
1982
- [
1983
- 14,
1984
- [
1985
- 12,
1986
- "dy",
1987
- [
1988
- 4,
1989
- "-",
1990
- [5, "3"]
1991
- ]
1992
- ],
1993
- [
1994
- 1,
1995
- "dy",
1996
- "<=",
1997
- [5, "3"]
1998
- ],
1999
- [
2000
- 102,
2001
- "++",
2002
- "dy"
2003
- ],
2004
- [0, [[
2005
- 14,
2006
- [
2007
- 12,
2008
- "dx",
2009
- [
2010
- 4,
2011
- "-",
2012
- [5, "3"]
2013
- ]
2014
- ],
2015
- [
2016
- 1,
2017
- "dx",
2018
- "<=",
2019
- [5, "3"]
2020
- ],
2021
- [
2022
- 102,
2023
- "++",
2024
- "dx"
2025
- ],
2026
- [0, [
2027
- [
2028
- 13,
2029
- "ox",
2030
- [
2031
- 1,
2032
- [
2033
- 1,
2034
- [
2035
- 6,
2036
- "d.f32",
2037
- ["dx"]
2038
- ],
2039
- "/",
2040
- [5, "3"]
2041
- ],
2042
- "*",
2043
- "radius"
2044
- ]
2045
- ],
2046
- [
2047
- 13,
2048
- "oy",
2049
- [
2050
- 1,
2051
- [
2052
- 1,
2053
- [
2054
- 6,
2055
- "d.f32",
2056
- ["dy"]
2057
- ],
2058
- "/",
2059
- [5, "3"]
2060
- ],
2061
- "*",
2062
- "radius"
2063
- ]
2064
- ],
2065
- [
2066
- 13,
2067
- "cx01",
2068
- [
2069
- 6,
2070
- "std.clamp",
2071
- [
2072
- [
2073
- 1,
2074
- "posX",
2075
- "+",
2076
- "ox"
2077
- ],
2078
- [5, "0.02"],
2079
- [5, "0.98"]
2080
- ]
2081
- ]
2082
- ],
2083
- [
2084
- 13,
2085
- "cy01",
2086
- [
2087
- 6,
2088
- "std.clamp",
2089
- [
2090
- [
2091
- 1,
2092
- "posY",
2093
- "+",
2094
- "oy"
2095
- ],
2096
- [5, "0.02"],
2097
- [5, "0.98"]
2098
- ]
2099
- ]
2100
- ],
2101
- [
2102
- 13,
2103
- "tx",
2104
- [
2105
- 6,
2106
- "d.u32",
2107
- [[
2108
- 6,
2109
- "std.clamp",
2110
- [
2111
- [
2112
- 1,
2113
- "cx01",
2114
- "*",
2115
- "srcW"
2116
- ],
2117
- [
2118
- 6,
2119
- "d.f32",
2120
- [[5, "0"]]
2121
- ],
2122
- [
2123
- 1,
2124
- "srcW",
2125
- "-",
2126
- [5, "1"]
2127
- ]
2128
- ]
2129
- ]]
2130
- ]
2131
- ],
2132
- [
2133
- 13,
2134
- "ty",
2135
- [
2136
- 6,
2137
- "d.u32",
2138
- [[
2139
- 6,
2140
- "std.clamp",
2141
- [
2142
- [
2143
- 1,
2144
- "cy01",
2145
- "*",
2146
- "srcH"
2147
- ],
2148
- [
2149
- 6,
2150
- "d.f32",
2151
- [[5, "0"]]
2152
- ],
2153
- [
2154
- 1,
2155
- "srcH",
2156
- "-",
2157
- [5, "1"]
2158
- ]
2159
- ]
2160
- ]]
2161
- ]
2162
- ],
2163
- [
2164
- 13,
2165
- "s",
2166
- [
2167
- 6,
2168
- "score",
2169
- [[
2170
- 6,
2171
- "std.textureLoad",
2172
- [
2173
- [
2174
- 7,
2175
- [
2176
- 7,
2177
- "trackLayout",
2178
- "$"
2179
- ],
2180
- "src"
2181
- ],
2182
- [
2183
- 6,
2184
- "d.vec2u",
2185
- ["tx", "ty"]
2186
- ],
2187
- [5, "0"]
2188
- ]
2189
- ]]
2190
- ]
2191
- ],
2192
- [
2193
- 13,
2194
- "gate",
2195
- [
2196
- 6,
2197
- "std.select",
2198
- [
2199
- [
2200
- 6,
2201
- "d.f32",
2202
- [[5, "0"]]
2203
- ],
2204
- [
2205
- 6,
2206
- "d.f32",
2207
- [[5, "1"]]
2208
- ],
2209
- [
2210
- 1,
2211
- "s",
2212
- ">",
2213
- "minFeat"
2214
- ]
2215
- ]
2216
- ]
2217
- ],
2218
- [
2219
- 13,
2220
- "dBand",
2221
- [
2222
- 1,
2223
- "s",
2224
- "-",
2225
- "Lpref"
2226
- ]
2227
- ],
2228
- [
2229
- 13,
2230
- "aff",
2231
- [
2232
- 1,
2233
- [
2234
- 6,
2235
- "std.exp",
2236
- [[
2237
- 1,
2238
- [
2239
- 1,
2240
- "dBand",
2241
- "*",
2242
- "dBand"
2243
- ],
2244
- "*",
2245
- [
2246
- 4,
2247
- "-",
2248
- [5, "24"]
2249
- ]
2250
- ]]
2251
- ],
2252
- "*",
2253
- "gate"
2254
- ]
2255
- ],
2256
- [
2257
- 13,
2258
- "off",
2259
- [
2260
- 1,
2261
- [
2262
- 6,
2263
- "std.sqrt",
2264
- [[
2265
- 1,
2266
- [
2267
- 1,
2268
- "ox",
2269
- "*",
2270
- "ox"
2271
- ],
2272
- "+",
2273
- [
2274
- 1,
2275
- "oy",
2276
- "*",
2277
- "oy"
2278
- ]
2279
- ]]
2280
- ],
2281
- "/",
2282
- [
2283
- 6,
2284
- "std.max",
2285
- ["radius", [5, "0.001"]]
2286
- ]
2287
- ]
2288
- ],
2289
- [
2290
- 13,
2291
- "w",
2292
- [
2293
- 1,
2294
- "aff",
2295
- "*",
2296
- [
2297
- 1,
2298
- [5, "1"],
2299
- "-",
2300
- [
2301
- 1,
2302
- [5, "0.3"],
2303
- "*",
2304
- "off"
2305
- ]
2306
- ]
2307
- ]
2308
- ],
2309
- [
2310
- 2,
2311
- "sumW",
2312
- "=",
2313
- [
2314
- 1,
2315
- "sumW",
2316
- "+",
2317
- "w"
2318
- ]
2319
- ],
2320
- [
2321
- 2,
2322
- "sumX",
2323
- "=",
2324
- [
2325
- 1,
2326
- "sumX",
2327
- "+",
2328
- [
2329
- 1,
2330
- "cx01",
2331
- "*",
2332
- "w"
2333
- ]
2334
- ]
2335
- ],
2336
- [
2337
- 2,
2338
- "sumY",
2339
- "=",
2340
- [
2341
- 1,
2342
- "sumY",
2343
- "+",
2344
- [
2345
- 1,
2346
- "cy01",
2347
- "*",
2348
- "w"
2349
- ]
2350
- ]
2351
- ]
2352
- ]]
2353
- ]]]
2354
- ],
2355
- [
2356
- 13,
2357
- "locked",
2358
- [
2359
- 1,
2360
- "sumW",
2361
- ">",
2362
- [5, "0.8"]
2363
- ]
2364
- ],
2365
- [
2366
- 12,
2367
- "bestX",
2368
- "posX"
2369
- ],
2370
- [
2371
- 12,
2372
- "bestY",
2373
- "posY"
2374
- ],
2375
- [
2376
- 11,
2377
- "locked",
2378
- [0, [[
2379
- 2,
2380
- "bestX",
2381
- "=",
2382
- [
2383
- 1,
2384
- "sumX",
2385
- "/",
2386
- "sumW"
2387
- ]
2388
- ], [
2389
- 2,
2390
- "bestY",
2391
- "=",
2392
- [
2393
- 1,
2394
- "sumY",
2395
- "/",
2396
- "sumW"
2397
- ]
2398
- ]]]
2399
- ],
2400
- [
2401
- 2,
2402
- "missStreak",
2403
- "=",
2404
- [
2405
- 6,
2406
- "std.select",
2407
- [
2408
- [
2409
- 1,
2410
- "missStreak",
2411
- "+",
2412
- [5, "1"]
2413
- ],
2414
- [
2415
- 6,
2416
- "d.f32",
2417
- [[5, "0"]]
2418
- ],
2419
- "locked"
2420
- ]
2421
- ]
2422
- ],
2423
- [
2424
- 11,
2425
- [
2426
- 4,
2427
- "!",
2428
- "locked"
2429
- ],
2430
- [0, [
2431
- [
2432
- 13,
2433
- "g",
2434
- [
2435
- 6,
2436
- "d.f32",
2437
- ["FEAT_GRID"]
2438
- ]
2439
- ],
2440
- [
2441
- 12,
2442
- "bestW",
2443
- [
2444
- 6,
2445
- "d.f32",
2446
- [[5, "0"]]
2447
- ]
2448
- ],
2449
- [
2450
- 12,
2451
- "tgtX",
2452
- "posX"
2453
- ],
2454
- [
2455
- 12,
2456
- "tgtY",
2457
- "posY"
2458
- ],
2459
- [
2460
- 14,
2461
- [
2462
- 12,
2463
- "gy",
2464
- [5, "0"]
2465
- ],
2466
- [
2467
- 1,
2468
- "gy",
2469
- "<",
2470
- "FEAT_GRID"
2471
- ],
2472
- [
2473
- 102,
2474
- "++",
2475
- "gy"
2476
- ],
2477
- [0, [[
2478
- 14,
2479
- [
2480
- 12,
2481
- "gx",
2482
- [5, "0"]
2483
- ],
2484
- [
2485
- 1,
2486
- "gx",
2487
- "<",
2488
- "FEAT_GRID"
2489
- ],
2490
- [
2491
- 102,
2492
- "++",
2493
- "gx"
2494
- ],
2495
- [0, [
2496
- [
2497
- 13,
2498
- "cs",
2499
- [
2500
- 7,
2501
- [
2502
- 6,
2503
- "std.textureLoad",
2504
- [
2505
- [
2506
- 7,
2507
- [
2508
- 7,
2509
- "trackLayout",
2510
- "$"
2511
- ],
2512
- "featGrid"
2513
- ],
2514
- [
2515
- 6,
2516
- "d.vec2u",
2517
- [[
2518
- 6,
2519
- "d.u32",
2520
- ["gx"]
2521
- ], [
2522
- 6,
2523
- "d.u32",
2524
- ["gy"]
2525
- ]]
2526
- ],
2527
- [5, "0"]
2528
- ]
2529
- ],
2530
- "x"
2531
- ]
2532
- ],
2533
- [
2534
- 13,
2535
- "cGate",
2536
- [
2537
- 6,
2538
- "std.select",
2539
- [
2540
- [
2541
- 6,
2542
- "d.f32",
2543
- [[5, "0"]]
2544
- ],
2545
- [
2546
- 6,
2547
- "d.f32",
2548
- [[5, "1"]]
2549
- ],
2550
- [
2551
- 1,
2552
- "cs",
2553
- ">",
2554
- "minFeat"
2555
- ]
2556
- ]
2557
- ]
2558
- ],
2559
- [
2560
- 13,
2561
- "dB",
2562
- [
2563
- 1,
2564
- "cs",
2565
- "-",
2566
- "Lpref"
2567
- ]
2568
- ],
2569
- [
2570
- 13,
2571
- "aff",
2572
- [
2573
- 1,
2574
- [
2575
- 6,
2576
- "std.exp",
2577
- [[
2578
- 1,
2579
- [
2580
- 1,
2581
- "dB",
2582
- "*",
2583
- "dB"
2584
- ],
2585
- "*",
2586
- [
2587
- 4,
2588
- "-",
2589
- [5, "14"]
2590
- ]
2591
- ]]
2592
- ],
2593
- "*",
2594
- "cGate"
2595
- ]
2596
- ],
2597
- [
2598
- 13,
2599
- "cx",
2600
- [
2601
- 1,
2602
- [
2603
- 1,
2604
- [
2605
- 6,
2606
- "d.f32",
2607
- ["gx"]
2608
- ],
2609
- "+",
2610
- [5, "0.5"]
2611
- ],
2612
- "/",
2613
- "g"
2614
- ]
2615
- ],
2616
- [
2617
- 13,
2618
- "cy",
2619
- [
2620
- 1,
2621
- [
2622
- 1,
2623
- [
2624
- 6,
2625
- "d.f32",
2626
- ["gy"]
2627
- ],
2628
- "+",
2629
- [5, "0.5"]
2630
- ],
2631
- "/",
2632
- "g"
2633
- ]
2634
- ],
2635
- [
2636
- 13,
2637
- "ddx",
2638
- [
2639
- 1,
2640
- "cx",
2641
- "-",
2642
- "posX"
2643
- ]
2644
- ],
2645
- [
2646
- 13,
2647
- "ddy",
2648
- [
2649
- 1,
2650
- "cy",
2651
- "-",
2652
- "posY"
2653
- ]
2654
- ],
2655
- [
2656
- 13,
2657
- "pref",
2658
- [
2659
- 1,
2660
- [5, "0.6"],
2661
- "+",
2662
- [
2663
- 1,
2664
- [5, "0.8"],
2665
- "*",
2666
- [
2667
- 6,
2668
- "trackHash",
2669
- [[
2670
- 1,
2671
- [
2672
- 1,
2673
- [
2674
- 1,
2675
- "iF",
2676
- "*",
2677
- [5, "3.17"]
2678
- ],
2679
- "+",
2680
- [
2681
- 1,
2682
- [
2683
- 6,
2684
- "d.f32",
2685
- ["gx"]
2686
- ],
2687
- "*",
2688
- [5, "13.71"]
2689
- ]
2690
- ],
2691
- "+",
2692
- [
2693
- 1,
2694
- [
2695
- 6,
2696
- "d.f32",
2697
- ["gy"]
2698
- ],
2699
- "*",
2700
- [5, "29.37"]
2701
- ]
2702
- ]]
2703
- ]
2704
- ]
2705
- ]
2706
- ],
2707
- [
2708
- 13,
2709
- "wgt",
2710
- [
2711
- 1,
2712
- [
2713
- 1,
2714
- "aff",
2715
- "*",
2716
- "pref"
2717
- ],
2718
- "/",
2719
- [
2720
- 1,
2721
- [5, "1"],
2722
- "+",
2723
- [
2724
- 1,
2725
- [5, "5"],
2726
- "*",
2727
- [
2728
- 1,
2729
- [
2730
- 1,
2731
- "ddx",
2732
- "*",
2733
- "ddx"
2734
- ],
2735
- "+",
2736
- [
2737
- 1,
2738
- "ddy",
2739
- "*",
2740
- "ddy"
2741
- ]
2742
- ]
2743
- ]
2744
- ]
2745
- ]
2746
- ],
2747
- [
2748
- 11,
2749
- [
2750
- 1,
2751
- "wgt",
2752
- ">",
2753
- "bestW"
2754
- ],
2755
- [0, [
2756
- [
2757
- 2,
2758
- "bestW",
2759
- "=",
2760
- "wgt"
2761
- ],
2762
- [
2763
- 2,
2764
- "tgtX",
2765
- "=",
2766
- "cx"
2767
- ],
2768
- [
2769
- 2,
2770
- "tgtY",
2771
- "=",
2772
- "cy"
2773
- ]
2774
- ]]
2775
- ]
2776
- ]]
2777
- ]]]
2778
- ],
2779
- [
2780
- 11,
2781
- [
2782
- 1,
2783
- "bestW",
2784
- ">",
2785
- [5, "0.02"]
2786
- ],
2787
- [0, [[
2788
- 2,
2789
- "bestX",
2790
- "=",
2791
- [
2792
- 6,
2793
- "std.clamp",
2794
- [
2795
- [
2796
- 1,
2797
- "tgtX",
2798
- "+",
2799
- [
2800
- 1,
2801
- [
2802
- 1,
2803
- [
2804
- 6,
2805
- "trackHash",
2806
- [[
2807
- 1,
2808
- [
2809
- 1,
2810
- "iF",
2811
- "*",
2812
- [5, "5.77"]
2813
- ],
2814
- "+",
2815
- [
2816
- 1,
2817
- "gen",
2818
- "*",
2819
- [5, "2.13"]
2820
- ]
2821
- ]]
2822
- ],
2823
- "-",
2824
- [5, "0.5"]
2825
- ],
2826
- "/",
2827
- "g"
2828
- ]
2829
- ],
2830
- [5, "0.02"],
2831
- [5, "0.98"]
2832
- ]
2833
- ]
2834
- ], [
2835
- 2,
2836
- "bestY",
2837
- "=",
2838
- [
2839
- 6,
2840
- "std.clamp",
2841
- [
2842
- [
2843
- 1,
2844
- "tgtY",
2845
- "+",
2846
- [
2847
- 1,
2848
- [
2849
- 1,
2850
- [
2851
- 6,
2852
- "trackHash",
2853
- [[
2854
- 1,
2855
- [
2856
- 1,
2857
- "iF",
2858
- "*",
2859
- [5, "8.31"]
2860
- ],
2861
- "+",
2862
- [
2863
- 1,
2864
- "gen",
2865
- "*",
2866
- [5, "4.97"]
2867
- ]
2868
- ]]
2869
- ],
2870
- "-",
2871
- [5, "0.5"]
2872
- ],
2873
- "/",
2874
- "g"
2875
- ]
2876
- ],
2877
- [5, "0.02"],
2878
- [5, "0.98"]
2879
- ]
2880
- ]
2881
- ]]],
2882
- [0, [
2883
- [
2884
- 13,
2885
- "ang",
2886
- [
2887
- 1,
2888
- [
2889
- 1,
2890
- [
2891
- 6,
2892
- "trackHash",
2893
- [[
2894
- 1,
2895
- [
2896
- 1,
2897
- "iF",
2898
- "*",
2899
- [5, "13.77"]
2900
- ],
2901
- "+",
2902
- [
2903
- 1,
2904
- "gen",
2905
- "*",
2906
- [5, "3.19"]
2907
- ]
2908
- ]]
2909
- ],
2910
- "*",
2911
- "TWO_PI"
2912
- ],
2913
- "+",
2914
- [
2915
- 1,
2916
- [
2917
- 6,
2918
- "std.sin",
2919
- [[
2920
- 1,
2921
- [
2922
- 1,
2923
- "frame",
2924
- "*",
2925
- [5, "0.02"]
2926
- ],
2927
- "+",
2928
- "iF"
2929
- ]]
2930
- ],
2931
- "*",
2932
- [5, "1.4"]
2933
- ]
2934
- ]
2935
- ],
2936
- [
2937
- 2,
2938
- "bestX",
2939
- "=",
2940
- [
2941
- 6,
2942
- "std.clamp",
2943
- [
2944
- [
2945
- 1,
2946
- "posX",
2947
- "+",
2948
- [
2949
- 1,
2950
- [
2951
- 6,
2952
- "std.cos",
2953
- ["ang"]
2954
- ],
2955
- "*",
2956
- [5, "0.08"]
2957
- ]
2958
- ],
2959
- [5, "0.03"],
2960
- [5, "0.97"]
2961
- ]
2962
- ]
2963
- ],
2964
- [
2965
- 2,
2966
- "bestY",
2967
- "=",
2968
- [
2969
- 6,
2970
- "std.clamp",
2971
- [
2972
- [
2973
- 1,
2974
- "posY",
2975
- "+",
2976
- [
2977
- 1,
2978
- [
2979
- 6,
2980
- "std.sin",
2981
- ["ang"]
2982
- ],
2983
- "*",
2984
- [5, "0.08"]
2985
- ]
2986
- ],
2987
- [5, "0.03"],
2988
- [5, "0.97"]
2989
- ]
2990
- ]
2991
- ]
2992
- ]]
2993
- ]
2994
- ]]
2995
- ],
2996
- [
2997
- 13,
2998
- "maxStep",
2999
- [
3000
- 1,
3001
- [
3002
- 7,
3003
- "P",
3004
- "dt"
3005
- ],
3006
- "*",
3007
- [
3008
- 1,
3009
- [5, "0.15"],
3010
- "+",
3011
- [
3012
- 1,
3013
- [5, "1.4"],
3014
- "*",
3015
- [
3016
- 7,
3017
- "P",
3018
- "agility"
3019
- ]
3020
- ]
3021
- ]
3022
- ]
3023
- ],
3024
- [
3025
- 13,
3026
- "dX",
3027
- [
3028
- 1,
3029
- "bestX",
3030
- "-",
3031
- "posX"
3032
- ]
3033
- ],
3034
- [
3035
- 13,
3036
- "dY",
3037
- [
3038
- 1,
3039
- "bestY",
3040
- "-",
3041
- "posY"
3042
- ]
3043
- ],
3044
- [
3045
- 13,
3046
- "dist",
3047
- [
3048
- 6,
3049
- "std.sqrt",
3050
- [[
3051
- 1,
3052
- [
3053
- 1,
3054
- "dX",
3055
- "*",
3056
- "dX"
3057
- ],
3058
- "+",
3059
- [
3060
- 1,
3061
- "dY",
3062
- "*",
3063
- "dY"
3064
- ]
3065
- ]]
3066
- ]
3067
- ],
3068
- [
3069
- 13,
3070
- "stepK",
3071
- [
3072
- 6,
3073
- "std.min",
3074
- [[
3075
- 6,
3076
- "d.f32",
3077
- [[5, "1"]]
3078
- ], [
3079
- 1,
3080
- "maxStep",
3081
- "/",
3082
- [
3083
- 6,
3084
- "std.max",
3085
- ["dist", [5, "0.00001"]]
3086
- ]
3087
- ]]
3088
- ]
3089
- ],
3090
- [
3091
- 2,
3092
- "posX",
3093
- "=",
3094
- [
3095
- 1,
3096
- "posX",
3097
- "+",
3098
- [
3099
- 1,
3100
- "dX",
3101
- "*",
3102
- "stepK"
3103
- ]
3104
- ]
3105
- ],
3106
- [
3107
- 2,
3108
- "posY",
3109
- "=",
3110
- [
3111
- 1,
3112
- "posY",
3113
- "+",
3114
- [
3115
- 1,
3116
- "dY",
3117
- "*",
3118
- "stepK"
3119
- ]
3120
- ]
3121
- ],
3122
- [
3123
- 12,
3124
- "crowded",
3125
- [
3126
- 6,
3127
- "d.f32",
3128
- [[5, "0"]]
3129
- ]
3130
- ],
3131
- [
3132
- 13,
3133
- "iN",
3134
- [
3135
- 6,
3136
- "d.i32",
3137
- ["ti"]
3138
- ]
3139
- ],
3140
- [
3141
- 14,
3142
- [
3143
- 12,
3144
- "k",
3145
- [5, "0"]
3146
- ],
3147
- [
3148
- 1,
3149
- "k",
3150
- "<",
3151
- "iN"
3152
- ],
3153
- [
3154
- 102,
3155
- "++",
3156
- "k"
3157
- ],
3158
- [0, [
3159
- [
3160
- 13,
3161
- "kF",
3162
- [
3163
- 6,
3164
- "d.f32",
3165
- ["k"]
3166
- ]
3167
- ],
3168
- [
3169
- 13,
3170
- "other",
3171
- [
3172
- 6,
3173
- "std.textureLoad",
3174
- [
3175
- [
3176
- 7,
3177
- [
3178
- 7,
3179
- "trackLayout",
3180
- "$"
3181
- ],
3182
- "prev"
3183
- ],
3184
- [
3185
- 6,
3186
- "d.vec2u",
3187
- [[
3188
- 6,
3189
- "d.u32",
3190
- [[5, "0"]]
3191
- ], [
3192
- 6,
3193
- "d.u32",
3194
- ["k"]
3195
- ]]
3196
- ],
3197
- [5, "0"]
3198
- ]
3199
- ]
3200
- ],
3201
- [
3202
- 13,
3203
- "odx",
3204
- [
3205
- 1,
3206
- [
3207
- 7,
3208
- "other",
3209
- "x"
3210
- ],
3211
- "-",
3212
- "posX"
3213
- ]
3214
- ],
3215
- [
3216
- 13,
3217
- "ody",
3218
- [
3219
- 1,
3220
- [
3221
- 7,
3222
- "other",
3223
- "y"
3224
- ],
3225
- "-",
3226
- "posY"
3227
- ]
3228
- ],
3229
- [
3230
- 13,
3231
- "near",
3232
- [
3233
- 6,
3234
- "std.select",
3235
- [
3236
- [
3237
- 6,
3238
- "d.f32",
3239
- [[5, "0"]]
3240
- ],
3241
- [
3242
- 6,
3243
- "d.f32",
3244
- [[5, "1"]]
3245
- ],
3246
- [
3247
- 1,
3248
- [
3249
- 6,
3250
- "std.sqrt",
3251
- [[
3252
- 1,
3253
- [
3254
- 1,
3255
- "odx",
3256
- "*",
3257
- "odx"
3258
- ],
3259
- "+",
3260
- [
3261
- 1,
3262
- "ody",
3263
- "*",
3264
- "ody"
3265
- ]
3266
- ]]
3267
- ],
3268
- "<",
3269
- [5, "0.022"]
3270
- ]
3271
- ]
3272
- ]
3273
- ],
3274
- [
3275
- 2,
3276
- "crowded",
3277
- "=",
3278
- [
3279
- 6,
3280
- "std.max",
3281
- ["crowded", [
3282
- 1,
3283
- [
3284
- 1,
3285
- "near",
3286
- "*",
3287
- [
3288
- 7,
3289
- "other",
3290
- "w"
3291
- ]
3292
- ],
3293
- "*",
3294
- [
3295
- 6,
3296
- "std.select",
3297
- [
3298
- [
3299
- 6,
3300
- "d.f32",
3301
- [[5, "0"]]
3302
- ],
3303
- [
3304
- 6,
3305
- "d.f32",
3306
- [[5, "1"]]
3307
- ],
3308
- [
3309
- 1,
3310
- "kF",
3311
- "<",
3312
- [
3313
- 7,
3314
- "P",
3315
- "trackersF"
3316
- ]
3317
- ]
3318
- ]
3319
- ]
3320
- ]]
3321
- ]
3322
- ]
3323
- ]]
3324
- ],
3325
- [
3326
- 2,
3327
- "crowdStreak",
3328
- "=",
3329
- [
3330
- 6,
3331
- "std.select",
3332
- [
3333
- [
3334
- 6,
3335
- "d.f32",
3336
- [[5, "0"]]
3337
- ],
3338
- [
3339
- 1,
3340
- "crowdStreak",
3341
- "+",
3342
- [5, "1"]
3343
- ],
3344
- [
3345
- 1,
3346
- "crowded",
3347
- ">",
3348
- [5, "0.5"]
3349
- ]
3350
- ]
3351
- ]
3352
- ],
3353
- [
3354
- 11,
3355
- [
3356
- 1,
3357
- "crowdStreak",
3358
- ">",
3359
- [5, "30"]
3360
- ],
3361
- [0, [
3362
- [
3363
- 13,
3364
- "hopAng",
3365
- [
3366
- 1,
3367
- [
3368
- 6,
3369
- "trackHash",
3370
- [[
3371
- 1,
3372
- [
3373
- 1,
3374
- [
3375
- 1,
3376
- "iF",
3377
- "*",
3378
- [5, "9.13"]
3379
- ],
3380
- "+",
3381
- [
3382
- 1,
3383
- "gen",
3384
- "*",
3385
- [5, "5.77"]
3386
- ]
3387
- ],
3388
- "+",
3389
- [5, "2.3"]
3390
- ]]
3391
- ],
3392
- "*",
3393
- "TWO_PI"
3394
- ]
3395
- ],
3396
- [
3397
- 13,
3398
- "hopDist",
3399
- [
3400
- 1,
3401
- [5, "0.05"],
3402
- "+",
3403
- [
3404
- 1,
3405
- [5, "0.08"],
3406
- "*",
3407
- [
3408
- 6,
3409
- "trackHash",
3410
- [[
3411
- 1,
3412
- [
3413
- 1,
3414
- "iF",
3415
- "*",
3416
- [5, "4.71"]
3417
- ],
3418
- "+",
3419
- [
3420
- 1,
3421
- "gen",
3422
- "*",
3423
- [5, "8.11"]
3424
- ]
3425
- ]]
3426
- ]
3427
- ]
3428
- ]
3429
- ],
3430
- [
3431
- 2,
3432
- "posX",
3433
- "=",
3434
- [
3435
- 6,
3436
- "std.clamp",
3437
- [
3438
- [
3439
- 1,
3440
- "posX",
3441
- "+",
3442
- [
3443
- 1,
3444
- [
3445
- 6,
3446
- "std.cos",
3447
- ["hopAng"]
3448
- ],
3449
- "*",
3450
- "hopDist"
3451
- ]
3452
- ],
3453
- [5, "0.03"],
3454
- [5, "0.97"]
3455
- ]
3456
- ]
3457
- ],
3458
- [
3459
- 2,
3460
- "posY",
3461
- "=",
3462
- [
3463
- 6,
3464
- "std.clamp",
3465
- [
3466
- [
3467
- 1,
3468
- "posY",
3469
- "+",
3470
- [
3471
- 1,
3472
- [
3473
- 6,
3474
- "std.sin",
3475
- ["hopAng"]
3476
- ],
3477
- "*",
3478
- "hopDist"
3479
- ]
3480
- ],
3481
- [5, "0.03"],
3482
- [5, "0.97"]
3483
- ]
3484
- ]
3485
- ],
3486
- [
3487
- 2,
3488
- "gen",
3489
- "=",
3490
- [
3491
- 1,
3492
- "gen",
3493
- "+",
3494
- [5, "1"]
3495
- ]
3496
- ],
3497
- [
3498
- 2,
3499
- "genStart",
3500
- "=",
3501
- "frame"
3502
- ],
3503
- [
3504
- 2,
3505
- "missStreak",
3506
- "=",
3507
- [
3508
- 6,
3509
- "d.f32",
3510
- [[5, "0"]]
3511
- ]
3512
- ],
3513
- [
3514
- 2,
3515
- "crowdStreak",
3516
- "=",
3517
- [
3518
- 6,
3519
- "d.f32",
3520
- [[5, "0"]]
3521
- ]
3522
- ]
3523
- ]]
3524
- ],
3525
- [
3526
- 13,
3527
- "lifeFrames",
3528
- [
3529
- 1,
3530
- [
3531
- 1,
3532
- [
3533
- 7,
3534
- "P",
3535
- "lifespan"
3536
- ],
3537
- "*",
3538
- [5, "60"]
3539
- ],
3540
- "*",
3541
- [
3542
- 1,
3543
- [5, "0.7"],
3544
- "+",
3545
- [
3546
- 1,
3547
- [5, "0.6"],
3548
- "*",
3549
- [
3550
- 6,
3551
- "trackHash",
3552
- [[
3553
- 1,
3554
- [
3555
- 1,
3556
- "iF",
3557
- "*",
3558
- [5, "4.77"]
3559
- ],
3560
- "+",
3561
- [
3562
- 1,
3563
- "gen",
3564
- "*",
3565
- [5, "1.31"]
3566
- ]
3567
- ]]
3568
- ]
3569
- ]
3570
- ]
3571
- ]
3572
- ],
3573
- [
3574
- 13,
3575
- "expired",
3576
- [
3577
- 1,
3578
- [
3579
- 6,
3580
- "std.select",
3581
- [
3582
- [
3583
- 6,
3584
- "d.f32",
3585
- [[5, "0"]]
3586
- ],
3587
- [
3588
- 6,
3589
- "d.f32",
3590
- [[5, "1"]]
3591
- ],
3592
- [
3593
- 1,
3594
- [
3595
- 1,
3596
- "frame",
3597
- "-",
3598
- "genStart"
3599
- ],
3600
- ">",
3601
- "lifeFrames"
3602
- ]
3603
- ]
3604
- ],
3605
- "*",
3606
- [
3607
- 6,
3608
- "std.select",
3609
- [
3610
- [
3611
- 6,
3612
- "d.f32",
3613
- [[5, "0"]]
3614
- ],
3615
- [
3616
- 6,
3617
- "d.f32",
3618
- [[5, "1"]]
3619
- ],
3620
- [
3621
- 1,
3622
- [
3623
- 7,
3624
- "P",
3625
- "lifespan"
3626
- ],
3627
- ">",
3628
- [5, "0.01"]
3629
- ]
3630
- ]
3631
- ]
3632
- ]
3633
- ],
3634
- [
3635
- 13,
3636
- "lost",
3637
- [
3638
- 6,
3639
- "std.select",
3640
- [
3641
- [
3642
- 6,
3643
- "d.f32",
3644
- [[5, "0"]]
3645
- ],
3646
- [
3647
- 6,
3648
- "d.f32",
3649
- [[5, "1"]]
3650
- ],
3651
- [
3652
- 1,
3653
- "missStreak",
3654
- ">",
3655
- [5, "90"]
3656
- ]
3657
- ]
3658
- ]
3659
- ],
3660
- [
3661
- 11,
3662
- [
3663
- 1,
3664
- [
3665
- 1,
3666
- "expired",
3667
- "+",
3668
- "lost"
3669
- ],
3670
- ">",
3671
- [5, "0.5"]
3672
- ],
3673
- [0, [
3674
- [
3675
- 2,
3676
- "posX",
3677
- "=",
3678
- [
3679
- 1,
3680
- [5, "0.1"],
3681
- "+",
3682
- [
3683
- 1,
3684
- [5, "0.8"],
3685
- "*",
3686
- [
3687
- 6,
3688
- "trackHash",
3689
- [[
3690
- 1,
3691
- [
3692
- 1,
3693
- [
3694
- 1,
3695
- "iF",
3696
- "*",
3697
- [5, "7.31"]
3698
- ],
3699
- "+",
3700
- [
3701
- 1,
3702
- "gen",
3703
- "*",
3704
- [5, "13.7"]
3705
- ]
3706
- ],
3707
- "+",
3708
- [
3709
- 1,
3710
- "frame",
3711
- "*",
3712
- [5, "0.013"]
3713
- ]
3714
- ]]
3715
- ]
3716
- ]
3717
- ]
3718
- ],
3719
- [
3720
- 2,
3721
- "posY",
3722
- "=",
3723
- [
3724
- 1,
3725
- [5, "0.1"],
3726
- "+",
3727
- [
3728
- 1,
3729
- [5, "0.8"],
3730
- "*",
3731
- [
3732
- 6,
3733
- "trackHash",
3734
- [[
3735
- 1,
3736
- [
3737
- 1,
3738
- [
3739
- 1,
3740
- "iF",
3741
- "*",
3742
- [5, "11.93"]
3743
- ],
3744
- "+",
3745
- [
3746
- 1,
3747
- "gen",
3748
- "*",
3749
- [5, "17.3"]
3750
- ]
3751
- ],
3752
- "+",
3753
- [
3754
- 1,
3755
- "frame",
3756
- "*",
3757
- [5, "0.019"]
3758
- ]
3759
- ]]
3760
- ]
3761
- ]
3762
- ]
3763
- ],
3764
- [
3765
- 2,
3766
- "gen",
3767
- "=",
3768
- [
3769
- 1,
3770
- "gen",
3771
- "+",
3772
- [5, "1"]
3773
- ]
3774
- ],
3775
- [
3776
- 2,
3777
- "genStart",
3778
- "=",
3779
- "frame"
3780
- ],
3781
- [
3782
- 2,
3783
- "missStreak",
3784
- "=",
3785
- [
3786
- 6,
3787
- "d.f32",
3788
- [[5, "0"]]
3789
- ]
3790
- ],
3791
- [
3792
- 2,
3793
- "crowdStreak",
3794
- "=",
3795
- [
3796
- 6,
3797
- "d.f32",
3798
- [[5, "0"]]
3799
- ]
3800
- ]
3801
- ]]
3802
- ],
3803
- [
3804
- 13,
3805
- "writeIdx",
3806
- [
3807
- 1,
3808
- [
3809
- 6,
3810
- "std.floor",
3811
- [[
3812
- 1,
3813
- "frame",
3814
- "/",
3815
- [
3816
- 6,
3817
- "d.f32",
3818
- ["TRAIL_EVERY"]
3819
- ]
3820
- ]]
3821
- ],
3822
- "%",
3823
- [
3824
- 6,
3825
- "d.f32",
3826
- ["TRAIL_LEN"]
3827
- ]
3828
- ]
3829
- ],
3830
- [
3831
- 13,
3832
- "shouldWrite",
3833
- [
3834
- 6,
3835
- "std.select",
3836
- [
3837
- [
3838
- 6,
3839
- "d.f32",
3840
- [[5, "0"]]
3841
- ],
3842
- [
3843
- 6,
3844
- "d.f32",
3845
- [[5, "1"]]
3846
- ],
3847
- [
3848
- 1,
3849
- [
3850
- 1,
3851
- "frame",
3852
- "%",
3853
- [
3854
- 6,
3855
- "d.f32",
3856
- ["TRAIL_EVERY"]
3857
- ]
3858
- ],
3859
- "<",
3860
- [5, "0.5"]
3861
- ]
3862
- ]
3863
- ]
3864
- ],
3865
- [
3866
- 12,
3867
- "bbMinX",
3868
- "posX"
3869
- ],
3870
- [
3871
- 12,
3872
- "bbMinY",
3873
- "posY"
3874
- ],
3875
- [
3876
- 12,
3877
- "bbMaxX",
3878
- "posX"
3879
- ],
3880
- [
3881
- 12,
3882
- "bbMaxY",
3883
- "posY"
3884
- ],
3885
- [
3886
- 14,
3887
- [
3888
- 12,
3889
- "j",
3890
- [5, "0"]
3891
- ],
3892
- [
3893
- 1,
3894
- "j",
3895
- "<",
3896
- "TRAIL_LEN"
3897
- ],
3898
- [
3899
- 102,
3900
- "++",
3901
- "j"
3902
- ],
3903
- [0, [
3904
- [
3905
- 13,
3906
- "jF",
3907
- [
3908
- 6,
3909
- "d.f32",
3910
- ["j"]
3911
- ]
3912
- ],
3913
- [
3914
- 12,
3915
- "e",
3916
- [
3917
- 6,
3918
- "std.textureLoad",
3919
- [
3920
- [
3921
- 7,
3922
- [
3923
- 7,
3924
- "trackLayout",
3925
- "$"
3926
- ],
3927
- "prev"
3928
- ],
3929
- [
3930
- 6,
3931
- "d.vec2u",
3932
- [[
3933
- 6,
3934
- "d.u32",
3935
- [[
3936
- 1,
3937
- [5, "2"],
3938
- "+",
3939
- "j"
3940
- ]]
3941
- ], "ti"]
3942
- ],
3943
- [5, "0"]
3944
- ]
3945
- ]
3946
- ],
3947
- [
3948
- 13,
3949
- "isSlot",
3950
- [
3951
- 6,
3952
- "std.select",
3953
- [
3954
- [
3955
- 6,
3956
- "d.f32",
3957
- [[5, "0"]]
3958
- ],
3959
- [
3960
- 6,
3961
- "d.f32",
3962
- [[5, "1"]]
3963
- ],
3964
- [
3965
- 1,
3966
- [
3967
- 6,
3968
- "std.abs",
3969
- [[
3970
- 1,
3971
- "jF",
3972
- "-",
3973
- "writeIdx"
3974
- ]]
3975
- ],
3976
- "<",
3977
- [5, "0.5"]
3978
- ]
3979
- ]
3980
- ]
3981
- ],
3982
- [
3983
- 13,
3984
- "doWrite",
3985
- [
3986
- 1,
3987
- "isSlot",
3988
- "*",
3989
- "shouldWrite"
3990
- ]
3991
- ],
3992
- [
3993
- 2,
3994
- "e",
3995
- "=",
3996
- [
3997
- 6,
3998
- "std.mix",
3999
- [
4000
- "e",
4001
- [
4002
- 6,
4003
- "d.vec4f",
4004
- [
4005
- "posX",
4006
- "posY",
4007
- "frame",
4008
- "gen"
4009
- ]
4010
- ],
4011
- "doWrite"
4012
- ]
4013
- ]
4014
- ],
4015
- [
4016
- 6,
4017
- "std.textureStore",
4018
- [
4019
- [
4020
- 7,
4021
- [
4022
- 7,
4023
- "trackLayout",
4024
- "$"
4025
- ],
4026
- "next"
4027
- ],
4028
- [
4029
- 6,
4030
- "d.vec2u",
4031
- [[
4032
- 6,
4033
- "d.u32",
4034
- [[
4035
- 1,
4036
- [5, "2"],
4037
- "+",
4038
- "j"
4039
- ]]
4040
- ], "ti"]
4041
- ],
4042
- "e"
4043
- ]
4044
- ],
4045
- [
4046
- 6,
4047
- "std.textureStore",
4048
- [
4049
- [
4050
- 7,
4051
- [
4052
- 7,
4053
- "trackLayout",
4054
- "$"
4055
- ],
4056
- "present"
4057
- ],
4058
- [
4059
- 6,
4060
- "d.vec2u",
4061
- [[
4062
- 6,
4063
- "d.u32",
4064
- [[
4065
- 1,
4066
- [5, "2"],
4067
- "+",
4068
- "j"
4069
- ]]
4070
- ], "ti"]
4071
- ],
4072
- "e"
4073
- ]
4074
- ],
4075
- [
4076
- 13,
4077
- "live",
4078
- [
4079
- 1,
4080
- [
4081
- 6,
4082
- "std.select",
4083
- [
4084
- [
4085
- 6,
4086
- "d.f32",
4087
- [[5, "0"]]
4088
- ],
4089
- [
4090
- 6,
4091
- "d.f32",
4092
- [[5, "1"]]
4093
- ],
4094
- [
4095
- 1,
4096
- [
4097
- 6,
4098
- "std.abs",
4099
- [[
4100
- 1,
4101
- [
4102
- 7,
4103
- "e",
4104
- "w"
4105
- ],
4106
- "-",
4107
- "gen"
4108
- ]]
4109
- ],
4110
- "<",
4111
- [5, "0.5"]
4112
- ]
4113
- ]
4114
- ],
4115
- "*",
4116
- [
4117
- 6,
4118
- "std.select",
4119
- [
4120
- [
4121
- 6,
4122
- "d.f32",
4123
- [[5, "0"]]
4124
- ],
4125
- [
4126
- 6,
4127
- "d.f32",
4128
- [[5, "1"]]
4129
- ],
4130
- [
4131
- 1,
4132
- [
4133
- 7,
4134
- "e",
4135
- "z"
4136
- ],
4137
- ">",
4138
- [5, "0.5"]
4139
- ]
4140
- ]
4141
- ]
4142
- ]
4143
- ],
4144
- [
4145
- 2,
4146
- "bbMinX",
4147
- "=",
4148
- [
4149
- 6,
4150
- "std.min",
4151
- ["bbMinX", [
4152
- 6,
4153
- "std.mix",
4154
- [
4155
- "posX",
4156
- [
4157
- 7,
4158
- "e",
4159
- "x"
4160
- ],
4161
- "live"
4162
- ]
4163
- ]]
4164
- ]
4165
- ],
4166
- [
4167
- 2,
4168
- "bbMinY",
4169
- "=",
4170
- [
4171
- 6,
4172
- "std.min",
4173
- ["bbMinY", [
4174
- 6,
4175
- "std.mix",
4176
- [
4177
- "posY",
4178
- [
4179
- 7,
4180
- "e",
4181
- "y"
4182
- ],
4183
- "live"
4184
- ]
4185
- ]]
4186
- ]
4187
- ],
4188
- [
4189
- 2,
4190
- "bbMaxX",
4191
- "=",
4192
- [
4193
- 6,
4194
- "std.max",
4195
- ["bbMaxX", [
4196
- 6,
4197
- "std.mix",
4198
- [
4199
- "posX",
4200
- [
4201
- 7,
4202
- "e",
4203
- "x"
4204
- ],
4205
- "live"
4206
- ]
4207
- ]]
4208
- ]
4209
- ],
4210
- [
4211
- 2,
4212
- "bbMaxY",
4213
- "=",
4214
- [
4215
- 6,
4216
- "std.max",
4217
- ["bbMaxY", [
4218
- 6,
4219
- "std.mix",
4220
- [
4221
- "posY",
4222
- [
4223
- 7,
4224
- "e",
4225
- "y"
4226
- ],
4227
- "live"
4228
- ]
4229
- ]]
4230
- ]
4231
- ]
4232
- ]]
4233
- ],
4234
- [
4235
- 13,
4236
- "bbOut",
4237
- [
4238
- 6,
4239
- "d.vec4f",
4240
- [
4241
- "bbMinX",
4242
- "bbMinY",
4243
- "bbMaxX",
4244
- "bbMaxY"
4245
- ]
4246
- ]
4247
- ],
4248
- [
4249
- 6,
4250
- "std.textureStore",
4251
- [
4252
- [
4253
- 7,
4254
- [
4255
- 7,
4256
- "trackLayout",
4257
- "$"
4258
- ],
4259
- "next"
4260
- ],
4261
- [
4262
- 6,
4263
- "d.vec2u",
4264
- [[
4265
- 6,
4266
- "d.u32",
4267
- ["AABB_COL"]
4268
- ], "ti"]
4269
- ],
4270
- "bbOut"
4271
- ]
4272
- ],
4273
- [
4274
- 6,
4275
- "std.textureStore",
4276
- [
4277
- [
4278
- 7,
4279
- [
4280
- 7,
4281
- "trackLayout",
4282
- "$"
4283
- ],
4284
- "present"
4285
- ],
4286
- [
4287
- 6,
4288
- "d.vec2u",
4289
- [[
4290
- 6,
4291
- "d.u32",
4292
- ["AABB_COL"]
4293
- ], "ti"]
4294
- ],
4295
- "bbOut"
4296
- ]
4297
- ],
4298
- [
4299
- 13,
4300
- "headOut",
4301
- [
4302
- 6,
4303
- "d.vec4f",
4304
- [
4305
- "posX",
4306
- "posY",
4307
- "frame",
4308
- [
4309
- 1,
4310
- "genStart",
4311
- "+",
4312
- [5, "1"]
4313
- ]
4314
- ]
4315
- ]
4316
- ],
4317
- [
4318
- 13,
4319
- "metaOut",
4320
- [
4321
- 6,
4322
- "d.vec4f",
4323
- [
4324
- "missStreak",
4325
- "sumW",
4326
- "gen",
4327
- "crowdStreak"
4328
- ]
4329
- ]
4330
- ],
4331
- [
4332
- 6,
4333
- "std.textureStore",
4334
- [
4335
- [
4336
- 7,
4337
- [
4338
- 7,
4339
- "trackLayout",
4340
- "$"
4341
- ],
4342
- "next"
4343
- ],
4344
- [
4345
- 6,
4346
- "d.vec2u",
4347
- [[
4348
- 6,
4349
- "d.u32",
4350
- [[5, "0"]]
4351
- ], "ti"]
4352
- ],
4353
- "headOut"
4354
- ]
4355
- ],
4356
- [
4357
- 6,
4358
- "std.textureStore",
4359
- [
4360
- [
4361
- 7,
4362
- [
4363
- 7,
4364
- "trackLayout",
4365
- "$"
4366
- ],
4367
- "present"
4368
- ],
4369
- [
4370
- 6,
4371
- "d.vec2u",
4372
- [[
4373
- 6,
4374
- "d.u32",
4375
- [[5, "0"]]
4376
- ], "ti"]
4377
- ],
4378
- "headOut"
4379
- ]
4380
- ],
4381
- [
4382
- 6,
4383
- "std.textureStore",
4384
- [
4385
- [
4386
- 7,
4387
- [
4388
- 7,
4389
- "trackLayout",
4390
- "$"
4391
- ],
4392
- "next"
4393
- ],
4394
- [
4395
- 6,
4396
- "d.vec2u",
4397
- [[
4398
- 6,
4399
- "d.u32",
4400
- [[5, "1"]]
4401
- ], "ti"]
4402
- ],
4403
- "metaOut"
4404
- ]
4405
- ],
4406
- [
4407
- 6,
4408
- "std.textureStore",
4409
- [
4410
- [
4411
- 7,
4412
- [
4413
- 7,
4414
- "trackLayout",
4415
- "$"
4416
- ],
4417
- "present"
4418
- ],
4419
- [
4420
- 6,
4421
- "d.vec2u",
4422
- [[
4423
- 6,
4424
- "d.u32",
4425
- [[5, "1"]]
4426
- ], "ti"]
4427
- ],
4428
- "metaOut"
4429
- ]
4430
- ]
4431
- ]]
4432
- },
4433
- externals: {
4434
- "trackLayout": () => trackLayout,
4435
- "d.f32": () => f32,
4436
- "std.textureLoad": () => textureLoad,
4437
- "d.vec2u": () => vec2u,
4438
- "d.u32": () => u32,
4439
- "trackHash": () => trackHash,
4440
- "std.max": () => max,
4441
- "std.textureDimensions": () => textureDimensions,
4442
- "std.clamp": () => clamp,
4443
- "score": () => score,
4444
- "std.select": () => select,
4445
- "std.exp": () => exp,
4446
- "std.sqrt": () => sqrt,
4447
- "FEAT_GRID": () => FEAT_GRID,
4448
- "TWO_PI": () => TWO_PI,
4449
- "std.sin": () => sin,
4450
- "std.cos": () => cos,
4451
- "std.min": () => min,
4452
- "d.i32": () => i32,
4453
- "std.floor": () => floor,
4454
- "TRAIL_EVERY": () => TRAIL_EVERY,
4455
- "TRAIL_LEN": () => TRAIL_LEN,
4456
- "std.abs": () => abs,
4457
- "std.mix": () => mix,
4458
- "d.vec4f": () => vec4f,
4459
- "std.textureStore": () => textureStore,
4460
- "AABB_COL": () => AABB_COL
4461
- }
4462
- }) && $.f)({})).$name("trackerPursuit");
4463
- }
4464
- function createTrackerPursuitSim(slots) {
4465
- return (params) => {
4466
- const { childNode, gpu, getCpuValue } = params;
4467
- if (!childNode) return null;
4468
- const root = gpu?.root;
4469
- if (!root) return null;
4470
- const scoreFn = featureScoreFn(slots.mode);
4471
- const featureKernel = buildFeatureGridKernel(scoreFn);
4472
- const trackKernel = buildPursuitKernel(slots.mode, scoreFn);
4473
- const paramsBuf = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(root.createUniform(TrackParams), "paramsBuf");
4474
- const sim = createFeedbackTrailSim(params, {
4475
- size: [STATE_W, MAX_TRACKERS],
4476
- format: STATE_FORMAT,
4477
- textures: { grid: FEAT_GRID },
4478
- bindGroups: ({ childTexture, display, textures }, read, write) => root.createBindGroup(trackLayout, {
4479
- src: childTexture,
4480
- featGrid: textures.grid,
4481
- prev: read.state,
4482
- next: write.state,
4483
- present: display,
4484
- params: paramsBuf.buffer
4485
- }),
4486
- staticGroups: ({ childTexture, textures }) => root.createBindGroup(featureLayout, {
4487
- src: childTexture,
4488
- grid: textures.grid,
4489
- params: paramsBuf.buffer
4490
- })
4491
- });
4492
- if (!sim) return null;
4493
- const featurePipeline = createGuardedCompute(root, /* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((gx, gy) => {
4494
- "use gpu";
4495
- featureKernel(gx, gy);
4496
- }), {
4497
- v: 2,
4498
- name: void 0,
4499
- ast: {
4500
- "params": [{
4501
- "type": "i",
4502
- "name": "gx"
4503
- }, {
4504
- "type": "i",
4505
- "name": "gy"
4506
- }],
4507
- "body": [0, [[
4508
- 6,
4509
- "featureKernel",
4510
- ["gx", "gy"]
4511
- ]]]
4512
- },
4513
- externals: { "featureKernel": () => featureKernel }
4514
- }) && $.f)({}), { size: [FEAT_GRID, FEAT_GRID] });
4515
- const simPipeline = createGuardedCompute(root, /* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((ti) => {
4516
- "use gpu";
4517
- trackKernel(ti);
4518
- }), {
4519
- v: 2,
4520
- name: void 0,
4521
- ast: {
4522
- "params": [{
4523
- "type": "i",
4524
- "name": "ti"
4525
- }],
4526
- "body": [0, [[
4527
- 6,
4528
- "trackKernel",
4529
- ["ti"]
4530
- ]]]
4531
- },
4532
- externals: { "trackKernel": () => trackKernel }
4533
- }) && $.f)({}), { size: [MAX_TRACKERS] });
4534
- return {
4535
- outputs: {
4536
- childTexture: sim.childTexture,
4537
- trackState: sim.display
4538
- },
4539
- bindInputs: sim.bindInputs,
4540
- getComputeNodes: (frameParams) => sim.tick(frameParams, ({ groups, shared, dt }) => {
4541
- paramsBuf.write({
4542
- dt,
4543
- trackersF: getCpuValue(slots.trackers) ?? 4,
4544
- agility: getCpuValue(slots.agility) ?? .5,
4545
- threshold: getCpuValue(slots.threshold) ?? .15,
4546
- variance: getCpuValue(slots.variance) ?? .5,
4547
- lifespan: getCpuValue(slots.lifespan) ?? 6
4548
- });
4549
- return [featurePipeline.with(shared), simPipeline.with(groups)];
4550
- })
4551
- };
4552
- };
4553
- }
4554
- var num = (v, f) => typeof v === "number" ? v : f;
4555
- var DETECTION_REFERENCE_HEIGHT = 1080;
4556
- function detectionOverlay(slots) {
4557
- return (params) => {
4558
- const { uniforms, ctx, childNode, convertToTexture, propValues } = params;
4559
- if (!childNode) return ZERO;
4560
- const texKey = convertToTexture(childNode).key;
4561
- const modeMap = {
4562
- alpha: 0,
4563
- bright: 1,
4564
- dark: 2,
4565
- red: 3,
4566
- green: 4,
4567
- blue: 5
4568
- };
4569
- const layoutMap = {
4570
- grid: 0,
4571
- quadtree: 1,
4572
- mosaic: 2
4573
- };
4574
- const labelMap = {
4575
- none: 0,
4576
- dimensions: 1,
4577
- percentage: 2
4578
- };
4579
- const posMap = {
4580
- "bottom-left": 0,
4581
- "bottom-right": 1,
4582
- "top-left": 2,
4583
- "top-right": 3
4584
- };
4585
- const rawMode = propValues[slots.detectionMode.name];
4586
- const modeStr = [
4587
- "alpha",
4588
- "bright",
4589
- "dark",
4590
- "red",
4591
- "green",
4592
- "blue"
4593
- ][typeof rawMode === "number" ? rawMode : modeMap[rawMode] ?? 1];
4594
- const rawLayout = propValues[slots.layout.name];
4595
- const layoutStr = [
4596
- "grid",
4597
- "quadtree",
4598
- "mosaic"
4599
- ][typeof rawLayout === "number" ? rawLayout : layoutMap[rawLayout] ?? 2];
4600
- let D = Math.round(num(propValues[slots.maxDepth.name], 2));
4601
- if (!Number.isFinite(D)) D = 2;
4602
- D = Math.max(0, Math.min(5, D));
4603
- if (layoutStr === "grid") D = 0;
4604
- const rawBox = propValues[slots.boxStyle.name];
4605
- const cornerStyle = (typeof rawBox === "string" ? rawBox : "corners") === "corners";
4606
- const rawLabel = propValues[slots.labelMode.name];
4607
- const labelStr = [
4608
- "none",
4609
- "dimensions",
4610
- "percentage"
4611
- ][typeof rawLabel === "number" ? rawLabel : labelMap[rawLabel] ?? 0];
4612
- const labelsOn = labelStr !== "none";
4613
- const rawPos = propValues[slots.labelPosition.name];
4614
- const labelPos = typeof rawPos === "number" ? rawPos : posMap[rawPos] ?? 1;
4615
- const atlasKey = labelsOn ? createGlyphStripAtlas(params, {
4616
- label: "DetectionOverlay:atlas",
4617
- familyProp: slots.fontFamily.name,
4618
- weightProp: slots.fontWeight.name
4619
- }).key : void 0;
4620
- return new Expr((ec) => {
4621
- const p = ec.freshLocal("ot");
4622
- const s = [];
4623
- const f = {
4624
- p,
4625
- U: (name) => uniforms[slots[name].name]._emit(ec),
4626
- L: (n) => formatFloat(n),
4627
- s,
4628
- sampleChild: (uvWgsl) => `textureSampleLevel(tex.$.${texKey}, samp.$.linearClamp, ${uvWgsl}, 0.0)`,
4629
- UN: ec.external(unpremultiplyAlpha, "unpremultiplyAlpha"),
4630
- modeStr
4631
- };
4632
- const { U, L: L$1 } = f;
4633
- s.push(`let ${p}_res = ${ctx.logicalViewportSize._emit(ec)};`);
4634
- s.push(`let ${p}_scaleFactor = ${p}_res.y / ${L$1(DETECTION_REFERENCE_HEIGHT)};`);
4635
- const uvE = ctx.uv._emit(ec);
4636
- s.push(`let ${p}_fragPx = vec2f((${uvE}).x * ${p}_res.x, (${uvE}).y * ${p}_res.y);`);
4637
- s.push(`let ${p}_aa = max(max(fwidth(${p}_fragPx.x), fwidth(${p}_fragPx.y)), ${L$1(1e-4)});`);
4638
- s.push(`let ${p}_cellPx = max(${U("cellSize")} * ${p}_scaleFactor, ${L$1(4)});`);
4639
- s.push(`let ${p}_minSize = ${L$1(3)} * ${p}_scaleFactor;`);
4640
- s.push(`let ${p}_lineHalf = max(${U("lineWidth")} * ${p}_scaleFactor * ${L$1(.5)}, ${L$1(.5)});`);
4641
- s.push(`let ${p}_cornerRadiusPx = ${U("cornerRadius")} * ${p}_scaleFactor;`);
4642
- s.push(`let ${p}_boxInset = ${p}_lineHalf + ${p}_scaleFactor * ${L$1(1.5)};`);
4643
- s.push(`let ${p}_thr = ${U("threshold")};`);
4644
- partitionWalkStmts(f, layoutStr, D);
4645
- contentBBoxStmts(f);
4646
- s.push(`var ${p}_dst = ${f.sampleChild(`(${uvE})`)};`);
4647
- detectionBoxStmts(f, cornerStyle);
4648
- if (labelsOn && atlasKey) glyphPillLabelStmts(f, {
4649
- labelStr,
4650
- labelPos,
4651
- atlasKey
4652
- });
4653
- for (const line of s) ec.statement(line);
4654
- return straightFromPremul(`${p}_dst`);
4655
- });
4656
- };
4657
- }
4658
- function motionTrackerHud(slots) {
4659
- return (params) => {
4660
- const { uniforms, ctx, childNode, convertToTexture, computeOutputs } = params;
4661
- if (!childNode) return ZERO;
4662
- const texKey = (computeOutputs?.childTexture ?? convertToTexture(childNode)).key;
4663
- const stateKit = computeOutputs?.trackState;
4664
- return new Expr((ec) => {
4665
- const p = ec.freshLocal("kft");
4666
- const s = [];
4667
- const f = {
4668
- p,
4669
- U: (name) => uniforms[slots[name].name]._emit(ec),
4670
- L: (n) => formatFloat(n),
4671
- s
4672
- };
4673
- const { U, L: L$1 } = f;
4674
- const uvE = ctx.uv._emit(ec);
4675
- s.push(`let ${p}_res = ${ctx.logicalViewportSize._emit(ec)};`);
4676
- s.push(`let ${p}_sf = ${p}_res.y / ${L$1(DETECTION_REFERENCE_HEIGHT)};`);
4677
- s.push(`let ${p}_px = vec2f((${uvE}).x * ${p}_res.x, (${uvE}).y * ${p}_res.y);`);
4678
- s.push(`let ${p}_aa = max(max(fwidth(${p}_px.x), fwidth(${p}_px.y)), ${L$1(1e-4)});`);
4679
- s.push(`let ${p}_lw = max(${U("lineWidth")} * ${p}_sf, ${L$1(.5)});`);
4680
- s.push(`let ${p}_ms = max(${U("markerSize")} * ${p}_sf, ${L$1(4)});`);
4681
- s.push(`var ${p}_dst = textureSampleLevel(tex.$.${texKey}, samp.$.linearClamp, (${uvE}), 0.0);`);
4682
- if (stateKit) {
4683
- const stateKey = stateKit.key;
4684
- const load = (col) => `textureLoad(tex.$.${stateKey}, vec2u(${col}, ti), 0)`;
4685
- s.push(`let ${p}_n = u32(clamp(${U("trackers")}, ${L$1(1)}, ${L$1(64)}));`);
4686
- s.push(`for (var ti = 0u; ti < ${p}_n; ti = ti + 1u) {`);
4687
- s.push(`let head = ${load("0u")};`);
4688
- s.push(`if (head.w < 0.5) { continue; }`);
4689
- s.push(`let bb = ${load(`14u`)};`);
4690
- s.push(`let pad = ${p}_ms + ${p}_lw * ${L$1(4)} + ${p}_aa * ${L$1(2)};`);
4691
- s.push(`let bbMin = vec2f(bb.x * ${p}_res.x, bb.y * ${p}_res.y) - vec2f(pad);`);
4692
- s.push(`let bbMax = vec2f(bb.z * ${p}_res.x, bb.w * ${p}_res.y) + vec2f(pad);`);
4693
- s.push(`if (all(${p}_px >= bbMin) && all(${p}_px <= bbMax)) {`);
4694
- s.push(`let mta = ${load("1u")};`);
4695
- s.push(`let tp = vec2f(head.x * ${p}_res.x, head.y * ${p}_res.y);`);
4696
- s.push(`let searching = select(${L$1(1)}, ${L$1(.45)}, mta.x > ${L$1(4)});`);
4697
- ringTrailStmts(f, {
4698
- len: 12,
4699
- every: 8,
4700
- load,
4701
- stages: [diamondStamp, pathSegmentStamp(8)]
4702
- });
4703
- bracketGizmo(f);
4704
- s.push(`}`);
4705
- s.push(`}`);
4706
- }
4707
- for (const line of s) ec.statement(line);
4708
- return straightFromPremul(`${p}_dst`);
4709
- });
4710
- };
4711
- }
4712
- export { motionTrackerHud as n, createTrackerPursuitSim as r, detectionOverlay as t };