shaders 3.0.448 → 3.0.450

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 (443) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/core/{AngularBlur-xU811GPM.js → AngularBlur-4jt7bNoF.js} +15 -15
  3. package/dist/core/{Arc-DYvFxtGy.js → Arc-DXIfbBgd.js} +13 -12
  4. package/dist/core/{Ascii-ChE4BP7J.js → Ascii-GDof03Ca.js} +51 -53
  5. package/dist/core/{Aurora-BThE6pbb.js → Aurora-CS4vewUW.js} +63 -68
  6. package/dist/core/{BarShift-DdjkPSk3.js → BarShift-BtnYLQ0B.js} +31 -32
  7. package/dist/core/{BarnDoors-B_kxVuec.js → BarnDoors-Dw9K-amf.js} +21 -22
  8. package/dist/core/{Beam-C7zPHuIU.js → Beam-D_cyaMjJ.js} +32 -39
  9. package/dist/core/{Bend-CFcEjifF.js → Bend-CSs5UIh8.js} +27 -28
  10. package/dist/core/{Blob-CgUolAhz.js → Blob-h25zA5WH.js} +54 -60
  11. package/dist/core/{BlockDissolve-CLSxXB4e.js → BlockDissolve-CKN_KvLP.js} +21 -20
  12. package/dist/core/{BlockNoise-BgEJOicU.js → BlockNoise-DhKyd_F7.js} +16 -14
  13. package/dist/core/{BlueNoise-BqMtBLxM.js → BlueNoise-Auhzq4x5.js} +12 -10
  14. package/dist/core/{Blur-Xaa6jVPT.js → Blur-CcxMqYsu.js} +27 -27
  15. package/dist/core/{Boids-B8QUNxRL.js → Boids-D51U46GF.js} +916 -787
  16. package/dist/core/{BokehBlur-B5fql96U.js → BokehBlur-Cfaqbh3I.js} +104 -104
  17. package/dist/core/{BrickPattern-EAD5HD4e.js → BrickPattern-tASwilX0.js} +34 -38
  18. package/dist/core/{BrightnessContrast-mbv32DkA.js → BrightnessContrast-ZCKqJW7i.js} +9 -10
  19. package/dist/core/{BrushedMetal-B10fDdGt.js → BrushedMetal-B6gSVB28.js} +81 -84
  20. package/dist/core/{Bulge-C1Pq4DHk.js → Bulge-dCYtWP4S.js} +19 -19
  21. package/dist/core/{CRTScreen-Ctx0Mxtb.js → CRTScreen-CVY1lOGL.js} +35 -37
  22. package/dist/core/{CarbonFiber-DSSARe6R.js → CarbonFiber-Do9EONKv.js} +81 -84
  23. package/dist/core/{Chalkboard-C7srb54u.js → Chalkboard-0hyyGnYl.js} +59 -61
  24. package/dist/core/{ChannelBlur-DE3T4-pj.js → ChannelBlur-DcZKCKXi.js} +13 -15
  25. package/dist/core/{CheckerWipe-Dp49-iaT.js → CheckerWipe-BIE62tJ1.js} +23 -23
  26. package/dist/core/{Checkerboard-oVWtS0rz.js → Checkerboard-CRnfu63u.js} +31 -31
  27. package/dist/core/{Chevron-CCD5JTRA.js → Chevron-Ld_v4z9T.js} +20 -20
  28. package/dist/core/{ChromaFlow-BiE9Mes0.js → ChromaFlow-CTWeauIr.js} +32 -33
  29. package/dist/core/{ChromaticAberration-XEasUrD3.js → ChromaticAberration-CxuOb68m.js} +13 -13
  30. package/dist/core/{Circle-CvQ9duDU.js → Circle-XP1B5rsN.js} +14 -13
  31. package/dist/core/{ColorWheel-CXvfWAjN.js → ColorWheel-CFU_OmOW.js} +30 -34
  32. package/dist/core/{CompressionArtifacts-BDaP7XI6.js → CompressionArtifacts-Bc9xTdQP.js} +64 -66
  33. package/dist/core/{ConcentricSpin-D06hFXEb.js → ConcentricSpin-DTJytpAk.js} +39 -41
  34. package/dist/core/{ConicGradient-Cg6vy3gl.js → ConicGradient-C-4uDmQj.js} +17 -18
  35. package/dist/core/{ContourLines-Cg2Dlmcr.js → ContourLines-C8p6f-1y.js} +29 -30
  36. package/dist/core/{CornerPin-wtqiMUCa.js → CornerPin-CB92kX10.js} +55 -57
  37. package/dist/core/{Crescent-Co__JqEE.js → Crescent-Dk4nlG8T.js} +14 -13
  38. package/dist/core/{Cross-CFytbdrZ.js → Cross-DsnI1U8g.js} +14 -13
  39. package/dist/core/{Crystal-U7VqhbHy.js → Crystal-CR_sG2y7.js} +143 -152
  40. package/dist/core/{CurlNoise-BXWYh1Qi.js → CurlNoise-DJ27ih0F.js} +16 -14
  41. package/dist/core/{CursorRipples-APbH7SVR.js → CursorRipples-CuO3sZga.js} +59 -58
  42. package/dist/core/{CursorTrail-D5Fj0wGp.js → CursorTrail-d4xx4QpM.js} +72 -71
  43. package/dist/core/{DataMosh-CWRLpjU3.js → DataMosh-BhvE-2yC.js} +71 -73
  44. package/dist/core/{DiamondGradient-C_2VoEiQ.js → DiamondGradient-CtOVKrYf.js} +23 -25
  45. package/dist/core/{DiamondWipe-BkdNODD1.js → DiamondWipe-D-yiQBVj.js} +22 -22
  46. package/dist/core/{DiffuseBlur-Dl7S4KBW.js → DiffuseBlur-BDf-Czxz.js} +11 -12
  47. package/dist/core/{DisplacementMap-lv-qoLem.js → DisplacementMap-B_jf_2lj.js} +26 -26
  48. package/dist/core/{Dither-B33J_gJU.js → Dither-D3P6EJU8.js} +116 -119
  49. package/dist/core/{DotGrid-DaOhiRaL.js → DotGrid-BnSVhJlh.js} +37 -39
  50. package/dist/core/{DropShadow-C5Z2Rs2C.js → DropShadow-BSKVH3n3.js} +37 -37
  51. package/dist/core/{Duotone-x4cywJbU.js → Duotone-DfjYuK2u.js} +7 -7
  52. package/dist/core/{Ellipse-CrQ1XYjx.js → Ellipse-D7_1QKaa.js} +13 -12
  53. package/dist/core/{Emboss-DNwO5JcE.js → Emboss-ZiPslqzl.js} +76 -78
  54. package/dist/core/{Engraving-FsaRQiyI.js → Engraving-DsfkKajz.js} +57 -59
  55. package/dist/core/{ErosionNoise-CloHpdFT.js → ErosionNoise-SELArv9H.js} +13 -11
  56. package/dist/core/{Exposure-mO6KjYvc.js → Exposure-A7WlTOti.js} +4 -5
  57. package/dist/core/{FallingLines-D_1wHUkx.js → FallingLines-9PRMb_Ou.js} +40 -42
  58. package/dist/core/{FilmGrain-DDhrsw94.js → FilmGrain-SXzVDesw.js} +17 -18
  59. package/dist/core/{FilmStock-BaP2aTLu.js → FilmStock-RK4fk4m0.js} +74 -74
  60. package/dist/core/{Flip-DYuqyJva.js → Flip-DjoNWG4v.js} +10 -12
  61. package/dist/core/{FloatingParticles-DJwNpHtZ.js → FloatingParticles-D7vUF5g7.js} +637 -451
  62. package/dist/core/{FlowField-D4iGiDic.js → FlowField-tHrXhd1b.js} +24 -23
  63. package/dist/core/{Flower-D0MqoayS.js → Flower-BfehbmmG.js} +14 -13
  64. package/dist/core/{FlowingGradient-9Zu0Pu4a.js → FlowingGradient-BTKjkx5F.js} +38 -39
  65. package/dist/core/{FlutedGlass-C_clmShu.js → FlutedGlass-uFT7iy_9.js} +43 -43
  66. package/dist/core/{Fog-C_kY5pWB.js → Fog-Cu1CMATa.js} +172 -171
  67. package/dist/core/{Form3D-D4aXZGoJ.js → Form3D-D0ji-MeC.js} +259 -267
  68. package/dist/core/{FractalNoise-mMVLGmIv.js → FractalNoise-D9HYiOdr.js} +30 -28
  69. package/dist/core/{Frost-M53tZlcf.js → Frost-DQZZxdTk.js} +70 -73
  70. package/dist/core/{GaborNoise-BhXywN1d.js → GaborNoise-D7BP0K4g.js} +16 -14
  71. package/dist/core/{Glass-B9D_52op.js → Glass-CzCVnGn-.js} +6 -4
  72. package/dist/core/{GlassTiles-DIkGYgVE.js → GlassTiles-DJzPPqwz.js} +23 -26
  73. package/dist/core/{Glitch-CUOJt5VX.js → Glitch-D1Dx8__X.js} +84 -72
  74. package/dist/core/{Glow-D5AdnLvU.js → Glow-Bd9_o_Kv.js} +76 -77
  75. package/dist/core/{Godrays-BeQCWVw7.js → Godrays-DRPRWGPm.js} +52 -56
  76. package/dist/core/{Goo-C0_0QYne.js → Goo-28A_pNBg.js} +64 -65
  77. package/dist/core/{GradientMap-DOVK05_a.js → GradientMap-D8dv-1AX.js} +47 -50
  78. package/dist/core/{Grayscale-Uv_6LYA9.js → Grayscale-BlVXBVwW.js} +6 -6
  79. package/dist/core/{Grid-Dbp4DoXZ.js → Grid-D9vlHvs1.js} +46 -48
  80. package/dist/core/{GridDistortion-D_21zIrm.js → GridDistortion-BpqDvqj6.js} +63 -62
  81. package/dist/core/{Group-DXiB5Qrx.js → Group-bwQnJRec.js} +1 -1
  82. package/dist/core/{HTMLInCanvas-xXPLTYIv.js → HTMLInCanvas-gCf64ozE.js} +1 -1
  83. package/dist/core/{Halftone-DszIQsyx.js → Halftone-B_WouxiP.js} +59 -62
  84. package/dist/core/{Heart-COpnSJPD.js → Heart-Bmt2TLNz.js} +12 -11
  85. package/dist/core/{Heatmap-CMm8SD-P.js → Heatmap-Ruef741_.js} +57 -55
  86. package/dist/core/{HexGrid-B6wNW-45.js → HexGrid-By9k0YuI.js} +32 -35
  87. package/dist/core/{Hologram-XejRN51V.js → Hologram-Cf25ONOE.js} +62 -66
  88. package/dist/core/{Holographic-D1G_Ou1y.js → Holographic-C9RzYykt.js} +58 -61
  89. package/dist/core/{HueShift-BCDgYfJs.js → HueShift-V3gQVuIo.js} +7 -10
  90. package/dist/core/{ImageTexture-BE2Jlkg6.js → ImageTexture-DAUR2N5Q.js} +3 -2
  91. package/dist/core/{InkFlow-DJaJqula.js → InkFlow-DlP1gmr4.js} +156 -156
  92. package/dist/core/{Invert-DDmITZjt.js → Invert-K648khvD.js} +4 -4
  93. package/dist/core/{IrisWipe-BFs5DDSa.js → IrisWipe-Clkd_5CA.js} +20 -23
  94. package/dist/core/{IsometricCubes-ChKqYTIw.js → IsometricCubes-CzfAwpQ5.js} +37 -42
  95. package/dist/core/{Kaleidoscope-C8_-tC6T.js → Kaleidoscope-B9k6HkNn.js} +21 -21
  96. package/dist/core/{KeyFrames-xR9ZzHKj.js → KeyFrames-DX6JFhsy.js} +130 -129
  97. package/dist/core/{LensFlare-DHGNEDIX.js → LensFlare-G73cvrIG.js} +82 -84
  98. package/dist/core/{LightEdge-DYfhB3-7.js → LightEdge-D3i7HUR9.js} +106 -107
  99. package/dist/core/{LightLeak-CYjuMURe.js → LightLeak-B8yGreP-.js} +58 -59
  100. package/dist/core/{LinearBlur-CV7gKYHV.js → LinearBlur-BEzNPe0e.js} +14 -14
  101. package/dist/core/{LinearGradient-DAzw65UB.js → LinearGradient-XjXyaoii.js} +36 -37
  102. package/dist/core/{LinearWipe-DoDZF7y0.js → LinearWipe-Doj9aS5n.js} +20 -21
  103. package/dist/core/{LiquidMetal-C9OxRyE4.js → LiquidMetal-CWV_RQip.js} +70 -73
  104. package/dist/core/{Liquify-gNsuR7aA.js → Liquify-DWrgFruC.js} +67 -66
  105. package/dist/core/{MagneticFilings-CQ7zHEow.js → MagneticFilings-Co0V07-1.js} +996 -756
  106. package/dist/core/{Marble-BSSMSrv8.js → Marble-D13mDBvL.js} +22 -21
  107. package/dist/core/{Mirror-BZAUA2jk.js → Mirror-DvukM_eG.js} +18 -18
  108. package/dist/core/{MultiPointGradient-HSfAYB-u.js → MultiPointGradient-CyK_Ty9a.js} +30 -31
  109. package/dist/core/{Neon-D9d6Osal.js → Neon-DD8qY6H9.js} +102 -113
  110. package/dist/core/{NoiseDissolve-CnELvUG_.js → NoiseDissolve-CeX3VO8J.js} +23 -22
  111. package/dist/core/{ObjectTracker-COh35yTh.js → ObjectTracker-BWo8H1kh.js} +3 -3
  112. package/dist/core/{PagePeel-B6sjmvZ1.js → PagePeel-BL5IeBeD.js} +54 -58
  113. package/dist/core/{Paper-LfukraJk.js → Paper-BAq9MqtG.js} +16 -15
  114. package/dist/core/{Parallelogram-DBi0yAG3.js → Parallelogram-DYzFG9ci.js} +14 -13
  115. package/dist/core/{ParticleField-q7COY9YT.js → ParticleField-Bl4uztO7.js} +1489 -1340
  116. package/dist/core/{ParticleFlow-DiHWbIon.js → ParticleFlow-RPxLP8HC.js} +1422 -1149
  117. package/dist/core/{Particles-BFsKUAPx.js → Particles-BDEX4Fw2.js} +866 -656
  118. package/dist/core/{PerlinNoise-KV2GG0ts.js → PerlinNoise-BtXlaEd8.js} +16 -14
  119. package/dist/core/{Perspective-CJSrtEy5.js → Perspective-CdU5nAEn.js} +23 -25
  120. package/dist/core/{PixelSort-WD-Y6ZFu.js → PixelSort-C7TX1ClH.js} +109 -109
  121. package/dist/core/{PixelThrow-CnOXm7Hv.js → PixelThrow-DpKEZPMK.js} +35 -35
  122. package/dist/core/{Pixelate-XJI9f1oT.js → Pixelate-C2OQUtqr.js} +19 -19
  123. package/dist/core/{Plasma-C0dnSaw1.js → Plasma-DLq9HroF.js} +33 -32
  124. package/dist/core/{Plastic-DBv_6A7q.js → Plastic-C2hiOaXw.js} +82 -84
  125. package/dist/core/{PolarCoordinates-B8Cq2bzT.js → PolarCoordinates-Bumv-Hi3.js} +16 -18
  126. package/dist/core/{Polygon-ORM35JKg.js → Polygon-DOpR58g4.js} +16 -17
  127. package/dist/core/{Posterize-Dn-Vv2S1.js → Posterize-CVNOkDme.js} +5 -8
  128. package/dist/core/{Prism-CYLsGJHY.js → Prism-CCQ1BsBL.js} +36 -40
  129. package/dist/core/{ProgressiveBlur-BXUumCm5.js → ProgressiveBlur-Cprr1XSE.js} +63 -65
  130. package/dist/core/{RadialGradient-j6T56q1W.js → RadialGradient-CsmCSySC.js} +22 -23
  131. package/dist/core/{RadialWipe-Bz19qvls.js → RadialWipe-BAnsqol4.js} +25 -25
  132. package/dist/core/{RandomBars-3RlhwDYG.js → RandomBars-DdhtxO8o.js} +23 -23
  133. package/dist/core/{ReactionDiffusion-DdXavIVw.js → ReactionDiffusion-Bih4xEtV.js} +173 -175
  134. package/dist/core/{RectangularCoordinates-p3250IKV.js → RectangularCoordinates-CKKA2oY1.js} +14 -14
  135. package/dist/core/{ReflectivePlane-BOl9AEoO.js → ReflectivePlane-u3Tje37M.js} +35 -37
  136. package/dist/core/{Repeater-BMXmN95R.js → Repeater-C-agsqBS.js} +2 -2
  137. package/dist/core/{Ring-DKcROHDs.js → Ring-Cj7bR89h.js} +15 -14
  138. package/dist/core/{RippleWipe-QH8D0Y-2.js → RippleWipe-VL1MMd5o.js} +24 -27
  139. package/dist/core/{Ripples-8fFdo6aq.js → Ripples-B88TeopS.js} +18 -21
  140. package/dist/core/{RoundedRect-Cr76tP9o.js → RoundedRect-jn8_QLrT.js} +14 -13
  141. package/dist/core/{Saturation-Dqifs1x7.js → Saturation-dCNIhHq2.js} +8 -9
  142. package/dist/core/{Scratches-sa8JU4Eb.js → Scratches-Dz_1Ptk0.js} +16 -14
  143. package/dist/core/{Sharpness-IRuPd9nn.js → Sharpness-Bxq4YiRL.js} +21 -22
  144. package/dist/core/{Shatter-BYaxMvyd.js → Shatter-DsuYUr-1.js} +73 -72
  145. package/dist/core/{SimplexNoise-C2vmRzgy.js → SimplexNoise-CvalBPNF.js} +19 -17
  146. package/dist/core/{SineWave-BGAJyGFr.js → SineWave-XPK5BsPB.js} +20 -20
  147. package/dist/core/{SliceWipe-BOcCk5Se.js → SliceWipe-gSs_VRwf.js} +19 -19
  148. package/dist/core/{Smoke-B1twbhQ4.js → Smoke-kzRXFLW9.js} +156 -155
  149. package/dist/core/{SmokeFill-CAayneM2.js → SmokeFill-DQZeqiwX.js} +233 -231
  150. package/dist/core/{SmokeFlow-Ug8difAz.js → SmokeFlow-n23YvKoI.js} +143 -142
  151. package/dist/core/{Solarize-205KKROH.js → Solarize-DINiQSz1.js} +12 -14
  152. package/dist/core/{SolidColor-B4pj8onb.js → SolidColor-Cu_9b_my.js} +1 -1
  153. package/dist/core/{Spherize-DUQxwwCL.js → Spherize-BLY2eqBV.js} +31 -37
  154. package/dist/core/{Spiral-DY1c-N4F.js → Spiral-CWCmvI3m.js} +36 -36
  155. package/dist/core/{Star-DRxNaHHo.js → Star-9WSeF-vW.js} +14 -13
  156. package/dist/core/{Stone-CUdcvOWd.js → Stone-CVO2Ey8i.js} +2 -2
  157. package/dist/core/{Strands-CFxYJMFu.js → Strands-D9Sz1vX9.js} +47 -49
  158. package/dist/core/{Stretch-DYrVdt8A.js → Stretch-DMT2Y6kN.js} +19 -19
  159. package/dist/core/{Stripes-BvnoWdwn.js → Stripes-DPVbOQkX.js} +39 -39
  160. package/dist/core/{StudioBackground-srQGUpfZ.js → StudioBackground-5JgYClrr.js} +67 -68
  161. package/dist/core/{SunBurst-COsVDZ4e.js → SunBurst-Din5CIAU.js} +18 -20
  162. package/dist/core/{Surface3D-TsGPzdGm.js → Surface3D-CW2ApEgt.js} +1934 -1528
  163. package/dist/core/{Swirl-nXMWVY2X.js → Swirl-DrchXPfh.js} +18 -21
  164. package/dist/core/{Teardrop-Bjtkigk4.js → Teardrop-CDt_XA4d.js} +13 -12
  165. package/dist/core/{Text-BGdsqRl5.js → Text-o_dubJeo.js} +20 -21
  166. package/dist/core/{ThinFilm-DhMKI5e2.js → ThinFilm-d7IlUY62.js} +59 -67
  167. package/dist/core/{TiltShift-BwuYyXB6.js → TiltShift-DJVcMb_M.js} +66 -67
  168. package/dist/core/{TimeTrail-CE2XumxR.js → TimeTrail-D1Gir7BK.js} +1003 -1647
  169. package/dist/core/{Tint-BTmcGjEl.js → Tint-Cak_PyOJ.js} +25 -26
  170. package/dist/core/{Trapezoid-CiZCh8QS.js → Trapezoid-DnFhlKCD.js} +14 -13
  171. package/dist/core/{TriangularGrid-BnQOEljy.js → TriangularGrid-BE9CgVlb.js} +34 -36
  172. package/dist/core/{Tritone-Ta084wlF.js → Tritone-mqU9b4YZ.js} +7 -10
  173. package/dist/core/{Truchet-BxCh_IIp.js → Truchet-yLdaw6z4.js} +31 -33
  174. package/dist/core/{Twirl-Cw4jm59Q.js → Twirl-SA6uh8pI.js} +16 -16
  175. package/dist/core/{VHS-Nwk0E-tf.js → VHS-Ch-bVeit.js} +68 -69
  176. package/dist/core/{VenetianBlinds-BZ0sS97G.js → VenetianBlinds-CboEoPIZ.js} +22 -23
  177. package/dist/core/{Vesica-Cf1KiSzK.js → Vesica-DmJWzk7E.js} +13 -12
  178. package/dist/core/{Vibrance-qWGvLkrW.js → Vibrance-7rW_G3qT.js} +7 -8
  179. package/dist/core/{VideoTexture-48ylVDvN.js → VideoTexture-Ctk5_1F8.js} +34 -39
  180. package/dist/core/{Vignette-CK_Li7v2.js → Vignette-DXtlR5LT.js} +20 -22
  181. package/dist/core/{Voronoi-DMYFDwIS.js → Voronoi-B0ZrQ6QO.js} +33 -37
  182. package/dist/core/{Water-D74wbHmn.js → Water-DfwGqSnM.js} +101 -108
  183. package/dist/core/{Watercolor-zo8-4Vqx.js → Watercolor-BAShYSu7.js} +305 -389
  184. package/dist/core/{WaveDistortion-BLrvGOzF.js → WaveDistortion-Cj4QBBKm.js} +80 -82
  185. package/dist/core/{WaveletNoise-a5OpO8-D.js → WaveletNoise-DYiU_ziD.js} +16 -14
  186. package/dist/core/{Weave-D1D3kuUg.js → Weave-DVefdB9i.js} +28 -31
  187. package/dist/core/{WebcamTexture-pBETyQYG.js → WebcamTexture-BO9jNxcP.js} +7 -7
  188. package/dist/core/{Wool-CMnWPdy9.js → Wool-D304TmpD.js} +2 -2
  189. package/dist/core/{WorleyNoise-BAEo0duh.js → WorleyNoise-B5FBTklZ.js} +69 -70
  190. package/dist/core/{ZoomBlur-CnBNmcfx.js → ZoomBlur-DxySopLs.js} +12 -12
  191. package/dist/core/agents-c-JjGH1b.js +1440 -0
  192. package/dist/core/blur-DKmdsW6d.js +2247 -0
  193. package/dist/core/compute-BoeIXi0l.js +31 -0
  194. package/dist/core/dataEncoding-CEmpiitu.js +24 -0
  195. package/dist/core/device-BODv_4aH.js +10 -0
  196. package/dist/core/edges-BZUKQxSE.js +29857 -0
  197. package/dist/core/{glass-sOqjtPJD.js → glass-BVqgjSPg.js} +164 -172
  198. package/dist/core/gpu/index.d.ts.map +1 -1
  199. package/dist/core/gpu/kit/agents.d.ts +17 -1
  200. package/dist/core/gpu/kit/agents.d.ts.map +1 -1
  201. package/dist/core/gpu/passManager.d.ts +6 -2
  202. package/dist/core/gpu/passManager.d.ts.map +1 -1
  203. package/dist/core/gpu/textures.d.ts +2 -2
  204. package/dist/core/gpu/textures.d.ts.map +1 -1
  205. package/dist/core/index.js +324 -226
  206. package/dist/core/media-Ds6MRfGR.js +757 -0
  207. package/dist/core/noise-Cq0KUOSC.js +12033 -0
  208. package/dist/core/noiseColor-CQyzqpVZ.js +103 -0
  209. package/dist/core/{noiseColor-CRpf22bk.js → noiseColor-DjCUZ_8u.js} +2 -2
  210. package/dist/core/noiseStylize-fKVcJbGK.js +359 -0
  211. package/dist/core/porters-DogLzpKT.js +991 -0
  212. package/dist/core/presetRenderer.d.ts.map +1 -1
  213. package/dist/core/registry.js +208 -199
  214. package/dist/core/sdf-o99ONcMJ.js +5174 -0
  215. package/dist/core/shaderRegistry-BSrnuqx-.js +425 -0
  216. package/dist/core/shaders/AngularBlur/index.js +5 -4
  217. package/dist/core/shaders/Arc/index.js +7 -4
  218. package/dist/core/shaders/Ascii/index.js +5 -4
  219. package/dist/core/shaders/Aurora/index.js +6 -4
  220. package/dist/core/shaders/BarShift/index.js +5 -4
  221. package/dist/core/shaders/BarnDoors/index.js +5 -4
  222. package/dist/core/shaders/Beam/index.js +5 -4
  223. package/dist/core/shaders/Bend/index.js +5 -4
  224. package/dist/core/shaders/Blob/index.js +5 -4
  225. package/dist/core/shaders/BlockDissolve/index.js +6 -4
  226. package/dist/core/shaders/BlockNoise/index.js +8 -5
  227. package/dist/core/shaders/BlueNoise/index.js +8 -5
  228. package/dist/core/shaders/Blur/index.js +6 -4
  229. package/dist/core/shaders/Boids/index.d.ts +3 -3
  230. package/dist/core/shaders/Boids/index.d.ts.map +1 -1
  231. package/dist/core/shaders/Boids/index.js +9 -5
  232. package/dist/core/shaders/BokehBlur/index.js +6 -4
  233. package/dist/core/shaders/BrickPattern/index.js +5 -4
  234. package/dist/core/shaders/BrightnessContrast/index.js +5 -4
  235. package/dist/core/shaders/BrushedMetal/index.js +11 -6
  236. package/dist/core/shaders/Bulge/index.js +5 -4
  237. package/dist/core/shaders/CRTScreen/index.js +5 -4
  238. package/dist/core/shaders/CarbonFiber/index.js +11 -6
  239. package/dist/core/shaders/Chalkboard/index.js +5 -4
  240. package/dist/core/shaders/ChannelBlur/index.js +6 -4
  241. package/dist/core/shaders/CheckerWipe/index.js +5 -4
  242. package/dist/core/shaders/Checkerboard/index.js +5 -4
  243. package/dist/core/shaders/Chevron/index.js +5 -4
  244. package/dist/core/shaders/ChromaFlow/index.js +6 -4
  245. package/dist/core/shaders/ChromaticAberration/index.js +5 -4
  246. package/dist/core/shaders/Circle/index.js +7 -4
  247. package/dist/core/shaders/ColorWheel/index.js +5 -4
  248. package/dist/core/shaders/CompressionArtifacts/index.js +5 -4
  249. package/dist/core/shaders/ConcentricSpin/index.js +5 -4
  250. package/dist/core/shaders/ConicGradient/index.js +5 -4
  251. package/dist/core/shaders/ContourLines/index.js +5 -4
  252. package/dist/core/shaders/CornerPin/index.js +5 -4
  253. package/dist/core/shaders/Crescent/index.js +7 -4
  254. package/dist/core/shaders/Cross/index.js +7 -4
  255. package/dist/core/shaders/Crystal/index.js +11 -6
  256. package/dist/core/shaders/CurlNoise/index.js +8 -5
  257. package/dist/core/shaders/CursorRipples/index.js +5 -4
  258. package/dist/core/shaders/CursorTrail/index.js +5 -4
  259. package/dist/core/shaders/DataMosh/index.js +5 -4
  260. package/dist/core/shaders/DiamondGradient/index.js +5 -4
  261. package/dist/core/shaders/DiamondWipe/index.js +5 -4
  262. package/dist/core/shaders/DiffuseBlur/index.js +5 -4
  263. package/dist/core/shaders/DisplacementMap/index.js +5 -4
  264. package/dist/core/shaders/Dither/index.js +5 -4
  265. package/dist/core/shaders/DotGrid/index.js +5 -4
  266. package/dist/core/shaders/DropShadow/index.js +5 -4
  267. package/dist/core/shaders/Duotone/index.js +5 -4
  268. package/dist/core/shaders/Ellipse/index.js +7 -4
  269. package/dist/core/shaders/Emboss/index.js +10 -6
  270. package/dist/core/shaders/Engraving/index.js +6 -4
  271. package/dist/core/shaders/ErosionNoise/index.js +8 -5
  272. package/dist/core/shaders/Exposure/index.js +5 -4
  273. package/dist/core/shaders/FallingLines/index.js +5 -4
  274. package/dist/core/shaders/FilmGrain/index.js +5 -4
  275. package/dist/core/shaders/FilmStock/index.js +6 -4
  276. package/dist/core/shaders/Flip/index.js +5 -4
  277. package/dist/core/shaders/FloatingParticles/index.d.ts +9 -4
  278. package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
  279. package/dist/core/shaders/FloatingParticles/index.js +9 -5
  280. package/dist/core/shaders/FlowField/index.js +6 -4
  281. package/dist/core/shaders/Flower/index.js +7 -4
  282. package/dist/core/shaders/FlowingGradient/index.js +6 -4
  283. package/dist/core/shaders/FlutedGlass/index.js +5 -4
  284. package/dist/core/shaders/Fog/index.js +5 -4
  285. package/dist/core/shaders/Form3D/index.js +5 -4
  286. package/dist/core/shaders/FractalNoise/index.js +7 -4
  287. package/dist/core/shaders/Frost/index.js +11 -6
  288. package/dist/core/shaders/GaborNoise/index.js +8 -5
  289. package/dist/core/shaders/Glass/index.js +11 -6
  290. package/dist/core/shaders/GlassTiles/index.js +5 -4
  291. package/dist/core/shaders/Glitch/index.d.ts +1 -1
  292. package/dist/core/shaders/Glitch/index.d.ts.map +1 -1
  293. package/dist/core/shaders/Glitch/index.js +5 -4
  294. package/dist/core/shaders/Glow/index.js +6 -4
  295. package/dist/core/shaders/Godrays/index.js +5 -4
  296. package/dist/core/shaders/Goo/index.js +10 -6
  297. package/dist/core/shaders/GradientMap/index.js +5 -4
  298. package/dist/core/shaders/Grayscale/index.js +5 -4
  299. package/dist/core/shaders/Grid/index.js +5 -4
  300. package/dist/core/shaders/GridDistortion/index.js +5 -4
  301. package/dist/core/shaders/Group/index.js +5 -4
  302. package/dist/core/shaders/HTMLInCanvas/index.js +5 -4
  303. package/dist/core/shaders/Halftone/index.js +5 -4
  304. package/dist/core/shaders/Heart/index.js +7 -4
  305. package/dist/core/shaders/Heatmap/index.js +11 -6
  306. package/dist/core/shaders/HexGrid/index.js +5 -4
  307. package/dist/core/shaders/Hologram/index.js +11 -6
  308. package/dist/core/shaders/Holographic/index.js +11 -6
  309. package/dist/core/shaders/HueShift/index.js +5 -4
  310. package/dist/core/shaders/ImageTexture/index.js +7 -5
  311. package/dist/core/shaders/InkFlow/index.js +5 -4
  312. package/dist/core/shaders/Invert/index.js +5 -4
  313. package/dist/core/shaders/IrisWipe/index.js +5 -4
  314. package/dist/core/shaders/IsometricCubes/index.js +5 -4
  315. package/dist/core/shaders/Kaleidoscope/index.js +5 -4
  316. package/dist/core/shaders/KeyFrames/index.js +5 -4
  317. package/dist/core/shaders/LensFlare/index.js +5 -4
  318. package/dist/core/shaders/LightEdge/index.js +11 -6
  319. package/dist/core/shaders/LightLeak/index.js +6 -4
  320. package/dist/core/shaders/LinearBlur/index.js +5 -4
  321. package/dist/core/shaders/LinearGradient/index.js +5 -4
  322. package/dist/core/shaders/LinearWipe/index.js +5 -4
  323. package/dist/core/shaders/LiquidMetal/index.js +11 -6
  324. package/dist/core/shaders/Liquify/index.js +5 -4
  325. package/dist/core/shaders/MagneticFilings/index.d.ts +0 -2
  326. package/dist/core/shaders/MagneticFilings/index.d.ts.map +1 -1
  327. package/dist/core/shaders/MagneticFilings/index.js +9 -5
  328. package/dist/core/shaders/Marble/index.js +6 -4
  329. package/dist/core/shaders/Mirror/index.js +5 -4
  330. package/dist/core/shaders/MultiPointGradient/index.js +5 -4
  331. package/dist/core/shaders/Neon/index.js +9 -5
  332. package/dist/core/shaders/NoiseDissolve/index.js +6 -4
  333. package/dist/core/shaders/ObjectTracker/index.js +6 -5
  334. package/dist/core/shaders/PagePeel/index.js +5 -4
  335. package/dist/core/shaders/Paper/index.js +6 -4
  336. package/dist/core/shaders/Parallelogram/index.js +7 -4
  337. package/dist/core/shaders/ParticleField/index.d.ts +10 -5
  338. package/dist/core/shaders/ParticleField/index.d.ts.map +1 -1
  339. package/dist/core/shaders/ParticleField/index.js +9 -5
  340. package/dist/core/shaders/ParticleFlow/index.d.ts +10 -4
  341. package/dist/core/shaders/ParticleFlow/index.d.ts.map +1 -1
  342. package/dist/core/shaders/ParticleFlow/index.js +9 -5
  343. package/dist/core/shaders/Particles/index.d.ts +4 -3
  344. package/dist/core/shaders/Particles/index.d.ts.map +1 -1
  345. package/dist/core/shaders/Particles/index.js +12 -6
  346. package/dist/core/shaders/PerlinNoise/index.js +8 -5
  347. package/dist/core/shaders/Perspective/index.js +5 -4
  348. package/dist/core/shaders/PixelSort/index.js +5 -4
  349. package/dist/core/shaders/PixelThrow/index.js +6 -4
  350. package/dist/core/shaders/Pixelate/index.js +5 -4
  351. package/dist/core/shaders/Plasma/index.js +6 -4
  352. package/dist/core/shaders/Plastic/index.js +11 -6
  353. package/dist/core/shaders/PolarCoordinates/index.js +5 -4
  354. package/dist/core/shaders/Polygon/index.js +7 -4
  355. package/dist/core/shaders/Posterize/index.js +5 -4
  356. package/dist/core/shaders/Prism/index.js +5 -4
  357. package/dist/core/shaders/ProgressiveBlur/index.js +6 -4
  358. package/dist/core/shaders/RadialGradient/index.js +5 -4
  359. package/dist/core/shaders/RadialWipe/index.js +5 -4
  360. package/dist/core/shaders/RandomBars/index.js +6 -4
  361. package/dist/core/shaders/ReactionDiffusion/index.js +5 -4
  362. package/dist/core/shaders/RectangularCoordinates/index.js +5 -4
  363. package/dist/core/shaders/ReflectivePlane/index.js +6 -4
  364. package/dist/core/shaders/Repeater/index.js +5 -4
  365. package/dist/core/shaders/Ring/index.js +7 -4
  366. package/dist/core/shaders/RippleWipe/index.js +5 -4
  367. package/dist/core/shaders/Ripples/index.js +5 -4
  368. package/dist/core/shaders/RoundedRect/index.js +7 -4
  369. package/dist/core/shaders/Saturation/index.js +5 -4
  370. package/dist/core/shaders/Scratches/index.js +8 -5
  371. package/dist/core/shaders/Sharpness/index.js +5 -4
  372. package/dist/core/shaders/Shatter/index.js +6 -4
  373. package/dist/core/shaders/SimplexNoise/index.js +7 -4
  374. package/dist/core/shaders/SineWave/index.js +5 -4
  375. package/dist/core/shaders/SliceWipe/index.js +5 -4
  376. package/dist/core/shaders/Smoke/index.js +5 -4
  377. package/dist/core/shaders/SmokeFill/index.js +10 -6
  378. package/dist/core/shaders/SmokeFlow/index.js +5 -4
  379. package/dist/core/shaders/Solarize/index.js +5 -4
  380. package/dist/core/shaders/SolidColor/index.js +2 -2
  381. package/dist/core/shaders/Spherize/index.js +5 -4
  382. package/dist/core/shaders/Spiral/index.js +5 -4
  383. package/dist/core/shaders/Star/index.js +7 -4
  384. package/dist/core/shaders/Stone/index.js +4 -3
  385. package/dist/core/shaders/Strands/index.js +5 -4
  386. package/dist/core/shaders/Stretch/index.js +5 -4
  387. package/dist/core/shaders/Stripes/index.js +5 -4
  388. package/dist/core/shaders/StudioBackground/index.js +5 -4
  389. package/dist/core/shaders/SunBurst/index.js +5 -4
  390. package/dist/core/shaders/Surface3D/index.d.ts +4 -2
  391. package/dist/core/shaders/Surface3D/index.d.ts.map +1 -1
  392. package/dist/core/shaders/Surface3D/index.js +7 -4
  393. package/dist/core/shaders/Swirl/index.js +5 -4
  394. package/dist/core/shaders/Teardrop/index.js +7 -4
  395. package/dist/core/shaders/Text/index.js +6 -5
  396. package/dist/core/shaders/ThinFilm/index.js +9 -5
  397. package/dist/core/shaders/TiltShift/index.js +6 -4
  398. package/dist/core/shaders/TimeTrail/index.d.ts +47 -1
  399. package/dist/core/shaders/TimeTrail/index.d.ts.map +1 -1
  400. package/dist/core/shaders/TimeTrail/index.js +7 -5
  401. package/dist/core/shaders/Tint/index.js +5 -4
  402. package/dist/core/shaders/Trapezoid/index.js +7 -4
  403. package/dist/core/shaders/TriangularGrid/index.js +5 -4
  404. package/dist/core/shaders/Tritone/index.js +5 -4
  405. package/dist/core/shaders/Truchet/index.js +5 -4
  406. package/dist/core/shaders/Twirl/index.js +5 -4
  407. package/dist/core/shaders/VHS/index.js +5 -4
  408. package/dist/core/shaders/VenetianBlinds/index.js +5 -4
  409. package/dist/core/shaders/Vesica/index.js +7 -4
  410. package/dist/core/shaders/Vibrance/index.js +5 -4
  411. package/dist/core/shaders/VideoTexture/index.js +6 -5
  412. package/dist/core/shaders/Vignette/index.js +5 -4
  413. package/dist/core/shaders/Voronoi/index.js +5 -4
  414. package/dist/core/shaders/Water/index.js +11 -6
  415. package/dist/core/shaders/Watercolor/index.d.ts +1 -1
  416. package/dist/core/shaders/Watercolor/index.d.ts.map +1 -1
  417. package/dist/core/shaders/Watercolor/index.js +6 -4
  418. package/dist/core/shaders/WaveDistortion/index.js +5 -4
  419. package/dist/core/shaders/WaveletNoise/index.js +8 -5
  420. package/dist/core/shaders/Weave/index.js +5 -4
  421. package/dist/core/shaders/WebcamTexture/index.js +7 -5
  422. package/dist/core/shaders/Wool/index.js +4 -3
  423. package/dist/core/shaders/WorleyNoise/index.js +5 -4
  424. package/dist/core/shaders/ZoomBlur/index.js +5 -4
  425. package/dist/core/shapeEffectBounds-Dg4GQ5vW.js +19213 -0
  426. package/dist/core/utilities/transformations/index.js +1 -1
  427. package/dist/js/bundle.js +188 -184
  428. package/dist/js/createShader.js +1 -1
  429. package/dist/react/Shader.js +1 -1
  430. package/dist/react/bundle.js +197 -193
  431. package/dist/registry.js +0 -1
  432. package/dist/solid/engine/Shader.js +1 -1
  433. package/dist/svelte/index.js +1 -1
  434. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  435. package/package.json +1 -1
  436. package/dist/core/coords-BkIjixe_.js +0 -55724
  437. package/dist/core/noiseStylize-J6sFKoTh.js +0 -65
  438. package/dist/core/porters-BmU6G9TR.js +0 -321
  439. package/dist/core/shaderRegistry-D75z2sND.js +0 -425
  440. package/dist/core/shapeEffectBounds-PQqKLQXO.js +0 -406
  441. /package/dist/core/{fonts-DwhbVe2B.js → fonts-v_F1SFl9.js} +0 -0
  442. /package/dist/core/{naturalSize-Caz3-kRv.js → naturalSize-B679wTgN.js} +0 -0
  443. /package/dist/core/{transformations-t0d2-uSX.js → transformations-CsPUHppB.js} +0 -0
@@ -1,11 +1,17 @@
1
- import { Bt as ZERO, J as std, Tn as d, X as createGuardedCompute, Z as createStateBuffer, c as orientedShapeOptions, gn as mixColorsVariants, hn as mixColorsLinear, lt as hash33, n as tgpu, ot as hash11, pt as noise_exports, r as AGENT_SHAPES, s as makeAgentWeightFn, u as resolveAgentShape } from "./coords-BkIjixe_.js";
2
- import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-t0d2-uSX.js";
1
+ import { Bt as sqrt, Ct as exp, Dt as length, Gt as arrayOf, H as mixColorsLinear, Ot as max, Qt as struct, Rt as sin, St as dot, Tt as floor, U as mixColorsVariants, Ut as data_exports, Wt as atomic, bt as cos, cn as i32, d as ZERO, dt as atomicLoad, et as src_default, ft as atomicStore, in as vec3f, kt as min, ln as u32, mt as select, nt as std_exports, on as vec4f, ot as textureStore, qt as textureStorage2d, rn as vec2u, sn as f32, tn as vec2f, ut as atomicAdd, vt as ceil, yt as clamp } from "./edges-BZUKQxSE.js";
2
+ import { l as hash33, o as hash11, p as noise_exports } from "./noise-Cq0KUOSC.js";
3
+ import { n as createGuardedCompute, r as createStateBuffer } from "./compute-BoeIXi0l.js";
4
+ import { t as isMobileGpuViewport } from "./device-BODv_4aH.js";
5
+ import { a as makeAgentTexelWeightFn, l as resolveAgentShape, s as orientedShapeOptions, t as AGENT_SHAPES } from "./agents-c-JjGH1b.js";
6
+ import { a as transformColor, o as transformColorSpace, t as colorSpaceOptions } from "./transformations-CsPUHppB.js";
3
7
  var MAX_AGENTS = 4096;
4
- var RES = 1024;
8
+ var COUNT_MAX_MOBILE = 1200;
9
+ var RES = isMobileGpuViewport() ? 640 : 1024;
10
+ var COUNT_CAP = isMobileGpuViewport() ? COUNT_MAX_MOBILE : MAX_AGENTS;
5
11
  var INV_RES = 1 / RES;
12
+ var SIZE_REF_RES = 1024;
6
13
  var STATE_FORMAT = "rgba16float";
7
14
  var SPLAT_R = 16;
8
- var SPLAT_WIN = 33;
9
15
  var AA_W = .75 * INV_RES;
10
16
  var TAU = 6.283185307179586;
11
17
  var BASE_SPEED = .13;
@@ -15,67 +21,67 @@ var AGIT_GAIN = .4545;
15
21
  var AGIT_COOL = 1.3;
16
22
  var HARD_GAIN = 637;
17
23
  var SOFT_GAIN = 255;
18
- var SimParams = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(d.struct({
19
- colA: d.vec4f,
20
- colB: d.vec4f,
21
- count: d.f32,
22
- trails: d.f32,
23
- dt: d.f32,
24
- aspect: d.f32,
25
- domainX: d.f32,
26
- maxSpeed: d.f32,
27
- maxForce: d.f32,
28
- perceptionSq: d.f32,
29
- sepRadiusSq: d.f32,
30
- sepW: d.f32,
31
- aliW: d.f32,
32
- cohW: d.f32,
33
- cursorX: d.f32,
34
- cursorY: d.f32,
35
- cursorMode: d.f32,
36
- cursorRadius: d.f32,
37
- cursorRadiusSq: d.f32,
38
- cursorForce: d.f32,
39
- bodyR: d.f32,
40
- margin: d.f32,
41
- turnForce: d.f32,
42
- seed: d.f32
24
+ var SimParams = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(struct({
25
+ colA: vec4f,
26
+ colB: vec4f,
27
+ count: f32,
28
+ trails: f32,
29
+ dt: f32,
30
+ aspect: f32,
31
+ domainX: f32,
32
+ maxSpeed: f32,
33
+ maxForce: f32,
34
+ perceptionSq: f32,
35
+ sepRadiusSq: f32,
36
+ sepW: f32,
37
+ aliW: f32,
38
+ cohW: f32,
39
+ cursorX: f32,
40
+ cursorY: f32,
41
+ cursorMode: f32,
42
+ cursorRadius: f32,
43
+ cursorRadiusSq: f32,
44
+ cursorForce: f32,
45
+ bodyR: f32,
46
+ margin: f32,
47
+ turnForce: f32,
48
+ seed: f32
43
49
  }), "SimParams");
44
- var simLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(tgpu.bindGroupLayout({
50
+ var simLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(src_default.bindGroupLayout({
45
51
  agents: {
46
- storage: d.arrayOf(d.vec4f, MAX_AGENTS),
52
+ storage: arrayOf(vec4f, MAX_AGENTS),
47
53
  access: "mutable"
48
54
  },
49
55
  agit: {
50
- storage: d.arrayOf(d.f32, MAX_AGENTS),
56
+ storage: arrayOf(f32, MAX_AGENTS),
51
57
  access: "mutable"
52
58
  },
53
59
  accumE: {
54
- storage: d.arrayOf(d.atomic(d.u32), RES * RES),
60
+ storage: arrayOf(atomic(u32), RES * RES),
55
61
  access: "mutable"
56
62
  },
57
63
  accumS: {
58
- storage: d.arrayOf(d.atomic(d.u32), RES * RES),
64
+ storage: arrayOf(atomic(u32), RES * RES),
59
65
  access: "mutable"
60
66
  },
61
67
  trailBuf: {
62
- storage: d.arrayOf(d.vec4f, RES * RES),
68
+ storage: arrayOf(vec4f, RES * RES),
63
69
  access: "mutable"
64
70
  },
65
71
  params: { uniform: SimParams },
66
- outTex: { storageTexture: d.textureStorage2d(STATE_FORMAT, "write-only") }
72
+ outTex: { storageTexture: textureStorage2d(STATE_FORMAT, "write-only") }
67
73
  }), "simLayout");
68
- var safeSteer = tgpu.fn([
69
- d.vec2f,
70
- d.vec2f,
71
- d.f32,
72
- d.f32
73
- ], d.vec2f)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dir, vel, maxSpeed, maxForce) => {
74
+ var safeSteer = src_default.fn([
75
+ vec2f,
76
+ vec2f,
77
+ f32,
78
+ f32
79
+ ], vec2f)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dir, vel, maxSpeed, maxForce) => {
74
80
  "use gpu";
75
- const len = std.length(dir);
76
- const steer = std.select(d.vec2f(0, 0), dir.div(std.max(len, 1e-5)).mul(maxSpeed), len > 1e-5).sub(vel);
77
- const sl = std.length(steer);
78
- return std.select(steer, steer.div(std.max(sl, 1e-5)).mul(maxForce), sl > maxForce);
81
+ const len = length(dir);
82
+ const steer = select(vec2f(0, 0), dir.div(max(len, 1e-5)).mul(maxSpeed), len > 1e-5).sub(vel);
83
+ const sl = length(steer);
84
+ return select(steer, steer.div(max(sl, 1e-5)).mul(maxForce), sl > maxForce);
79
85
  }), {
80
86
  v: 1,
81
87
  name: void 0,
@@ -238,30 +244,30 @@ var safeSteer = tgpu.fn([
238
244
  "externalNames": ["std", "d"]
239
245
  },
240
246
  externals: () => ({
241
- std,
242
- d
247
+ std: std_exports,
248
+ d: data_exports
243
249
  })
244
250
  }) && $.f)({}));
245
- const boidsInitKernel = tgpu.fn([d.u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((i) => {
251
+ const boidsInitKernel = src_default.fn([u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((i) => {
246
252
  "use gpu";
247
253
  const prm = simLayout.$.params;
248
- const fi = d.f32(i);
254
+ const fi = f32(i);
249
255
  const sd = __tsover_mul(prm.seed, 13.137);
250
- const flocks = std.max(std.floor(__tsover_div(prm.count, 250)), d.f32(3));
251
- const c = __tsover_sub(fi, __tsover_mul(std.floor(__tsover_div(fi, flocks)), flocks));
252
- const rc = hash33(d.vec3f(__tsover_add(__tsover_add(__tsover_mul(c, 7.1315), sd), .71), __tsover_add(__tsover_add(__tsover_mul(c, 3.7719), sd), 4.17), __tsover_add(__tsover_add(__tsover_mul(c, 9.4103), sd), 9.03)));
256
+ const flocks = max(floor(__tsover_div(prm.count, 250)), f32(3));
257
+ const c = __tsover_sub(fi, __tsover_mul(floor(__tsover_div(fi, flocks)), flocks));
258
+ const rc = hash33(vec3f(__tsover_add(__tsover_add(__tsover_mul(c, 7.1315), sd), .71), __tsover_add(__tsover_add(__tsover_mul(c, 3.7719), sd), 4.17), __tsover_add(__tsover_add(__tsover_mul(c, 9.4103), sd), 9.03)));
253
259
  const ang = __tsover_mul(rc.z, TAU);
254
- const hd = d.vec2f(std.cos(ang), std.sin(ang));
255
- const center = d.vec2f(__tsover_mul(__tsover_add(.12, __tsover_mul(rc.x, .76)), prm.domainX), __tsover_add(.12, __tsover_mul(rc.y, .76)));
256
- const ra = hash33(d.vec3f(__tsover_add(__tsover_add(__tsover_mul(fi, 1.6180339), sd), .71), __tsover_add(__tsover_add(__tsover_mul(fi, 2.7182818), sd), 4.17), __tsover_add(__tsover_add(__tsover_mul(fi, 3.1415926), sd), 9.03)));
260
+ const hd = vec2f(cos(ang), sin(ang));
261
+ const center = vec2f(__tsover_mul(__tsover_add(.12, __tsover_mul(rc.x, .76)), prm.domainX), __tsover_add(.12, __tsover_mul(rc.y, .76)));
262
+ const ra = hash33(vec3f(__tsover_add(__tsover_add(__tsover_mul(fi, 1.6180339), sd), .71), __tsover_add(__tsover_add(__tsover_mul(fi, 2.7182818), sd), 4.17), __tsover_add(__tsover_add(__tsover_mul(fi, 3.1415926), sd), 9.03)));
257
263
  const t = __tsover_mul(__tsover_sub(ra.x, .5), .6);
258
264
  const n = __tsover_mul(__tsover_sub(ra.y, .5), .16);
259
- const px = std.clamp(__tsover_sub(__tsover_add(center.x, __tsover_mul(hd.x, t)), __tsover_mul(hd.y, n)), 0, prm.domainX);
260
- const py = std.clamp(__tsover_add(__tsover_add(center.y, __tsover_mul(hd.y, t)), __tsover_mul(hd.x, n)), 0, 1);
265
+ const px = clamp(__tsover_sub(__tsover_add(center.x, __tsover_mul(hd.x, t)), __tsover_mul(hd.y, n)), 0, prm.domainX);
266
+ const py = clamp(__tsover_add(__tsover_add(center.y, __tsover_mul(hd.y, t)), __tsover_mul(hd.x, n)), 0, 1);
261
267
  const jAng = __tsover_add(ang, __tsover_mul(__tsover_sub(ra.z, .5), .5));
262
268
  const sp = __tsover_mul(prm.maxSpeed, __tsover_add(.75, __tsover_mul(ra.y, .25)));
263
- simLayout.$.agents[i] = d.vec4f(px, py, __tsover_mul(std.cos(jAng), sp), __tsover_mul(std.sin(jAng), sp));
264
- simLayout.$.agit[i] = d.f32(0);
269
+ simLayout.$.agents[i] = vec4f(px, py, __tsover_mul(cos(jAng), sp), __tsover_mul(sin(jAng), sp));
270
+ simLayout.$.agit[i] = f32(0);
265
271
  }), {
266
272
  v: 1,
267
273
  name: void 0,
@@ -896,168 +902,63 @@ const boidsInitKernel = tgpu.fn([d.u32])(/* @__PURE__ */ (($) => (globalThis.__T
896
902
  },
897
903
  externals: () => ({
898
904
  simLayout,
899
- d,
900
- std,
905
+ d: data_exports,
906
+ std: std_exports,
901
907
  noise: noise_exports,
902
908
  TAU
903
909
  })
904
910
  }) && $.f)({})).$name("boidsInit");
905
- const boidsClearAccumKernel = tgpu.fn([d.u32, d.u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((x, y) => {
906
- "use gpu";
907
- const idx = __tsover_add(__tsover_mul(y, d.u32(RES)), x);
908
- std.atomicStore(simLayout.$.accumE[idx], d.u32(0));
909
- std.atomicStore(simLayout.$.accumS[idx], d.u32(0));
910
- }), {
911
- v: 1,
912
- name: void 0,
913
- ast: {
914
- "params": [{
915
- "type": "i",
916
- "name": "x"
917
- }, {
918
- "type": "i",
919
- "name": "y"
920
- }],
921
- "body": [0, [
922
- [
923
- 13,
924
- "idx",
925
- [
926
- 1,
927
- [
928
- 1,
929
- "y",
930
- "*",
931
- [
932
- 6,
933
- [
934
- 7,
935
- "d",
936
- "u32"
937
- ],
938
- ["RES"]
939
- ]
940
- ],
941
- "+",
942
- "x"
943
- ]
944
- ],
945
- [
946
- 6,
947
- [
948
- 7,
949
- "std",
950
- "atomicStore"
951
- ],
952
- [[
953
- 8,
954
- [
955
- 7,
956
- [
957
- 7,
958
- "simLayout",
959
- "$"
960
- ],
961
- "accumE"
962
- ],
963
- "idx"
964
- ], [
965
- 6,
966
- [
967
- 7,
968
- "d",
969
- "u32"
970
- ],
971
- [[5, "0"]]
972
- ]]
973
- ],
974
- [
975
- 6,
976
- [
977
- 7,
978
- "std",
979
- "atomicStore"
980
- ],
981
- [[
982
- 8,
983
- [
984
- 7,
985
- [
986
- 7,
987
- "simLayout",
988
- "$"
989
- ],
990
- "accumS"
991
- ],
992
- "idx"
993
- ], [
994
- 6,
995
- [
996
- 7,
997
- "d",
998
- "u32"
999
- ],
1000
- [[5, "0"]]
1001
- ]]
1002
- ]
1003
- ]],
1004
- "externalNames": [
1005
- "d",
1006
- "RES",
1007
- "std",
1008
- "simLayout"
1009
- ]
1010
- },
1011
- externals: () => ({
1012
- d,
1013
- RES,
1014
- std,
1015
- simLayout
1016
- })
1017
- }) && $.f)({})).$name("boidsClearAccum");
1018
911
  function makeBoidsSplatKernel(shape) {
1019
912
  const name = resolveAgentShape(shape, "arrow");
1020
913
  const s = AGENT_SHAPES[name];
1021
- const weightFn = makeAgentWeightFn(name);
914
+ const weightFn = makeAgentTexelWeightFn(name);
1022
915
  const HL = name === "glow" ? 1 : s.hl;
1023
916
  const SOFT = s.soft;
1024
917
  const EXT = name === "glow" ? s.ext + 1 : s.ext;
1025
918
  const GAIN = s.soft ? SOFT_GAIN : HARD_GAIN;
1026
- return tgpu.fn([d.u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((i) => {
919
+ return src_default.fn([u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((i) => {
1027
920
  "use gpu";
1028
921
  const prm = simLayout.$.params;
1029
922
  const a = simLayout.$.agents[i];
1030
- const pos = d.vec2f(a.x, a.y);
1031
- const vel = d.vec2f(a.z, a.w);
1032
- const spd = std.length(vel);
1033
- const dir = std.select(d.vec2f(1, 0), vel.div(std.max(spd, 1e-5)), spd > 1e-5);
1034
- const agitI = std.clamp(simLayout.$.agit[i], 0, 1);
1035
- const bodyR = std.max(prm.bodyR, 1e-6);
923
+ const pos = vec2f(a.x, a.y);
924
+ const vel = vec2f(a.z, a.w);
925
+ const spd = length(vel);
926
+ const dir = select(vec2f(1, 0), vel.div(max(spd, 1e-5)), spd > 1e-5);
927
+ const agitI = clamp(simLayout.$.agit[i], 0, 1);
928
+ const agitGain = __tsover_mul(agitI, f32(GAIN));
929
+ const aspect = max(prm.aspect, 1e-5);
930
+ const bodyR = clamp(prm.bodyR, 1e-6, __tsover_mul(f32(SPLAT_R), INV_RES));
1036
931
  const hl = __tsover_mul(bodyR, HL);
1037
- const extSq = __tsover_mul(__tsover_add(__tsover_mul(bodyR, EXT), __tsover_mul(AA_W, 2)), __tsover_add(__tsover_mul(bodyR, EXT), __tsover_mul(AA_W, 2)));
1038
- const txf = __tsover_mul(__tsover_div(pos.x, prm.aspect), d.f32(RES));
1039
- const tyf = __tsover_mul(pos.y, d.f32(RES));
1040
- const cxi = d.i32(std.floor(txf));
1041
- const cyi = d.i32(std.floor(tyf));
1042
- for (let ky = 0; ky < SPLAT_WIN; ky++) for (let kx = 0; kx < SPLAT_WIN; kx++) {
1043
- const px = __tsover_sub(__tsover_add(cxi, kx), SPLAT_R);
1044
- const py = __tsover_sub(__tsover_add(cyi, ky), SPLAT_R);
1045
- if (px >= 0 && px < RES && py >= 0 && py < RES) {
1046
- const offX = __tsover_sub(__tsover_mul(__tsover_mul(__tsover_add(d.f32(px), .5), INV_RES), prm.aspect), pos.x);
1047
- const offY = __tsover_sub(__tsover_mul(__tsover_add(d.f32(py), .5), INV_RES), pos.y);
1048
- if (__tsover_add(__tsover_mul(offX, offX), __tsover_mul(offY, offY)) < extSq) {
932
+ const radW = __tsover_add(__tsover_mul(bodyR, EXT), __tsover_mul(AA_W, 2));
933
+ const extSq = __tsover_mul(radW, radW);
934
+ const txf = __tsover_mul(__tsover_div(pos.x, aspect), f32(RES));
935
+ const tyf = __tsover_mul(pos.y, f32(RES));
936
+ const cxi = i32(floor(txf));
937
+ const cyi = i32(floor(tyf));
938
+ const radY = i32(ceil(__tsover_mul(radW, f32(RES))));
939
+ const radX = i32(ceil(__tsover_div(__tsover_mul(radW, f32(RES)), aspect)));
940
+ const x0 = max(__tsover_sub(cxi, radX), 0);
941
+ const x1 = min(__tsover_add(cxi, radX), __tsover_sub(i32(RES), 1));
942
+ const y0 = max(__tsover_sub(cyi, radY), 0);
943
+ const y1 = min(__tsover_add(cyi, radY), __tsover_sub(i32(RES), 1));
944
+ for (let py = y0; py <= y1; py++) {
945
+ const offY = __tsover_sub(__tsover_mul(__tsover_add(f32(py), .5), INV_RES), pos.y);
946
+ const offYSq = __tsover_mul(offY, offY);
947
+ for (let px = x0; px <= x1; px++) {
948
+ const offX = __tsover_sub(__tsover_mul(__tsover_mul(__tsover_add(f32(px), .5), INV_RES), aspect), pos.x);
949
+ if (__tsover_add(__tsover_mul(offX, offX), offYSq) < extSq) {
1049
950
  const t = __tsover_add(__tsover_mul(offX, dir.x), __tsover_mul(offY, dir.y));
1050
951
  const n = __tsover_add(__tsover_mul(offX, -dir.y), __tsover_mul(offY, dir.x));
1051
- const tGlow = __tsover_sub(t, std.clamp(t, -hl, hl));
1052
- const tEval = std.select(t, tGlow, d.f32(SOFT) > .5);
1053
- const tk = std.clamp(__tsover_div(__tsover_sub(hl, t), std.max(__tsover_mul(hl, 2), 1e-6)), 0, 1);
1054
- const bright = __tsover_sub(1, __tsover_mul(__tsover_mul(.55, tk), d.f32(SOFT)));
1055
- const w = __tsover_mul(weightFn(tEval, n, bodyR, AA_W, d.f32(SOFT)), bright);
1056
- const e = d.u32(__tsover_mul(w, d.f32(GAIN)));
1057
- if (e > d.u32(0)) {
1058
- const idx = d.u32(__tsover_add(__tsover_mul(py, RES), px));
1059
- std.atomicAdd(simLayout.$.accumE[idx], e);
1060
- std.atomicAdd(simLayout.$.accumS[idx], d.u32(__tsover_mul(__tsover_mul(w, agitI), d.f32(GAIN))));
952
+ const tEval = select(t, __tsover_sub(t, clamp(t, -hl, hl)), f32(SOFT) > .5);
953
+ const tk = clamp(__tsover_div(__tsover_sub(hl, t), max(__tsover_mul(hl, 2), 1e-6)), 0, 1);
954
+ const bright = __tsover_sub(1, __tsover_mul(__tsover_mul(.55, tk), f32(SOFT)));
955
+ const qEval = __tsover_div(__tsover_add(__tsover_mul(tEval, tEval), __tsover_mul(n, n)), __tsover_mul(bodyR, bodyR));
956
+ const w = __tsover_mul(weightFn(qEval, tEval, n, bodyR, AA_W), bright);
957
+ const e = u32(__tsover_mul(w, f32(GAIN)));
958
+ if (e > u32(0)) {
959
+ const idx = u32(__tsover_add(__tsover_mul(py, i32(RES)), px));
960
+ atomicAdd(simLayout.$.accumE[idx], e);
961
+ if (agitI > 0) atomicAdd(simLayout.$.accumS[idx], u32(__tsover_mul(w, agitGain)));
1061
962
  }
1062
963
  }
1063
964
  }
@@ -1233,7 +1134,25 @@ function makeBoidsSplatKernel(shape) {
1233
1134
  ],
1234
1135
  [
1235
1136
  13,
1236
- "bodyR",
1137
+ "agitGain",
1138
+ [
1139
+ 1,
1140
+ "agitI",
1141
+ "*",
1142
+ [
1143
+ 6,
1144
+ [
1145
+ 7,
1146
+ "d",
1147
+ "f32"
1148
+ ],
1149
+ ["GAIN"]
1150
+ ]
1151
+ ]
1152
+ ],
1153
+ [
1154
+ 13,
1155
+ "aspect",
1237
1156
  [
1238
1157
  6,
1239
1158
  [
@@ -1244,8 +1163,42 @@ function makeBoidsSplatKernel(shape) {
1244
1163
  [[
1245
1164
  7,
1246
1165
  "prm",
1247
- "bodyR"
1248
- ], [5, "0.000001"]]
1166
+ "aspect"
1167
+ ], [5, "0.00001"]]
1168
+ ]
1169
+ ],
1170
+ [
1171
+ 13,
1172
+ "bodyR",
1173
+ [
1174
+ 6,
1175
+ [
1176
+ 7,
1177
+ "std",
1178
+ "clamp"
1179
+ ],
1180
+ [
1181
+ [
1182
+ 7,
1183
+ "prm",
1184
+ "bodyR"
1185
+ ],
1186
+ [5, "0.000001"],
1187
+ [
1188
+ 1,
1189
+ [
1190
+ 6,
1191
+ [
1192
+ 7,
1193
+ "d",
1194
+ "f32"
1195
+ ],
1196
+ ["SPLAT_R"]
1197
+ ],
1198
+ "*",
1199
+ "INV_RES"
1200
+ ]
1201
+ ]
1249
1202
  ]
1250
1203
  ],
1251
1204
  [
@@ -1260,44 +1213,34 @@ function makeBoidsSplatKernel(shape) {
1260
1213
  ],
1261
1214
  [
1262
1215
  13,
1263
- "extSq",
1216
+ "radW",
1264
1217
  [
1265
1218
  1,
1266
1219
  [
1267
1220
  1,
1268
- [
1269
- 1,
1270
- "bodyR",
1271
- "*",
1272
- "EXT"
1273
- ],
1274
- "+",
1275
- [
1276
- 1,
1277
- "AA_W",
1278
- "*",
1279
- [5, "2"]
1280
- ]
1221
+ "bodyR",
1222
+ "*",
1223
+ "EXT"
1281
1224
  ],
1282
- "*",
1225
+ "+",
1283
1226
  [
1284
1227
  1,
1285
- [
1286
- 1,
1287
- "bodyR",
1288
- "*",
1289
- "EXT"
1290
- ],
1291
- "+",
1292
- [
1293
- 1,
1294
- "AA_W",
1295
- "*",
1296
- [5, "2"]
1297
- ]
1228
+ "AA_W",
1229
+ "*",
1230
+ [5, "2"]
1298
1231
  ]
1299
1232
  ]
1300
1233
  ],
1234
+ [
1235
+ 13,
1236
+ "extSq",
1237
+ [
1238
+ 1,
1239
+ "radW",
1240
+ "*",
1241
+ "radW"
1242
+ ]
1243
+ ],
1301
1244
  [
1302
1245
  13,
1303
1246
  "txf",
@@ -1311,11 +1254,7 @@ function makeBoidsSplatKernel(shape) {
1311
1254
  "x"
1312
1255
  ],
1313
1256
  "/",
1314
- [
1315
- 7,
1316
- "prm",
1317
- "aspect"
1318
- ]
1257
+ "aspect"
1319
1258
  ],
1320
1259
  "*",
1321
1260
  [
@@ -1394,423 +1333,590 @@ function makeBoidsSplatKernel(shape) {
1394
1333
  ]
1395
1334
  ],
1396
1335
  [
1397
- 14,
1398
- [
1399
- 12,
1400
- "ky",
1401
- [5, "0"]
1402
- ],
1403
- [
1404
- 1,
1405
- "ky",
1406
- "<",
1407
- "SPLAT_WIN"
1408
- ],
1336
+ 13,
1337
+ "radY",
1409
1338
  [
1410
- 102,
1411
- "++",
1412
- "ky"
1413
- ],
1414
- [0, [[
1415
- 14,
1416
- [
1417
- 12,
1418
- "kx",
1419
- [5, "0"]
1420
- ],
1421
- [
1422
- 1,
1423
- "kx",
1424
- "<",
1425
- "SPLAT_WIN"
1426
- ],
1339
+ 6,
1427
1340
  [
1428
- 102,
1429
- "++",
1430
- "kx"
1341
+ 7,
1342
+ "d",
1343
+ "i32"
1431
1344
  ],
1432
- [0, [
1345
+ [[
1346
+ 6,
1433
1347
  [
1434
- 13,
1435
- "px",
1436
- [
1437
- 1,
1438
- [
1439
- 1,
1440
- "cxi",
1441
- "+",
1442
- "kx"
1443
- ],
1444
- "-",
1445
- "SPLAT_R"
1446
- ]
1348
+ 7,
1349
+ "std",
1350
+ "ceil"
1447
1351
  ],
1448
- [
1449
- 13,
1450
- "py",
1352
+ [[
1353
+ 1,
1354
+ "radW",
1355
+ "*",
1451
1356
  [
1452
- 1,
1357
+ 6,
1453
1358
  [
1454
- 1,
1455
- "cyi",
1456
- "+",
1457
- "ky"
1359
+ 7,
1360
+ "d",
1361
+ "f32"
1458
1362
  ],
1459
- "-",
1460
- "SPLAT_R"
1363
+ ["RES"]
1461
1364
  ]
1462
- ],
1365
+ ]]
1366
+ ]]
1367
+ ]
1368
+ ],
1369
+ [
1370
+ 13,
1371
+ "radX",
1372
+ [
1373
+ 6,
1374
+ [
1375
+ 7,
1376
+ "d",
1377
+ "i32"
1378
+ ],
1379
+ [[
1380
+ 6,
1463
1381
  [
1464
- 11,
1382
+ 7,
1383
+ "std",
1384
+ "ceil"
1385
+ ],
1386
+ [[
1387
+ 1,
1465
1388
  [
1466
- 3,
1389
+ 1,
1390
+ "radW",
1391
+ "*",
1467
1392
  [
1468
- 3,
1393
+ 6,
1469
1394
  [
1470
- 3,
1471
- [
1472
- 1,
1473
- "px",
1474
- ">=",
1475
- [5, "0"]
1476
- ],
1477
- "&&",
1478
- [
1479
- 1,
1480
- "px",
1481
- "<",
1482
- "RES"
1483
- ]
1395
+ 7,
1396
+ "d",
1397
+ "f32"
1484
1398
  ],
1485
- "&&",
1486
- [
1487
- 1,
1488
- "py",
1489
- ">=",
1490
- [5, "0"]
1491
- ]
1492
- ],
1493
- "&&",
1494
- [
1495
- 1,
1496
- "py",
1497
- "<",
1498
- "RES"
1399
+ ["RES"]
1499
1400
  ]
1500
1401
  ],
1501
- [0, [
1402
+ "/",
1403
+ "aspect"
1404
+ ]]
1405
+ ]]
1406
+ ]
1407
+ ],
1408
+ [
1409
+ 13,
1410
+ "x0",
1411
+ [
1412
+ 6,
1413
+ [
1414
+ 7,
1415
+ "std",
1416
+ "max"
1417
+ ],
1418
+ [[
1419
+ 1,
1420
+ "cxi",
1421
+ "-",
1422
+ "radX"
1423
+ ], [5, "0"]]
1424
+ ]
1425
+ ],
1426
+ [
1427
+ 13,
1428
+ "x1",
1429
+ [
1430
+ 6,
1431
+ [
1432
+ 7,
1433
+ "std",
1434
+ "min"
1435
+ ],
1436
+ [[
1437
+ 1,
1438
+ "cxi",
1439
+ "+",
1440
+ "radX"
1441
+ ], [
1442
+ 1,
1443
+ [
1444
+ 6,
1445
+ [
1446
+ 7,
1447
+ "d",
1448
+ "i32"
1449
+ ],
1450
+ ["RES"]
1451
+ ],
1452
+ "-",
1453
+ [5, "1"]
1454
+ ]]
1455
+ ]
1456
+ ],
1457
+ [
1458
+ 13,
1459
+ "y0",
1460
+ [
1461
+ 6,
1462
+ [
1463
+ 7,
1464
+ "std",
1465
+ "max"
1466
+ ],
1467
+ [[
1468
+ 1,
1469
+ "cyi",
1470
+ "-",
1471
+ "radY"
1472
+ ], [5, "0"]]
1473
+ ]
1474
+ ],
1475
+ [
1476
+ 13,
1477
+ "y1",
1478
+ [
1479
+ 6,
1480
+ [
1481
+ 7,
1482
+ "std",
1483
+ "min"
1484
+ ],
1485
+ [[
1486
+ 1,
1487
+ "cyi",
1488
+ "+",
1489
+ "radY"
1490
+ ], [
1491
+ 1,
1492
+ [
1493
+ 6,
1494
+ [
1495
+ 7,
1496
+ "d",
1497
+ "i32"
1498
+ ],
1499
+ ["RES"]
1500
+ ],
1501
+ "-",
1502
+ [5, "1"]
1503
+ ]]
1504
+ ]
1505
+ ],
1506
+ [
1507
+ 14,
1508
+ [
1509
+ 12,
1510
+ "py",
1511
+ "y0"
1512
+ ],
1513
+ [
1514
+ 1,
1515
+ "py",
1516
+ "<=",
1517
+ "y1"
1518
+ ],
1519
+ [
1520
+ 102,
1521
+ "++",
1522
+ "py"
1523
+ ],
1524
+ [0, [
1525
+ [
1526
+ 13,
1527
+ "offY",
1528
+ [
1529
+ 1,
1530
+ [
1531
+ 1,
1502
1532
  [
1503
- 13,
1504
- "offX",
1533
+ 1,
1534
+ [
1535
+ 6,
1536
+ [
1537
+ 7,
1538
+ "d",
1539
+ "f32"
1540
+ ],
1541
+ ["py"]
1542
+ ],
1543
+ "+",
1544
+ [5, "0.5"]
1545
+ ],
1546
+ "*",
1547
+ "INV_RES"
1548
+ ],
1549
+ "-",
1550
+ [
1551
+ 7,
1552
+ "pos",
1553
+ "y"
1554
+ ]
1555
+ ]
1556
+ ],
1557
+ [
1558
+ 13,
1559
+ "offYSq",
1560
+ [
1561
+ 1,
1562
+ "offY",
1563
+ "*",
1564
+ "offY"
1565
+ ]
1566
+ ],
1567
+ [
1568
+ 14,
1569
+ [
1570
+ 12,
1571
+ "px",
1572
+ "x0"
1573
+ ],
1574
+ [
1575
+ 1,
1576
+ "px",
1577
+ "<=",
1578
+ "x1"
1579
+ ],
1580
+ [
1581
+ 102,
1582
+ "++",
1583
+ "px"
1584
+ ],
1585
+ [0, [[
1586
+ 13,
1587
+ "offX",
1588
+ [
1589
+ 1,
1590
+ [
1591
+ 1,
1505
1592
  [
1506
1593
  1,
1507
1594
  [
1508
1595
  1,
1509
1596
  [
1510
- 1,
1597
+ 6,
1511
1598
  [
1512
- 1,
1513
- [
1514
- 6,
1515
- [
1516
- 7,
1517
- "d",
1518
- "f32"
1519
- ],
1520
- ["px"]
1521
- ],
1522
- "+",
1523
- [5, "0.5"]
1599
+ 7,
1600
+ "d",
1601
+ "f32"
1524
1602
  ],
1525
- "*",
1526
- "INV_RES"
1603
+ ["px"]
1527
1604
  ],
1605
+ "+",
1606
+ [5, "0.5"]
1607
+ ],
1608
+ "*",
1609
+ "INV_RES"
1610
+ ],
1611
+ "*",
1612
+ "aspect"
1613
+ ],
1614
+ "-",
1615
+ [
1616
+ 7,
1617
+ "pos",
1618
+ "x"
1619
+ ]
1620
+ ]
1621
+ ], [
1622
+ 11,
1623
+ [
1624
+ 1,
1625
+ [
1626
+ 1,
1627
+ [
1628
+ 1,
1629
+ "offX",
1630
+ "*",
1631
+ "offX"
1632
+ ],
1633
+ "+",
1634
+ "offYSq"
1635
+ ],
1636
+ "<",
1637
+ "extSq"
1638
+ ],
1639
+ [0, [
1640
+ [
1641
+ 13,
1642
+ "t",
1643
+ [
1644
+ 1,
1645
+ [
1646
+ 1,
1647
+ "offX",
1528
1648
  "*",
1529
1649
  [
1530
1650
  7,
1531
- "prm",
1532
- "aspect"
1651
+ "dir",
1652
+ "x"
1533
1653
  ]
1534
1654
  ],
1535
- "-",
1655
+ "+",
1536
1656
  [
1537
- 7,
1538
- "pos",
1539
- "x"
1657
+ 1,
1658
+ "offY",
1659
+ "*",
1660
+ [
1661
+ 7,
1662
+ "dir",
1663
+ "y"
1664
+ ]
1540
1665
  ]
1541
1666
  ]
1542
1667
  ],
1543
1668
  [
1544
1669
  13,
1545
- "offY",
1670
+ "n",
1546
1671
  [
1547
1672
  1,
1548
1673
  [
1549
1674
  1,
1675
+ "offX",
1676
+ "*",
1550
1677
  [
1551
- 1,
1678
+ 4,
1679
+ "-",
1552
1680
  [
1553
- 6,
1554
- [
1555
- 7,
1556
- "d",
1557
- "f32"
1558
- ],
1559
- ["py"]
1560
- ],
1561
- "+",
1562
- [5, "0.5"]
1563
- ],
1564
- "*",
1565
- "INV_RES"
1681
+ 7,
1682
+ "dir",
1683
+ "y"
1684
+ ]
1685
+ ]
1566
1686
  ],
1567
- "-",
1687
+ "+",
1568
1688
  [
1569
- 7,
1570
- "pos",
1571
- "y"
1689
+ 1,
1690
+ "offY",
1691
+ "*",
1692
+ [
1693
+ 7,
1694
+ "dir",
1695
+ "x"
1696
+ ]
1572
1697
  ]
1573
1698
  ]
1574
1699
  ],
1575
1700
  [
1576
- 11,
1701
+ 13,
1702
+ "tGlow",
1577
1703
  [
1578
1704
  1,
1705
+ "t",
1706
+ "-",
1579
1707
  [
1580
- 1,
1708
+ 6,
1581
1709
  [
1582
- 1,
1583
- "offX",
1584
- "*",
1585
- "offX"
1710
+ 7,
1711
+ "std",
1712
+ "clamp"
1586
1713
  ],
1587
- "+",
1588
1714
  [
1589
- 1,
1590
- "offY",
1591
- "*",
1592
- "offY"
1715
+ "t",
1716
+ [
1717
+ 4,
1718
+ "-",
1719
+ "hl"
1720
+ ],
1721
+ "hl"
1593
1722
  ]
1723
+ ]
1724
+ ]
1725
+ ],
1726
+ [
1727
+ 13,
1728
+ "tEval",
1729
+ [
1730
+ 6,
1731
+ [
1732
+ 7,
1733
+ "std",
1734
+ "select"
1594
1735
  ],
1595
- "<",
1596
- "extSq"
1597
- ],
1598
- [0, [
1599
1736
  [
1600
- 13,
1601
1737
  "t",
1738
+ "tGlow",
1602
1739
  [
1603
1740
  1,
1604
1741
  [
1605
- 1,
1606
- "offX",
1607
- "*",
1742
+ 6,
1608
1743
  [
1609
1744
  7,
1610
- "dir",
1611
- "x"
1612
- ]
1745
+ "d",
1746
+ "f32"
1747
+ ],
1748
+ ["SOFT"]
1613
1749
  ],
1614
- "+",
1615
- [
1616
- 1,
1617
- "offY",
1618
- "*",
1619
- [
1620
- 7,
1621
- "dir",
1622
- "y"
1623
- ]
1624
- ]
1750
+ ">",
1751
+ [5, "0.5"]
1625
1752
  ]
1753
+ ]
1754
+ ]
1755
+ ],
1756
+ [
1757
+ 13,
1758
+ "tk",
1759
+ [
1760
+ 6,
1761
+ [
1762
+ 7,
1763
+ "std",
1764
+ "clamp"
1626
1765
  ],
1627
1766
  [
1628
- 13,
1629
- "n",
1630
1767
  [
1631
1768
  1,
1632
1769
  [
1633
1770
  1,
1634
- "offX",
1635
- "*",
1636
- [
1637
- 4,
1638
- "-",
1639
- [
1640
- 7,
1641
- "dir",
1642
- "y"
1643
- ]
1644
- ]
1771
+ "hl",
1772
+ "-",
1773
+ "t"
1645
1774
  ],
1646
- "+",
1647
- [
1648
- 1,
1649
- "offY",
1650
- "*",
1651
- [
1652
- 7,
1653
- "dir",
1654
- "x"
1655
- ]
1656
- ]
1657
- ]
1658
- ],
1659
- [
1660
- 13,
1661
- "tGlow",
1662
- [
1663
- 1,
1664
- "t",
1665
- "-",
1775
+ "/",
1666
1776
  [
1667
1777
  6,
1668
1778
  [
1669
1779
  7,
1670
1780
  "std",
1671
- "clamp"
1781
+ "max"
1672
1782
  ],
1673
- [
1674
- "t",
1675
- [
1676
- 4,
1677
- "-",
1678
- "hl"
1679
- ],
1680
- "hl"
1681
- ]
1783
+ [[
1784
+ 1,
1785
+ "hl",
1786
+ "*",
1787
+ [5, "2"]
1788
+ ], [5, "0.000001"]]
1682
1789
  ]
1683
- ]
1684
- ],
1790
+ ],
1791
+ [5, "0"],
1792
+ [5, "1"]
1793
+ ]
1794
+ ]
1795
+ ],
1796
+ [
1797
+ 13,
1798
+ "bright",
1799
+ [
1800
+ 1,
1801
+ [5, "1"],
1802
+ "-",
1685
1803
  [
1686
- 13,
1687
- "tEval",
1804
+ 1,
1805
+ [
1806
+ 1,
1807
+ [5, "0.55"],
1808
+ "*",
1809
+ "tk"
1810
+ ],
1811
+ "*",
1688
1812
  [
1689
1813
  6,
1690
1814
  [
1691
1815
  7,
1692
- "std",
1693
- "select"
1816
+ "d",
1817
+ "f32"
1694
1818
  ],
1695
- [
1696
- "t",
1697
- "tGlow",
1698
- [
1699
- 1,
1700
- [
1701
- 6,
1702
- [
1703
- 7,
1704
- "d",
1705
- "f32"
1706
- ],
1707
- ["SOFT"]
1708
- ],
1709
- ">",
1710
- [5, "0.5"]
1711
- ]
1712
- ]
1819
+ ["SOFT"]
1713
1820
  ]
1714
- ],
1821
+ ]
1822
+ ]
1823
+ ],
1824
+ [
1825
+ 13,
1826
+ "qEval",
1827
+ [
1828
+ 1,
1715
1829
  [
1716
- 13,
1717
- "tk",
1830
+ 1,
1718
1831
  [
1719
- 6,
1720
- [
1721
- 7,
1722
- "std",
1723
- "clamp"
1724
- ],
1725
- [
1726
- [
1727
- 1,
1728
- [
1729
- 1,
1730
- "hl",
1731
- "-",
1732
- "t"
1733
- ],
1734
- "/",
1735
- [
1736
- 6,
1737
- [
1738
- 7,
1739
- "std",
1740
- "max"
1741
- ],
1742
- [[
1743
- 1,
1744
- "hl",
1745
- "*",
1746
- [5, "2"]
1747
- ], [5, "0.000001"]]
1748
- ]
1749
- ],
1750
- [5, "0"],
1751
- [5, "1"]
1752
- ]
1832
+ 1,
1833
+ "tEval",
1834
+ "*",
1835
+ "tEval"
1836
+ ],
1837
+ "+",
1838
+ [
1839
+ 1,
1840
+ "n",
1841
+ "*",
1842
+ "n"
1753
1843
  ]
1754
1844
  ],
1845
+ "/",
1755
1846
  [
1756
- 13,
1757
- "bright",
1847
+ 1,
1848
+ "bodyR",
1849
+ "*",
1850
+ "bodyR"
1851
+ ]
1852
+ ]
1853
+ ],
1854
+ [
1855
+ 13,
1856
+ "w",
1857
+ [
1858
+ 1,
1859
+ [
1860
+ 6,
1861
+ "weightFn",
1758
1862
  [
1759
- 1,
1760
- [5, "1"],
1761
- "-",
1762
- [
1763
- 1,
1764
- [
1765
- 1,
1766
- [5, "0.55"],
1767
- "*",
1768
- "tk"
1769
- ],
1770
- "*",
1771
- [
1772
- 6,
1773
- [
1774
- 7,
1775
- "d",
1776
- "f32"
1777
- ],
1778
- ["SOFT"]
1779
- ]
1780
- ]
1863
+ "qEval",
1864
+ "tEval",
1865
+ "n",
1866
+ "bodyR",
1867
+ "AA_W"
1781
1868
  ]
1782
1869
  ],
1783
- [
1784
- 13,
1870
+ "*",
1871
+ "bright"
1872
+ ]
1873
+ ],
1874
+ [
1875
+ 13,
1876
+ "e",
1877
+ [
1878
+ 6,
1879
+ [
1880
+ 7,
1881
+ "d",
1882
+ "u32"
1883
+ ],
1884
+ [[
1885
+ 1,
1785
1886
  "w",
1887
+ "*",
1786
1888
  [
1787
- 1,
1889
+ 6,
1788
1890
  [
1789
- 6,
1790
- "weightFn",
1791
- [
1792
- "tEval",
1793
- "n",
1794
- "bodyR",
1795
- "AA_W",
1796
- [
1797
- 6,
1798
- [
1799
- 7,
1800
- "d",
1801
- "f32"
1802
- ],
1803
- ["SOFT"]
1804
- ]
1805
- ]
1891
+ 7,
1892
+ "d",
1893
+ "f32"
1806
1894
  ],
1807
- "*",
1808
- "bright"
1895
+ ["GAIN"]
1809
1896
  ]
1810
- ],
1897
+ ]]
1898
+ ]
1899
+ ],
1900
+ [
1901
+ 11,
1902
+ [
1903
+ 1,
1904
+ "e",
1905
+ ">",
1906
+ [
1907
+ 6,
1908
+ [
1909
+ 7,
1910
+ "d",
1911
+ "u32"
1912
+ ],
1913
+ [[5, "0"]]
1914
+ ]
1915
+ ],
1916
+ [0, [
1811
1917
  [
1812
1918
  13,
1813
- "e",
1919
+ "idx",
1814
1920
  [
1815
1921
  6,
1816
1922
  [
@@ -1820,191 +1926,153 @@ function makeBoidsSplatKernel(shape) {
1820
1926
  ],
1821
1927
  [[
1822
1928
  1,
1823
- "w",
1824
- "*",
1825
1929
  [
1826
- 6,
1930
+ 1,
1931
+ "py",
1932
+ "*",
1827
1933
  [
1828
- 7,
1829
- "d",
1830
- "f32"
1831
- ],
1832
- ["GAIN"]
1833
- ]
1934
+ 6,
1935
+ [
1936
+ 7,
1937
+ "d",
1938
+ "i32"
1939
+ ],
1940
+ ["RES"]
1941
+ ]
1942
+ ],
1943
+ "+",
1944
+ "px"
1834
1945
  ]]
1835
1946
  ]
1836
1947
  ],
1837
1948
  [
1838
- 11,
1949
+ 6,
1839
1950
  [
1840
- 1,
1841
- "e",
1842
- ">",
1951
+ 7,
1952
+ "std",
1953
+ "atomicAdd"
1954
+ ],
1955
+ [[
1956
+ 8,
1843
1957
  [
1844
- 6,
1958
+ 7,
1845
1959
  [
1846
1960
  7,
1847
- "d",
1848
- "u32"
1961
+ "simLayout",
1962
+ "$"
1849
1963
  ],
1850
- [[5, "0"]]
1851
- ]
1964
+ "accumE"
1965
+ ],
1966
+ "idx"
1967
+ ], "e"]
1968
+ ],
1969
+ [
1970
+ 11,
1971
+ [
1972
+ 1,
1973
+ "agitI",
1974
+ ">",
1975
+ [5, "0"]
1852
1976
  ],
1853
- [0, [
1977
+ [0, [[
1978
+ 6,
1854
1979
  [
1855
- 13,
1856
- "idx",
1857
- [
1858
- 6,
1859
- [
1860
- 7,
1861
- "d",
1862
- "u32"
1863
- ],
1864
- [[
1865
- 1,
1866
- [
1867
- 1,
1868
- "py",
1869
- "*",
1870
- "RES"
1871
- ],
1872
- "+",
1873
- "px"
1874
- ]]
1875
- ]
1980
+ 7,
1981
+ "std",
1982
+ "atomicAdd"
1876
1983
  ],
1877
- [
1878
- 6,
1984
+ [[
1985
+ 8,
1879
1986
  [
1880
1987
  7,
1881
- "std",
1882
- "atomicAdd"
1883
- ],
1884
- [[
1885
- 8,
1886
1988
  [
1887
1989
  7,
1888
- [
1889
- 7,
1890
- "simLayout",
1891
- "$"
1892
- ],
1893
- "accumE"
1990
+ "simLayout",
1991
+ "$"
1894
1992
  ],
1895
- "idx"
1896
- ], "e"]
1897
- ],
1898
- [
1993
+ "accumS"
1994
+ ],
1995
+ "idx"
1996
+ ], [
1899
1997
  6,
1900
1998
  [
1901
1999
  7,
1902
- "std",
1903
- "atomicAdd"
2000
+ "d",
2001
+ "u32"
1904
2002
  ],
1905
2003
  [[
1906
- 8,
1907
- [
1908
- 7,
1909
- [
1910
- 7,
1911
- "simLayout",
1912
- "$"
1913
- ],
1914
- "accumS"
1915
- ],
1916
- "idx"
1917
- ], [
1918
- 6,
1919
- [
1920
- 7,
1921
- "d",
1922
- "u32"
1923
- ],
1924
- [[
1925
- 1,
1926
- [
1927
- 1,
1928
- "w",
1929
- "*",
1930
- "agitI"
1931
- ],
1932
- "*",
1933
- [
1934
- 6,
1935
- [
1936
- 7,
1937
- "d",
1938
- "f32"
1939
- ],
1940
- ["GAIN"]
1941
- ]
1942
- ]]
2004
+ 1,
2005
+ "w",
2006
+ "*",
2007
+ "agitGain"
1943
2008
  ]]
1944
- ]
1945
- ]]
2009
+ ]]
2010
+ ]]]
1946
2011
  ]
1947
2012
  ]]
1948
2013
  ]
1949
2014
  ]]
1950
- ]
1951
- ]]
1952
- ]]]
2015
+ ]]]
2016
+ ]
2017
+ ]]
1953
2018
  ]
1954
2019
  ]],
1955
2020
  "externalNames": [
1956
2021
  "simLayout",
1957
2022
  "d",
1958
2023
  "std",
2024
+ "GAIN",
2025
+ "SPLAT_R",
2026
+ "INV_RES",
1959
2027
  "HL",
1960
2028
  "EXT",
1961
2029
  "AA_W",
1962
2030
  "RES",
1963
- "SPLAT_WIN",
1964
- "SPLAT_R",
1965
- "INV_RES",
1966
2031
  "SOFT",
1967
- "weightFn",
1968
- "GAIN"
2032
+ "weightFn"
1969
2033
  ]
1970
2034
  },
1971
2035
  externals: () => ({
1972
2036
  simLayout,
1973
- d,
1974
- std,
2037
+ d: data_exports,
2038
+ std: std_exports,
2039
+ GAIN,
2040
+ SPLAT_R,
2041
+ INV_RES,
1975
2042
  HL,
1976
2043
  EXT,
1977
2044
  AA_W,
1978
2045
  RES,
1979
- SPLAT_WIN,
1980
- SPLAT_R,
1981
- INV_RES,
1982
2046
  SOFT,
1983
- weightFn,
1984
- GAIN
2047
+ weightFn
1985
2048
  })
1986
2049
  }) && $.f)({})).$name("boidsSplat");
1987
2050
  }
1988
2051
  const boidsSplatKernel = makeBoidsSplatKernel("arrow");
1989
2052
  function makeBoidsResolveKernel(colorSpaceMode) {
1990
2053
  const mixFn = mixColorsVariants[colorSpaceMode] ?? mixColorsLinear;
1991
- return tgpu.fn([d.u32, d.u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((x, y) => {
2054
+ return src_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((x, y) => {
1992
2055
  "use gpu";
1993
2056
  const prm = simLayout.$.params;
1994
- const idx = __tsover_add(__tsover_mul(y, d.u32(RES)), x);
1995
- const eRaw = d.f32(std.atomicLoad(simLayout.$.accumE[idx]));
1996
- const sRaw = d.f32(std.atomicLoad(simLayout.$.accumS[idx]));
2057
+ const idx = __tsover_add(__tsover_mul(y, u32(RES)), x);
2058
+ const eRaw = f32(atomicLoad(simLayout.$.accumE[idx]));
2059
+ atomicStore(simLayout.$.accumE[idx], u32(0));
2060
+ const sRaw = f32(atomicLoad(simLayout.$.accumS[idx]));
2061
+ atomicStore(simLayout.$.accumS[idx], u32(0));
1997
2062
  const energy = __tsover_mul(eRaw, __tsover_div(1, 255));
1998
- const agitAvg = __tsover_div(sRaw, std.max(eRaw, 1));
1999
- const col = mixFn(prm.colA, prm.colB, std.clamp(agitAvg, 0, 1));
2000
- const curA = __tsover_mul(__tsover_sub(1, std.exp(__tsover_mul(energy, -1.6))), col.w);
2063
+ let col = vec4f(prm.colA);
2064
+ if (eRaw > 0) {
2065
+ const agitAvg = __tsover_div(sRaw, max(eRaw, 1));
2066
+ col = mixFn(prm.colA, prm.colB, clamp(agitAvg, 0, 1));
2067
+ }
2068
+ const curA = __tsover_mul(__tsover_sub(1, exp(__tsover_mul(energy, -1.6))), col.w);
2001
2069
  const prev = simLayout.$.trailBuf[idx];
2002
2070
  const prevA = __tsover_mul(prev.w, prm.trails);
2003
2071
  const win = curA >= prevA;
2004
- const outA = std.max(curA, prevA);
2005
- const outRGB = std.select(d.vec3f(prev.x, prev.y, prev.z), d.vec3f(col.x, col.y, col.z), win);
2006
- simLayout.$.trailBuf[idx] = d.vec4f(outRGB.x, outRGB.y, outRGB.z, outA);
2007
- std.textureStore(simLayout.$.outTex, d.vec2u(x, y), d.vec4f(outRGB.x, outRGB.y, outRGB.z, outA));
2072
+ const outA = max(curA, prevA);
2073
+ const outRGB = select(vec3f(prev.x, prev.y, prev.z), vec3f(col.x, col.y, col.z), win);
2074
+ simLayout.$.trailBuf[idx] = vec4f(outRGB.x, outRGB.y, outRGB.z, outA);
2075
+ textureStore(simLayout.$.outTex, vec2u(x, y), vec4f(outRGB.x, outRGB.y, outRGB.z, outA));
2008
2076
  }), {
2009
2077
  v: 1,
2010
2078
  name: void 0,
@@ -2086,6 +2154,35 @@ function makeBoidsResolveKernel(colorSpaceMode) {
2086
2154
  ]]
2087
2155
  ]
2088
2156
  ],
2157
+ [
2158
+ 6,
2159
+ [
2160
+ 7,
2161
+ "std",
2162
+ "atomicStore"
2163
+ ],
2164
+ [[
2165
+ 8,
2166
+ [
2167
+ 7,
2168
+ [
2169
+ 7,
2170
+ "simLayout",
2171
+ "$"
2172
+ ],
2173
+ "accumE"
2174
+ ],
2175
+ "idx"
2176
+ ], [
2177
+ 6,
2178
+ [
2179
+ 7,
2180
+ "d",
2181
+ "u32"
2182
+ ],
2183
+ [[5, "0"]]
2184
+ ]]
2185
+ ],
2089
2186
  [
2090
2187
  13,
2091
2188
  "sRaw",
@@ -2119,6 +2216,35 @@ function makeBoidsResolveKernel(colorSpaceMode) {
2119
2216
  ]]
2120
2217
  ]
2121
2218
  ],
2219
+ [
2220
+ 6,
2221
+ [
2222
+ 7,
2223
+ "std",
2224
+ "atomicStore"
2225
+ ],
2226
+ [[
2227
+ 8,
2228
+ [
2229
+ 7,
2230
+ [
2231
+ 7,
2232
+ "simLayout",
2233
+ "$"
2234
+ ],
2235
+ "accumS"
2236
+ ],
2237
+ "idx"
2238
+ ], [
2239
+ 6,
2240
+ [
2241
+ 7,
2242
+ "d",
2243
+ "u32"
2244
+ ],
2245
+ [[5, "0"]]
2246
+ ]]
2247
+ ],
2122
2248
  [
2123
2249
  13,
2124
2250
  "energy",
@@ -2135,55 +2261,81 @@ function makeBoidsResolveKernel(colorSpaceMode) {
2135
2261
  ]
2136
2262
  ],
2137
2263
  [
2138
- 13,
2139
- "agitAvg",
2264
+ 12,
2265
+ "col",
2140
2266
  [
2141
- 1,
2142
- "sRaw",
2143
- "/",
2267
+ 6,
2144
2268
  [
2145
- 6,
2146
- [
2147
- 7,
2148
- "std",
2149
- "max"
2150
- ],
2151
- ["eRaw", [5, "1"]]
2152
- ]
2269
+ 7,
2270
+ "d",
2271
+ "vec4f"
2272
+ ],
2273
+ [[
2274
+ 7,
2275
+ "prm",
2276
+ "colA"
2277
+ ]]
2153
2278
  ]
2154
2279
  ],
2155
2280
  [
2156
- 13,
2157
- "col",
2281
+ 11,
2158
2282
  [
2159
- 6,
2160
- "mixFn",
2283
+ 1,
2284
+ "eRaw",
2285
+ ">",
2286
+ [5, "0"]
2287
+ ],
2288
+ [0, [[
2289
+ 13,
2290
+ "agitAvg",
2161
2291
  [
2162
- [
2163
- 7,
2164
- "prm",
2165
- "colA"
2166
- ],
2167
- [
2168
- 7,
2169
- "prm",
2170
- "colB"
2171
- ],
2292
+ 1,
2293
+ "sRaw",
2294
+ "/",
2172
2295
  [
2173
2296
  6,
2174
2297
  [
2175
2298
  7,
2176
2299
  "std",
2177
- "clamp"
2300
+ "max"
2301
+ ],
2302
+ ["eRaw", [5, "1"]]
2303
+ ]
2304
+ ]
2305
+ ], [
2306
+ 2,
2307
+ "col",
2308
+ "=",
2309
+ [
2310
+ 6,
2311
+ "mixFn",
2312
+ [
2313
+ [
2314
+ 7,
2315
+ "prm",
2316
+ "colA"
2178
2317
  ],
2179
2318
  [
2180
- "agitAvg",
2181
- [5, "0"],
2182
- [5, "1"]
2319
+ 7,
2320
+ "prm",
2321
+ "colB"
2322
+ ],
2323
+ [
2324
+ 6,
2325
+ [
2326
+ 7,
2327
+ "std",
2328
+ "clamp"
2329
+ ],
2330
+ [
2331
+ "agitAvg",
2332
+ [5, "0"],
2333
+ [5, "1"]
2334
+ ]
2183
2335
  ]
2184
2336
  ]
2185
2337
  ]
2186
- ]
2338
+ ]]]
2187
2339
  ],
2188
2340
  [
2189
2341
  13,
@@ -2452,36 +2604,36 @@ function makeBoidsResolveKernel(colorSpaceMode) {
2452
2604
  },
2453
2605
  externals: () => ({
2454
2606
  simLayout,
2455
- d,
2607
+ d: data_exports,
2456
2608
  RES,
2457
- std,
2609
+ std: std_exports,
2458
2610
  mixFn
2459
2611
  })
2460
2612
  }) && $.f)({})).$name("boidsResolve");
2461
2613
  }
2462
2614
  const boidsResolveKernel = makeBoidsResolveKernel(2);
2463
- const boidsUpdateKernel = tgpu.fn([d.u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((i) => {
2615
+ const boidsUpdateKernel = src_default.fn([u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((i) => {
2464
2616
  "use gpu";
2465
2617
  const prm = simLayout.$.params;
2466
2618
  const self = simLayout.$.agents[i];
2467
- let pos = d.vec2f(self.x, self.y);
2468
- let vel = d.vec2f(self.z, self.w);
2619
+ let pos = vec2f(self.x, self.y);
2620
+ let vel = vec2f(self.z, self.w);
2469
2621
  const dt = prm.dt;
2470
- const sVar = __tsover_add(.82, __tsover_mul(hash11(__tsover_add(__tsover_mul(d.f32(i), .61803), .13)), .4));
2622
+ const sVar = __tsover_add(.82, __tsover_mul(hash11(__tsover_add(__tsover_mul(f32(i), .61803), .13)), .4));
2471
2623
  const maxSpeedI = __tsover_mul(prm.maxSpeed, sVar);
2472
- let sep = d.vec2f(0, 0);
2473
- let ali = d.vec2f(0, 0);
2474
- let coh = d.vec2f(0, 0);
2475
- let nCount = d.f32(0);
2476
- let sCount = d.f32(0);
2624
+ let sep = vec2f(0, 0);
2625
+ let ali = vec2f(0, 0);
2626
+ let coh = vec2f(0, 0);
2627
+ let nCount = f32(0);
2628
+ let sCount = f32(0);
2477
2629
  for (let j = 0; j < MAX_AGENTS; j++) {
2478
- if (d.f32(j) >= prm.count) break;
2479
- const other = simLayout.$.agents[d.u32(j)];
2480
- const opos = d.vec2f(other.x, other.y);
2630
+ if (f32(j) >= prm.count) break;
2631
+ const other = simLayout.$.agents[u32(j)];
2632
+ const opos = vec2f(other.x, other.y);
2481
2633
  const off = pos.sub(opos);
2482
- const dsq = std.dot(off, off);
2634
+ const dsq = dot(off, off);
2483
2635
  if (dsq > 1e-7 && dsq < prm.perceptionSq) {
2484
- ali = ali.add(d.vec2f(other.z, other.w));
2636
+ ali = ali.add(vec2f(other.z, other.w));
2485
2637
  coh = coh.add(opos);
2486
2638
  nCount = __tsover_add(nCount, 1);
2487
2639
  if (dsq < prm.sepRadiusSq) {
@@ -2490,7 +2642,7 @@ const boidsUpdateKernel = tgpu.fn([d.u32])(/* @__PURE__ */ (($) => (globalThis._
2490
2642
  }
2491
2643
  }
2492
2644
  }
2493
- let accel = d.vec2f(0, 0);
2645
+ let accel = vec2f(0, 0);
2494
2646
  if (nCount > .5) {
2495
2647
  const aliSteer = safeSteer(ali.div(nCount), vel, maxSpeedI, prm.maxForce);
2496
2648
  const cohSteer = safeSteer(coh.div(nCount).sub(pos), vel, maxSpeedI, prm.maxForce);
@@ -2498,37 +2650,37 @@ const boidsUpdateKernel = tgpu.fn([d.u32])(/* @__PURE__ */ (($) => (globalThis._
2498
2650
  }
2499
2651
  if (sCount > .5) accel = accel.add(safeSteer(sep, vel, maxSpeedI, prm.maxForce).mul(prm.sepW));
2500
2652
  if (prm.cursorMode > .5) {
2501
- const cd = d.vec2f(prm.cursorX, prm.cursorY).sub(pos);
2502
- const cdsq = std.dot(cd, cd);
2653
+ const cd = vec2f(prm.cursorX, prm.cursorY).sub(pos);
2654
+ const cdsq = dot(cd, cd);
2503
2655
  if (cdsq > 1e-7 && cdsq < prm.cursorRadiusSq) {
2504
- const cdist = std.sqrt(cdsq);
2505
- const falloff = __tsover_sub(1, __tsover_div(cdist, std.max(prm.cursorRadius, 1e-5)));
2506
- const sign = std.select(d.f32(1), d.f32(-1), prm.cursorMode > 1.5);
2656
+ const cdist = sqrt(cdsq);
2657
+ const falloff = __tsover_sub(1, __tsover_div(cdist, max(prm.cursorRadius, 1e-5)));
2658
+ const sign = select(f32(1), f32(-1), prm.cursorMode > 1.5);
2507
2659
  accel = accel.add(cd.div(cdist).mul(__tsover_mul(__tsover_mul(sign, falloff), prm.cursorForce)));
2508
2660
  }
2509
2661
  }
2510
2662
  const m = prm.margin;
2511
2663
  const tf = prm.turnForce;
2512
- accel = accel.add(d.vec2f(std.select(d.f32(0), tf, pos.x < m), d.f32(0)));
2513
- accel = accel.add(d.vec2f(std.select(d.f32(0), -tf, pos.x > __tsover_sub(prm.domainX, m)), d.f32(0)));
2514
- accel = accel.add(d.vec2f(d.f32(0), std.select(d.f32(0), tf, pos.y < m)));
2515
- accel = accel.add(d.vec2f(d.f32(0), std.select(d.f32(0), -tf, pos.y > __tsover_sub(1, m))));
2516
- const effort = __tsover_div(std.length(accel), std.max(prm.maxForce, 1e-5));
2517
- const raw = std.clamp(__tsover_mul(__tsover_sub(effort, AGIT_REST), AGIT_GAIN), 0, 1);
2518
- const cooled = __tsover_mul(simLayout.$.agit[i], std.exp(__tsover_mul(dt, -AGIT_COOL)));
2519
- simLayout.$.agit[i] = std.max(raw, cooled);
2664
+ accel = accel.add(vec2f(select(f32(0), tf, pos.x < m), f32(0)));
2665
+ accel = accel.add(vec2f(select(f32(0), -tf, pos.x > __tsover_sub(prm.domainX, m)), f32(0)));
2666
+ accel = accel.add(vec2f(f32(0), select(f32(0), tf, pos.y < m)));
2667
+ accel = accel.add(vec2f(f32(0), select(f32(0), -tf, pos.y > __tsover_sub(1, m))));
2668
+ const effort = __tsover_div(length(accel), max(prm.maxForce, 1e-5));
2669
+ const raw = clamp(__tsover_mul(__tsover_sub(effort, AGIT_REST), AGIT_GAIN), 0, 1);
2670
+ const cooled = __tsover_mul(simLayout.$.agit[i], exp(__tsover_mul(dt, -AGIT_COOL)));
2671
+ simLayout.$.agit[i] = max(raw, cooled);
2520
2672
  vel = vel.add(accel.mul(dt));
2521
- const spd = std.length(vel);
2522
- const clamped = std.clamp(spd, __tsover_mul(maxSpeedI, .35), maxSpeedI);
2523
- vel = vel.div(std.max(spd, 1e-5)).mul(clamped);
2673
+ const spd = length(vel);
2674
+ const clamped = clamp(spd, __tsover_mul(maxSpeedI, .35), maxSpeedI);
2675
+ vel = vel.div(max(spd, 1e-5)).mul(clamped);
2524
2676
  pos = pos.add(vel.mul(dt));
2525
2677
  const hitX = pos.x < 0 || pos.x > prm.domainX;
2526
2678
  const hitY = pos.y < 0 || pos.y > 1;
2527
- const nvx = std.select(vel.x, __tsover_mul(vel.x, -.6), hitX);
2528
- const nvy = std.select(vel.y, __tsover_mul(vel.y, -.6), hitY);
2529
- const cx = std.clamp(pos.x, 0, prm.domainX);
2530
- const cy = std.clamp(pos.y, 0, 1);
2531
- simLayout.$.agents[i] = d.vec4f(cx, cy, nvx, nvy);
2679
+ const nvx = select(vel.x, __tsover_mul(vel.x, -.6), hitX);
2680
+ const nvy = select(vel.y, __tsover_mul(vel.y, -.6), hitY);
2681
+ const cx = clamp(pos.x, 0, prm.domainX);
2682
+ const cy = clamp(pos.y, 0, 1);
2683
+ simLayout.$.agents[i] = vec4f(cx, cy, nvx, nvy);
2532
2684
  }), {
2533
2685
  v: 1,
2534
2686
  name: void 0,
@@ -4096,10 +4248,10 @@ const boidsUpdateKernel = tgpu.fn([d.u32])(/* @__PURE__ */ (($) => (globalThis._
4096
4248
  },
4097
4249
  externals: () => ({
4098
4250
  simLayout,
4099
- d,
4251
+ d: data_exports,
4100
4252
  noise: noise_exports,
4101
4253
  MAX_AGENTS,
4102
- std,
4254
+ std: std_exports,
4103
4255
  safeSteer,
4104
4256
  AGIT_REST,
4105
4257
  AGIT_GAIN,
@@ -4306,11 +4458,11 @@ const componentDefinition = {
4306
4458
  const { gpu, getCpuValue, registerComputeTexture, onCleanup } = params;
4307
4459
  const root = gpu?.root;
4308
4460
  if (!root) return null;
4309
- const agents = createStateBuffer(root, d.vec4f, MAX_AGENTS);
4310
- const agitBuf = createStateBuffer(root, d.f32, MAX_AGENTS);
4311
- const accumE = createStateBuffer(root, d.atomic(d.u32), RES * RES);
4312
- const accumS = createStateBuffer(root, d.atomic(d.u32), RES * RES);
4313
- const trailBuf = createStateBuffer(root, d.vec4f, RES * RES);
4461
+ const agents = createStateBuffer(root, vec4f, MAX_AGENTS);
4462
+ const agitBuf = createStateBuffer(root, f32, MAX_AGENTS);
4463
+ const accumE = createStateBuffer(root, atomic(u32), RES * RES);
4464
+ const accumS = createStateBuffer(root, atomic(u32), RES * RES);
4465
+ const trailBuf = createStateBuffer(root, vec4f, RES * RES);
4314
4466
  const outTex = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(root.createTexture({
4315
4467
  size: [RES, RES],
4316
4468
  format: STATE_FORMAT
@@ -4349,29 +4501,6 @@ const componentDefinition = {
4349
4501
  },
4350
4502
  externals: () => ({ boidsInitKernel })
4351
4503
  }) && $.f)({})).with(simBg);
4352
- const clearAccum = createGuardedCompute(root, /* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((x, y) => {
4353
- "use gpu";
4354
- boidsClearAccumKernel(x, y);
4355
- }), {
4356
- v: 1,
4357
- name: void 0,
4358
- ast: {
4359
- "params": [{
4360
- "type": "i",
4361
- "name": "x"
4362
- }, {
4363
- "type": "i",
4364
- "name": "y"
4365
- }],
4366
- "body": [0, [[
4367
- 6,
4368
- "boidsClearAccumKernel",
4369
- ["x", "y"]
4370
- ]]],
4371
- "externalNames": ["boidsClearAccumKernel"]
4372
- },
4373
- externals: () => ({ boidsClearAccumKernel })
4374
- }) && $.f)({}), { size: [RES, RES] }).with(simBg);
4375
4504
  const update = createGuardedCompute(root, /* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((i) => {
4376
4505
  "use gpu";
4377
4506
  boidsUpdateKernel(i);
@@ -4449,7 +4578,7 @@ const componentDefinition = {
4449
4578
  const v = getCpuValue(key);
4450
4579
  return typeof v === "number" ? v : fallback;
4451
4580
  };
4452
- const count = Math.min(Math.max(Math.round(g("count", 2e3)), 16), MAX_AGENTS);
4581
+ const count = Math.min(Math.max(Math.round(g("count", 2e3)), 16), COUNT_CAP);
4453
4582
  const seed = g("seed", 0);
4454
4583
  const maxSpeed = BASE_SPEED * g("speed", 2);
4455
4584
  const maxForce = maxSpeed * FORCE_RATIO;
@@ -4461,10 +4590,10 @@ const componentDefinition = {
4461
4590
  const cursorRadius = .22;
4462
4591
  const colA = getCpuValue("colorA");
4463
4592
  const colB = getCpuValue("colorB");
4464
- const bodyR = Math.min(Math.max(g("size", 1.5), .5), 3) * 2 * INV_RES;
4593
+ const bodyR = Math.min(Math.max(g("size", 1.5), .5), 3) * 2 / SIZE_REF_RES;
4465
4594
  paramsU.write({
4466
- colA: d.vec4f(colA?.x ?? .56, colA?.y ?? .77, colA?.z ?? 1, colA?.w ?? 1),
4467
- colB: d.vec4f(colB?.x ?? 1, colB?.y ?? .48, colB?.z ?? .85, colB?.w ?? 1),
4595
+ colA: vec4f(colA?.x ?? .56, colA?.y ?? .77, colA?.z ?? 1, colA?.w ?? 1),
4596
+ colB: vec4f(colB?.x ?? 1, colB?.y ?? .48, colB?.z ?? .85, colB?.w ?? 1),
4468
4597
  count,
4469
4598
  trails: Math.min(Math.max(g("trails", .35), 0), 1) * .92,
4470
4599
  dt,
@@ -4494,7 +4623,7 @@ const componentDefinition = {
4494
4623
  lastSeed = seed;
4495
4624
  nodes.push(() => init.dispatchThreads(MAX_AGENTS));
4496
4625
  }
4497
- nodes.push(clearAccum, () => update.dispatchThreads(count), () => splat.dispatchThreads(count), resolve);
4626
+ nodes.push(() => update.dispatchThreads(count), () => splat.dispatchThreads(count), resolve);
4498
4627
  return nodes;
4499
4628
  }
4500
4629
  };
@@ -4506,4 +4635,4 @@ const componentDefinition = {
4506
4635
  }
4507
4636
  };
4508
4637
  var Boids_default = componentDefinition;
4509
- export { boidsSplatKernel as a, makeBoidsResolveKernel as c, boidsResolveKernel as i, makeBoidsSplatKernel as l, boidsClearAccumKernel as n, boidsUpdateKernel as o, boidsInitKernel as r, componentDefinition as s, Boids_default as t };
4638
+ export { boidsUpdateKernel as a, makeBoidsSplatKernel as c, boidsSplatKernel as i, boidsInitKernel as n, componentDefinition as o, boidsResolveKernel as r, makeBoidsResolveKernel as s, Boids_default as t };