shaders 3.2.464 → 3.2.465

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 (605) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/core/{AngularBlur-BwCxKNcQ.js → AngularBlur-DIuqsh_g.js} +3 -3
  3. package/dist/core/{Arc-BdSzj8aT.js → Arc-Bj71OeVa.js} +3 -3
  4. package/dist/core/{Ascii-3XAIw2Bb.js → Ascii-B5Zg8nLu.js} +5 -5
  5. package/dist/core/Aurora-Bj7ZG2AI.js +304 -0
  6. package/dist/core/{BarShift-BfLFLroO.js → BarShift-DPThLZs_.js} +3 -3
  7. package/dist/core/{BarnDoors-Do1MN34d.js → BarnDoors-BRBbwW_m.js} +3 -3
  8. package/dist/core/{Beam-Crszqjl5.js → Beam-Hb_ert_g.js} +3 -3
  9. package/dist/core/{Bend-XAqsg_xj.js → Bend-DXsmc81z.js} +2 -2
  10. package/dist/core/{Blob-Sr5tPikb.js → Blob-BigqrVZv.js} +129 -23
  11. package/dist/core/{BlockDissolve-CtvDicJt.js → BlockDissolve-CdFU8h6C.js} +3 -3
  12. package/dist/core/{BlockNoise-BYCW1y2-.js → BlockNoise-CqPy-Ugl.js} +4 -4
  13. package/dist/core/{BlueNoise-DqZFPThf.js → BlueNoise-BAo4Aauw.js} +4 -4
  14. package/dist/core/{Blur-CbnGAsl9.js → Blur-DWRebKhd.js} +2 -2
  15. package/dist/core/{Boids-CnXob_HY.js → Boids-DmJhzUCH.js} +5 -5
  16. package/dist/core/{BokehBlur-DN1DMnaB.js → BokehBlur-CV3_ON_U.js} +3 -3
  17. package/dist/core/{BrickPattern-DxfaxjHT.js → BrickPattern-vu5nVCWG.js} +3 -3
  18. package/dist/core/{BrightnessContrast-DRSwp0yp.js → BrightnessContrast-CY9XAi43.js} +3 -3
  19. package/dist/core/{BrushedMetal-BlwYqKiC.js → BrushedMetal-DS2r5KNw.js} +7 -7
  20. package/dist/core/{Bulge-CWtv1aVG.js → Bulge-Deev-nna.js} +2 -2
  21. package/dist/core/{CRTScreen-CKNOV6IF.js → CRTScreen-UtLgwP9x.js} +2 -2
  22. package/dist/core/{CarbonFiber-0PowYOyE.js → CarbonFiber-DyjbFQoK.js} +6 -6
  23. package/dist/core/{Chalkboard-DNfYEUQN.js → Chalkboard-BmeKO6iA.js} +3 -3
  24. package/dist/core/{ChannelBlur-Bl5Slnhm.js → ChannelBlur-BCQbhip0.js} +2 -2
  25. package/dist/core/{CheckerWipe-D1Pn4tq3.js → CheckerWipe-B0AHd80A.js} +3 -3
  26. package/dist/core/{Checkerboard-DYNjSdWz.js → Checkerboard-BxPmaPzN.js} +3 -3
  27. package/dist/core/{Chevron-By9YDPlg.js → Chevron-DRRnVJv8.js} +3 -3
  28. package/dist/core/{ChromaFlow-BHgHfSHB.js → ChromaFlow-DvHs9Afa.js} +5 -5
  29. package/dist/core/{ChromaticAberration-CsekFO9W.js → ChromaticAberration-qZmFsW-9.js} +4 -4
  30. package/dist/core/{Chrome-wfGdzbP1.js → Chrome-CCiXGEIK.js} +6 -7
  31. package/dist/core/{Circle-CBP-iZmQ.js → Circle-C8oVlMm5.js} +3 -3
  32. package/dist/core/{ColorWheel-Bt8Yats6.js → ColorWheel-UiKMjGmo.js} +3 -3
  33. package/dist/core/{CompressionArtifacts-CN-aj4Cz.js → CompressionArtifacts-Bcy_oi6I.js} +3 -3
  34. package/dist/core/{ConcentricSpin-CyCJxLJL.js → ConcentricSpin-ChsvpM4g.js} +2 -2
  35. package/dist/core/{ConicGradient-ucJPMdRd.js → ConicGradient-biAKBzTF.js} +4 -4
  36. package/dist/core/{ContourLines-B_CtL8Vu.js → ContourLines-DSVY48D3.js} +3 -3
  37. package/dist/core/{CornerPin-C76LSuH_.js → CornerPin-Dlk-j8yj.js} +3 -3
  38. package/dist/core/{Crescent-D-gZU6vD.js → Crescent-CW1Jtj3p.js} +2 -2
  39. package/dist/core/{Cross-CPbK6WLW.js → Cross-BZJwBhka.js} +2 -2
  40. package/dist/core/{Crystal-BAVRri0F.js → Crystal-B9bRXJr3.js} +6 -6
  41. package/dist/core/{CurlNoise-B8V3FalE.js → CurlNoise-ChVPqfJM.js} +4 -4
  42. package/dist/core/{CursorRipples-Ce_kWhe1.js → CursorRipples-uyzFiPfj.js} +6 -18
  43. package/dist/core/{CursorTrail-Dza0OORy.js → CursorTrail-BljiaEok.js} +4 -4
  44. package/dist/core/{DataMosh-DrJYG80o.js → DataMosh-CrqYJIlZ.js} +3 -3
  45. package/dist/core/{DiamondGradient-Dq0DpQpR.js → DiamondGradient-DsJORW4q.js} +4 -4
  46. package/dist/core/{DiamondWipe-CcgeiQ3X.js → DiamondWipe-CZCAIz29.js} +3 -3
  47. package/dist/core/{DiffuseBlur-DUecWEvv.js → DiffuseBlur-D-ps8_Uv.js} +3 -3
  48. package/dist/core/{DisplacementMap-B-yc-a_8.js → DisplacementMap-BdTvPZ5i.js} +3 -3
  49. package/dist/core/{Dither-CFxqATIY.js → Dither-DZH2vlNW.js} +3 -3
  50. package/dist/core/{DotGrid-Br5gKbrO.js → DotGrid-DBBt-OS1.js} +3 -3
  51. package/dist/core/{DropShadow-CRe0s6MQ.js → DropShadow-CUzoBD7j.js} +3 -3
  52. package/dist/core/{Duotone-M-wa5I6y.js → Duotone-Bn5yWY27.js} +3 -3
  53. package/dist/core/{Ellipse-B8SC59iU.js → Ellipse-BtgtCRPq.js} +2 -2
  54. package/dist/core/{Emboss-Df9dLMp4.js → Emboss-DZ6Je6il.js} +5 -5
  55. package/dist/core/{Engraving-BCfdEBr_.js → Engraving-DzCC1mKj.js} +3 -3
  56. package/dist/core/{ErosionNoise-cwJc4FgN.js → ErosionNoise-Buor7ogt.js} +4 -4
  57. package/dist/core/{Exposure-ILGY3UKH.js → Exposure-CcM7JTiR.js} +3 -3
  58. package/dist/core/{FallingLines-wUWAGXtD.js → FallingLines-Cu1_3RSE.js} +3 -3
  59. package/dist/core/{FilmGrain-ablIumMy.js → FilmGrain-CDvRV776.js} +3 -3
  60. package/dist/core/{FilmStock-CmpGCyGm.js → FilmStock-CVEZ0MMq.js} +4 -4
  61. package/dist/core/{Flip-tLanxfrx.js → Flip-D4aYsHii.js} +3 -3
  62. package/dist/core/{FloatingParticles-Bi1Llmwz.js → FloatingParticles-DxG2b7KL.js} +5 -5
  63. package/dist/core/{FlowField-DDFjV4AF.js → FlowField-CBZ6AJjI.js} +3 -3
  64. package/dist/core/{Flower-CQgB1K5v.js → Flower-DQIHZ-bK.js} +2 -2
  65. package/dist/core/FlowingGradient-Dp7p0Z0-.js +201 -0
  66. package/dist/core/{FlutedGlass-B3Talps5.js → FlutedGlass-D0Eij6P1.js} +4 -4
  67. package/dist/core/{Fog-zIXi81Mr.js → Fog-CRkLRU9L.js} +4 -4
  68. package/dist/core/{Form3D-JvT_i-8s.js → Form3D-DPKVw7Uz.js} +4 -4
  69. package/dist/core/{FractalNoise-BclR0vM-.js → FractalNoise-CKerAjEP.js} +4 -4
  70. package/dist/core/{Frost-r3Cn37X0.js → Frost-BT2y1-78.js} +7 -8
  71. package/dist/core/{GaborNoise-DCcdB69a.js → GaborNoise-CBl3ObUD.js} +4 -4
  72. package/dist/core/{Glass-U4NJVg8d.js → Glass-DujSDEC3.js} +7 -7
  73. package/dist/core/{GlassTiles-CF1FpanH.js → GlassTiles-BrFjg8_U.js} +2 -2
  74. package/dist/core/{Glitch-DOnrgMPv.js → Glitch-BEj5IcEk.js} +2 -2
  75. package/dist/core/{Glow-C5Xwf4jz.js → Glow-BrLQEgGG.js} +3 -3
  76. package/dist/core/{Godrays-DFD0-QUO.js → Godrays-C-nFhT7J.js} +3 -3
  77. package/dist/core/{Goo-CXruf3Bc.js → Goo-BHDDGalk.js} +7 -7
  78. package/dist/core/{GradientMap-0btW-vE7.js → GradientMap-o2MPg2ow.js} +4 -4
  79. package/dist/core/{Grayscale-CQVfbvqS.js → Grayscale-C-la_L2j.js} +2 -2
  80. package/dist/core/{Grid-OAYnOEA9.js → Grid-B1VcFuc7.js} +3 -3
  81. package/dist/core/{GridDistortion-DeLoOUlh.js → GridDistortion-CCHiCvEG.js} +5 -5
  82. package/dist/core/{Group-UfbFIE6i.js → Group-AnGFDE0L.js} +1 -1
  83. package/dist/core/{HTMLInCanvas-DFZW7XjR.js → HTMLInCanvas-C_rqrYa1.js} +2 -2
  84. package/dist/core/{Halftone-BK7mr9rb.js → Halftone-CU42fH-5.js} +3 -3
  85. package/dist/core/{Heart-BdD0KoOX.js → Heart-07cEG1xh.js} +2 -2
  86. package/dist/core/{Heatmap-BubYsW6_.js → Heatmap-xBYZaTxw.js} +7 -7
  87. package/dist/core/{HexGrid-BVK5rrwR.js → HexGrid-3qTBLwQu.js} +3 -3
  88. package/dist/core/{Hologram-DE3lGk0F.js → Hologram-BMUHKIhP.js} +6 -6
  89. package/dist/core/{Holographic-DJqswtrS.js → Holographic-XrdyIsQ7.js} +6 -6
  90. package/dist/core/{HueShift-BfopB_hn.js → HueShift-DizW-T84.js} +3 -3
  91. package/dist/core/{ImageTexture-B5gNePC8.js → ImageTexture-C3Cn7rtL.js} +2 -2
  92. package/dist/core/{InkFlow-9Dy9cgIR.js → InkFlow-hFBLw4IG.js} +5 -5
  93. package/dist/core/{Invert-B5uKr4Bw.js → Invert-BFpiH_Fe.js} +2 -2
  94. package/dist/core/{IrisWipe-BunsTSPx.js → IrisWipe-DSr8gRmW.js} +3 -3
  95. package/dist/core/Irradiance-DT3bdyrR.js +4191 -0
  96. package/dist/core/{IsometricCubes-COoLKav-.js → IsometricCubes-BCRJuLb8.js} +3 -3
  97. package/dist/core/{Kaleidoscope-D2zB6f60.js → Kaleidoscope-BpOMiquv.js} +2 -2
  98. package/dist/core/{KeyFrames-QLmC6Sdn.js → KeyFrames-wKMZnI5V.js} +3 -3
  99. package/dist/core/{LensDistortion-CxLTKe5L.js → LensDistortion-DPn9dipa.js} +3 -3
  100. package/dist/core/{LensFlare-P1Cc_7_5.js → LensFlare-BrSUeEER.js} +3 -3
  101. package/dist/core/{LightEdge-B3HMbUyU.js → LightEdge-DMKtLk_r.js} +5 -6
  102. package/dist/core/{LightLeak-oEDfnsq5.js → LightLeak-D1d75-LU.js} +4 -4
  103. package/dist/core/{Line-BzGomKXR.js → Line-CJ1nmMq5.js} +3 -3
  104. package/dist/core/{LinearBlur-yhxdvssU.js → LinearBlur-1kNx5NeX.js} +3 -3
  105. package/dist/core/{LinearGradient-C15kSqLN.js → LinearGradient-BIg2PR9v.js} +4 -4
  106. package/dist/core/{LinearWipe-DHxvpnNg.js → LinearWipe-CfGDpMW3.js} +3 -3
  107. package/dist/core/{LiquidMetal-Cu2WeYH7.js → LiquidMetal-CnkraENV.js} +7 -7
  108. package/dist/core/{Liquify-DY1EfFNf.js → Liquify-2zml8B9N.js} +4 -4
  109. package/dist/core/{MagneticFilings-Bd6Pe_E0.js → MagneticFilings-Ddl4BEe7.js} +5 -5
  110. package/dist/core/{Marble-Bdc_FHzu.js → Marble-yskR3VxY.js} +26 -11
  111. package/dist/core/{MeshGradient-DRRMmZHE.js → MeshGradient-DzcW4S3J.js} +43 -13
  112. package/dist/core/{Mirror-5UQjt2Tf.js → Mirror-PoO2nzkL.js} +2 -2
  113. package/dist/core/{MultiPointGradient-DqdcS8e0.js → MultiPointGradient-b0b1o2Zp.js} +3 -3
  114. package/dist/core/{Nebula-BQuiaN-z.js → Nebula-yfdqoP2y.js} +8 -19
  115. package/dist/core/{Neon-BicLpgbo.js → Neon-BAsvBcVb.js} +5 -5
  116. package/dist/core/{NoiseDissolve-DGbFYpRH.js → NoiseDissolve-CFofypUT.js} +3 -3
  117. package/dist/core/{ObjectTracker-T8FCXWre.js → ObjectTracker-A8bkVn0T.js} +3 -3
  118. package/dist/core/Obsidian-ug1e4cqX.js +305 -0
  119. package/dist/core/{PagePeel-DilPJ9RZ.js → PagePeel-0gUH5Q-F.js} +2 -2
  120. package/dist/core/{Paper-l6RxJWBc.js → Paper-Cv-ENEnt.js} +2 -2
  121. package/dist/core/{Parallelogram-C95JWNsU.js → Parallelogram-CKri4Oxr.js} +2 -2
  122. package/dist/core/{ParticleField-aw2g8IBO.js → ParticleField-ImA96tiR.js} +4 -4
  123. package/dist/core/{ParticleFlow-DTrnGnOB.js → ParticleFlow-CvOwCV9k.js} +6 -6
  124. package/dist/core/{Particles-Jhwjq6OU.js → Particles-HiSrLK4u.js} +6 -6
  125. package/dist/core/{PerlinNoise-D6xOjr7j.js → PerlinNoise-DWzWZnfd.js} +4 -4
  126. package/dist/core/{Perspective-Bb-9hqX5.js → Perspective-CZsUpoMX.js} +3 -3
  127. package/dist/core/{PixelSort-INY2qe01.js → PixelSort-sFDbi0pD.js} +4 -4
  128. package/dist/core/{PixelThrow-BWWz7QQi.js → PixelThrow-jqMlr2Be.js} +4 -4
  129. package/dist/core/{Pixelate-C3aJ40yf.js → Pixelate-BM5zL6Ss.js} +2 -2
  130. package/dist/core/{Plasma-evU7RvjN.js → Plasma--XCLN3eI.js} +4 -4
  131. package/dist/core/{Plastic-CdenJzHE.js → Plastic-COIZ00DY.js} +7 -7
  132. package/dist/core/{PolarCoordinates-CgSPmcVa.js → PolarCoordinates-DvrVbOAL.js} +2 -2
  133. package/dist/core/{Polygon-CP182yxM.js → Polygon-C9joRqmN.js} +3 -3
  134. package/dist/core/{Posterize-g1VAiALB.js → Posterize-Ctj5u3WL.js} +2 -2
  135. package/dist/core/{Prism-ZUtkRwyw.js → Prism-DDbB5dVW.js} +6 -6
  136. package/dist/core/{ProgressiveBlur-wUfFxLuq.js → ProgressiveBlur-DtsGEfjw.js} +3 -3
  137. package/dist/core/{RadialGradient-BVplFboK.js → RadialGradient-X-zZCLXw.js} +4 -4
  138. package/dist/core/{RadialWipe-CEvgkBtN.js → RadialWipe-_fAAAe7h.js} +3 -3
  139. package/dist/core/{RandomBars-DznYc1cK.js → RandomBars-HijtROxW.js} +3 -3
  140. package/dist/core/{ReactionDiffusion-hEARMWb4.js → ReactionDiffusion-CS7NfQ4C.js} +5 -5
  141. package/dist/core/{RectangularCoordinates-BKOR8UVl.js → RectangularCoordinates-BqG9R6nC.js} +2 -2
  142. package/dist/core/{ReflectivePlane-DrJ1pxMa.js → ReflectivePlane-Cgxar0Vg.js} +3 -3
  143. package/dist/core/{Repeater-DTpCf9Lm.js → Repeater-Bja_7hpl.js} +3 -3
  144. package/dist/core/{Ring-DINywbbr.js → Ring-CjXxnr67.js} +2 -2
  145. package/dist/core/{RippleWipe-CwenaRYy.js → RippleWipe-pFLRAiMP.js} +3 -3
  146. package/dist/core/{Ripples-FuYdWcQW.js → Ripples-f1uD5ZHV.js} +3 -3
  147. package/dist/core/{RoundedRect-h_UJqq2W.js → RoundedRect-Nocfrish.js} +2 -2
  148. package/dist/core/{Saturation-DitLgecu.js → Saturation-Bk2_CdAM.js} +3 -3
  149. package/dist/core/{Scratches-4So8YZag.js → Scratches-BGjPBk-E.js} +4 -4
  150. package/dist/core/{Sharpness-CZ7h17-W.js → Sharpness-nMDZWmUh.js} +3 -3
  151. package/dist/core/{Shatter-DQ1i7GCD.js → Shatter-CNqHaYVM.js} +2 -2
  152. package/dist/core/{SimplexNoise-Cbhm8yTV.js → SimplexNoise-HdsHuat_.js} +4 -4
  153. package/dist/core/{SineWave-BULHKSth.js → SineWave-DtfHg2hB.js} +3 -3
  154. package/dist/core/{SliceWipe-CrxHLUSK.js → SliceWipe-Bp_riBms.js} +2 -2
  155. package/dist/core/{Smoke-C-0NUtDU.js → Smoke-C-lb8En_.js} +4 -4
  156. package/dist/core/{SmokeFill-D81FhHmB.js → SmokeFill-ChR8Pe8m.js} +7 -7
  157. package/dist/core/{SmokeFlow-DirP_Xti.js → SmokeFlow-Dx6_BTmh.js} +4 -4
  158. package/dist/core/{Solarize-DZP3UJ85.js → Solarize-CjleKYpq.js} +3 -3
  159. package/dist/core/{SolidColor-DvatFKwG.js → SolidColor-BgxBiv00.js} +3 -3
  160. package/dist/core/{Spherize-sLICbjrn.js → Spherize-B8aaXFYF.js} +3 -3
  161. package/dist/core/{Spiral-irgoeG4p.js → Spiral-CMHZAfrE.js} +3 -3
  162. package/dist/core/{Star-CKLN8zIt.js → Star-CCs7sc0U.js} +2 -2
  163. package/dist/core/{Stone-D5-LyXDX.js → Stone-DGW4Z0fk.js} +2 -2
  164. package/dist/core/{Strands-DhHb1DvF.js → Strands-CRqZn5yd.js} +5 -5
  165. package/dist/core/{Stretch-T57H17vt.js → Stretch-CcVH3bEx.js} +2 -2
  166. package/dist/core/{Stripes-DxWGkOif.js → Stripes-BZieDTLM.js} +3 -3
  167. package/dist/core/StudioBackground-Ba3yr_rk.js +399 -0
  168. package/dist/core/{SunBurst-DR13HThp.js → SunBurst-DcgLv7MO.js} +3 -3
  169. package/dist/core/{Surface3D-CpOF-rTd.js → Surface3D-CJCdvt2D.js} +6 -6
  170. package/dist/core/{Swirl-Cn9B5BXA.js → Swirl-DWcoxaOQ.js} +4 -4
  171. package/dist/core/{Teardrop-xVB2Rryt.js → Teardrop-CKptpnfu.js} +2 -2
  172. package/dist/core/{Text-Bzitt0Bc.js → Text-Cdu-4DM4.js} +6 -6
  173. package/dist/core/{ThinFilm-CrslR7Dx.js → ThinFilm-CEgkS1Gh.js} +5 -5
  174. package/dist/core/{TiltShift-DxfHWzYk.js → TiltShift-sU_nwYUs.js} +3 -3
  175. package/dist/core/{TimeTrail-CSy6Y7hh.js → TimeTrail-BPpKtbwU.js} +6 -6
  176. package/dist/core/{Tint-DOCp2b8s.js → Tint-DLMwqDc-.js} +3 -3
  177. package/dist/core/{Trapezoid-CtfXCYGA.js → Trapezoid-HmlCtO5F.js} +2 -2
  178. package/dist/core/{TriangularGrid-BmumLNDo.js → TriangularGrid-CyN-Xlpp.js} +3 -3
  179. package/dist/core/{Tritone-B93mcT36.js → Tritone-TxR-2WxY.js} +3 -3
  180. package/dist/core/{Truchet-CH6G5ozn.js → Truchet-Dz0_Wb6a.js} +3 -3
  181. package/dist/core/{Twirl-B9Z9dST8.js → Twirl-C2ZZbEqD.js} +2 -2
  182. package/dist/core/{VHS-BqFaXkMd.js → VHS-AzcydKoR.js} +2 -2
  183. package/dist/core/{VenetianBlinds-DAGlgwNE.js → VenetianBlinds-ByLVp-bI.js} +3 -3
  184. package/dist/core/{Vesica-D-8FK4C2.js → Vesica--m1hCd0S.js} +2 -2
  185. package/dist/core/{Vibrance-bJAZ4iks.js → Vibrance-C3W42RTW.js} +3 -3
  186. package/dist/core/{VideoTexture-LRpjvr-E.js → VideoTexture-CiONs3rJ.js} +2 -2
  187. package/dist/core/{Vignette-QPr1Cal2.js → Vignette-YXS49Qyf.js} +5 -12
  188. package/dist/core/{Voronoi-c4jiH9Rs.js → Voronoi-BwSw2fv2.js} +5 -5
  189. package/dist/core/{Water-D9HuYCj8.js → Water-Bsh_h3mJ.js} +7 -7
  190. package/dist/core/{Watercolor-DQUk4Fp6.js → Watercolor-CE1O6HQG.js} +4 -4
  191. package/dist/core/{WaveDistortion-7a_HwjyD.js → WaveDistortion-Bjr4PG5Q.js} +2 -2
  192. package/dist/core/Waveform-VAxURycO.js +427 -0
  193. package/dist/core/{WaveletNoise-B87y08nU.js → WaveletNoise-dNJGloeP.js} +4 -4
  194. package/dist/core/{Weave-BYnUiQAe.js → Weave-3Esy_ShT.js} +3 -3
  195. package/dist/core/{WebcamTexture-B7ldvLMJ.js → WebcamTexture-BPuazZWW.js} +2 -2
  196. package/dist/core/{Wool-BIVLEFAo.js → Wool-Crs8DCcs.js} +2 -2
  197. package/dist/core/{WorleyNoise-BzruBvh3.js → WorleyNoise-DHH2D7Mj.js} +3 -3
  198. package/dist/core/{ZoomBlur-Cg6vOxUb.js → ZoomBlur-EltMxju3.js} +3 -3
  199. package/dist/core/{agents-Ccxns43k.js → agents-CR8K0nq1.js} +4 -5
  200. package/dist/core/{agents-DbHmHbkU.js → agents-DcHmaB0C.js} +1 -2
  201. package/dist/core/{blur-CpGmUq81.js → blur-BwjlF0Uk.js} +1 -1
  202. package/dist/core/{blurs-O1YbZEVw.js → blurs-D1HfQTGP.js} +5 -5
  203. package/dist/core/{color-C9iR6boM.js → color-dbYyVLqf.js} +2 -3
  204. package/dist/core/compose-prsdG9f_.js +46 -0
  205. package/dist/core/{feedback-ZMsR_fKB.js → feedback-DvKOD0Oo.js} +1 -1
  206. package/dist/core/{fields-Cg5kOBDV.js → fields-Cv-wBDLP.js} +155 -7
  207. package/dist/core/figures-DdZ6A2i8.js +48 -0
  208. package/dist/core/{fluids-D76EnTFg.js → fluids-BPs3cdPe.js} +2 -2
  209. package/dist/core/{frames-BWC4dNMQ.js → frames-DIS73FmL.js} +23 -3
  210. package/dist/core/{glass-DxE2Cy6_.js → glass-CtWl8jzT.js} +1 -1
  211. package/dist/core/gpu/index.d.ts +4 -0
  212. package/dist/core/gpu/index.d.ts.map +1 -1
  213. package/dist/core/gpu/kit/colorStops.d.ts +6 -0
  214. package/dist/core/gpu/kit/colorStops.d.ts.map +1 -1
  215. package/dist/core/gpu/kit/fields.d.ts +29 -0
  216. package/dist/core/gpu/kit/fields.d.ts.map +1 -1
  217. package/dist/core/gpu/kit/gradientPaints.d.ts +9 -0
  218. package/dist/core/gpu/kit/gradientPaints.d.ts.map +1 -1
  219. package/dist/core/gpu/kit/index.d.ts +0 -1
  220. package/dist/core/gpu/kit/index.d.ts.map +1 -1
  221. package/dist/core/gpu/kit/noisePaints.d.ts +12 -22
  222. package/dist/core/gpu/kit/noisePaints.d.ts.map +1 -1
  223. package/dist/core/gpu/kit/patternPaints.d.ts +5 -0
  224. package/dist/core/gpu/kit/patternPaints.d.ts.map +1 -1
  225. package/dist/core/gpu/kit/sdf.d.ts +15 -0
  226. package/dist/core/gpu/kit/sdf.d.ts.map +1 -1
  227. package/dist/core/gpu/kit/shapePaints.d.ts +8 -21
  228. package/dist/core/gpu/kit/shapePaints.d.ts.map +1 -1
  229. package/dist/core/gpu/kit/tone.d.ts +5 -0
  230. package/dist/core/gpu/kit/tone.d.ts.map +1 -1
  231. package/dist/core/gpu/scaffolds/radiance.d.ts +347 -0
  232. package/dist/core/gpu/scaffolds/radiance.d.ts.map +1 -0
  233. package/dist/core/gpu/transforms.d.ts +2 -1
  234. package/dist/core/gpu/transforms.d.ts.map +1 -1
  235. package/dist/core/gpu/uniformBridge.d.ts +6 -0
  236. package/dist/core/gpu/uniformBridge.d.ts.map +1 -1
  237. package/dist/core/{gradientPaints-B6-PoDoK.js → gradientPaints-Du0XCNHB.js} +1287 -301
  238. package/dist/core/{gradients-CVEWcxw9.js → gradients-DT6nJTmW.js} +4 -4
  239. package/dist/core/index.js +300 -248
  240. package/dist/core/{lens-ChZyqXRf.js → lens-Dh_a0mZH.js} +2 -2
  241. package/dist/core/{light-CJ3dY0iH.js → light-CROZ7Zf1.js} +39 -6
  242. package/dist/core/{lightfields-BjzpZvFy.js → lightfields-D5lW4WSp.js} +2 -2
  243. package/dist/core/{lower-z2vuXP8M.js → lower-DSk_KxOY.js} +12186 -958
  244. package/dist/core/mask-AFtVwMNo.js +28 -0
  245. package/dist/core/{materials-D7QX3H4h.js → materials-Dhq8lDKb.js} +77 -28
  246. package/dist/core/{math-BF-GBlb4.js → math-DCQU6EQz.js} +9 -2
  247. package/dist/core/{media-By6o6a83.js → media-Bh5c_fVF.js} +2 -2
  248. package/dist/core/{mediaLifecycle-DQg13y-f.js → mediaLifecycle-BTPb5i1-.js} +1 -1
  249. package/dist/core/{motionBlur-BnthNfqm.js → motionBlur-CiNghKu6.js} +2 -3
  250. package/dist/core/{noise-DQWgxDEf.js → noise-DrbAbu3H.js} +54 -76
  251. package/dist/core/{noiseColor-XppoAmXi.js → noiseColor-DKo-P8T0.js} +2 -2
  252. package/dist/core/{noisePaints-Cs2Q1Xk9.js → noisePaints-DV5jKo1A.js} +464 -735
  253. package/dist/core/{overlay-Sye7-I6D.js → overlay-Dc6bKqEd.js} +5 -5
  254. package/dist/core/{patterns-CUWhLDh0.js → patterns-BAu9g0yn.js} +729 -433
  255. package/dist/core/{pointerFields-CaaXhvvu.js → pointerFields-yUe8811b.js} +2 -2
  256. package/dist/core/{porters-B1UjrM1y.js → porters-j4QbEOqj.js} +148 -7
  257. package/dist/core/presetRenderer.d.ts.map +1 -1
  258. package/dist/core/registry.js +246 -244
  259. package/dist/core/{reveal-xpOj9hSs.js → reveal-s6xWR757.js} +1 -2
  260. package/dist/core/{sdf3d-BD5m6HR6.js → sdf3d-DQ55w9nI.js} +3 -3
  261. package/dist/core/shaderRegistry-D6mNFoD5.js +441 -0
  262. package/dist/core/shaderRegistry.d.ts.map +1 -1
  263. package/dist/core/shaders/AngularBlur/index.js +10 -11
  264. package/dist/core/shaders/Arc/index.js +6 -6
  265. package/dist/core/shaders/Ascii/index.js +11 -12
  266. package/dist/core/shaders/Aurora/index.d.ts.map +1 -1
  267. package/dist/core/shaders/Aurora/index.js +21 -12
  268. package/dist/core/shaders/BarShift/index.js +8 -9
  269. package/dist/core/shaders/BarnDoors/index.js +7 -8
  270. package/dist/core/shaders/Beam/index.js +11 -12
  271. package/dist/core/shaders/Bend/index.js +8 -9
  272. package/dist/core/shaders/Blob/index.d.ts.map +1 -1
  273. package/dist/core/shaders/Blob/index.js +18 -12
  274. package/dist/core/shaders/BlockDissolve/index.js +7 -8
  275. package/dist/core/shaders/BlockNoise/index.js +14 -16
  276. package/dist/core/shaders/BlueNoise/index.js +14 -16
  277. package/dist/core/shaders/Blur/index.js +10 -11
  278. package/dist/core/shaders/Boids/index.js +9 -10
  279. package/dist/core/shaders/BokehBlur/index.js +10 -11
  280. package/dist/core/shaders/BrickPattern/index.js +13 -15
  281. package/dist/core/shaders/BrightnessContrast/index.js +7 -8
  282. package/dist/core/shaders/BrushedMetal/index.js +11 -12
  283. package/dist/core/shaders/Bulge/index.js +8 -9
  284. package/dist/core/shaders/CRTScreen/index.js +10 -11
  285. package/dist/core/shaders/CarbonFiber/index.js +11 -12
  286. package/dist/core/shaders/Chalkboard/index.js +9 -10
  287. package/dist/core/shaders/ChannelBlur/index.js +10 -11
  288. package/dist/core/shaders/CheckerWipe/index.js +7 -8
  289. package/dist/core/shaders/Checkerboard/index.js +13 -15
  290. package/dist/core/shaders/Chevron/index.js +13 -15
  291. package/dist/core/shaders/ChromaFlow/index.js +8 -9
  292. package/dist/core/shaders/ChromaticAberration/index.js +11 -12
  293. package/dist/core/shaders/Chrome/index.js +10 -11
  294. package/dist/core/shaders/Circle/index.js +6 -6
  295. package/dist/core/shaders/ColorWheel/index.js +11 -12
  296. package/dist/core/shaders/CompressionArtifacts/index.js +7 -8
  297. package/dist/core/shaders/ConcentricSpin/index.js +8 -9
  298. package/dist/core/shaders/ConicGradient/index.js +11 -12
  299. package/dist/core/shaders/ContourLines/index.js +6 -7
  300. package/dist/core/shaders/CornerPin/index.js +8 -9
  301. package/dist/core/shaders/Crescent/index.js +5 -5
  302. package/dist/core/shaders/Cross/index.js +5 -5
  303. package/dist/core/shaders/Crystal/index.js +11 -12
  304. package/dist/core/shaders/CurlNoise/index.js +14 -16
  305. package/dist/core/shaders/CursorRipples/index.js +7 -6
  306. package/dist/core/shaders/CursorTrail/index.js +7 -8
  307. package/dist/core/shaders/DataMosh/index.js +7 -8
  308. package/dist/core/shaders/DiamondGradient/index.js +11 -12
  309. package/dist/core/shaders/DiamondWipe/index.js +7 -8
  310. package/dist/core/shaders/DiffuseBlur/index.js +10 -11
  311. package/dist/core/shaders/DisplacementMap/index.js +8 -9
  312. package/dist/core/shaders/Dither/index.js +13 -15
  313. package/dist/core/shaders/DotGrid/index.js +13 -15
  314. package/dist/core/shaders/DropShadow/index.js +10 -11
  315. package/dist/core/shaders/Duotone/index.js +6 -7
  316. package/dist/core/shaders/Ellipse/index.js +5 -5
  317. package/dist/core/shaders/Emboss/index.js +9 -10
  318. package/dist/core/shaders/Engraving/index.js +9 -10
  319. package/dist/core/shaders/ErosionNoise/index.js +14 -16
  320. package/dist/core/shaders/Exposure/index.js +7 -8
  321. package/dist/core/shaders/FallingLines/index.js +13 -15
  322. package/dist/core/shaders/FilmGrain/index.js +7 -8
  323. package/dist/core/shaders/FilmStock/index.js +13 -14
  324. package/dist/core/shaders/Flip/index.js +8 -9
  325. package/dist/core/shaders/FloatingParticles/index.js +9 -10
  326. package/dist/core/shaders/FlowField/index.js +8 -9
  327. package/dist/core/shaders/Flower/index.js +5 -5
  328. package/dist/core/shaders/FlowingGradient/index.d.ts.map +1 -1
  329. package/dist/core/shaders/FlowingGradient/index.js +15 -12
  330. package/dist/core/shaders/FlutedGlass/index.js +11 -12
  331. package/dist/core/shaders/Fog/index.js +7 -8
  332. package/dist/core/shaders/Form3D/index.js +7 -8
  333. package/dist/core/shaders/FractalNoise/index.js +13 -15
  334. package/dist/core/shaders/Frost/index.js +11 -12
  335. package/dist/core/shaders/GaborNoise/index.js +14 -16
  336. package/dist/core/shaders/Glass/index.js +11 -12
  337. package/dist/core/shaders/GlassTiles/index.js +8 -9
  338. package/dist/core/shaders/Glitch/index.js +10 -11
  339. package/dist/core/shaders/Glow/index.js +11 -12
  340. package/dist/core/shaders/Godrays/index.js +12 -12
  341. package/dist/core/shaders/Goo/index.js +11 -12
  342. package/dist/core/shaders/GradientMap/index.js +7 -8
  343. package/dist/core/shaders/Grayscale/index.js +6 -7
  344. package/dist/core/shaders/Grid/index.js +13 -15
  345. package/dist/core/shaders/GridDistortion/index.js +11 -12
  346. package/dist/core/shaders/Group/index.js +6 -7
  347. package/dist/core/shaders/HTMLInCanvas/index.js +7 -8
  348. package/dist/core/shaders/Halftone/index.js +13 -15
  349. package/dist/core/shaders/Heart/index.js +5 -5
  350. package/dist/core/shaders/Heatmap/index.js +11 -12
  351. package/dist/core/shaders/HexGrid/index.js +13 -15
  352. package/dist/core/shaders/Hologram/index.js +10 -11
  353. package/dist/core/shaders/Holographic/index.js +10 -11
  354. package/dist/core/shaders/HueShift/index.js +7 -8
  355. package/dist/core/shaders/ImageTexture/index.js +6 -6
  356. package/dist/core/shaders/InkFlow/index.js +8 -9
  357. package/dist/core/shaders/Invert/index.js +6 -7
  358. package/dist/core/shaders/IrisWipe/index.js +7 -8
  359. package/dist/core/shaders/Irradiance/index.d.ts +127 -0
  360. package/dist/core/shaders/Irradiance/index.d.ts.map +1 -0
  361. package/dist/core/shaders/Irradiance/index.js +14 -0
  362. package/dist/core/shaders/IsometricCubes/index.js +13 -15
  363. package/dist/core/shaders/Kaleidoscope/index.js +8 -9
  364. package/dist/core/shaders/KeyFrames/index.js +10 -11
  365. package/dist/core/shaders/LensDistortion/index.js +6 -6
  366. package/dist/core/shaders/LensFlare/index.js +12 -12
  367. package/dist/core/shaders/LightEdge/index.js +10 -11
  368. package/dist/core/shaders/LightLeak/index.js +12 -12
  369. package/dist/core/shaders/Line/index.js +10 -12
  370. package/dist/core/shaders/LinearBlur/index.js +10 -11
  371. package/dist/core/shaders/LinearGradient/index.js +11 -12
  372. package/dist/core/shaders/LinearWipe/index.js +7 -8
  373. package/dist/core/shaders/LiquidMetal/index.js +11 -12
  374. package/dist/core/shaders/Liquify/index.js +10 -11
  375. package/dist/core/shaders/MagneticFilings/index.js +9 -10
  376. package/dist/core/shaders/Marble/index.d.ts +1 -1
  377. package/dist/core/shaders/Marble/index.d.ts.map +1 -1
  378. package/dist/core/shaders/Marble/index.js +15 -15
  379. package/dist/core/shaders/MeshGradient/index.d.ts.map +1 -1
  380. package/dist/core/shaders/MeshGradient/index.js +16 -12
  381. package/dist/core/shaders/Mirror/index.js +8 -9
  382. package/dist/core/shaders/MultiPointGradient/index.js +11 -12
  383. package/dist/core/shaders/Nebula/index.js +13 -12
  384. package/dist/core/shaders/Neon/index.js +9 -10
  385. package/dist/core/shaders/NoiseDissolve/index.js +7 -8
  386. package/dist/core/shaders/ObjectTracker/index.js +10 -11
  387. package/dist/core/shaders/Obsidian/index.d.ts +142 -0
  388. package/dist/core/shaders/Obsidian/index.d.ts.map +1 -0
  389. package/dist/core/shaders/Obsidian/index.js +16 -0
  390. package/dist/core/shaders/PagePeel/index.js +10 -11
  391. package/dist/core/shaders/Paper/index.js +8 -9
  392. package/dist/core/shaders/Parallelogram/index.js +5 -5
  393. package/dist/core/shaders/ParticleField/index.js +9 -10
  394. package/dist/core/shaders/ParticleFlow/index.js +10 -11
  395. package/dist/core/shaders/Particles/index.js +9 -10
  396. package/dist/core/shaders/PerlinNoise/index.js +14 -16
  397. package/dist/core/shaders/Perspective/index.js +8 -9
  398. package/dist/core/shaders/PixelSort/index.js +8 -9
  399. package/dist/core/shaders/PixelThrow/index.js +8 -9
  400. package/dist/core/shaders/Pixelate/index.js +10 -11
  401. package/dist/core/shaders/Plasma/index.js +11 -12
  402. package/dist/core/shaders/Plastic/index.js +11 -12
  403. package/dist/core/shaders/PolarCoordinates/index.js +8 -9
  404. package/dist/core/shaders/Polygon/index.js +6 -6
  405. package/dist/core/shaders/Posterize/index.js +6 -7
  406. package/dist/core/shaders/Prism/index.js +12 -13
  407. package/dist/core/shaders/ProgressiveBlur/index.js +10 -11
  408. package/dist/core/shaders/RadialGradient/index.js +11 -12
  409. package/dist/core/shaders/RadialWipe/index.js +7 -8
  410. package/dist/core/shaders/RandomBars/index.js +7 -8
  411. package/dist/core/shaders/ReactionDiffusion/index.js +8 -9
  412. package/dist/core/shaders/RectangularCoordinates/index.js +8 -9
  413. package/dist/core/shaders/ReflectivePlane/index.js +10 -11
  414. package/dist/core/shaders/Repeater/index.js +5 -5
  415. package/dist/core/shaders/Ring/index.js +5 -5
  416. package/dist/core/shaders/RippleWipe/index.js +7 -8
  417. package/dist/core/shaders/Ripples/index.js +13 -15
  418. package/dist/core/shaders/RoundedRect/index.js +5 -5
  419. package/dist/core/shaders/Saturation/index.js +7 -8
  420. package/dist/core/shaders/Scratches/index.js +14 -16
  421. package/dist/core/shaders/Sharpness/index.js +11 -12
  422. package/dist/core/shaders/Shatter/index.js +6 -7
  423. package/dist/core/shaders/SimplexNoise/index.js +14 -16
  424. package/dist/core/shaders/SineWave/index.js +10 -12
  425. package/dist/core/shaders/SliceWipe/index.js +8 -9
  426. package/dist/core/shaders/Smoke/index.js +7 -8
  427. package/dist/core/shaders/SmokeFill/index.js +10 -11
  428. package/dist/core/shaders/SmokeFlow/index.js +7 -8
  429. package/dist/core/shaders/Solarize/index.js +7 -8
  430. package/dist/core/shaders/SolidColor/index.js +11 -12
  431. package/dist/core/shaders/Spherize/index.js +10 -11
  432. package/dist/core/shaders/Spiral/index.js +11 -12
  433. package/dist/core/shaders/Star/index.js +5 -5
  434. package/dist/core/shaders/Stone/index.js +13 -15
  435. package/dist/core/shaders/Strands/index.js +13 -15
  436. package/dist/core/shaders/Stretch/index.js +8 -9
  437. package/dist/core/shaders/Stripes/index.js +13 -15
  438. package/dist/core/shaders/StudioBackground/index.d.ts.map +1 -1
  439. package/dist/core/shaders/StudioBackground/index.js +14 -15
  440. package/dist/core/shaders/SunBurst/index.js +12 -12
  441. package/dist/core/shaders/Surface3D/index.js +8 -9
  442. package/dist/core/shaders/Swirl/index.js +11 -12
  443. package/dist/core/shaders/Teardrop/index.js +5 -5
  444. package/dist/core/shaders/Text/index.js +12 -13
  445. package/dist/core/shaders/ThinFilm/index.js +9 -10
  446. package/dist/core/shaders/TiltShift/index.js +10 -11
  447. package/dist/core/shaders/TimeTrail/index.js +8 -9
  448. package/dist/core/shaders/Tint/index.js +6 -7
  449. package/dist/core/shaders/Trapezoid/index.js +5 -5
  450. package/dist/core/shaders/TriangularGrid/index.js +13 -15
  451. package/dist/core/shaders/Tritone/index.js +6 -7
  452. package/dist/core/shaders/Truchet/index.js +13 -15
  453. package/dist/core/shaders/Twirl/index.js +8 -9
  454. package/dist/core/shaders/VHS/index.js +10 -11
  455. package/dist/core/shaders/VenetianBlinds/index.js +7 -8
  456. package/dist/core/shaders/Vesica/index.js +5 -5
  457. package/dist/core/shaders/Vibrance/index.js +7 -8
  458. package/dist/core/shaders/VideoTexture/index.js +6 -6
  459. package/dist/core/shaders/Vignette/index.js +8 -7
  460. package/dist/core/shaders/Voronoi/index.js +13 -15
  461. package/dist/core/shaders/Water/index.js +11 -12
  462. package/dist/core/shaders/Watercolor/index.js +10 -11
  463. package/dist/core/shaders/WaveDistortion/index.js +8 -9
  464. package/dist/core/shaders/Waveform/index.d.ts +131 -0
  465. package/dist/core/shaders/Waveform/index.d.ts.map +1 -0
  466. package/dist/core/shaders/Waveform/index.js +17 -0
  467. package/dist/core/shaders/WaveletNoise/index.js +14 -16
  468. package/dist/core/shaders/Weave/index.js +13 -15
  469. package/dist/core/shaders/WebcamTexture/index.js +6 -6
  470. package/dist/core/shaders/Wool/index.js +13 -15
  471. package/dist/core/shaders/WorleyNoise/index.js +13 -15
  472. package/dist/core/shaders/ZoomBlur/index.js +10 -11
  473. package/dist/core/{shape-BMO1cLTt.js → shape-Dfa7_eQh.js} +1 -1
  474. package/dist/core/{shapePaints-G_Ap8xID.js → shapePaints-CRpPT5Z5.js} +792 -2038
  475. package/dist/core/signal-DuaxoxK4.js +34 -0
  476. package/dist/core/std/frames.d.ts +27 -0
  477. package/dist/core/std/frames.d.ts.map +1 -1
  478. package/dist/core/std/invoke.d.ts +9 -1
  479. package/dist/core/std/invoke.d.ts.map +1 -1
  480. package/dist/core/std/lists.d.ts +32 -0
  481. package/dist/core/std/lists.d.ts.map +1 -0
  482. package/dist/core/std/mask.d.ts +52 -0
  483. package/dist/core/std/mask.d.ts.map +1 -1
  484. package/dist/core/std/math.d.ts +14 -0
  485. package/dist/core/std/math.d.ts.map +1 -1
  486. package/dist/core/std/paint/compose.d.ts +29 -1
  487. package/dist/core/std/paint/compose.d.ts.map +1 -1
  488. package/dist/core/std/paint/fields.d.ts +91 -0
  489. package/dist/core/std/paint/fields.d.ts.map +1 -1
  490. package/dist/core/std/paint/figures.d.ts +0 -36
  491. package/dist/core/std/paint/figures.d.ts.map +1 -1
  492. package/dist/core/std/paint/light.d.ts +61 -0
  493. package/dist/core/std/paint/light.d.ts.map +1 -1
  494. package/dist/core/std/paint/materials.d.ts +84 -6
  495. package/dist/core/std/paint/materials.d.ts.map +1 -1
  496. package/dist/core/std/paint/noise.d.ts +72 -34
  497. package/dist/core/std/paint/noise.d.ts.map +1 -1
  498. package/dist/core/std/paint/patterns.d.ts +4 -3
  499. package/dist/core/std/paint/patterns.d.ts.map +1 -1
  500. package/dist/core/std/paint/radiance.d.ts +94 -0
  501. package/dist/core/std/paint/radiance.d.ts.map +1 -0
  502. package/dist/core/std/signal.d.ts +25 -0
  503. package/dist/core/std/signal.d.ts.map +1 -1
  504. package/dist/core/{stylize-DuY5wWZo.js → stylize-AZmEMszr.js} +2 -3
  505. package/dist/core/telemetry/index.js +1 -1
  506. package/dist/core/{tone-BA0D_veZ.js → tone-Ax72n2WU.js} +130 -2
  507. package/dist/core/types.d.ts +26 -1
  508. package/dist/core/types.d.ts.map +1 -1
  509. package/dist/core/utilities/listProps.d.ts +68 -0
  510. package/dist/core/utilities/listProps.d.ts.map +1 -0
  511. package/dist/core/utilities/transformations/index.js +1 -1
  512. package/dist/core/{warpMaps-CPjWFW4W.js → warpMaps-051QhmeG.js} +2 -3
  513. package/dist/core/{warps-B_sbWWsN.js → warps-B5j8H1vX.js} +3 -3
  514. package/dist/js/bundle.js +182 -180
  515. package/dist/js/createShader.js +1 -1
  516. package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
  517. package/dist/js/utils/generatePresetCode.js +119 -0
  518. package/dist/react/Irradiance.js +226 -0
  519. package/dist/react/Obsidian.js +226 -0
  520. package/dist/react/Preview.js +3 -0
  521. package/dist/react/Shader.js +1 -1
  522. package/dist/react/Waveform.js +226 -0
  523. package/dist/react/bundle.js +167 -165
  524. package/dist/react/components/Irradiance.d.ts +45 -0
  525. package/dist/react/components/Irradiance.d.ts.map +1 -0
  526. package/dist/react/components/Obsidian.d.ts +44 -0
  527. package/dist/react/components/Obsidian.d.ts.map +1 -0
  528. package/dist/react/components/Waveform.d.ts +46 -0
  529. package/dist/react/components/Waveform.d.ts.map +1 -0
  530. package/dist/react/engine/Preview.d.ts.map +1 -1
  531. package/dist/react/index.d.ts +3 -0
  532. package/dist/react/index.d.ts.map +1 -1
  533. package/dist/react/index.js +4 -1
  534. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  535. package/dist/react/utils/generatePresetCode.js +119 -0
  536. package/dist/registry.js +2549 -554
  537. package/dist/solid/components/Irradiance.d.ts +42 -0
  538. package/dist/solid/components/Irradiance.d.ts.map +1 -0
  539. package/dist/solid/components/Irradiance.js +232 -0
  540. package/dist/solid/components/Obsidian.d.ts +41 -0
  541. package/dist/solid/components/Obsidian.d.ts.map +1 -0
  542. package/dist/solid/components/Obsidian.js +232 -0
  543. package/dist/solid/components/Waveform.d.ts +43 -0
  544. package/dist/solid/components/Waveform.d.ts.map +1 -0
  545. package/dist/solid/components/Waveform.js +232 -0
  546. package/dist/solid/engine/Preview.d.ts.map +1 -1
  547. package/dist/solid/engine/Preview.js +383 -377
  548. package/dist/solid/engine/Shader.js +1 -1
  549. package/dist/solid/index.d.ts +3 -0
  550. package/dist/solid/index.d.ts.map +1 -1
  551. package/dist/solid/index.js +212 -206
  552. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  553. package/dist/solid/utils/generatePresetCode.js +122 -0
  554. package/dist/svelte/components/Irradiance.svelte.d.ts +32 -0
  555. package/dist/svelte/components/Obsidian.svelte.d.ts +31 -0
  556. package/dist/svelte/components/Waveform.svelte.d.ts +33 -0
  557. package/dist/svelte/index.d.ts +3 -0
  558. package/dist/svelte/index.js +1698 -1077
  559. package/dist/svelte/source/components/Irradiance.svelte +356 -0
  560. package/dist/svelte/source/components/Obsidian.svelte +355 -0
  561. package/dist/svelte/source/components/Waveform.svelte +357 -0
  562. package/dist/svelte/source/engine/Preview.svelte +6 -0
  563. package/dist/svelte/source/index.js +3 -0
  564. package/dist/svelte/utils/generatePresetCode.js +119 -0
  565. package/dist/vue/Irradiance.js +3 -0
  566. package/dist/vue/Irradiance.vue_vue_type_script_setup_true_lang.js +244 -0
  567. package/dist/vue/Obsidian.js +3 -0
  568. package/dist/vue/Obsidian.vue_vue_type_script_setup_true_lang.js +248 -0
  569. package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +6 -0
  570. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  571. package/dist/vue/Waveform.js +3 -0
  572. package/dist/vue/Waveform.vue_vue_type_script_setup_true_lang.js +244 -0
  573. package/dist/vue/components/Irradiance.vue.d.ts +67 -0
  574. package/dist/vue/components/Irradiance.vue.d.ts.map +1 -0
  575. package/dist/vue/components/Obsidian.vue.d.ts +66 -0
  576. package/dist/vue/components/Obsidian.vue.d.ts.map +1 -0
  577. package/dist/vue/components/Waveform.vue.d.ts +68 -0
  578. package/dist/vue/components/Waveform.vue.d.ts.map +1 -0
  579. package/dist/vue/index.d.ts +3 -0
  580. package/dist/vue/index.d.ts.map +1 -1
  581. package/dist/vue/index.js +4 -1
  582. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  583. package/dist/vue/utils/generatePresetCode.js +119 -0
  584. package/package.json +25 -1
  585. package/dist/core/Aurora-aZQ7Sgpi.js +0 -189
  586. package/dist/core/FlowingGradient-DExZwWd-.js +0 -154
  587. package/dist/core/StudioBackground-CyNdOTtR.js +0 -294
  588. package/dist/core/aa-BfXCHL6-.js +0 -915
  589. package/dist/core/figures-Ca2qPDh7.js +0 -116
  590. package/dist/core/gpu/kit/scenicPaints.d.ts +0 -18
  591. package/dist/core/gpu/kit/scenicPaints.d.ts.map +0 -1
  592. package/dist/core/noise-B3Oq1k3_.js +0 -10320
  593. package/dist/core/noiseColor-CMKVWP1J.js +0 -20
  594. package/dist/core/scenic-CJSExiX2.js +0 -5738
  595. package/dist/core/shaderRegistry-Ch1r8XbD.js +0 -435
  596. package/dist/core/std/paint/scenic.d.ts +0 -111
  597. package/dist/core/std/paint/scenic.d.ts.map +0 -1
  598. /package/dist/core/{canvasRaster-Clio8jcl.js → canvasRaster-DDBkrdY8.js} +0 -0
  599. /package/dist/core/{device-DLKcFOd2.js → device-m0ud8-Fn.js} +0 -0
  600. /package/dist/core/{filter-Bw8Ogi4T.js → filter-VJlLs3Zs.js} +0 -0
  601. /package/dist/core/{fonts-Dyp7nl7T.js → fonts-BUXTd9qb.js} +0 -0
  602. /package/dist/core/{grids-BqY3o2yc.js → grids-C6sTUox5.js} +0 -0
  603. /package/dist/core/{slots-BqeQDVxy.js → slots-BuIG6s6W.js} +0 -0
  604. /package/dist/core/{support-ULZQgbko.js → support-GJphyuEe.js} +0 -0
  605. /package/dist/core/{transformations-CoIwF5JU.js → transformations-COlfAEsk.js} +0 -0
@@ -0,0 +1,4191 @@
1
+ import { $n as clamp, Ar as texture2d, Br as f32, Cr as vec2u, G as createGuardedCompute, Hn as textureSampleLevel, Hr as u32, Jn as select, Mr as arrayOf, Nr as struct, P as sdf_exports, Pn as TAU, Tr as vec4f, Un as textureStore, Vn as textureLoad, Vr as i32, _r as smoothstep$1, cr as max$1, d as glassShellProps, dr as normalize$1, er as cos, gr as sin, jr as textureStorage2d, lr as min, mt as formatFloat, nr as dot$1, or as fract, pt as Expr, sr as length, t as defineStd, v as buildAnalyticSdfFn, wr as vec3f, xr as vec2f, zn as typegpu_default } from "./lower-DSk_KxOY.js";
2
+ import { ct as listCountName, ft as listPropConfig, ut as listFieldName } from "./porters-j4QbEOqj.js";
3
+ import { y as createGaussianBlurCompute } from "./blur-BwjlF0Uk.js";
4
+ import { A as placementPoint, F as shapedSurface, R as silhouette, S as lambert, T as nearestEdge, V as surfaceField, f as geometricNormal, g as guarded, i as continuedField, j as pointLightFrom, l as fieldSlope, s as exposureTone, v as insideShape, y as inverseSquare } from "./materials-Dhq8lDKb.js";
5
+ import { t as isMobileGpuViewport } from "./device-m0ud8-Fn.js";
6
+ import { m as sdf3d_exports, n as buildFieldSampleGraphArgs, v as resolveShapeType, y as shapeEffectBoundingBoxDeclaration } from "./sdf3d-DQ55w9nI.js";
7
+ import { n as glass_exports } from "./glass-CtWl8jzT.js";
8
+ import { a as transformColor, c as transformPosition, i as transformBoolean } from "./transformations-COlfAEsk.js";
9
+ import { B as vec4, C as mul, E as pow, L as sub, M as smoothstep, P as splat3, R as vec2, S as mix, T as normalize, b as max, h as gt, n as add, o as div, s as dot, u as float, y as local, z as vec3 } from "./math-DCQU6EQz.js";
10
+ import { n as emissiveAlpha } from "./compose-prsdG9f_.js";
11
+ var { sdfSpaceUV } = glass_exports;
12
+ const IRRADIANCE_FORMAT = "rgba16float";
13
+ const IrradianceParams = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(struct({
14
+ center: vec2f,
15
+ lightPos: arrayOf(vec4f, 8),
16
+ lightColor: arrayOf(vec4f, 8),
17
+ lightCount: f32,
18
+ scale: f32,
19
+ rotation: f32,
20
+ aspect: f32,
21
+ reach: f32,
22
+ wrap: f32,
23
+ lightRange: f32,
24
+ shadowSoftness: f32,
25
+ eps: f32,
26
+ res: f32,
27
+ frame: f32,
28
+ rays: f32,
29
+ saRadius: f32,
30
+ saSides: f32,
31
+ saRounding: f32,
32
+ saInnerRatio: f32,
33
+ saRotation: f32,
34
+ saHeight: f32,
35
+ saOffset: f32,
36
+ saAperture: f32,
37
+ vfOriginX: f32,
38
+ vfOriginY: f32,
39
+ vfSpanX: f32,
40
+ vfSpanY: f32,
41
+ vfActiveRes: f32,
42
+ vfRBound: f32
43
+ }), "IrradianceParams");
44
+ var outEntry = { storageTexture: textureStorage2d(IRRADIANCE_FORMAT, "write-only") };
45
+ const irradianceAnalyticLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
46
+ params: { uniform: IrradianceParams },
47
+ outTex: outEntry
48
+ }), "irradianceAnalyticLayout");
49
+ const irradianceSvgLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
50
+ params: { uniform: IrradianceParams },
51
+ outTex: outEntry,
52
+ sdfSource: { texture: texture2d(f32) },
53
+ samp: { sampler: "filtering" }
54
+ }), "irradianceSvgLayout");
55
+ const irradianceFieldLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
56
+ params: { uniform: IrradianceParams },
57
+ outTex: outEntry,
58
+ silhouetteTex: { texture: texture2d(f32) },
59
+ samp: { sampler: "filtering" }
60
+ }), "irradianceFieldLayout");
61
+ var FAR = 1e3;
62
+ var sane = typegpu_default.fn([f32], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((v) => {
63
+ "use gpu";
64
+ return max$1(min(v, FAR), __tsover_mul(FAR, -1));
65
+ }), {
66
+ v: 2,
67
+ name: void 0,
68
+ ast: {
69
+ "params": [{
70
+ "type": "i",
71
+ "name": "v"
72
+ }],
73
+ "body": [0, [[10, [
74
+ 6,
75
+ "std.max",
76
+ [[
77
+ 6,
78
+ "std.min",
79
+ ["v", "FAR"]
80
+ ], [
81
+ 1,
82
+ "FAR",
83
+ "*",
84
+ [
85
+ 4,
86
+ "-",
87
+ [5, "1"]
88
+ ]
89
+ ]]
90
+ ]]]]
91
+ },
92
+ externals: {
93
+ "std.max": () => max$1,
94
+ "std.min": () => min,
95
+ "FAR": () => FAR
96
+ }
97
+ }) && $.f)({})).$name("irradianceSane");
98
+ var beyondSquare = typegpu_default.fn([vec2f], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((uv) => {
99
+ "use gpu";
100
+ const c = clamp(uv, vec2f(0, 0), vec2f(1, 1));
101
+ return length(uv.sub(c));
102
+ }), {
103
+ v: 2,
104
+ name: void 0,
105
+ ast: {
106
+ "params": [{
107
+ "type": "i",
108
+ "name": "uv"
109
+ }],
110
+ "body": [0, [[
111
+ 13,
112
+ "c",
113
+ [
114
+ 6,
115
+ "std.clamp",
116
+ [
117
+ "uv",
118
+ [
119
+ 6,
120
+ "d.vec2f",
121
+ [[5, "0"], [5, "0"]]
122
+ ],
123
+ [
124
+ 6,
125
+ "d.vec2f",
126
+ [[5, "1"], [5, "1"]]
127
+ ]
128
+ ]
129
+ ]
130
+ ], [10, [
131
+ 6,
132
+ "std.length",
133
+ [[
134
+ 6,
135
+ [
136
+ 7,
137
+ "uv",
138
+ "sub"
139
+ ],
140
+ ["c"]
141
+ ]]
142
+ ]]]]
143
+ },
144
+ externals: {
145
+ "std.clamp": () => clamp,
146
+ "d.vec2f": () => vec2f,
147
+ "std.length": () => length
148
+ }
149
+ }) && $.f)({})).$name("irradianceBeyondSquare");
150
+ function analyticField(shapeType) {
151
+ const sdfFn = buildAnalyticSdfFn(shapeType);
152
+ return typegpu_default.fn([vec2f], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((uv) => {
153
+ "use gpu";
154
+ const p = irradianceAnalyticLayout.$.params;
155
+ return sdfFn(uv, p.saRadius, p.saSides, p.saRounding, p.saInnerRatio, p.saRotation, p.saHeight, p.saOffset, p.saAperture).x;
156
+ }), {
157
+ v: 2,
158
+ name: void 0,
159
+ ast: {
160
+ "params": [{
161
+ "type": "i",
162
+ "name": "uv"
163
+ }],
164
+ "body": [0, [[
165
+ 13,
166
+ "p",
167
+ [
168
+ 7,
169
+ [
170
+ 7,
171
+ "irradianceAnalyticLayout",
172
+ "$"
173
+ ],
174
+ "params"
175
+ ]
176
+ ], [10, [
177
+ 7,
178
+ [
179
+ 6,
180
+ "sdfFn",
181
+ [
182
+ "uv",
183
+ [
184
+ 7,
185
+ "p",
186
+ "saRadius"
187
+ ],
188
+ [
189
+ 7,
190
+ "p",
191
+ "saSides"
192
+ ],
193
+ [
194
+ 7,
195
+ "p",
196
+ "saRounding"
197
+ ],
198
+ [
199
+ 7,
200
+ "p",
201
+ "saInnerRatio"
202
+ ],
203
+ [
204
+ 7,
205
+ "p",
206
+ "saRotation"
207
+ ],
208
+ [
209
+ 7,
210
+ "p",
211
+ "saHeight"
212
+ ],
213
+ [
214
+ 7,
215
+ "p",
216
+ "saOffset"
217
+ ],
218
+ [
219
+ 7,
220
+ "p",
221
+ "saAperture"
222
+ ]
223
+ ]
224
+ ],
225
+ "x"
226
+ ]]]]
227
+ },
228
+ externals: {
229
+ "irradianceAnalyticLayout": () => irradianceAnalyticLayout,
230
+ "sdfFn": () => sdfFn
231
+ }
232
+ }) && $.f)({})).$name("irradianceAnalyticField");
233
+ }
234
+ const svgField = typegpu_default.fn([vec2f], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((uv) => {
235
+ "use gpu";
236
+ const border = textureSampleLevel(irradianceSvgLayout.$.sdfSource, irradianceSvgLayout.$.samp, uv, f32(0)).x;
237
+ const beyond = beyondSquare(uv);
238
+ return sane(select(border, max$1(beyond, __tsover_sub(border, beyond)), beyond > 0));
239
+ }), {
240
+ v: 2,
241
+ name: void 0,
242
+ ast: {
243
+ "params": [{
244
+ "type": "i",
245
+ "name": "uv"
246
+ }],
247
+ "body": [0, [
248
+ [
249
+ 13,
250
+ "border",
251
+ [
252
+ 7,
253
+ [
254
+ 6,
255
+ "std.textureSampleLevel",
256
+ [
257
+ [
258
+ 7,
259
+ [
260
+ 7,
261
+ "irradianceSvgLayout",
262
+ "$"
263
+ ],
264
+ "sdfSource"
265
+ ],
266
+ [
267
+ 7,
268
+ [
269
+ 7,
270
+ "irradianceSvgLayout",
271
+ "$"
272
+ ],
273
+ "samp"
274
+ ],
275
+ "uv",
276
+ [
277
+ 6,
278
+ "d.f32",
279
+ [[5, "0"]]
280
+ ]
281
+ ]
282
+ ],
283
+ "x"
284
+ ]
285
+ ],
286
+ [
287
+ 13,
288
+ "beyond",
289
+ [
290
+ 6,
291
+ "beyondSquare",
292
+ ["uv"]
293
+ ]
294
+ ],
295
+ [10, [
296
+ 6,
297
+ "sane",
298
+ [[
299
+ 6,
300
+ "std.select",
301
+ [
302
+ "border",
303
+ [
304
+ 6,
305
+ "std.max",
306
+ ["beyond", [
307
+ 1,
308
+ "border",
309
+ "-",
310
+ "beyond"
311
+ ]]
312
+ ],
313
+ [
314
+ 1,
315
+ "beyond",
316
+ ">",
317
+ [5, "0"]
318
+ ]
319
+ ]
320
+ ]]
321
+ ]]
322
+ ]]
323
+ },
324
+ externals: {
325
+ "std.textureSampleLevel": () => textureSampleLevel,
326
+ "irradianceSvgLayout": () => irradianceSvgLayout,
327
+ "d.f32": () => f32,
328
+ "beyondSquare": () => beyondSquare,
329
+ "sane": () => sane,
330
+ "std.select": () => select,
331
+ "std.max": () => max$1
332
+ }
333
+ }) && $.f)({})).$name("irradianceSvgField");
334
+ const volumetricField = typegpu_default.fn([vec2f], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((uv) => {
335
+ "use gpu";
336
+ const p = irradianceFieldLayout.$.params;
337
+ const cx = clamp(uv.x, p.vfOriginX, __tsover_add(p.vfOriginX, p.vfSpanX));
338
+ const cy = clamp(uv.y, p.vfOriginY, __tsover_add(p.vfOriginY, p.vfSpanY));
339
+ const outside = length(vec2f(__tsover_sub(uv.x, cx), __tsover_sub(uv.y, cy)));
340
+ const circle = __tsover_sub(length(vec2f(__tsover_sub(uv.x, .5), __tsover_sub(uv.y, .5))), p.vfRBound);
341
+ const tuv = vec2f(__tsover_div(__tsover_sub(cx, p.vfOriginX), p.vfSpanX), __tsover_div(__tsover_sub(cy, p.vfOriginY), p.vfSpanY));
342
+ const sil = textureSampleLevel(irradianceFieldLayout.$.silhouetteTex, irradianceFieldLayout.$.samp, tuv, f32(0));
343
+ const inDomain = __tsover_mul(sil.z, sil.w);
344
+ return sane(select(inDomain, max$1(max$1(outside, circle), __tsover_sub(inDomain, outside)), outside > 0));
345
+ }), {
346
+ v: 2,
347
+ name: void 0,
348
+ ast: {
349
+ "params": [{
350
+ "type": "i",
351
+ "name": "uv"
352
+ }],
353
+ "body": [0, [
354
+ [
355
+ 13,
356
+ "p",
357
+ [
358
+ 7,
359
+ [
360
+ 7,
361
+ "irradianceFieldLayout",
362
+ "$"
363
+ ],
364
+ "params"
365
+ ]
366
+ ],
367
+ [
368
+ 13,
369
+ "cx",
370
+ [
371
+ 6,
372
+ "std.clamp",
373
+ [
374
+ [
375
+ 7,
376
+ "uv",
377
+ "x"
378
+ ],
379
+ [
380
+ 7,
381
+ "p",
382
+ "vfOriginX"
383
+ ],
384
+ [
385
+ 1,
386
+ [
387
+ 7,
388
+ "p",
389
+ "vfOriginX"
390
+ ],
391
+ "+",
392
+ [
393
+ 7,
394
+ "p",
395
+ "vfSpanX"
396
+ ]
397
+ ]
398
+ ]
399
+ ]
400
+ ],
401
+ [
402
+ 13,
403
+ "cy",
404
+ [
405
+ 6,
406
+ "std.clamp",
407
+ [
408
+ [
409
+ 7,
410
+ "uv",
411
+ "y"
412
+ ],
413
+ [
414
+ 7,
415
+ "p",
416
+ "vfOriginY"
417
+ ],
418
+ [
419
+ 1,
420
+ [
421
+ 7,
422
+ "p",
423
+ "vfOriginY"
424
+ ],
425
+ "+",
426
+ [
427
+ 7,
428
+ "p",
429
+ "vfSpanY"
430
+ ]
431
+ ]
432
+ ]
433
+ ]
434
+ ],
435
+ [
436
+ 13,
437
+ "outside",
438
+ [
439
+ 6,
440
+ "std.length",
441
+ [[
442
+ 6,
443
+ "d.vec2f",
444
+ [[
445
+ 1,
446
+ [
447
+ 7,
448
+ "uv",
449
+ "x"
450
+ ],
451
+ "-",
452
+ "cx"
453
+ ], [
454
+ 1,
455
+ [
456
+ 7,
457
+ "uv",
458
+ "y"
459
+ ],
460
+ "-",
461
+ "cy"
462
+ ]]
463
+ ]]
464
+ ]
465
+ ],
466
+ [
467
+ 13,
468
+ "circle",
469
+ [
470
+ 1,
471
+ [
472
+ 6,
473
+ "std.length",
474
+ [[
475
+ 6,
476
+ "d.vec2f",
477
+ [[
478
+ 1,
479
+ [
480
+ 7,
481
+ "uv",
482
+ "x"
483
+ ],
484
+ "-",
485
+ [5, "0.5"]
486
+ ], [
487
+ 1,
488
+ [
489
+ 7,
490
+ "uv",
491
+ "y"
492
+ ],
493
+ "-",
494
+ [5, "0.5"]
495
+ ]]
496
+ ]]
497
+ ],
498
+ "-",
499
+ [
500
+ 7,
501
+ "p",
502
+ "vfRBound"
503
+ ]
504
+ ]
505
+ ],
506
+ [
507
+ 13,
508
+ "tuv",
509
+ [
510
+ 6,
511
+ "d.vec2f",
512
+ [[
513
+ 1,
514
+ [
515
+ 1,
516
+ "cx",
517
+ "-",
518
+ [
519
+ 7,
520
+ "p",
521
+ "vfOriginX"
522
+ ]
523
+ ],
524
+ "/",
525
+ [
526
+ 7,
527
+ "p",
528
+ "vfSpanX"
529
+ ]
530
+ ], [
531
+ 1,
532
+ [
533
+ 1,
534
+ "cy",
535
+ "-",
536
+ [
537
+ 7,
538
+ "p",
539
+ "vfOriginY"
540
+ ]
541
+ ],
542
+ "/",
543
+ [
544
+ 7,
545
+ "p",
546
+ "vfSpanY"
547
+ ]
548
+ ]]
549
+ ]
550
+ ],
551
+ [
552
+ 13,
553
+ "sil",
554
+ [
555
+ 6,
556
+ "std.textureSampleLevel",
557
+ [
558
+ [
559
+ 7,
560
+ [
561
+ 7,
562
+ "irradianceFieldLayout",
563
+ "$"
564
+ ],
565
+ "silhouetteTex"
566
+ ],
567
+ [
568
+ 7,
569
+ [
570
+ 7,
571
+ "irradianceFieldLayout",
572
+ "$"
573
+ ],
574
+ "samp"
575
+ ],
576
+ "tuv",
577
+ [
578
+ 6,
579
+ "d.f32",
580
+ [[5, "0"]]
581
+ ]
582
+ ]
583
+ ]
584
+ ],
585
+ [
586
+ 13,
587
+ "inDomain",
588
+ [
589
+ 1,
590
+ [
591
+ 7,
592
+ "sil",
593
+ "z"
594
+ ],
595
+ "*",
596
+ [
597
+ 7,
598
+ "sil",
599
+ "w"
600
+ ]
601
+ ]
602
+ ],
603
+ [
604
+ 13,
605
+ "beyond",
606
+ [
607
+ 6,
608
+ "std.max",
609
+ [[
610
+ 6,
611
+ "std.max",
612
+ ["outside", "circle"]
613
+ ], [
614
+ 1,
615
+ "inDomain",
616
+ "-",
617
+ "outside"
618
+ ]]
619
+ ]
620
+ ],
621
+ [10, [
622
+ 6,
623
+ "sane",
624
+ [[
625
+ 6,
626
+ "std.select",
627
+ [
628
+ "inDomain",
629
+ "beyond",
630
+ [
631
+ 1,
632
+ "outside",
633
+ ">",
634
+ [5, "0"]
635
+ ]
636
+ ]
637
+ ]]
638
+ ]]
639
+ ]]
640
+ },
641
+ externals: {
642
+ "irradianceFieldLayout": () => irradianceFieldLayout,
643
+ "std.clamp": () => clamp,
644
+ "std.length": () => length,
645
+ "d.vec2f": () => vec2f,
646
+ "std.textureSampleLevel": () => textureSampleLevel,
647
+ "d.f32": () => f32,
648
+ "std.max": () => max$1,
649
+ "sane": () => sane,
650
+ "std.select": () => select
651
+ }
652
+ }) && $.f)({})).$name("irradianceVolumetricField");
653
+ const SilhouetteParams = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(struct({
654
+ vfOriginX: f32,
655
+ vfOriginY: f32,
656
+ vfSpanX: f32,
657
+ vfSpanY: f32,
658
+ vfActiveRes: f32,
659
+ vfRBound: f32,
660
+ res: f32,
661
+ step: f32
662
+ }), "SilhouetteParams");
663
+ const silhouetteSeedLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
664
+ params: { uniform: SilhouetteParams },
665
+ fieldTex: {
666
+ texture: texture2d(f32),
667
+ sampleType: "unfilterable-float"
668
+ },
669
+ out: outEntry
670
+ }), "silhouetteSeedLayout");
671
+ const silhouetteStepLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
672
+ params: { uniform: SilhouetteParams },
673
+ src: { texture: texture2d(f32) },
674
+ out: outEntry
675
+ }), "silhouetteStepLayout");
676
+ var { fieldSampleFastArg } = buildFieldSampleGraphArgs();
677
+ var silhouetteInside = typegpu_default.fn([f32, f32], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((tx, ty) => {
678
+ "use gpu";
679
+ const p = silhouetteSeedLayout.$.params;
680
+ const v = fieldSampleFastArg(vec2f(__tsover_add(p.vfOriginX, __tsover_mul(__tsover_div(__tsover_add(tx, .5), p.res), p.vfSpanX)), __tsover_add(p.vfOriginY, __tsover_mul(__tsover_div(__tsover_add(ty, .5), p.res), p.vfSpanY))), silhouetteSeedLayout.$.fieldTex, p.vfOriginX, p.vfOriginY, p.vfSpanX, p.vfSpanY, p.vfActiveRes, p.vfRBound).x;
681
+ return select(f32(1), f32(-1), v < 0);
682
+ }), {
683
+ v: 2,
684
+ name: void 0,
685
+ ast: {
686
+ "params": [{
687
+ "type": "i",
688
+ "name": "tx"
689
+ }, {
690
+ "type": "i",
691
+ "name": "ty"
692
+ }],
693
+ "body": [0, [
694
+ [
695
+ 13,
696
+ "p",
697
+ [
698
+ 7,
699
+ [
700
+ 7,
701
+ "silhouetteSeedLayout",
702
+ "$"
703
+ ],
704
+ "params"
705
+ ]
706
+ ],
707
+ [
708
+ 13,
709
+ "uv",
710
+ [
711
+ 6,
712
+ "d.vec2f",
713
+ [[
714
+ 1,
715
+ [
716
+ 7,
717
+ "p",
718
+ "vfOriginX"
719
+ ],
720
+ "+",
721
+ [
722
+ 1,
723
+ [
724
+ 1,
725
+ [
726
+ 1,
727
+ "tx",
728
+ "+",
729
+ [5, "0.5"]
730
+ ],
731
+ "/",
732
+ [
733
+ 7,
734
+ "p",
735
+ "res"
736
+ ]
737
+ ],
738
+ "*",
739
+ [
740
+ 7,
741
+ "p",
742
+ "vfSpanX"
743
+ ]
744
+ ]
745
+ ], [
746
+ 1,
747
+ [
748
+ 7,
749
+ "p",
750
+ "vfOriginY"
751
+ ],
752
+ "+",
753
+ [
754
+ 1,
755
+ [
756
+ 1,
757
+ [
758
+ 1,
759
+ "ty",
760
+ "+",
761
+ [5, "0.5"]
762
+ ],
763
+ "/",
764
+ [
765
+ 7,
766
+ "p",
767
+ "res"
768
+ ]
769
+ ],
770
+ "*",
771
+ [
772
+ 7,
773
+ "p",
774
+ "vfSpanY"
775
+ ]
776
+ ]
777
+ ]]
778
+ ]
779
+ ],
780
+ [
781
+ 13,
782
+ "v",
783
+ [
784
+ 7,
785
+ [
786
+ 6,
787
+ "fieldSampleFastArg",
788
+ [
789
+ "uv",
790
+ [
791
+ 7,
792
+ [
793
+ 7,
794
+ "silhouetteSeedLayout",
795
+ "$"
796
+ ],
797
+ "fieldTex"
798
+ ],
799
+ [
800
+ 7,
801
+ "p",
802
+ "vfOriginX"
803
+ ],
804
+ [
805
+ 7,
806
+ "p",
807
+ "vfOriginY"
808
+ ],
809
+ [
810
+ 7,
811
+ "p",
812
+ "vfSpanX"
813
+ ],
814
+ [
815
+ 7,
816
+ "p",
817
+ "vfSpanY"
818
+ ],
819
+ [
820
+ 7,
821
+ "p",
822
+ "vfActiveRes"
823
+ ],
824
+ [
825
+ 7,
826
+ "p",
827
+ "vfRBound"
828
+ ]
829
+ ]
830
+ ],
831
+ "x"
832
+ ]
833
+ ],
834
+ [10, [
835
+ 6,
836
+ "std.select",
837
+ [
838
+ [
839
+ 6,
840
+ "d.f32",
841
+ [[5, "1"]]
842
+ ],
843
+ [
844
+ 6,
845
+ "d.f32",
846
+ [[
847
+ 4,
848
+ "-",
849
+ [5, "1"]
850
+ ]]
851
+ ],
852
+ [
853
+ 1,
854
+ "v",
855
+ "<",
856
+ [5, "0"]
857
+ ]
858
+ ]
859
+ ]]
860
+ ]]
861
+ },
862
+ externals: {
863
+ "silhouetteSeedLayout": () => silhouetteSeedLayout,
864
+ "d.vec2f": () => vec2f,
865
+ "fieldSampleFastArg": () => fieldSampleFastArg,
866
+ "std.select": () => select,
867
+ "d.f32": () => f32
868
+ }
869
+ }) && $.f)({})).$name("silhouetteInside");
870
+ const silhouetteSeedKernel = typegpu_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
871
+ "use gpu";
872
+ const p = silhouetteSeedLayout.$.params;
873
+ const fx = f32(cx);
874
+ const fy = f32(cy);
875
+ const s0 = silhouetteInside(fx, fy);
876
+ const maxT = __tsover_sub(p.res, 1);
877
+ const sL = silhouetteInside(max$1(__tsover_sub(fx, 1), 0), fy);
878
+ const sR = silhouetteInside(min(__tsover_add(fx, 1), maxT), fy);
879
+ const sD = silhouetteInside(fx, max$1(__tsover_sub(fy, 1), 0));
880
+ const sU = silhouetteInside(fx, min(__tsover_add(fy, 1), maxT));
881
+ const boundary = sL !== s0 || sR !== s0 || sD !== s0 || sU !== s0;
882
+ const sx = __tsover_add(p.vfOriginX, __tsover_mul(__tsover_div(__tsover_add(fx, .5), p.res), p.vfSpanX));
883
+ const sy = __tsover_add(p.vfOriginY, __tsover_mul(__tsover_div(__tsover_add(fy, .5), p.res), p.vfSpanY));
884
+ const seed = select(vec4f(-1, -1, 6e4, s0), vec4f(sx, sy, 0, s0), boundary);
885
+ textureStore(silhouetteSeedLayout.$.out, vec2u(cx, cy), seed);
886
+ }), {
887
+ v: 2,
888
+ name: void 0,
889
+ ast: {
890
+ "params": [{
891
+ "type": "i",
892
+ "name": "cx"
893
+ }, {
894
+ "type": "i",
895
+ "name": "cy"
896
+ }],
897
+ "body": [0, [
898
+ [
899
+ 13,
900
+ "p",
901
+ [
902
+ 7,
903
+ [
904
+ 7,
905
+ "silhouetteSeedLayout",
906
+ "$"
907
+ ],
908
+ "params"
909
+ ]
910
+ ],
911
+ [
912
+ 13,
913
+ "fx",
914
+ [
915
+ 6,
916
+ "d.f32",
917
+ ["cx"]
918
+ ]
919
+ ],
920
+ [
921
+ 13,
922
+ "fy",
923
+ [
924
+ 6,
925
+ "d.f32",
926
+ ["cy"]
927
+ ]
928
+ ],
929
+ [
930
+ 13,
931
+ "s0",
932
+ [
933
+ 6,
934
+ "silhouetteInside",
935
+ ["fx", "fy"]
936
+ ]
937
+ ],
938
+ [
939
+ 13,
940
+ "maxT",
941
+ [
942
+ 1,
943
+ [
944
+ 7,
945
+ "p",
946
+ "res"
947
+ ],
948
+ "-",
949
+ [5, "1"]
950
+ ]
951
+ ],
952
+ [
953
+ 13,
954
+ "sL",
955
+ [
956
+ 6,
957
+ "silhouetteInside",
958
+ [[
959
+ 6,
960
+ "std.max",
961
+ [[
962
+ 1,
963
+ "fx",
964
+ "-",
965
+ [5, "1"]
966
+ ], [5, "0"]]
967
+ ], "fy"]
968
+ ]
969
+ ],
970
+ [
971
+ 13,
972
+ "sR",
973
+ [
974
+ 6,
975
+ "silhouetteInside",
976
+ [[
977
+ 6,
978
+ "std.min",
979
+ [[
980
+ 1,
981
+ "fx",
982
+ "+",
983
+ [5, "1"]
984
+ ], "maxT"]
985
+ ], "fy"]
986
+ ]
987
+ ],
988
+ [
989
+ 13,
990
+ "sD",
991
+ [
992
+ 6,
993
+ "silhouetteInside",
994
+ ["fx", [
995
+ 6,
996
+ "std.max",
997
+ [[
998
+ 1,
999
+ "fy",
1000
+ "-",
1001
+ [5, "1"]
1002
+ ], [5, "0"]]
1003
+ ]]
1004
+ ]
1005
+ ],
1006
+ [
1007
+ 13,
1008
+ "sU",
1009
+ [
1010
+ 6,
1011
+ "silhouetteInside",
1012
+ ["fx", [
1013
+ 6,
1014
+ "std.min",
1015
+ [[
1016
+ 1,
1017
+ "fy",
1018
+ "+",
1019
+ [5, "1"]
1020
+ ], "maxT"]
1021
+ ]]
1022
+ ]
1023
+ ],
1024
+ [
1025
+ 13,
1026
+ "boundary",
1027
+ [
1028
+ 3,
1029
+ [
1030
+ 3,
1031
+ [
1032
+ 3,
1033
+ [
1034
+ 1,
1035
+ "sL",
1036
+ "!==",
1037
+ "s0"
1038
+ ],
1039
+ "||",
1040
+ [
1041
+ 1,
1042
+ "sR",
1043
+ "!==",
1044
+ "s0"
1045
+ ]
1046
+ ],
1047
+ "||",
1048
+ [
1049
+ 1,
1050
+ "sD",
1051
+ "!==",
1052
+ "s0"
1053
+ ]
1054
+ ],
1055
+ "||",
1056
+ [
1057
+ 1,
1058
+ "sU",
1059
+ "!==",
1060
+ "s0"
1061
+ ]
1062
+ ]
1063
+ ],
1064
+ [
1065
+ 13,
1066
+ "sx",
1067
+ [
1068
+ 1,
1069
+ [
1070
+ 7,
1071
+ "p",
1072
+ "vfOriginX"
1073
+ ],
1074
+ "+",
1075
+ [
1076
+ 1,
1077
+ [
1078
+ 1,
1079
+ [
1080
+ 1,
1081
+ "fx",
1082
+ "+",
1083
+ [5, "0.5"]
1084
+ ],
1085
+ "/",
1086
+ [
1087
+ 7,
1088
+ "p",
1089
+ "res"
1090
+ ]
1091
+ ],
1092
+ "*",
1093
+ [
1094
+ 7,
1095
+ "p",
1096
+ "vfSpanX"
1097
+ ]
1098
+ ]
1099
+ ]
1100
+ ],
1101
+ [
1102
+ 13,
1103
+ "sy",
1104
+ [
1105
+ 1,
1106
+ [
1107
+ 7,
1108
+ "p",
1109
+ "vfOriginY"
1110
+ ],
1111
+ "+",
1112
+ [
1113
+ 1,
1114
+ [
1115
+ 1,
1116
+ [
1117
+ 1,
1118
+ "fy",
1119
+ "+",
1120
+ [5, "0.5"]
1121
+ ],
1122
+ "/",
1123
+ [
1124
+ 7,
1125
+ "p",
1126
+ "res"
1127
+ ]
1128
+ ],
1129
+ "*",
1130
+ [
1131
+ 7,
1132
+ "p",
1133
+ "vfSpanY"
1134
+ ]
1135
+ ]
1136
+ ]
1137
+ ],
1138
+ [
1139
+ 13,
1140
+ "seed",
1141
+ [
1142
+ 6,
1143
+ "std.select",
1144
+ [
1145
+ [
1146
+ 6,
1147
+ "d.vec4f",
1148
+ [
1149
+ [
1150
+ 4,
1151
+ "-",
1152
+ [5, "1"]
1153
+ ],
1154
+ [
1155
+ 4,
1156
+ "-",
1157
+ [5, "1"]
1158
+ ],
1159
+ [5, "60000"],
1160
+ "s0"
1161
+ ]
1162
+ ],
1163
+ [
1164
+ 6,
1165
+ "d.vec4f",
1166
+ [
1167
+ "sx",
1168
+ "sy",
1169
+ [5, "0"],
1170
+ "s0"
1171
+ ]
1172
+ ],
1173
+ "boundary"
1174
+ ]
1175
+ ]
1176
+ ],
1177
+ [
1178
+ 6,
1179
+ "std.textureStore",
1180
+ [
1181
+ [
1182
+ 7,
1183
+ [
1184
+ 7,
1185
+ "silhouetteSeedLayout",
1186
+ "$"
1187
+ ],
1188
+ "out"
1189
+ ],
1190
+ [
1191
+ 6,
1192
+ "d.vec2u",
1193
+ ["cx", "cy"]
1194
+ ],
1195
+ "seed"
1196
+ ]
1197
+ ]
1198
+ ]]
1199
+ },
1200
+ externals: {
1201
+ "silhouetteSeedLayout": () => silhouetteSeedLayout,
1202
+ "d.f32": () => f32,
1203
+ "silhouetteInside": () => silhouetteInside,
1204
+ "std.max": () => max$1,
1205
+ "std.min": () => min,
1206
+ "std.select": () => select,
1207
+ "d.vec4f": () => vec4f,
1208
+ "std.textureStore": () => textureStore,
1209
+ "d.vec2u": () => vec2u
1210
+ }
1211
+ }) && $.f)({})).$name("silhouetteSeed");
1212
+ const silhouetteStepKernel = typegpu_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
1213
+ "use gpu";
1214
+ const p = silhouetteStepLayout.$.params;
1215
+ const tx = f32(cx);
1216
+ const ty = f32(cy);
1217
+ const here = vec2f(__tsover_add(p.vfOriginX, __tsover_mul(__tsover_div(__tsover_add(tx, .5), p.res), p.vfSpanX)), __tsover_add(p.vfOriginY, __tsover_mul(__tsover_div(__tsover_add(ty, .5), p.res), p.vfSpanY)));
1218
+ const self = textureLoad(silhouetteStepLayout.$.src, vec2u(cx, cy), 0);
1219
+ let best = vec4f(self);
1220
+ const maxT = __tsover_sub(p.res, 1);
1221
+ for (let j = -1; j <= 1; j++) for (let i = -1; i <= 1; i++) {
1222
+ const nx = clamp(__tsover_add(tx, __tsover_mul(f32(i), p.step)), 0, maxT);
1223
+ const ny = clamp(__tsover_add(ty, __tsover_mul(f32(j), p.step)), 0, maxT);
1224
+ const n = textureLoad(silhouetteStepLayout.$.src, vec2u(u32(nx), u32(ny)), 0);
1225
+ if (n.x >= 0) {
1226
+ const dist = length(n.xy.sub(here));
1227
+ if (dist < best.z) best = vec4f(n.x, n.y, dist, best.w);
1228
+ }
1229
+ }
1230
+ textureStore(silhouetteStepLayout.$.out, vec2u(cx, cy), vec4f(best.x, best.y, best.z, self.w));
1231
+ }), {
1232
+ v: 2,
1233
+ name: void 0,
1234
+ ast: {
1235
+ "params": [{
1236
+ "type": "i",
1237
+ "name": "cx"
1238
+ }, {
1239
+ "type": "i",
1240
+ "name": "cy"
1241
+ }],
1242
+ "body": [0, [
1243
+ [
1244
+ 13,
1245
+ "p",
1246
+ [
1247
+ 7,
1248
+ [
1249
+ 7,
1250
+ "silhouetteStepLayout",
1251
+ "$"
1252
+ ],
1253
+ "params"
1254
+ ]
1255
+ ],
1256
+ [
1257
+ 13,
1258
+ "tx",
1259
+ [
1260
+ 6,
1261
+ "d.f32",
1262
+ ["cx"]
1263
+ ]
1264
+ ],
1265
+ [
1266
+ 13,
1267
+ "ty",
1268
+ [
1269
+ 6,
1270
+ "d.f32",
1271
+ ["cy"]
1272
+ ]
1273
+ ],
1274
+ [
1275
+ 13,
1276
+ "here",
1277
+ [
1278
+ 6,
1279
+ "d.vec2f",
1280
+ [[
1281
+ 1,
1282
+ [
1283
+ 7,
1284
+ "p",
1285
+ "vfOriginX"
1286
+ ],
1287
+ "+",
1288
+ [
1289
+ 1,
1290
+ [
1291
+ 1,
1292
+ [
1293
+ 1,
1294
+ "tx",
1295
+ "+",
1296
+ [5, "0.5"]
1297
+ ],
1298
+ "/",
1299
+ [
1300
+ 7,
1301
+ "p",
1302
+ "res"
1303
+ ]
1304
+ ],
1305
+ "*",
1306
+ [
1307
+ 7,
1308
+ "p",
1309
+ "vfSpanX"
1310
+ ]
1311
+ ]
1312
+ ], [
1313
+ 1,
1314
+ [
1315
+ 7,
1316
+ "p",
1317
+ "vfOriginY"
1318
+ ],
1319
+ "+",
1320
+ [
1321
+ 1,
1322
+ [
1323
+ 1,
1324
+ [
1325
+ 1,
1326
+ "ty",
1327
+ "+",
1328
+ [5, "0.5"]
1329
+ ],
1330
+ "/",
1331
+ [
1332
+ 7,
1333
+ "p",
1334
+ "res"
1335
+ ]
1336
+ ],
1337
+ "*",
1338
+ [
1339
+ 7,
1340
+ "p",
1341
+ "vfSpanY"
1342
+ ]
1343
+ ]
1344
+ ]]
1345
+ ]
1346
+ ],
1347
+ [
1348
+ 13,
1349
+ "self",
1350
+ [
1351
+ 6,
1352
+ "std.textureLoad",
1353
+ [
1354
+ [
1355
+ 7,
1356
+ [
1357
+ 7,
1358
+ "silhouetteStepLayout",
1359
+ "$"
1360
+ ],
1361
+ "src"
1362
+ ],
1363
+ [
1364
+ 6,
1365
+ "d.vec2u",
1366
+ ["cx", "cy"]
1367
+ ],
1368
+ [5, "0"]
1369
+ ]
1370
+ ]
1371
+ ],
1372
+ [
1373
+ 12,
1374
+ "best",
1375
+ [
1376
+ 6,
1377
+ "d.vec4f",
1378
+ ["self"]
1379
+ ]
1380
+ ],
1381
+ [
1382
+ 13,
1383
+ "maxT",
1384
+ [
1385
+ 1,
1386
+ [
1387
+ 7,
1388
+ "p",
1389
+ "res"
1390
+ ],
1391
+ "-",
1392
+ [5, "1"]
1393
+ ]
1394
+ ],
1395
+ [
1396
+ 14,
1397
+ [
1398
+ 12,
1399
+ "j",
1400
+ [
1401
+ 4,
1402
+ "-",
1403
+ [5, "1"]
1404
+ ]
1405
+ ],
1406
+ [
1407
+ 1,
1408
+ "j",
1409
+ "<=",
1410
+ [5, "1"]
1411
+ ],
1412
+ [
1413
+ 102,
1414
+ "++",
1415
+ "j"
1416
+ ],
1417
+ [0, [[
1418
+ 14,
1419
+ [
1420
+ 12,
1421
+ "i",
1422
+ [
1423
+ 4,
1424
+ "-",
1425
+ [5, "1"]
1426
+ ]
1427
+ ],
1428
+ [
1429
+ 1,
1430
+ "i",
1431
+ "<=",
1432
+ [5, "1"]
1433
+ ],
1434
+ [
1435
+ 102,
1436
+ "++",
1437
+ "i"
1438
+ ],
1439
+ [0, [
1440
+ [
1441
+ 13,
1442
+ "nx",
1443
+ [
1444
+ 6,
1445
+ "std.clamp",
1446
+ [
1447
+ [
1448
+ 1,
1449
+ "tx",
1450
+ "+",
1451
+ [
1452
+ 1,
1453
+ [
1454
+ 6,
1455
+ "d.f32",
1456
+ ["i"]
1457
+ ],
1458
+ "*",
1459
+ [
1460
+ 7,
1461
+ "p",
1462
+ "step"
1463
+ ]
1464
+ ]
1465
+ ],
1466
+ [5, "0"],
1467
+ "maxT"
1468
+ ]
1469
+ ]
1470
+ ],
1471
+ [
1472
+ 13,
1473
+ "ny",
1474
+ [
1475
+ 6,
1476
+ "std.clamp",
1477
+ [
1478
+ [
1479
+ 1,
1480
+ "ty",
1481
+ "+",
1482
+ [
1483
+ 1,
1484
+ [
1485
+ 6,
1486
+ "d.f32",
1487
+ ["j"]
1488
+ ],
1489
+ "*",
1490
+ [
1491
+ 7,
1492
+ "p",
1493
+ "step"
1494
+ ]
1495
+ ]
1496
+ ],
1497
+ [5, "0"],
1498
+ "maxT"
1499
+ ]
1500
+ ]
1501
+ ],
1502
+ [
1503
+ 13,
1504
+ "n",
1505
+ [
1506
+ 6,
1507
+ "std.textureLoad",
1508
+ [
1509
+ [
1510
+ 7,
1511
+ [
1512
+ 7,
1513
+ "silhouetteStepLayout",
1514
+ "$"
1515
+ ],
1516
+ "src"
1517
+ ],
1518
+ [
1519
+ 6,
1520
+ "d.vec2u",
1521
+ [[
1522
+ 6,
1523
+ "d.u32",
1524
+ ["nx"]
1525
+ ], [
1526
+ 6,
1527
+ "d.u32",
1528
+ ["ny"]
1529
+ ]]
1530
+ ],
1531
+ [5, "0"]
1532
+ ]
1533
+ ]
1534
+ ],
1535
+ [
1536
+ 11,
1537
+ [
1538
+ 1,
1539
+ [
1540
+ 7,
1541
+ "n",
1542
+ "x"
1543
+ ],
1544
+ ">=",
1545
+ [5, "0"]
1546
+ ],
1547
+ [0, [[
1548
+ 13,
1549
+ "dist",
1550
+ [
1551
+ 6,
1552
+ "std.length",
1553
+ [[
1554
+ 6,
1555
+ [
1556
+ 7,
1557
+ [
1558
+ 7,
1559
+ "n",
1560
+ "xy"
1561
+ ],
1562
+ "sub"
1563
+ ],
1564
+ ["here"]
1565
+ ]]
1566
+ ]
1567
+ ], [
1568
+ 11,
1569
+ [
1570
+ 1,
1571
+ "dist",
1572
+ "<",
1573
+ [
1574
+ 7,
1575
+ "best",
1576
+ "z"
1577
+ ]
1578
+ ],
1579
+ [0, [[
1580
+ 2,
1581
+ "best",
1582
+ "=",
1583
+ [
1584
+ 6,
1585
+ "d.vec4f",
1586
+ [
1587
+ [
1588
+ 7,
1589
+ "n",
1590
+ "x"
1591
+ ],
1592
+ [
1593
+ 7,
1594
+ "n",
1595
+ "y"
1596
+ ],
1597
+ "dist",
1598
+ [
1599
+ 7,
1600
+ "best",
1601
+ "w"
1602
+ ]
1603
+ ]
1604
+ ]
1605
+ ]]]
1606
+ ]]]
1607
+ ]
1608
+ ]]
1609
+ ]]]
1610
+ ],
1611
+ [
1612
+ 6,
1613
+ "std.textureStore",
1614
+ [
1615
+ [
1616
+ 7,
1617
+ [
1618
+ 7,
1619
+ "silhouetteStepLayout",
1620
+ "$"
1621
+ ],
1622
+ "out"
1623
+ ],
1624
+ [
1625
+ 6,
1626
+ "d.vec2u",
1627
+ ["cx", "cy"]
1628
+ ],
1629
+ [
1630
+ 6,
1631
+ "d.vec4f",
1632
+ [
1633
+ [
1634
+ 7,
1635
+ "best",
1636
+ "x"
1637
+ ],
1638
+ [
1639
+ 7,
1640
+ "best",
1641
+ "y"
1642
+ ],
1643
+ [
1644
+ 7,
1645
+ "best",
1646
+ "z"
1647
+ ],
1648
+ [
1649
+ 7,
1650
+ "self",
1651
+ "w"
1652
+ ]
1653
+ ]
1654
+ ]
1655
+ ]
1656
+ ]
1657
+ ]]
1658
+ },
1659
+ externals: {
1660
+ "silhouetteStepLayout": () => silhouetteStepLayout,
1661
+ "d.f32": () => f32,
1662
+ "d.vec2f": () => vec2f,
1663
+ "std.textureLoad": () => textureLoad,
1664
+ "d.vec2u": () => vec2u,
1665
+ "d.vec4f": () => vec4f,
1666
+ "std.clamp": () => clamp,
1667
+ "d.u32": () => u32,
1668
+ "std.length": () => length,
1669
+ "std.textureStore": () => textureStore
1670
+ }
1671
+ }) && $.f)({})).$name("silhouetteStep");
1672
+ function buildIrradianceKernel(layout, fieldAt, opts) {
1673
+ const { steps, shadowSteps, namePrefix } = opts;
1674
+ const RAY_SPAN = 3;
1675
+ const shadows = shadowSteps > 0;
1676
+ const shadowLoop = Math.max(shadowSteps, 1);
1677
+ const lay = layout;
1678
+ const visibility = typegpu_default.fn([
1679
+ vec2f,
1680
+ vec2f,
1681
+ f32,
1682
+ f32
1683
+ ], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((from, toward, eps, soft) => {
1684
+ "use gpu";
1685
+ const seg = toward.sub(from);
1686
+ const len = length(seg);
1687
+ const dir = seg.div(max$1(len, 1e-4));
1688
+ let vis = f32(1);
1689
+ let t = __tsover_mul(eps, 2);
1690
+ for (let k = 0; k < shadowLoop; k++) {
1691
+ if (t >= len) break;
1692
+ const dd = fieldAt(from.add(dir.mul(t)));
1693
+ vis = min(vis, clamp(__tsover_div(dd, max$1(__tsover_mul(t, soft), eps)), 0, 1));
1694
+ if (vis <= 0) break;
1695
+ t = __tsover_add(t, max$1(dd, eps));
1696
+ }
1697
+ return vis;
1698
+ }), {
1699
+ v: 2,
1700
+ name: void 0,
1701
+ ast: {
1702
+ "params": [
1703
+ {
1704
+ "type": "i",
1705
+ "name": "from"
1706
+ },
1707
+ {
1708
+ "type": "i",
1709
+ "name": "toward"
1710
+ },
1711
+ {
1712
+ "type": "i",
1713
+ "name": "eps"
1714
+ },
1715
+ {
1716
+ "type": "i",
1717
+ "name": "soft"
1718
+ }
1719
+ ],
1720
+ "body": [0, [
1721
+ [
1722
+ 13,
1723
+ "seg",
1724
+ [
1725
+ 6,
1726
+ [
1727
+ 7,
1728
+ "toward",
1729
+ "sub"
1730
+ ],
1731
+ ["from"]
1732
+ ]
1733
+ ],
1734
+ [
1735
+ 13,
1736
+ "len",
1737
+ [
1738
+ 6,
1739
+ "std.length",
1740
+ ["seg"]
1741
+ ]
1742
+ ],
1743
+ [
1744
+ 13,
1745
+ "dir",
1746
+ [
1747
+ 6,
1748
+ [
1749
+ 7,
1750
+ "seg",
1751
+ "div"
1752
+ ],
1753
+ [[
1754
+ 6,
1755
+ "std.max",
1756
+ ["len", [5, "0.0001"]]
1757
+ ]]
1758
+ ]
1759
+ ],
1760
+ [
1761
+ 12,
1762
+ "vis",
1763
+ [
1764
+ 6,
1765
+ "d.f32",
1766
+ [[5, "1"]]
1767
+ ]
1768
+ ],
1769
+ [
1770
+ 12,
1771
+ "t",
1772
+ [
1773
+ 1,
1774
+ "eps",
1775
+ "*",
1776
+ [5, "2"]
1777
+ ]
1778
+ ],
1779
+ [
1780
+ 14,
1781
+ [
1782
+ 12,
1783
+ "k",
1784
+ [5, "0"]
1785
+ ],
1786
+ [
1787
+ 1,
1788
+ "k",
1789
+ "<",
1790
+ "shadowLoop"
1791
+ ],
1792
+ [
1793
+ 102,
1794
+ "++",
1795
+ "k"
1796
+ ],
1797
+ [0, [
1798
+ [
1799
+ 11,
1800
+ [
1801
+ 1,
1802
+ "t",
1803
+ ">=",
1804
+ "len"
1805
+ ],
1806
+ [0, [[17]]]
1807
+ ],
1808
+ [
1809
+ 13,
1810
+ "dd",
1811
+ [
1812
+ 6,
1813
+ "fieldAt",
1814
+ [[
1815
+ 6,
1816
+ [
1817
+ 7,
1818
+ "from",
1819
+ "add"
1820
+ ],
1821
+ [[
1822
+ 6,
1823
+ [
1824
+ 7,
1825
+ "dir",
1826
+ "mul"
1827
+ ],
1828
+ ["t"]
1829
+ ]]
1830
+ ]]
1831
+ ]
1832
+ ],
1833
+ [
1834
+ 2,
1835
+ "vis",
1836
+ "=",
1837
+ [
1838
+ 6,
1839
+ "std.min",
1840
+ ["vis", [
1841
+ 6,
1842
+ "std.clamp",
1843
+ [
1844
+ [
1845
+ 1,
1846
+ "dd",
1847
+ "/",
1848
+ [
1849
+ 6,
1850
+ "std.max",
1851
+ [[
1852
+ 1,
1853
+ "t",
1854
+ "*",
1855
+ "soft"
1856
+ ], "eps"]
1857
+ ]
1858
+ ],
1859
+ [5, "0"],
1860
+ [5, "1"]
1861
+ ]
1862
+ ]]
1863
+ ]
1864
+ ],
1865
+ [
1866
+ 11,
1867
+ [
1868
+ 1,
1869
+ "vis",
1870
+ "<=",
1871
+ [5, "0"]
1872
+ ],
1873
+ [0, [[17]]]
1874
+ ],
1875
+ [
1876
+ 2,
1877
+ "t",
1878
+ "+=",
1879
+ [
1880
+ 6,
1881
+ "std.max",
1882
+ ["dd", "eps"]
1883
+ ]
1884
+ ]
1885
+ ]]
1886
+ ],
1887
+ [10, "vis"]
1888
+ ]]
1889
+ },
1890
+ externals: {
1891
+ "std.length": () => length,
1892
+ "std.max": () => max$1,
1893
+ "d.f32": () => f32,
1894
+ "shadowLoop": () => shadowLoop,
1895
+ "fieldAt": () => fieldAt,
1896
+ "std.min": () => min,
1897
+ "std.clamp": () => clamp
1898
+ }
1899
+ }) && $.f)({})).$name(`${namePrefix}Visibility`);
1900
+ return typegpu_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
1901
+ "use gpu";
1902
+ const p = lay.$.params;
1903
+ const eps = p.eps;
1904
+ const uv = vec2f(__tsover_div(__tsover_add(f32(cx), .5), p.res), __tsover_div(__tsover_add(f32(cy), .5), p.res));
1905
+ const sdfUV = sdfSpaceUV(p.center, p.scale, p.rotation, uv, p.aspect);
1906
+ const d0 = fieldAt(sdfUV);
1907
+ if (d0 < __tsover_mul(eps, -1)) {
1908
+ textureStore(lay.$.outTex, vec2u(cx, cy), vec4f(0, 0, 0, 0));
1909
+ return;
1910
+ }
1911
+ let o = vec2f(sdfUV);
1912
+ if (d0 < __tsover_mul(eps, 2)) {
1913
+ const gx = __tsover_sub(fieldAt(sdfUV.add(vec2f(eps, 0))), d0);
1914
+ const gy = __tsover_sub(fieldAt(sdfUV.add(vec2f(0, eps))), d0);
1915
+ const g = normalize$1(vec2f(gx, __tsover_add(gy, 1e-6)));
1916
+ o = sdfUV.add(g.mul(__tsover_sub(__tsover_mul(eps, 2), d0)));
1917
+ }
1918
+ const start = max$1(fieldAt(o), eps);
1919
+ const tMax = __tsover_add(start, RAY_SPAN);
1920
+ const ign = fract(__tsover_mul(52.9829189, fract(__tsover_add(__tsover_mul(f32(cx), .06711056), __tsover_mul(f32(cy), .00583715)))));
1921
+ const u = fract(__tsover_add(ign, __tsover_mul(p.frame, .6180339887)));
1922
+ const rays = i32(p.rays);
1923
+ const rayStep = __tsover_div(TAU, p.rays);
1924
+ const lightCount = i32(p.lightCount);
1925
+ let acc = vec3f(0, 0, 0);
1926
+ for (let i = 0; i < rays; i++) {
1927
+ const ang = __tsover_mul(__tsover_add(f32(i), u), rayStep);
1928
+ const dir = vec2f(cos(ang), sin(ang));
1929
+ let t = start;
1930
+ let hitD = f32(1);
1931
+ for (let s = 0; s < steps; s++) {
1932
+ const dd = fieldAt(o.add(dir.mul(t)));
1933
+ if (dd < eps) {
1934
+ hitD = dd;
1935
+ break;
1936
+ }
1937
+ t = __tsover_add(t, max$1(dd, eps));
1938
+ if (t > tMax) break;
1939
+ }
1940
+ if (hitD < eps) {
1941
+ const pos = o.add(dir.mul(t));
1942
+ const nx = __tsover_sub(fieldAt(pos.add(vec2f(eps, 0))), hitD);
1943
+ const ny = __tsover_sub(fieldAt(pos.add(vec2f(0, eps))), hitD);
1944
+ const n = normalize$1(vec2f(nx, __tsover_add(ny, 1e-6)));
1945
+ const hitP = pos.sub(n.mul(max$1(hitD, 0)));
1946
+ const shadowFrom = hitP.add(n.mul(__tsover_mul(eps, 2)));
1947
+ for (let l = 0; l < lightCount; l++) {
1948
+ const lp = p.lightPos[l];
1949
+ const lc = p.lightColor[l];
1950
+ const lightUV = lp.xy;
1951
+ const toL = lightUV.sub(hitP);
1952
+ const dist = length(toL);
1953
+ const dirL = toL.div(max$1(dist, 1e-4));
1954
+ const facing = clamp(__tsover_div(__tsover_add(dot$1(n, dirL), p.wrap), __tsover_add(1, p.wrap)), 0, 1);
1955
+ if (facing > 0) {
1956
+ const r = __tsover_div(dist, p.lightRange);
1957
+ let struck = __tsover_div(facing, __tsover_add(1, __tsover_mul(r, r)));
1958
+ if (shadows) struck = __tsover_mul(struck, visibility(shadowFrom, lightUV, eps, p.shadowSoftness));
1959
+ acc = acc.add(lc.xyz.mul(__tsover_mul(struck, lc.w)));
1960
+ }
1961
+ }
1962
+ }
1963
+ }
1964
+ const fade = __tsover_sub(1, smoothstep$1(__tsover_mul(p.reach, .25), p.reach, max$1(d0, 0)));
1965
+ const m = clamp(__tsover_add(__tsover_div(d0, eps), 1), 0, 1);
1966
+ const irr = min(max$1(acc.div(p.rays), vec3f(0, 0, 0)), vec3f(FAR, FAR, FAR));
1967
+ textureStore(lay.$.outTex, vec2u(cx, cy), vec4f(irr.mul(__tsover_mul(fade, m)), m));
1968
+ }), {
1969
+ v: 2,
1970
+ name: void 0,
1971
+ ast: {
1972
+ "params": [{
1973
+ "type": "i",
1974
+ "name": "cx"
1975
+ }, {
1976
+ "type": "i",
1977
+ "name": "cy"
1978
+ }],
1979
+ "body": [0, [
1980
+ [
1981
+ 13,
1982
+ "p",
1983
+ [
1984
+ 7,
1985
+ [
1986
+ 7,
1987
+ "lay",
1988
+ "$"
1989
+ ],
1990
+ "params"
1991
+ ]
1992
+ ],
1993
+ [
1994
+ 13,
1995
+ "eps",
1996
+ [
1997
+ 7,
1998
+ "p",
1999
+ "eps"
2000
+ ]
2001
+ ],
2002
+ [
2003
+ 13,
2004
+ "uv",
2005
+ [
2006
+ 6,
2007
+ "d.vec2f",
2008
+ [[
2009
+ 1,
2010
+ [
2011
+ 1,
2012
+ [
2013
+ 6,
2014
+ "d.f32",
2015
+ ["cx"]
2016
+ ],
2017
+ "+",
2018
+ [5, "0.5"]
2019
+ ],
2020
+ "/",
2021
+ [
2022
+ 7,
2023
+ "p",
2024
+ "res"
2025
+ ]
2026
+ ], [
2027
+ 1,
2028
+ [
2029
+ 1,
2030
+ [
2031
+ 6,
2032
+ "d.f32",
2033
+ ["cy"]
2034
+ ],
2035
+ "+",
2036
+ [5, "0.5"]
2037
+ ],
2038
+ "/",
2039
+ [
2040
+ 7,
2041
+ "p",
2042
+ "res"
2043
+ ]
2044
+ ]]
2045
+ ]
2046
+ ],
2047
+ [
2048
+ 13,
2049
+ "sdfUV",
2050
+ [
2051
+ 6,
2052
+ "sdfSpaceUV",
2053
+ [
2054
+ [
2055
+ 7,
2056
+ "p",
2057
+ "center"
2058
+ ],
2059
+ [
2060
+ 7,
2061
+ "p",
2062
+ "scale"
2063
+ ],
2064
+ [
2065
+ 7,
2066
+ "p",
2067
+ "rotation"
2068
+ ],
2069
+ "uv",
2070
+ [
2071
+ 7,
2072
+ "p",
2073
+ "aspect"
2074
+ ]
2075
+ ]
2076
+ ]
2077
+ ],
2078
+ [
2079
+ 13,
2080
+ "d0",
2081
+ [
2082
+ 6,
2083
+ "fieldAt",
2084
+ ["sdfUV"]
2085
+ ]
2086
+ ],
2087
+ [
2088
+ 11,
2089
+ [
2090
+ 1,
2091
+ "d0",
2092
+ "<",
2093
+ [
2094
+ 1,
2095
+ "eps",
2096
+ "*",
2097
+ [
2098
+ 4,
2099
+ "-",
2100
+ [5, "1"]
2101
+ ]
2102
+ ]
2103
+ ],
2104
+ [0, [[
2105
+ 6,
2106
+ "std.textureStore",
2107
+ [
2108
+ [
2109
+ 7,
2110
+ [
2111
+ 7,
2112
+ "lay",
2113
+ "$"
2114
+ ],
2115
+ "outTex"
2116
+ ],
2117
+ [
2118
+ 6,
2119
+ "d.vec2u",
2120
+ ["cx", "cy"]
2121
+ ],
2122
+ [
2123
+ 6,
2124
+ "d.vec4f",
2125
+ [
2126
+ [5, "0"],
2127
+ [5, "0"],
2128
+ [5, "0"],
2129
+ [5, "0"]
2130
+ ]
2131
+ ]
2132
+ ]
2133
+ ], [10]]]
2134
+ ],
2135
+ [
2136
+ 12,
2137
+ "o",
2138
+ [
2139
+ 6,
2140
+ "d.vec2f",
2141
+ ["sdfUV"]
2142
+ ]
2143
+ ],
2144
+ [
2145
+ 11,
2146
+ [
2147
+ 1,
2148
+ "d0",
2149
+ "<",
2150
+ [
2151
+ 1,
2152
+ "eps",
2153
+ "*",
2154
+ [5, "2"]
2155
+ ]
2156
+ ],
2157
+ [0, [
2158
+ [
2159
+ 13,
2160
+ "gx",
2161
+ [
2162
+ 1,
2163
+ [
2164
+ 6,
2165
+ "fieldAt",
2166
+ [[
2167
+ 6,
2168
+ [
2169
+ 7,
2170
+ "sdfUV",
2171
+ "add"
2172
+ ],
2173
+ [[
2174
+ 6,
2175
+ "d.vec2f",
2176
+ ["eps", [5, "0"]]
2177
+ ]]
2178
+ ]]
2179
+ ],
2180
+ "-",
2181
+ "d0"
2182
+ ]
2183
+ ],
2184
+ [
2185
+ 13,
2186
+ "gy",
2187
+ [
2188
+ 1,
2189
+ [
2190
+ 6,
2191
+ "fieldAt",
2192
+ [[
2193
+ 6,
2194
+ [
2195
+ 7,
2196
+ "sdfUV",
2197
+ "add"
2198
+ ],
2199
+ [[
2200
+ 6,
2201
+ "d.vec2f",
2202
+ [[5, "0"], "eps"]
2203
+ ]]
2204
+ ]]
2205
+ ],
2206
+ "-",
2207
+ "d0"
2208
+ ]
2209
+ ],
2210
+ [
2211
+ 13,
2212
+ "g",
2213
+ [
2214
+ 6,
2215
+ "std.normalize",
2216
+ [[
2217
+ 6,
2218
+ "d.vec2f",
2219
+ ["gx", [
2220
+ 1,
2221
+ "gy",
2222
+ "+",
2223
+ [5, "0.000001"]
2224
+ ]]
2225
+ ]]
2226
+ ]
2227
+ ],
2228
+ [
2229
+ 2,
2230
+ "o",
2231
+ "=",
2232
+ [
2233
+ 6,
2234
+ [
2235
+ 7,
2236
+ "sdfUV",
2237
+ "add"
2238
+ ],
2239
+ [[
2240
+ 6,
2241
+ [
2242
+ 7,
2243
+ "g",
2244
+ "mul"
2245
+ ],
2246
+ [[
2247
+ 1,
2248
+ [
2249
+ 1,
2250
+ "eps",
2251
+ "*",
2252
+ [5, "2"]
2253
+ ],
2254
+ "-",
2255
+ "d0"
2256
+ ]]
2257
+ ]]
2258
+ ]
2259
+ ]
2260
+ ]]
2261
+ ],
2262
+ [
2263
+ 13,
2264
+ "start",
2265
+ [
2266
+ 6,
2267
+ "std.max",
2268
+ [[
2269
+ 6,
2270
+ "fieldAt",
2271
+ ["o"]
2272
+ ], "eps"]
2273
+ ]
2274
+ ],
2275
+ [
2276
+ 13,
2277
+ "tMax",
2278
+ [
2279
+ 1,
2280
+ "start",
2281
+ "+",
2282
+ "RAY_SPAN"
2283
+ ]
2284
+ ],
2285
+ [
2286
+ 13,
2287
+ "ign",
2288
+ [
2289
+ 6,
2290
+ "std.fract",
2291
+ [[
2292
+ 1,
2293
+ [5, "52.9829189"],
2294
+ "*",
2295
+ [
2296
+ 6,
2297
+ "std.fract",
2298
+ [[
2299
+ 1,
2300
+ [
2301
+ 1,
2302
+ [
2303
+ 6,
2304
+ "d.f32",
2305
+ ["cx"]
2306
+ ],
2307
+ "*",
2308
+ [5, "0.06711056"]
2309
+ ],
2310
+ "+",
2311
+ [
2312
+ 1,
2313
+ [
2314
+ 6,
2315
+ "d.f32",
2316
+ ["cy"]
2317
+ ],
2318
+ "*",
2319
+ [5, "0.00583715"]
2320
+ ]
2321
+ ]]
2322
+ ]
2323
+ ]]
2324
+ ]
2325
+ ],
2326
+ [
2327
+ 13,
2328
+ "u",
2329
+ [
2330
+ 6,
2331
+ "std.fract",
2332
+ [[
2333
+ 1,
2334
+ "ign",
2335
+ "+",
2336
+ [
2337
+ 1,
2338
+ [
2339
+ 7,
2340
+ "p",
2341
+ "frame"
2342
+ ],
2343
+ "*",
2344
+ [5, "0.6180339887"]
2345
+ ]
2346
+ ]]
2347
+ ]
2348
+ ],
2349
+ [
2350
+ 13,
2351
+ "rays",
2352
+ [
2353
+ 6,
2354
+ "d.i32",
2355
+ [[
2356
+ 7,
2357
+ "p",
2358
+ "rays"
2359
+ ]]
2360
+ ]
2361
+ ],
2362
+ [
2363
+ 13,
2364
+ "rayStep",
2365
+ [
2366
+ 1,
2367
+ "TAU",
2368
+ "/",
2369
+ [
2370
+ 7,
2371
+ "p",
2372
+ "rays"
2373
+ ]
2374
+ ]
2375
+ ],
2376
+ [
2377
+ 13,
2378
+ "lightCount",
2379
+ [
2380
+ 6,
2381
+ "d.i32",
2382
+ [[
2383
+ 7,
2384
+ "p",
2385
+ "lightCount"
2386
+ ]]
2387
+ ]
2388
+ ],
2389
+ [
2390
+ 12,
2391
+ "acc",
2392
+ [
2393
+ 6,
2394
+ "d.vec3f",
2395
+ [
2396
+ [5, "0"],
2397
+ [5, "0"],
2398
+ [5, "0"]
2399
+ ]
2400
+ ]
2401
+ ],
2402
+ [
2403
+ 14,
2404
+ [
2405
+ 12,
2406
+ "i",
2407
+ [5, "0"]
2408
+ ],
2409
+ [
2410
+ 1,
2411
+ "i",
2412
+ "<",
2413
+ "rays"
2414
+ ],
2415
+ [
2416
+ 102,
2417
+ "++",
2418
+ "i"
2419
+ ],
2420
+ [0, [
2421
+ [
2422
+ 13,
2423
+ "ang",
2424
+ [
2425
+ 1,
2426
+ [
2427
+ 1,
2428
+ [
2429
+ 6,
2430
+ "d.f32",
2431
+ ["i"]
2432
+ ],
2433
+ "+",
2434
+ "u"
2435
+ ],
2436
+ "*",
2437
+ "rayStep"
2438
+ ]
2439
+ ],
2440
+ [
2441
+ 13,
2442
+ "dir",
2443
+ [
2444
+ 6,
2445
+ "d.vec2f",
2446
+ [[
2447
+ 6,
2448
+ "std.cos",
2449
+ ["ang"]
2450
+ ], [
2451
+ 6,
2452
+ "std.sin",
2453
+ ["ang"]
2454
+ ]]
2455
+ ]
2456
+ ],
2457
+ [
2458
+ 12,
2459
+ "t",
2460
+ "start"
2461
+ ],
2462
+ [
2463
+ 12,
2464
+ "hitD",
2465
+ [
2466
+ 6,
2467
+ "d.f32",
2468
+ [[5, "1"]]
2469
+ ]
2470
+ ],
2471
+ [
2472
+ 14,
2473
+ [
2474
+ 12,
2475
+ "s",
2476
+ [5, "0"]
2477
+ ],
2478
+ [
2479
+ 1,
2480
+ "s",
2481
+ "<",
2482
+ "steps"
2483
+ ],
2484
+ [
2485
+ 102,
2486
+ "++",
2487
+ "s"
2488
+ ],
2489
+ [0, [
2490
+ [
2491
+ 13,
2492
+ "dd",
2493
+ [
2494
+ 6,
2495
+ "fieldAt",
2496
+ [[
2497
+ 6,
2498
+ [
2499
+ 7,
2500
+ "o",
2501
+ "add"
2502
+ ],
2503
+ [[
2504
+ 6,
2505
+ [
2506
+ 7,
2507
+ "dir",
2508
+ "mul"
2509
+ ],
2510
+ ["t"]
2511
+ ]]
2512
+ ]]
2513
+ ]
2514
+ ],
2515
+ [
2516
+ 11,
2517
+ [
2518
+ 1,
2519
+ "dd",
2520
+ "<",
2521
+ "eps"
2522
+ ],
2523
+ [0, [[
2524
+ 2,
2525
+ "hitD",
2526
+ "=",
2527
+ "dd"
2528
+ ], [17]]]
2529
+ ],
2530
+ [
2531
+ 2,
2532
+ "t",
2533
+ "+=",
2534
+ [
2535
+ 6,
2536
+ "std.max",
2537
+ ["dd", "eps"]
2538
+ ]
2539
+ ],
2540
+ [
2541
+ 11,
2542
+ [
2543
+ 1,
2544
+ "t",
2545
+ ">",
2546
+ "tMax"
2547
+ ],
2548
+ [0, [[17]]]
2549
+ ]
2550
+ ]]
2551
+ ],
2552
+ [
2553
+ 11,
2554
+ [
2555
+ 1,
2556
+ "hitD",
2557
+ "<",
2558
+ "eps"
2559
+ ],
2560
+ [0, [
2561
+ [
2562
+ 13,
2563
+ "pos",
2564
+ [
2565
+ 6,
2566
+ [
2567
+ 7,
2568
+ "o",
2569
+ "add"
2570
+ ],
2571
+ [[
2572
+ 6,
2573
+ [
2574
+ 7,
2575
+ "dir",
2576
+ "mul"
2577
+ ],
2578
+ ["t"]
2579
+ ]]
2580
+ ]
2581
+ ],
2582
+ [
2583
+ 13,
2584
+ "nx",
2585
+ [
2586
+ 1,
2587
+ [
2588
+ 6,
2589
+ "fieldAt",
2590
+ [[
2591
+ 6,
2592
+ [
2593
+ 7,
2594
+ "pos",
2595
+ "add"
2596
+ ],
2597
+ [[
2598
+ 6,
2599
+ "d.vec2f",
2600
+ ["eps", [5, "0"]]
2601
+ ]]
2602
+ ]]
2603
+ ],
2604
+ "-",
2605
+ "hitD"
2606
+ ]
2607
+ ],
2608
+ [
2609
+ 13,
2610
+ "ny",
2611
+ [
2612
+ 1,
2613
+ [
2614
+ 6,
2615
+ "fieldAt",
2616
+ [[
2617
+ 6,
2618
+ [
2619
+ 7,
2620
+ "pos",
2621
+ "add"
2622
+ ],
2623
+ [[
2624
+ 6,
2625
+ "d.vec2f",
2626
+ [[5, "0"], "eps"]
2627
+ ]]
2628
+ ]]
2629
+ ],
2630
+ "-",
2631
+ "hitD"
2632
+ ]
2633
+ ],
2634
+ [
2635
+ 13,
2636
+ "n",
2637
+ [
2638
+ 6,
2639
+ "std.normalize",
2640
+ [[
2641
+ 6,
2642
+ "d.vec2f",
2643
+ ["nx", [
2644
+ 1,
2645
+ "ny",
2646
+ "+",
2647
+ [5, "0.000001"]
2648
+ ]]
2649
+ ]]
2650
+ ]
2651
+ ],
2652
+ [
2653
+ 13,
2654
+ "hitP",
2655
+ [
2656
+ 6,
2657
+ [
2658
+ 7,
2659
+ "pos",
2660
+ "sub"
2661
+ ],
2662
+ [[
2663
+ 6,
2664
+ [
2665
+ 7,
2666
+ "n",
2667
+ "mul"
2668
+ ],
2669
+ [[
2670
+ 6,
2671
+ "std.max",
2672
+ ["hitD", [5, "0"]]
2673
+ ]]
2674
+ ]]
2675
+ ]
2676
+ ],
2677
+ [
2678
+ 13,
2679
+ "shadowFrom",
2680
+ [
2681
+ 6,
2682
+ [
2683
+ 7,
2684
+ "hitP",
2685
+ "add"
2686
+ ],
2687
+ [[
2688
+ 6,
2689
+ [
2690
+ 7,
2691
+ "n",
2692
+ "mul"
2693
+ ],
2694
+ [[
2695
+ 1,
2696
+ "eps",
2697
+ "*",
2698
+ [5, "2"]
2699
+ ]]
2700
+ ]]
2701
+ ]
2702
+ ],
2703
+ [
2704
+ 14,
2705
+ [
2706
+ 12,
2707
+ "l",
2708
+ [5, "0"]
2709
+ ],
2710
+ [
2711
+ 1,
2712
+ "l",
2713
+ "<",
2714
+ "lightCount"
2715
+ ],
2716
+ [
2717
+ 102,
2718
+ "++",
2719
+ "l"
2720
+ ],
2721
+ [0, [
2722
+ [
2723
+ 13,
2724
+ "lp",
2725
+ [
2726
+ 8,
2727
+ [
2728
+ 7,
2729
+ "p",
2730
+ "lightPos"
2731
+ ],
2732
+ "l"
2733
+ ]
2734
+ ],
2735
+ [
2736
+ 13,
2737
+ "lc",
2738
+ [
2739
+ 8,
2740
+ [
2741
+ 7,
2742
+ "p",
2743
+ "lightColor"
2744
+ ],
2745
+ "l"
2746
+ ]
2747
+ ],
2748
+ [
2749
+ 13,
2750
+ "lightUV",
2751
+ [
2752
+ 7,
2753
+ "lp",
2754
+ "xy"
2755
+ ]
2756
+ ],
2757
+ [
2758
+ 13,
2759
+ "toL",
2760
+ [
2761
+ 6,
2762
+ [
2763
+ 7,
2764
+ "lightUV",
2765
+ "sub"
2766
+ ],
2767
+ ["hitP"]
2768
+ ]
2769
+ ],
2770
+ [
2771
+ 13,
2772
+ "dist",
2773
+ [
2774
+ 6,
2775
+ "std.length",
2776
+ ["toL"]
2777
+ ]
2778
+ ],
2779
+ [
2780
+ 13,
2781
+ "dirL",
2782
+ [
2783
+ 6,
2784
+ [
2785
+ 7,
2786
+ "toL",
2787
+ "div"
2788
+ ],
2789
+ [[
2790
+ 6,
2791
+ "std.max",
2792
+ ["dist", [5, "0.0001"]]
2793
+ ]]
2794
+ ]
2795
+ ],
2796
+ [
2797
+ 13,
2798
+ "facing",
2799
+ [
2800
+ 6,
2801
+ "std.clamp",
2802
+ [
2803
+ [
2804
+ 1,
2805
+ [
2806
+ 1,
2807
+ [
2808
+ 6,
2809
+ "std.dot",
2810
+ ["n", "dirL"]
2811
+ ],
2812
+ "+",
2813
+ [
2814
+ 7,
2815
+ "p",
2816
+ "wrap"
2817
+ ]
2818
+ ],
2819
+ "/",
2820
+ [
2821
+ 1,
2822
+ [5, "1"],
2823
+ "+",
2824
+ [
2825
+ 7,
2826
+ "p",
2827
+ "wrap"
2828
+ ]
2829
+ ]
2830
+ ],
2831
+ [5, "0"],
2832
+ [5, "1"]
2833
+ ]
2834
+ ]
2835
+ ],
2836
+ [
2837
+ 11,
2838
+ [
2839
+ 1,
2840
+ "facing",
2841
+ ">",
2842
+ [5, "0"]
2843
+ ],
2844
+ [0, [
2845
+ [
2846
+ 13,
2847
+ "r",
2848
+ [
2849
+ 1,
2850
+ "dist",
2851
+ "/",
2852
+ [
2853
+ 7,
2854
+ "p",
2855
+ "lightRange"
2856
+ ]
2857
+ ]
2858
+ ],
2859
+ [
2860
+ 12,
2861
+ "struck",
2862
+ [
2863
+ 1,
2864
+ "facing",
2865
+ "/",
2866
+ [
2867
+ 1,
2868
+ [5, "1"],
2869
+ "+",
2870
+ [
2871
+ 1,
2872
+ "r",
2873
+ "*",
2874
+ "r"
2875
+ ]
2876
+ ]
2877
+ ]
2878
+ ],
2879
+ [
2880
+ 11,
2881
+ "shadows",
2882
+ [0, [[
2883
+ 2,
2884
+ "struck",
2885
+ "=",
2886
+ [
2887
+ 1,
2888
+ "struck",
2889
+ "*",
2890
+ [
2891
+ 6,
2892
+ "visibility",
2893
+ [
2894
+ "shadowFrom",
2895
+ "lightUV",
2896
+ "eps",
2897
+ [
2898
+ 7,
2899
+ "p",
2900
+ "shadowSoftness"
2901
+ ]
2902
+ ]
2903
+ ]
2904
+ ]
2905
+ ]]]
2906
+ ],
2907
+ [
2908
+ 2,
2909
+ "acc",
2910
+ "=",
2911
+ [
2912
+ 6,
2913
+ [
2914
+ 7,
2915
+ "acc",
2916
+ "add"
2917
+ ],
2918
+ [[
2919
+ 6,
2920
+ [
2921
+ 7,
2922
+ [
2923
+ 7,
2924
+ "lc",
2925
+ "xyz"
2926
+ ],
2927
+ "mul"
2928
+ ],
2929
+ [[
2930
+ 1,
2931
+ "struck",
2932
+ "*",
2933
+ [
2934
+ 7,
2935
+ "lc",
2936
+ "w"
2937
+ ]
2938
+ ]]
2939
+ ]]
2940
+ ]
2941
+ ]
2942
+ ]]
2943
+ ]
2944
+ ]]
2945
+ ]
2946
+ ]]
2947
+ ]
2948
+ ]]
2949
+ ],
2950
+ [
2951
+ 13,
2952
+ "fade",
2953
+ [
2954
+ 1,
2955
+ [5, "1"],
2956
+ "-",
2957
+ [
2958
+ 6,
2959
+ "std.smoothstep",
2960
+ [
2961
+ [
2962
+ 1,
2963
+ [
2964
+ 7,
2965
+ "p",
2966
+ "reach"
2967
+ ],
2968
+ "*",
2969
+ [5, "0.25"]
2970
+ ],
2971
+ [
2972
+ 7,
2973
+ "p",
2974
+ "reach"
2975
+ ],
2976
+ [
2977
+ 6,
2978
+ "std.max",
2979
+ ["d0", [5, "0"]]
2980
+ ]
2981
+ ]
2982
+ ]
2983
+ ]
2984
+ ],
2985
+ [
2986
+ 13,
2987
+ "m",
2988
+ [
2989
+ 6,
2990
+ "std.clamp",
2991
+ [
2992
+ [
2993
+ 1,
2994
+ [
2995
+ 1,
2996
+ "d0",
2997
+ "/",
2998
+ "eps"
2999
+ ],
3000
+ "+",
3001
+ [5, "1"]
3002
+ ],
3003
+ [5, "0"],
3004
+ [5, "1"]
3005
+ ]
3006
+ ]
3007
+ ],
3008
+ [
3009
+ 13,
3010
+ "irr",
3011
+ [
3012
+ 6,
3013
+ "std.min",
3014
+ [[
3015
+ 6,
3016
+ "std.max",
3017
+ [[
3018
+ 6,
3019
+ [
3020
+ 7,
3021
+ "acc",
3022
+ "div"
3023
+ ],
3024
+ [[
3025
+ 7,
3026
+ "p",
3027
+ "rays"
3028
+ ]]
3029
+ ], [
3030
+ 6,
3031
+ "d.vec3f",
3032
+ [
3033
+ [5, "0"],
3034
+ [5, "0"],
3035
+ [5, "0"]
3036
+ ]
3037
+ ]]
3038
+ ], [
3039
+ 6,
3040
+ "d.vec3f",
3041
+ [
3042
+ "FAR",
3043
+ "FAR",
3044
+ "FAR"
3045
+ ]
3046
+ ]]
3047
+ ]
3048
+ ],
3049
+ [
3050
+ 6,
3051
+ "std.textureStore",
3052
+ [
3053
+ [
3054
+ 7,
3055
+ [
3056
+ 7,
3057
+ "lay",
3058
+ "$"
3059
+ ],
3060
+ "outTex"
3061
+ ],
3062
+ [
3063
+ 6,
3064
+ "d.vec2u",
3065
+ ["cx", "cy"]
3066
+ ],
3067
+ [
3068
+ 6,
3069
+ "d.vec4f",
3070
+ [[
3071
+ 6,
3072
+ [
3073
+ 7,
3074
+ "irr",
3075
+ "mul"
3076
+ ],
3077
+ [[
3078
+ 1,
3079
+ "fade",
3080
+ "*",
3081
+ "m"
3082
+ ]]
3083
+ ], "m"]
3084
+ ]
3085
+ ]
3086
+ ]
3087
+ ]]
3088
+ },
3089
+ externals: {
3090
+ "lay": () => lay,
3091
+ "d.vec2f": () => vec2f,
3092
+ "d.f32": () => f32,
3093
+ "sdfSpaceUV": () => sdfSpaceUV,
3094
+ "fieldAt": () => fieldAt,
3095
+ "std.textureStore": () => textureStore,
3096
+ "d.vec2u": () => vec2u,
3097
+ "d.vec4f": () => vec4f,
3098
+ "std.normalize": () => normalize$1,
3099
+ "std.max": () => max$1,
3100
+ "RAY_SPAN": () => RAY_SPAN,
3101
+ "std.fract": () => fract,
3102
+ "d.i32": () => i32,
3103
+ "TAU": () => TAU,
3104
+ "d.vec3f": () => vec3f,
3105
+ "std.cos": () => cos,
3106
+ "std.sin": () => sin,
3107
+ "steps": () => steps,
3108
+ "std.length": () => length,
3109
+ "std.clamp": () => clamp,
3110
+ "std.dot": () => dot$1,
3111
+ "shadows": () => shadows,
3112
+ "visibility": () => visibility,
3113
+ "std.smoothstep": () => smoothstep$1,
3114
+ "std.min": () => min,
3115
+ "FAR": () => FAR
3116
+ }
3117
+ }) && $.f)({})).$name(`${namePrefix}Gather`);
3118
+ }
3119
+ function createIrradiancePass(root, kernel, opts) {
3120
+ return createGuardedCompute(root, /* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
3121
+ "use gpu";
3122
+ kernel(cx, cy);
3123
+ }), {
3124
+ v: 2,
3125
+ name: void 0,
3126
+ ast: {
3127
+ "params": [{
3128
+ "type": "i",
3129
+ "name": "cx"
3130
+ }, {
3131
+ "type": "i",
3132
+ "name": "cy"
3133
+ }],
3134
+ "body": [0, [[
3135
+ 6,
3136
+ "kernel",
3137
+ ["cx", "cy"]
3138
+ ]]]
3139
+ },
3140
+ externals: { "kernel": () => kernel }
3141
+ }) && $.f)({}), {
3142
+ size: [opts.res, opts.res],
3143
+ bindGroup: opts.bindGroup
3144
+ });
3145
+ }
3146
+ const AccumulateParams = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(struct({ weight: f32 }), "AccumulateParams");
3147
+ const accumulateLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
3148
+ sample: { texture: texture2d(f32) },
3149
+ prev: { texture: texture2d(f32) },
3150
+ out: outEntry,
3151
+ params: { uniform: AccumulateParams }
3152
+ }), "accumulateLayout");
3153
+ const accumulateKernel = typegpu_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
3154
+ "use gpu";
3155
+ const at = vec2u(cx, cy);
3156
+ const s = textureLoad(accumulateLayout.$.sample, at, 0);
3157
+ const prev = textureLoad(accumulateLayout.$.prev, at, 0);
3158
+ const w = accumulateLayout.$.params.weight;
3159
+ textureStore(accumulateLayout.$.out, at, select(prev.add(s.sub(prev).mul(w)), s, w >= 1));
3160
+ }), {
3161
+ v: 2,
3162
+ name: void 0,
3163
+ ast: {
3164
+ "params": [{
3165
+ "type": "i",
3166
+ "name": "cx"
3167
+ }, {
3168
+ "type": "i",
3169
+ "name": "cy"
3170
+ }],
3171
+ "body": [0, [
3172
+ [
3173
+ 13,
3174
+ "at",
3175
+ [
3176
+ 6,
3177
+ "d.vec2u",
3178
+ ["cx", "cy"]
3179
+ ]
3180
+ ],
3181
+ [
3182
+ 13,
3183
+ "s",
3184
+ [
3185
+ 6,
3186
+ "std.textureLoad",
3187
+ [
3188
+ [
3189
+ 7,
3190
+ [
3191
+ 7,
3192
+ "accumulateLayout",
3193
+ "$"
3194
+ ],
3195
+ "sample"
3196
+ ],
3197
+ "at",
3198
+ [5, "0"]
3199
+ ]
3200
+ ]
3201
+ ],
3202
+ [
3203
+ 13,
3204
+ "prev",
3205
+ [
3206
+ 6,
3207
+ "std.textureLoad",
3208
+ [
3209
+ [
3210
+ 7,
3211
+ [
3212
+ 7,
3213
+ "accumulateLayout",
3214
+ "$"
3215
+ ],
3216
+ "prev"
3217
+ ],
3218
+ "at",
3219
+ [5, "0"]
3220
+ ]
3221
+ ]
3222
+ ],
3223
+ [
3224
+ 13,
3225
+ "w",
3226
+ [
3227
+ 7,
3228
+ [
3229
+ 7,
3230
+ [
3231
+ 7,
3232
+ "accumulateLayout",
3233
+ "$"
3234
+ ],
3235
+ "params"
3236
+ ],
3237
+ "weight"
3238
+ ]
3239
+ ],
3240
+ [
3241
+ 6,
3242
+ "std.textureStore",
3243
+ [
3244
+ [
3245
+ 7,
3246
+ [
3247
+ 7,
3248
+ "accumulateLayout",
3249
+ "$"
3250
+ ],
3251
+ "out"
3252
+ ],
3253
+ "at",
3254
+ [
3255
+ 6,
3256
+ "std.select",
3257
+ [
3258
+ [
3259
+ 6,
3260
+ [
3261
+ 7,
3262
+ "prev",
3263
+ "add"
3264
+ ],
3265
+ [[
3266
+ 6,
3267
+ [
3268
+ 7,
3269
+ [
3270
+ 6,
3271
+ [
3272
+ 7,
3273
+ "s",
3274
+ "sub"
3275
+ ],
3276
+ ["prev"]
3277
+ ],
3278
+ "mul"
3279
+ ],
3280
+ ["w"]
3281
+ ]]
3282
+ ],
3283
+ "s",
3284
+ [
3285
+ 1,
3286
+ "w",
3287
+ ">=",
3288
+ [5, "1"]
3289
+ ]
3290
+ ]
3291
+ ]
3292
+ ]
3293
+ ]
3294
+ ]]
3295
+ },
3296
+ externals: {
3297
+ "d.vec2u": () => vec2u,
3298
+ "std.textureLoad": () => textureLoad,
3299
+ "accumulateLayout": () => accumulateLayout,
3300
+ "std.textureStore": () => textureStore,
3301
+ "std.select": () => select
3302
+ }
3303
+ }) && $.f)({})).$name("irradianceAccumulate");
3304
+ const copyLayout = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(typegpu_default.bindGroupLayout({
3305
+ src: { texture: texture2d(f32) },
3306
+ out: outEntry
3307
+ }), "copyLayout");
3308
+ const copyKernel = typegpu_default.fn([u32, u32])(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((cx, cy) => {
3309
+ "use gpu";
3310
+ const at = vec2u(cx, cy);
3311
+ textureStore(copyLayout.$.out, at, textureLoad(copyLayout.$.src, at, 0));
3312
+ }), {
3313
+ v: 2,
3314
+ name: void 0,
3315
+ ast: {
3316
+ "params": [{
3317
+ "type": "i",
3318
+ "name": "cx"
3319
+ }, {
3320
+ "type": "i",
3321
+ "name": "cy"
3322
+ }],
3323
+ "body": [0, [[
3324
+ 13,
3325
+ "at",
3326
+ [
3327
+ 6,
3328
+ "d.vec2u",
3329
+ ["cx", "cy"]
3330
+ ]
3331
+ ], [
3332
+ 6,
3333
+ "std.textureStore",
3334
+ [
3335
+ [
3336
+ 7,
3337
+ [
3338
+ 7,
3339
+ "copyLayout",
3340
+ "$"
3341
+ ],
3342
+ "out"
3343
+ ],
3344
+ "at",
3345
+ [
3346
+ 6,
3347
+ "std.textureLoad",
3348
+ [
3349
+ [
3350
+ 7,
3351
+ [
3352
+ 7,
3353
+ "copyLayout",
3354
+ "$"
3355
+ ],
3356
+ "src"
3357
+ ],
3358
+ "at",
3359
+ [5, "0"]
3360
+ ]
3361
+ ]
3362
+ ]
3363
+ ]]]
3364
+ },
3365
+ externals: {
3366
+ "d.vec2u": () => vec2u,
3367
+ "std.textureStore": () => textureStore,
3368
+ "copyLayout": () => copyLayout,
3369
+ "std.textureLoad": () => textureLoad
3370
+ }
3371
+ }) && $.f)({})).$name("irradianceCopy");
3372
+ var radianceCounter = 0;
3373
+ var raw$1 = (name) => new Expr(() => name);
3374
+ var num = (v, ctx) => typeof v === "number" ? formatFloat(v) : v._emit(ctx);
3375
+ function scopedInto(ctx, into) {
3376
+ return {
3377
+ external: (v, h) => ctx.external(v, h),
3378
+ statement: (w) => into.push(w),
3379
+ freshLocal: (h) => ctx.freshLocal(h),
3380
+ memo: (k, f) => ctx.memo(k, f)
3381
+ };
3382
+ }
3383
+ function shadowVisibility(spec) {
3384
+ const id = radianceCounter++;
3385
+ const hint = spec.hint ?? "visibility";
3386
+ return new Expr((ctx) => ctx.memo(`shadow:${id}`, () => {
3387
+ const vis = ctx.freshLocal(hint);
3388
+ const from = ctx.freshLocal("shFrom");
3389
+ const seg = ctx.freshLocal("shSeg");
3390
+ const len = ctx.freshLocal("shLen");
3391
+ const dir = ctx.freshLocal("shDir");
3392
+ const eps = ctx.freshLocal("shEps");
3393
+ const soft = ctx.freshLocal("shSoft");
3394
+ const t = ctx.freshLocal("shT");
3395
+ const pos = ctx.freshLocal("shPos");
3396
+ const dd = ctx.freshLocal("shD");
3397
+ const k = ctx.freshLocal("shStep");
3398
+ ctx.statement(`let ${from} = ${spec.from._emit(ctx)};`);
3399
+ ctx.statement(`let ${seg} = ${spec.toward._emit(ctx)} - ${from};`);
3400
+ ctx.statement(`let ${len} = length(${seg});`);
3401
+ ctx.statement(`let ${dir} = ${seg} / max(${len}, 0.0001);`);
3402
+ ctx.statement(`let ${eps} = ${num(spec.surfaceEps, ctx)};`);
3403
+ ctx.statement(`let ${soft} = ${num(spec.softness ?? 0, ctx)};`);
3404
+ ctx.statement(`var ${vis} = 1.0;`);
3405
+ const marchStmts = [];
3406
+ const fieldAtPos = spec.field(raw$1(pos))._emit(scopedInto(ctx, marchStmts));
3407
+ ctx.statement([
3408
+ `{`,
3409
+ ` var ${t} = ${eps} * 2.0;`,
3410
+ ` for (var ${k} = 0u; ${k} < ${spec.steps}u; ${k}++) {`,
3411
+ ` if (${t} >= ${len}) { break; }`,
3412
+ ` let ${pos} = ${from} + ${dir} * ${t};`,
3413
+ ...marchStmts.map((w) => ` ${w}`),
3414
+ ` let ${dd} = ${fieldAtPos};`,
3415
+ ` ${vis} = min(${vis}, clamp(${dd} / max(${t} * ${soft}, ${eps}), 0.0, 1.0));`,
3416
+ ` if (${vis} <= 0.0) { break; }`,
3417
+ ` ${t} += max(${dd}, ${eps});`,
3418
+ ` }`,
3419
+ `}`
3420
+ ].join("\n"));
3421
+ return vis;
3422
+ }));
3423
+ }
3424
+ var DENOISE_RADIUS = 3;
3425
+ var DENOISE_HALF_KERNEL = 6;
3426
+ var WARMUP_FRAMES = 3;
3427
+ var { createSdfDataTexture, analyticSubPropValues, parseShapeConfigValue } = sdf_exports;
3428
+ var { createVolumetricFieldComputeNode } = sdf3d_exports;
3429
+ function toPlacement(center, scale, rotationDeg, aspect, stored) {
3430
+ const dxAc = (stored.x - center.x) * aspect;
3431
+ const dy = 1 - stored.y - (1 - center.y);
3432
+ const r = rotationDeg * Math.PI / 180;
3433
+ const c = Math.cos(r);
3434
+ const s = Math.sin(r);
3435
+ const sc = Math.max(scale, .001);
3436
+ return {
3437
+ x: (dxAc * c + dy * s) / sc + .5,
3438
+ y: (dy * c - dxAc * s) / sc + .5
3439
+ };
3440
+ }
3441
+ function lightLanes(items, fields, placement) {
3442
+ const list = (Array.isArray(items) ? items : []).slice(0, 8);
3443
+ const pos = [];
3444
+ const color = [];
3445
+ for (let i = 0; i < 8; i++) {
3446
+ const item = list[i];
3447
+ const stored = item?.[fields.position] ?? {
3448
+ x: .5,
3449
+ y: .5
3450
+ };
3451
+ const p = toPlacement(placement.center, placement.scale, placement.rotation, placement.aspect, stored);
3452
+ const c = item?.[fields.color] ?? [
3453
+ 1,
3454
+ 1,
3455
+ 1,
3456
+ 1
3457
+ ];
3458
+ const intensity = typeof item?.[fields.intensity] === "number" ? item[fields.intensity] : 0;
3459
+ pos.push(item ? [
3460
+ p.x,
3461
+ p.y,
3462
+ 0,
3463
+ 0
3464
+ ] : [
3465
+ 0,
3466
+ 0,
3467
+ 0,
3468
+ 0
3469
+ ]);
3470
+ color.push(item ? [
3471
+ c[0],
3472
+ c[1],
3473
+ c[2],
3474
+ intensity
3475
+ ] : [
3476
+ 0,
3477
+ 0,
3478
+ 0,
3479
+ 0
3480
+ ]);
3481
+ }
3482
+ return {
3483
+ pos,
3484
+ color,
3485
+ count: list.length
3486
+ };
3487
+ }
3488
+ function irradianceField(spec) {
3489
+ const outputKey = spec.outputKey ?? "irradianceTexture";
3490
+ const namePrefix = spec.namePrefix ?? "irradiance";
3491
+ const kernelOpts = {
3492
+ steps: spec.steps ?? 32,
3493
+ shadowSteps: spec.shadowSteps ?? 12,
3494
+ namePrefix
3495
+ };
3496
+ const res = spec.resolution;
3497
+ const compute = (params) => {
3498
+ const { gpu, getCpuValue, registerComputeTexture, onCleanup, onResize } = params;
3499
+ const root = gpu?.root;
3500
+ if (!root) return null;
3501
+ const shapeSdfUrl = getCpuValue("shapeSdfUrl") || "";
3502
+ const shapeType = resolveShapeType(getCpuValue("shapeType") || "", getCpuValue("shape"));
3503
+ const vf = createVolumetricFieldComputeNode(params, () => getCpuValue("shape"), "none", "span");
3504
+ const mkTex = () => {
3505
+ const t = root.createTexture({
3506
+ size: [res, res],
3507
+ format: IRRADIANCE_FORMAT
3508
+ }).$usage("storage", "sampled");
3509
+ onCleanup(() => t.destroy());
3510
+ return t;
3511
+ };
3512
+ const outTex = mkTex();
3513
+ const meanTex = mkTex();
3514
+ const prevTex = mkTex();
3515
+ const denoise = createGaussianBlurCompute(root, meanTex, res, res, onCleanup, DENOISE_HALF_KERNEL, res, res);
3516
+ denoise.updateRadius(DENOISE_RADIUS);
3517
+ const outputTexture = registerComputeTexture(denoise.outputTexture);
3518
+ const paramsU = root.createUniform(IrradianceParams);
3519
+ const accumU = root.createUniform(AccumulateParams);
3520
+ const accumulate$1 = createIrradiancePass(root, accumulateKernel, {
3521
+ res,
3522
+ bindGroup: root.createBindGroup(accumulateLayout, {
3523
+ sample: outTex,
3524
+ prev: prevTex,
3525
+ out: meanTex,
3526
+ params: accumU.buffer
3527
+ })
3528
+ });
3529
+ const keepMean = createIrradiancePass(root, copyKernel, {
3530
+ res,
3531
+ bindGroup: root.createBindGroup(copyLayout, {
3532
+ src: meanTex,
3533
+ out: prevTex
3534
+ })
3535
+ });
3536
+ let pass;
3537
+ let fieldVersion = () => 0;
3538
+ let silhouette$1 = null;
3539
+ if (vf) {
3540
+ const jfaA = mkTex();
3541
+ const jfaB = mkTex();
3542
+ const silU = root.createUniform(SilhouetteParams);
3543
+ const seedPass = createIrradiancePass(root, silhouetteSeedKernel, {
3544
+ res,
3545
+ bindGroup: root.createBindGroup(silhouetteSeedLayout, {
3546
+ params: silU.buffer,
3547
+ fieldTex: vf.fieldTexture,
3548
+ out: jfaA
3549
+ })
3550
+ });
3551
+ const stepAB = createIrradiancePass(root, silhouetteStepKernel, {
3552
+ res,
3553
+ bindGroup: root.createBindGroup(silhouetteStepLayout, {
3554
+ params: silU.buffer,
3555
+ src: jfaA,
3556
+ out: jfaB
3557
+ })
3558
+ });
3559
+ const stepBA = createIrradiancePass(root, silhouetteStepKernel, {
3560
+ res,
3561
+ bindGroup: root.createBindGroup(silhouetteStepLayout, {
3562
+ params: silU.buffer,
3563
+ src: jfaB,
3564
+ out: jfaA
3565
+ })
3566
+ });
3567
+ const jumps = [];
3568
+ for (let step = Math.ceil(res / 2); step >= 1; step = Math.floor(step / 2)) {
3569
+ jumps.push(step);
3570
+ if (step === 1) break;
3571
+ }
3572
+ const finalTex = jumps.length % 2 === 1 ? jfaB : jfaA;
3573
+ silhouette$1 = { steps: (domain) => {
3574
+ const nodes = [];
3575
+ const base = {
3576
+ vfOriginX: domain.originX,
3577
+ vfOriginY: domain.originY,
3578
+ vfSpanX: domain.spanX,
3579
+ vfSpanY: domain.spanY,
3580
+ vfActiveRes: domain.activeRes,
3581
+ vfRBound: domain.rBound,
3582
+ res
3583
+ };
3584
+ nodes.push(() => silU.write({
3585
+ ...base,
3586
+ step: 0
3587
+ }), seedPass);
3588
+ jumps.forEach((step, i) => {
3589
+ nodes.push(() => silU.write({
3590
+ ...base,
3591
+ step
3592
+ }), i % 2 === 0 ? stepAB : stepBA);
3593
+ });
3594
+ return nodes;
3595
+ } };
3596
+ const samp = root.createSampler({
3597
+ magFilter: "linear",
3598
+ minFilter: "linear",
3599
+ addressModeU: "clamp-to-edge",
3600
+ addressModeV: "clamp-to-edge"
3601
+ });
3602
+ pass = createIrradiancePass(root, buildIrradianceKernel(irradianceFieldLayout, volumetricField, kernelOpts), {
3603
+ res,
3604
+ bindGroup: root.createBindGroup(irradianceFieldLayout, {
3605
+ params: paramsU.buffer,
3606
+ outTex,
3607
+ silhouetteTex: finalTex,
3608
+ samp
3609
+ })
3610
+ });
3611
+ } else if (shapeSdfUrl) {
3612
+ const sdfTex = createSdfDataTexture(params, shapeSdfUrl);
3613
+ fieldVersion = () => sdfTex.getVersion();
3614
+ const samp = root.createSampler({
3615
+ magFilter: "linear",
3616
+ minFilter: "linear",
3617
+ addressModeU: "clamp-to-edge",
3618
+ addressModeV: "clamp-to-edge"
3619
+ });
3620
+ pass = createIrradiancePass(root, buildIrradianceKernel(irradianceSvgLayout, svgField, kernelOpts), {
3621
+ res,
3622
+ bindGroup: root.createBindGroup(irradianceSvgLayout, {
3623
+ params: paramsU.buffer,
3624
+ outTex,
3625
+ sdfSource: sdfTex.texture.texture,
3626
+ samp
3627
+ })
3628
+ });
3629
+ } else pass = createIrradiancePass(root, buildIrradianceKernel(irradianceAnalyticLayout, analyticField(shapeType), kernelOpts), {
3630
+ res,
3631
+ bindGroup: root.createBindGroup(irradianceAnalyticLayout, {
3632
+ params: paramsU.buffer,
3633
+ outTex
3634
+ })
3635
+ });
3636
+ let width = Math.max(1, params.dimensions.width);
3637
+ let height = Math.max(1, params.dimensions.height);
3638
+ onResize(({ width: w, height: h }) => {
3639
+ width = Math.max(1, w);
3640
+ height = Math.max(1, h);
3641
+ });
3642
+ const num$1 = (key, fallback) => {
3643
+ const v = getCpuValue(key);
3644
+ return typeof v === "number" ? v : fallback;
3645
+ };
3646
+ const pos = (key) => {
3647
+ const v = getCpuValue(key);
3648
+ return {
3649
+ x: typeof v?.x === "number" ? v.x : .5,
3650
+ y: typeof v?.y === "number" ? v.y : .5
3651
+ };
3652
+ };
3653
+ let lastKey = "";
3654
+ let silhouetteReady = false;
3655
+ let frame = 0;
3656
+ let warmup = WARMUP_FRAMES;
3657
+ let samples = 0;
3658
+ let changedLastFrame = false;
3659
+ return {
3660
+ outputs: {
3661
+ [outputKey]: outputTexture,
3662
+ ...vf?.outputs ?? {}
3663
+ },
3664
+ getComputeNodes: (frameParams) => {
3665
+ const pre = vf?.getComputeNodes(frameParams) ?? null;
3666
+ let silhouettePasses = [];
3667
+ if (silhouette$1 && (pre || !silhouetteReady)) {
3668
+ const dom$1 = vf.getFieldDomain();
3669
+ silhouettePasses = silhouette$1.steps(dom$1);
3670
+ silhouetteReady = true;
3671
+ }
3672
+ const center = pos("center");
3673
+ const scale = num$1("scale", 1);
3674
+ const rotation = num$1("rotation", 0);
3675
+ const lights = lightLanes(getCpuValue(spec.lights.prop), spec.lights, {
3676
+ center,
3677
+ scale,
3678
+ rotation,
3679
+ aspect: width / height
3680
+ });
3681
+ const sub$1 = analyticSubPropValues(parseShapeConfigValue(getCpuValue("shape")));
3682
+ const dom = vf?.getFieldDomain();
3683
+ const values = {
3684
+ center: [center.x, center.y],
3685
+ lightPos: lights.pos,
3686
+ lightColor: lights.color,
3687
+ lightCount: lights.count,
3688
+ scale,
3689
+ rotation,
3690
+ aspect: width / height,
3691
+ reach: num$1(spec.reach, 3),
3692
+ wrap: num$1(spec.wrap, 0),
3693
+ lightRange: num$1(spec.lightRange, 1),
3694
+ shadowSoftness: num$1(spec.shadowSoftness, 0),
3695
+ eps: 1 / res / Math.max(scale, .001),
3696
+ res,
3697
+ saRadius: sub$1.radius,
3698
+ saSides: sub$1.sides,
3699
+ saRounding: sub$1.rounding,
3700
+ saInnerRatio: sub$1.innerRatio,
3701
+ saRotation: sub$1.rotation,
3702
+ saHeight: sub$1.height,
3703
+ saOffset: sub$1.offset,
3704
+ saAperture: sub$1.aperture,
3705
+ vfOriginX: dom?.originX ?? 0,
3706
+ vfOriginY: dom?.originY ?? 0,
3707
+ vfSpanX: dom?.spanX ?? 1,
3708
+ vfSpanY: dom?.spanY ?? 1,
3709
+ vfActiveRes: dom?.activeRes ?? 1,
3710
+ vfRBound: dom?.rBound ?? .6,
3711
+ fieldVersion: fieldVersion()
3712
+ };
3713
+ const key = JSON.stringify(values);
3714
+ const warming = warmup > 0;
3715
+ if (warming) warmup--;
3716
+ const changed = key !== lastKey || Boolean(pre) || silhouettePasses.length > 0 || warming;
3717
+ let rays;
3718
+ if (changed) {
3719
+ lastKey = key;
3720
+ frame = 0;
3721
+ samples = 0;
3722
+ rays = changedLastFrame ? spec.rays.motion : spec.rays.burst;
3723
+ } else if (frame > spec.rays.refineFrames) {
3724
+ changedLastFrame = false;
3725
+ return null;
3726
+ } else rays = spec.rays.refine;
3727
+ changedLastFrame = changed;
3728
+ const sampleIndex = frame++;
3729
+ const weight = rays / (samples + rays);
3730
+ samples += rays;
3731
+ const nodes = pre ? [...pre, ...silhouettePasses] : [...silhouettePasses];
3732
+ nodes.push(() => {
3733
+ const { fieldVersion: _version,...abi } = values;
3734
+ paramsU.write({
3735
+ ...abi,
3736
+ frame: sampleIndex,
3737
+ rays,
3738
+ center: vec2f(values.center[0], values.center[1]),
3739
+ lightPos: values.lightPos.map((l) => vec4f(l[0], l[1], l[2], l[3])),
3740
+ lightColor: values.lightColor.map((l) => vec4f(l[0], l[1], l[2], l[3]))
3741
+ });
3742
+ accumU.write({ weight });
3743
+ });
3744
+ nodes.push(pass, accumulate$1, keepMean, ...denoise.computeSteps);
3745
+ return nodes;
3746
+ }
3747
+ };
3748
+ };
3749
+ const sample = (params) => {
3750
+ const tex = params.computeOutputs?.[outputKey];
3751
+ if (!tex) return void 0;
3752
+ const s = local(tex.sampleLevel(params.ctx.uv), "irrTex");
3753
+ return div(s.member("rgb"), max(s.member("a"), .001));
3754
+ };
3755
+ return {
3756
+ compute,
3757
+ sample
3758
+ };
3759
+ }
3760
+ var listCounter = 0;
3761
+ var raw = (name) => new Expr(() => name);
3762
+ function listOf(params, prop) {
3763
+ const lane = (field, i) => {
3764
+ const arr = params.uniforms[listFieldName(prop, field)];
3765
+ if (!arr) throw new Error(`std: list '${prop}' has no field '${field}'`);
3766
+ return new Expr((ctx) => `${arr._emit(ctx)}[${i._emit(ctx)}]`);
3767
+ };
3768
+ const count = params.uniforms[listCountName(prop)];
3769
+ if (!count) throw new Error(`std: '${prop}' is not a list prop`);
3770
+ return {
3771
+ count,
3772
+ at: (i) => ({
3773
+ position: (field) => lane(field, i).member("xy"),
3774
+ color: (field) => lane(field, i),
3775
+ number: (field) => lane(field, i).member("x")
3776
+ })
3777
+ };
3778
+ }
3779
+ function accumulate(list, body, opts = {}) {
3780
+ const id = listCounter++;
3781
+ const zero = opts.zero === "vec3f" ? "vec3f(0.0)" : "0.0";
3782
+ const hint = opts.hint ?? "sum";
3783
+ return new Expr((ctx) => ctx.memo(`accumulate:${id}`, () => {
3784
+ for (const dep of opts.deps ?? []) dep._emit(ctx);
3785
+ const acc = ctx.freshLocal(hint);
3786
+ const i = ctx.freshLocal("item");
3787
+ const countText = list.count._emit(ctx);
3788
+ const stmts = [];
3789
+ const term = body(raw(i))._emit({
3790
+ external: (v, h) => ctx.external(v, h),
3791
+ statement: (w) => stmts.push(w),
3792
+ freshLocal: (h) => ctx.freshLocal(h),
3793
+ memo: (k, f) => ctx.memo(k, f)
3794
+ });
3795
+ ctx.statement(`var ${acc} = ${zero};`);
3796
+ ctx.statement([
3797
+ `for (var ${i} = 0u; ${i} < u32(${countText}); ${i}++) {`,
3798
+ ...stmts.map((w) => ` ${w}`),
3799
+ ` ${acc} += ${term};`,
3800
+ `}`
3801
+ ].join("\n"));
3802
+ return acc;
3803
+ }));
3804
+ }
3805
+ var DEFAULT_SHAPE_CONFIG = JSON.stringify({
3806
+ type: "circleSDF",
3807
+ radius: .35
3808
+ });
3809
+ var DEFAULT_LIGHTS = [{
3810
+ position: {
3811
+ x: .3,
3812
+ y: .3
3813
+ },
3814
+ color: "#ffb347",
3815
+ intensity: 3
3816
+ }, {
3817
+ position: {
3818
+ x: .72,
3819
+ y: .7
3820
+ },
3821
+ color: "#7a5cff",
3822
+ intensity: 2
3823
+ }];
3824
+ var MAX_LIGHTS = 6;
3825
+ var RAYS = {
3826
+ burst: 128,
3827
+ motion: 64,
3828
+ refine: 32,
3829
+ refineFrames: 12
3830
+ };
3831
+ var MOBILE_RAY_DIVISOR = 2;
3832
+ var MARCH_STEPS = 32;
3833
+ var SHADOW_STEPS = 12;
3834
+ var FIELD_RES = 512;
3835
+ var FIELD_RES_MOBILE = 320;
3836
+ var CORE_WIDTH_PX = 2.5;
3837
+ var STENCIL_EPS = .01;
3838
+ var BODY_AMBIENT = .3;
3839
+ var GLINT_EXPONENT = 60;
3840
+ var GLINT_GAIN = .6;
3841
+ function gatherSettings(propValues) {
3842
+ const shadowsRaw = propValues.shadows;
3843
+ const shadows = typeof shadowsRaw === "number" ? shadowsRaw > 0 : shadowsRaw !== false;
3844
+ const mobile = isMobileGpuViewport();
3845
+ const div$1 = mobile ? MOBILE_RAY_DIVISOR : 1;
3846
+ return {
3847
+ rays: {
3848
+ burst: RAYS.burst / div$1,
3849
+ motion: RAYS.motion / div$1,
3850
+ refine: RAYS.refine / div$1,
3851
+ refineFrames: RAYS.refineFrames
3852
+ },
3853
+ shadowSteps: shadows ? SHADOW_STEPS : 0,
3854
+ resolution: mobile ? FIELD_RES_MOBILE : FIELD_RES
3855
+ };
3856
+ }
3857
+ var GATHER_PROPS = {
3858
+ lights: {
3859
+ prop: "lights",
3860
+ position: "position",
3861
+ color: "color",
3862
+ intensity: "intensity"
3863
+ },
3864
+ reach: "reach",
3865
+ wrap: "wrap",
3866
+ lightRange: "lightRange",
3867
+ shadowSoftness: "shadowSoftness",
3868
+ steps: MARCH_STEPS
3869
+ };
3870
+ var spine = shapedSurface({
3871
+ stencil: "centre",
3872
+ centreTap: "fast",
3873
+ surface: (frame, params) => {
3874
+ const { uniforms: u, propValues } = params;
3875
+ const { shadowSteps } = gatherSettings(propValues);
3876
+ const shadows = shadowSteps > 0;
3877
+ const field = surfaceField(frame, params);
3878
+ const stencilled = (hint) => ({
3879
+ ...field,
3880
+ s0: local(frame.sampler(frame.sdfUV), `${hint}S0`),
3881
+ sX: local(frame.gradSampler(add(frame.sdfUV, vec2(STENCIL_EPS, 0))), `${hint}X`),
3882
+ sY: local(frame.gradSampler(add(frame.sdfUV, vec2(0, STENCIL_EPS))), `${hint}Y`)
3883
+ });
3884
+ const px = local(div(field.pxH, max(u.scale, .001)), "pxUV");
3885
+ const far = continuedField(frame, field, params);
3886
+ const lights = listOf(params, "lights");
3887
+ const lightAt = (i) => {
3888
+ const item = lights.at(i);
3889
+ return {
3890
+ uv: placementPoint(params, item.position("position"), "lightUV"),
3891
+ rgb: mul(item.color("color").member("rgb"), item.number("intensity"))
3892
+ };
3893
+ };
3894
+ const irradiance = irradianceField({
3895
+ ...gatherSettings(propValues),
3896
+ ...GATHER_PROPS
3897
+ }).sample(params) ?? splat3(0);
3898
+ const rim = local(sub(1, smoothstep(0, mul(px, CORE_WIDTH_PX), far.sdf)), "rim");
3899
+ const rimLight = () => {
3900
+ const edge = nearestEdge(frame.sdfUV, far.sdf, add(fieldSlope(stencilled("rim"), STENCIL_EPS), far.outward));
3901
+ return accumulate(lights, (i) => {
3902
+ const light = lightAt(i);
3903
+ const onEdge = pointLightFrom({
3904
+ position: light.uv,
3905
+ height: u.lightHeight
3906
+ }, edge.point, "rimLight");
3907
+ let struck = mul(lambert(edge.normal, onEdge.toLight, { wrap: u.wrap }), inverseSquare(onEdge.distance, u.lightRange));
3908
+ if (shadows) struck = mul(struck, shadowVisibility({
3909
+ from: add(edge.point, mul(edge.normal, mul(px, 2))),
3910
+ toward: light.uv,
3911
+ field: far.at,
3912
+ steps: SHADOW_STEPS,
3913
+ surfaceEps: px,
3914
+ softness: u.shadowSoftness,
3915
+ hint: "rimVisibility"
3916
+ }));
3917
+ return mul(light.rgb, struck);
3918
+ }, {
3919
+ zero: "vec3f",
3920
+ hint: "rimSum",
3921
+ deps: [edge.point, edge.normal]
3922
+ });
3923
+ };
3924
+ const glow = emissiveAlpha(exposureTone(add(irradiance, guarded(gt(rim, 0), mul(rimLight(), mul(rim, u.core)), splat3(0), "emitter", [px]))), "glow");
3925
+ const shadeBody = () => {
3926
+ const n = geometricNormal(frame, stencilled("body"), {
3927
+ bevelWidth: u.bevelWidth,
3928
+ bevelShape: float(0),
3929
+ eps: STENCIL_EPS
3930
+ });
3931
+ const lit = accumulate(lights, (i) => {
3932
+ const light = lightAt(i);
3933
+ const onBody = pointLightFrom({
3934
+ position: light.uv,
3935
+ height: u.lightHeight
3936
+ }, frame.sdfUV, "bodyLight");
3937
+ const bodyLit = local(mul(inverseSquare(onBody.distance, u.lightRange), u.bodyLight), "bodyLit");
3938
+ const glint = mul(pow(max(dot(n, normalize(add(onBody.L, vec3(0, 0, -1)))), 0), GLINT_EXPONENT), GLINT_GAIN);
3939
+ return add(mul(u.bodyColor.member("rgb"), mul(lambert(n, onBody.L), bodyLit)), mul(light.rgb, mul(glint, bodyLit)));
3940
+ }, {
3941
+ zero: "vec3f",
3942
+ hint: "bodySum",
3943
+ deps: [n]
3944
+ });
3945
+ return exposureTone(add(mul(u.bodyColor.member("rgb"), BODY_AMBIENT), lit));
3946
+ };
3947
+ const body = guarded(insideShape(field.sdf, px), shadeBody(), splat3(0), "body", []);
3948
+ const cov = local(silhouette({
3949
+ ...field,
3950
+ pxH: px
3951
+ }, u.edgeSoftness), "cov");
3952
+ return vec4(mix(glow.member("rgb"), body, cov), mix(glow.member("a"), 1, cov));
3953
+ }
3954
+ });
3955
+ const componentDefinition = defineStd({
3956
+ name: "Irradiance",
3957
+ role: "shapeEffect",
3958
+ species: "custom",
3959
+ boundingBoxDeclaration: shapeEffectBoundingBoxDeclaration,
3960
+ category: "Shape Effects",
3961
+ description: "Photorealistic light spilling around the edge of any 2D, SVG, or 3D shape — any number of movable coloured point lights strike the silhouette and the lit edges irradiate their surroundings, gathered in a compute pass with real cast shadows, mixing where they meet and burning to white at the rim",
3962
+ props: {
3963
+ origin: {
3964
+ default: "center",
3965
+ description: "Reference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre.",
3966
+ ui: {
3967
+ type: "origin",
3968
+ label: "Origin",
3969
+ group: "Position"
3970
+ }
3971
+ },
3972
+ center: {
3973
+ default: {
3974
+ x: .5,
3975
+ y: .5
3976
+ },
3977
+ transform: transformPosition,
3978
+ description: "Center position of the shape",
3979
+ ui: {
3980
+ type: "position",
3981
+ label: "Center",
3982
+ group: "Position",
3983
+ units: ["%", "px"]
3984
+ }
3985
+ },
3986
+ scale: {
3987
+ default: 1,
3988
+ description: "Scale of the shape (1 = default size)",
3989
+ ui: {
3990
+ type: "range",
3991
+ min: .1,
3992
+ max: 3,
3993
+ step: .01,
3994
+ label: "Scale",
3995
+ group: "Position"
3996
+ }
3997
+ },
3998
+ rotation: {
3999
+ default: 0,
4000
+ description: "Rotation of the shape in degrees",
4001
+ ui: {
4002
+ type: "range",
4003
+ min: 0,
4004
+ max: 360,
4005
+ step: 1,
4006
+ label: "Rotation",
4007
+ group: "Position"
4008
+ }
4009
+ },
4010
+ lights: listPropConfig({
4011
+ maxItems: MAX_LIGHTS,
4012
+ minItems: 1,
4013
+ itemLabel: "Light",
4014
+ item: {
4015
+ position: {
4016
+ kind: "position",
4017
+ default: {
4018
+ x: .3,
4019
+ y: .3
4020
+ },
4021
+ label: "Position",
4022
+ description: "Where this light sits — the edges facing it are struck and spill light outward. Map it to the mouse to carry the light around the shape."
4023
+ },
4024
+ color: {
4025
+ kind: "color",
4026
+ default: "#ffb347",
4027
+ label: "Color",
4028
+ description: "The colour this light casts"
4029
+ },
4030
+ intensity: {
4031
+ kind: "number",
4032
+ default: 3,
4033
+ label: "Intensity",
4034
+ min: 0,
4035
+ max: 8,
4036
+ step: .01,
4037
+ description: "Brightness of this light — past ~2 the rim it strikes overexposes to white"
4038
+ }
4039
+ }
4040
+ }, {
4041
+ default: DEFAULT_LIGHTS,
4042
+ description: "The point lights striking the shape — each with its own position, colour and brightness",
4043
+ label: "Lights",
4044
+ group: "Lights"
4045
+ }),
4046
+ lightHeight: {
4047
+ default: .5,
4048
+ description: "Height of the lights above the shape plane, relative to the shape — low lights graze the body, high lights flood it evenly",
4049
+ ui: {
4050
+ type: ["range", "map"],
4051
+ min: .05,
4052
+ max: 3,
4053
+ step: .01,
4054
+ label: "Light Height",
4055
+ group: "Light"
4056
+ }
4057
+ },
4058
+ lightRange: {
4059
+ default: 1.2,
4060
+ description: "Reach of each light — the distance at which it has fallen to half strength, relative to the shape",
4061
+ ui: {
4062
+ type: ["range", "map"],
4063
+ min: .1,
4064
+ max: 4,
4065
+ step: .01,
4066
+ label: "Range",
4067
+ group: "Light"
4068
+ }
4069
+ },
4070
+ reach: {
4071
+ default: 3,
4072
+ description: "How far from the shape the spilled light is gathered, relative to the shape — the glow fades out toward this distance",
4073
+ ui: {
4074
+ type: ["range", "map"],
4075
+ min: .5,
4076
+ max: 8,
4077
+ step: .01,
4078
+ label: "Reach",
4079
+ group: "Glow"
4080
+ }
4081
+ },
4082
+ core: {
4083
+ default: 1,
4084
+ description: "The lit edge seen directly — the white-hot line along the rim where the lights strike",
4085
+ ui: {
4086
+ type: ["range", "map"],
4087
+ min: 0,
4088
+ max: 2,
4089
+ step: .01,
4090
+ label: "Core",
4091
+ group: "Glow"
4092
+ }
4093
+ },
4094
+ wrap: {
4095
+ default: .1,
4096
+ description: "How far light wraps around edges that face away from it — 0 leaves the far side dark",
4097
+ ui: {
4098
+ type: ["range", "map"],
4099
+ min: 0,
4100
+ max: 1,
4101
+ step: .01,
4102
+ label: "Wrap",
4103
+ group: "Glow"
4104
+ }
4105
+ },
4106
+ shadows: {
4107
+ default: true,
4108
+ compileTime: true,
4109
+ transform: transformBoolean,
4110
+ description: "Cast shadows — the body blocks each light from edges it stands in front of (keeps holes and concave pockets dark)",
4111
+ ui: {
4112
+ type: "checkbox",
4113
+ label: "Shadows",
4114
+ group: "Glow"
4115
+ }
4116
+ },
4117
+ shadowSoftness: {
4118
+ default: .15,
4119
+ description: "Penumbra width of the cast shadows — 0 is razor sharp",
4120
+ ui: {
4121
+ type: ["range", "map"],
4122
+ min: 0,
4123
+ max: 1,
4124
+ step: .01,
4125
+ label: "Shadow Softness",
4126
+ group: "Glow"
4127
+ }
4128
+ },
4129
+ bodyColor: {
4130
+ default: "#000000",
4131
+ transform: transformColor,
4132
+ description: "Color of the shape itself — black for a pure occluder, lighter to see the lights land on its form",
4133
+ ui: {
4134
+ type: "color",
4135
+ label: "Body Color",
4136
+ group: "Body"
4137
+ }
4138
+ },
4139
+ bodyLight: {
4140
+ default: .6,
4141
+ description: "How much the lights illuminate the body — the bevel of a flat shape or the form of a 3D one",
4142
+ ui: {
4143
+ type: ["range", "map"],
4144
+ min: 0,
4145
+ max: 2,
4146
+ step: .01,
4147
+ label: "Body Light",
4148
+ group: "Body"
4149
+ }
4150
+ },
4151
+ bevelWidth: {
4152
+ default: .01,
4153
+ description: "Width of the rounded edge a flat shape catches the light on, relative to the shape",
4154
+ ui: {
4155
+ type: ["range", "map"],
4156
+ min: .005,
4157
+ max: .2,
4158
+ step: .001,
4159
+ label: "Bevel Width",
4160
+ group: "Body"
4161
+ }
4162
+ },
4163
+ ...glassShellProps({ edgeSoftness: { ui: { group: "Body" } } }),
4164
+ shape: {
4165
+ default: DEFAULT_SHAPE_CONFIG,
4166
+ description: "Serialized shape configuration (JSON)",
4167
+ ui: {
4168
+ type: "shape",
4169
+ label: "Shape",
4170
+ group: "Shape"
4171
+ }
4172
+ },
4173
+ shapeSdfUrl: {
4174
+ default: "",
4175
+ compileTime: true,
4176
+ description: "URL to a pre-generated SDF .bin file"
4177
+ },
4178
+ shapeType: {
4179
+ default: "",
4180
+ compileTime: true,
4181
+ description: "Active SDF shape type"
4182
+ }
4183
+ },
4184
+ ...spine,
4185
+ compute: (params) => irradianceField({
4186
+ ...gatherSettings(params.propValues),
4187
+ ...GATHER_PROPS
4188
+ }).compute(params)
4189
+ });
4190
+ var Irradiance_default = componentDefinition;
4191
+ export { componentDefinition as n, Irradiance_default as t };