shaders 3.0.447 → 3.0.449
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -2
- package/dist/core/{AngularBlur-xU811GPM.js → AngularBlur-DU1WmNHt.js} +15 -15
- package/dist/core/{Arc-DYvFxtGy.js → Arc-C8QmYsiZ.js} +13 -12
- package/dist/core/{Ascii-ChE4BP7J.js → Ascii-BaQ6MZTc.js} +51 -53
- package/dist/core/{Aurora-BThE6pbb.js → Aurora-B6lOg6M4.js} +63 -68
- package/dist/core/{BarShift-DdjkPSk3.js → BarShift-CFK-CzF9.js} +31 -32
- package/dist/core/{BarnDoors-B_kxVuec.js → BarnDoors-DWs_0xtH.js} +21 -22
- package/dist/core/{Beam-C7zPHuIU.js → Beam-Cgc4EYnj.js} +32 -39
- package/dist/core/{Bend-CFcEjifF.js → Bend-oof5pE1H.js} +27 -28
- package/dist/core/{Blob-CgUolAhz.js → Blob-cfvDCv0i.js} +54 -60
- package/dist/core/{BlockDissolve-CLSxXB4e.js → BlockDissolve-C7yJzYGZ.js} +21 -20
- package/dist/core/{BlockNoise-BgEJOicU.js → BlockNoise-DaM9YDAH.js} +16 -14
- package/dist/core/{BlueNoise-BqMtBLxM.js → BlueNoise-BMMRTsMw.js} +12 -10
- package/dist/core/{Blur-Xaa6jVPT.js → Blur-Be7sX4v9.js} +27 -27
- package/dist/core/{Boids-B8QUNxRL.js → Boids-C9S69THK.js} +151 -149
- package/dist/core/{BokehBlur-B5fql96U.js → BokehBlur-DSkKZ_yy.js} +104 -104
- package/dist/core/{BrickPattern-EAD5HD4e.js → BrickPattern-BY7h4hyx.js} +34 -38
- package/dist/core/{BrightnessContrast-mbv32DkA.js → BrightnessContrast-DFc0gSUv.js} +9 -10
- package/dist/core/{BrushedMetal-B10fDdGt.js → BrushedMetal-B06tUygH.js} +81 -84
- package/dist/core/{Bulge-C1Pq4DHk.js → Bulge-BpSOQfH0.js} +19 -19
- package/dist/core/{CRTScreen-Ctx0Mxtb.js → CRTScreen-DdGcEvk2.js} +35 -37
- package/dist/core/{CarbonFiber-DSSARe6R.js → CarbonFiber-Dy7Osb3V.js} +81 -84
- package/dist/core/{Chalkboard-C7srb54u.js → Chalkboard-wRYj23wL.js} +59 -61
- package/dist/core/{ChannelBlur-DE3T4-pj.js → ChannelBlur-DKD9GUpc.js} +13 -15
- package/dist/core/{CheckerWipe-Dp49-iaT.js → CheckerWipe-D0WmsSKg.js} +23 -23
- package/dist/core/{Checkerboard-oVWtS0rz.js → Checkerboard-2sQYJks9.js} +31 -31
- package/dist/core/{Chevron-CCD5JTRA.js → Chevron-D3oPw2-i.js} +20 -20
- package/dist/core/{ChromaFlow-BiE9Mes0.js → ChromaFlow-px9KG_h6.js} +32 -33
- package/dist/core/{ChromaticAberration-XEasUrD3.js → ChromaticAberration-DLFROPJV.js} +13 -13
- package/dist/core/{Circle-CvQ9duDU.js → Circle-0CqIPN3a.js} +14 -13
- package/dist/core/{ColorWheel-CXvfWAjN.js → ColorWheel-CMtn8slz.js} +30 -34
- package/dist/core/{CompressionArtifacts-BDaP7XI6.js → CompressionArtifacts-D7dpVg47.js} +64 -66
- package/dist/core/{ConcentricSpin-D06hFXEb.js → ConcentricSpin-BPk-_egF.js} +39 -41
- package/dist/core/{ConicGradient-Cg6vy3gl.js → ConicGradient-B-tEhmfR.js} +17 -18
- package/dist/core/{ContourLines-Cg2Dlmcr.js → ContourLines-BlgCWFSy.js} +29 -30
- package/dist/core/{CornerPin-wtqiMUCa.js → CornerPin-DB3G2i_y.js} +55 -57
- package/dist/core/{Crescent-Co__JqEE.js → Crescent-CFzPQKll.js} +14 -13
- package/dist/core/{Cross-CFytbdrZ.js → Cross-Cstl9nDg.js} +14 -13
- package/dist/core/{Crystal-U7VqhbHy.js → Crystal-CEeqF1Xa.js} +143 -152
- package/dist/core/{CurlNoise-BXWYh1Qi.js → CurlNoise-uvTKk4Wa.js} +16 -14
- package/dist/core/{CursorRipples-APbH7SVR.js → CursorRipples-B46VApbY.js} +59 -58
- package/dist/core/{CursorTrail-D5Fj0wGp.js → CursorTrail-DzYRTzzA.js} +72 -71
- package/dist/core/{DataMosh-CWRLpjU3.js → DataMosh-Ysev5-c_.js} +71 -73
- package/dist/core/{DiamondGradient-C_2VoEiQ.js → DiamondGradient-pTOwPuAl.js} +23 -25
- package/dist/core/{DiamondWipe-BkdNODD1.js → DiamondWipe-D6u1P2xH.js} +22 -22
- package/dist/core/{DiffuseBlur-Dl7S4KBW.js → DiffuseBlur-BX0cfwyh.js} +11 -12
- package/dist/core/{DisplacementMap-lv-qoLem.js → DisplacementMap-DMNivtcV.js} +26 -26
- package/dist/core/{Dither-B33J_gJU.js → Dither-Cxu-hSc_.js} +116 -119
- package/dist/core/{DotGrid-DaOhiRaL.js → DotGrid-CbNHebie.js} +37 -39
- package/dist/core/{DropShadow-C5Z2Rs2C.js → DropShadow-DFyuEA17.js} +37 -37
- package/dist/core/{Duotone-x4cywJbU.js → Duotone-CgueO-jZ.js} +7 -7
- package/dist/core/{Ellipse-CrQ1XYjx.js → Ellipse-DxRnSw__.js} +13 -12
- package/dist/core/{Emboss-DNwO5JcE.js → Emboss-BJxzjZmZ.js} +76 -78
- package/dist/core/{Engraving-FsaRQiyI.js → Engraving-DmQCj8vU.js} +57 -59
- package/dist/core/{ErosionNoise-CloHpdFT.js → ErosionNoise-7ekcAfBb.js} +13 -11
- package/dist/core/{Exposure-mO6KjYvc.js → Exposure-avEereLn.js} +4 -5
- package/dist/core/{FallingLines-D_1wHUkx.js → FallingLines-BINyHi3N.js} +40 -42
- package/dist/core/{FilmGrain-DDhrsw94.js → FilmGrain-B-pZBxiK.js} +17 -18
- package/dist/core/{FilmStock-BaP2aTLu.js → FilmStock-BJfso8f3.js} +74 -74
- package/dist/core/{Flip-DYuqyJva.js → Flip-Dbwe0zh8.js} +10 -12
- package/dist/core/{FloatingParticles-DJwNpHtZ.js → FloatingParticles-CoQ01il5.js} +97 -94
- package/dist/core/{FlowField-D4iGiDic.js → FlowField-CU6S3Jar.js} +24 -23
- package/dist/core/{Flower-D0MqoayS.js → Flower-R7HIopNH.js} +14 -13
- package/dist/core/{FlowingGradient-9Zu0Pu4a.js → FlowingGradient-D66Y9Wgq.js} +38 -39
- package/dist/core/{FlutedGlass-C_clmShu.js → FlutedGlass-WAaeW92l.js} +43 -43
- package/dist/core/{Fog-C_kY5pWB.js → Fog-BChoF6fi.js} +172 -171
- package/dist/core/{Form3D-D4aXZGoJ.js → Form3D-DajWNpAi.js} +259 -267
- package/dist/core/{FractalNoise-mMVLGmIv.js → FractalNoise-DIrQ3eQj.js} +30 -28
- package/dist/core/{Frost-M53tZlcf.js → Frost-B_3JSI2H.js} +70 -73
- package/dist/core/{GaborNoise-BhXywN1d.js → GaborNoise-4FWeA9yr.js} +16 -14
- package/dist/core/{Glass-B9D_52op.js → Glass-wOhmSf3v.js} +6 -4
- package/dist/core/{GlassTiles-DIkGYgVE.js → GlassTiles-DgdAiEuy.js} +23 -26
- package/dist/core/{Glitch-CUOJt5VX.js → Glitch-BOiywFUR.js} +60 -65
- package/dist/core/{Glow-D5AdnLvU.js → Glow-C2cEWdNE.js} +76 -77
- package/dist/core/{Godrays-BeQCWVw7.js → Godrays-DAZB2GSn.js} +52 -56
- package/dist/core/{Goo-C0_0QYne.js → Goo-B_WAqWYW.js} +64 -65
- package/dist/core/{GradientMap-DOVK05_a.js → GradientMap-DxsOInED.js} +47 -50
- package/dist/core/{Grayscale-Uv_6LYA9.js → Grayscale-DSHs9mZd.js} +6 -6
- package/dist/core/{Grid-Dbp4DoXZ.js → Grid-aO3wzf4X.js} +46 -48
- package/dist/core/{GridDistortion-D_21zIrm.js → GridDistortion-DsHsHda7.js} +63 -62
- package/dist/core/{Group-DXiB5Qrx.js → Group-CCcDbysC.js} +1 -1
- package/dist/core/{HTMLInCanvas-xXPLTYIv.js → HTMLInCanvas-B2OooKKr.js} +1 -1
- package/dist/core/{Halftone-DszIQsyx.js → Halftone-3a3rz4ln.js} +59 -62
- package/dist/core/{Heart-COpnSJPD.js → Heart-CzO0_GoB.js} +12 -11
- package/dist/core/{Heatmap-CMm8SD-P.js → Heatmap-DPtUc8YG.js} +57 -55
- package/dist/core/{HexGrid-B6wNW-45.js → HexGrid-CN5A0m5j.js} +32 -35
- package/dist/core/{Hologram-XejRN51V.js → Hologram-DoKRhChe.js} +62 -66
- package/dist/core/{Holographic-D1G_Ou1y.js → Holographic-BWyW5z_h.js} +58 -61
- package/dist/core/{HueShift-BCDgYfJs.js → HueShift-C0p8EGk-.js} +7 -10
- package/dist/core/{ImageTexture-BE2Jlkg6.js → ImageTexture-BnwkbXAW.js} +3 -2
- package/dist/core/{InkFlow-DJaJqula.js → InkFlow-BH86usRX.js} +156 -156
- package/dist/core/{Invert-DDmITZjt.js → Invert-BIjy9ddK.js} +4 -4
- package/dist/core/{IrisWipe-BFs5DDSa.js → IrisWipe-lpU7lucQ.js} +20 -23
- package/dist/core/{IsometricCubes-ChKqYTIw.js → IsometricCubes-CIieztxI.js} +37 -42
- package/dist/core/{Kaleidoscope-C8_-tC6T.js → Kaleidoscope-CUMvqmfN.js} +21 -21
- package/dist/core/{KeyFrames-xR9ZzHKj.js → KeyFrames-mI1J02zX.js} +130 -129
- package/dist/core/{LensFlare-DHGNEDIX.js → LensFlare-ChQK_hJN.js} +82 -84
- package/dist/core/{LightEdge-DYfhB3-7.js → LightEdge-Rg-zMpGb.js} +106 -107
- package/dist/core/{LightLeak-CYjuMURe.js → LightLeak-D1CxVo9A.js} +58 -59
- package/dist/core/{LinearBlur-CV7gKYHV.js → LinearBlur-DJBkHfs8.js} +14 -14
- package/dist/core/{LinearGradient-DAzw65UB.js → LinearGradient-DCRYBS4Q.js} +36 -37
- package/dist/core/{LinearWipe-DoDZF7y0.js → LinearWipe-Cxfs1tIO.js} +20 -21
- package/dist/core/{LiquidMetal-C9OxRyE4.js → LiquidMetal-oscNnbsr.js} +70 -73
- package/dist/core/{Liquify-gNsuR7aA.js → Liquify-CJwl6Wef.js} +67 -66
- package/dist/core/{MagneticFilings-CQ7zHEow.js → MagneticFilings-DAOFLjAQ.js} +125 -125
- package/dist/core/{Marble-BSSMSrv8.js → Marble-Cr4Iaq38.js} +22 -21
- package/dist/core/{Mirror-BZAUA2jk.js → Mirror-BwOuv3TP.js} +18 -18
- package/dist/core/{MultiPointGradient-HSfAYB-u.js → MultiPointGradient-CSowH0-7.js} +30 -31
- package/dist/core/{Neon-D9d6Osal.js → Neon-CPIvbGSB.js} +102 -113
- package/dist/core/{NoiseDissolve-CnELvUG_.js → NoiseDissolve-ByahROgQ.js} +23 -22
- package/dist/core/{ObjectTracker-COh35yTh.js → ObjectTracker-DMCr6kHz.js} +3 -3
- package/dist/core/{PagePeel-B6sjmvZ1.js → PagePeel-Coq0hc8R.js} +54 -58
- package/dist/core/{Paper-LfukraJk.js → Paper-CLlhc3fn.js} +16 -15
- package/dist/core/{Parallelogram-DBi0yAG3.js → Parallelogram-Be8RQBV7.js} +14 -13
- package/dist/core/{ParticleField-q7COY9YT.js → ParticleField-DDO-Tk9X.js} +154 -150
- package/dist/core/{ParticleFlow-DiHWbIon.js → ParticleFlow-B89PWVem.js} +210 -208
- package/dist/core/{Particles-BFsKUAPx.js → Particles-D8rP46SB.js} +207 -209
- package/dist/core/{PerlinNoise-KV2GG0ts.js → PerlinNoise-_whB3Y3m.js} +16 -14
- package/dist/core/{Perspective-CJSrtEy5.js → Perspective-BJuQWHOr.js} +23 -25
- package/dist/core/{PixelSort-WD-Y6ZFu.js → PixelSort-CJfXD6g0.js} +109 -109
- package/dist/core/{PixelThrow-CnOXm7Hv.js → PixelThrow-BaTI5PzH.js} +35 -35
- package/dist/core/{Pixelate-XJI9f1oT.js → Pixelate-D7Dto_8I.js} +19 -19
- package/dist/core/{Plasma-C0dnSaw1.js → Plasma-DWIDcCnn.js} +33 -32
- package/dist/core/{Plastic-DBv_6A7q.js → Plastic-CWAOd2i9.js} +82 -84
- package/dist/core/{PolarCoordinates-B8Cq2bzT.js → PolarCoordinates-DQM3dLK3.js} +16 -18
- package/dist/core/{Polygon-ORM35JKg.js → Polygon-CFmLohBu.js} +16 -17
- package/dist/core/{Posterize-Dn-Vv2S1.js → Posterize-B8PHXwhy.js} +5 -8
- package/dist/core/{Prism-CYLsGJHY.js → Prism-C5VS4TLU.js} +36 -40
- package/dist/core/{ProgressiveBlur-BXUumCm5.js → ProgressiveBlur-BcGcteLH.js} +63 -65
- package/dist/core/{RadialGradient-j6T56q1W.js → RadialGradient-D3UoKiGu.js} +22 -23
- package/dist/core/{RadialWipe-Bz19qvls.js → RadialWipe-DXfAH0Ug.js} +25 -25
- package/dist/core/{RandomBars-3RlhwDYG.js → RandomBars-BVsp1Q7v.js} +23 -23
- package/dist/core/{ReactionDiffusion-DdXavIVw.js → ReactionDiffusion-DknxOF-o.js} +173 -175
- package/dist/core/{RectangularCoordinates-p3250IKV.js → RectangularCoordinates-DFQm4y6H.js} +14 -14
- package/dist/core/{ReflectivePlane-BOl9AEoO.js → ReflectivePlane-BDlGBzo1.js} +35 -37
- package/dist/core/{Repeater-BMXmN95R.js → Repeater-DHW6eDAm.js} +2 -2
- package/dist/core/{Ring-DKcROHDs.js → Ring-3brC5en8.js} +15 -14
- package/dist/core/{RippleWipe-QH8D0Y-2.js → RippleWipe-DQfXGjRv.js} +24 -27
- package/dist/core/{Ripples-8fFdo6aq.js → Ripples-DajR3Cl5.js} +18 -21
- package/dist/core/{RoundedRect-Cr76tP9o.js → RoundedRect-CfkYNmkV.js} +14 -13
- package/dist/core/{Saturation-Dqifs1x7.js → Saturation-BPTssGSs.js} +8 -9
- package/dist/core/{Scratches-sa8JU4Eb.js → Scratches-A-AyASZm.js} +16 -14
- package/dist/core/{Sharpness-IRuPd9nn.js → Sharpness-Di39DpCB.js} +21 -22
- package/dist/core/{Shatter-BYaxMvyd.js → Shatter-CWf3HtjN.js} +73 -72
- package/dist/core/{SimplexNoise-C2vmRzgy.js → SimplexNoise-DpZ2jtdk.js} +19 -17
- package/dist/core/{SineWave-BGAJyGFr.js → SineWave-CZuksvHn.js} +20 -20
- package/dist/core/{SliceWipe-BOcCk5Se.js → SliceWipe-BwL2D3HR.js} +19 -19
- package/dist/core/{Smoke-B1twbhQ4.js → Smoke-BsUkbTI1.js} +156 -155
- package/dist/core/{SmokeFill-CAayneM2.js → SmokeFill-CaDMgNW-.js} +233 -231
- package/dist/core/{SmokeFlow-Ug8difAz.js → SmokeFlow-CLfsAbPS.js} +143 -142
- package/dist/core/{Solarize-205KKROH.js → Solarize-ALjXXAf0.js} +12 -14
- package/dist/core/{SolidColor-B4pj8onb.js → SolidColor-Cu_9b_my.js} +1 -1
- package/dist/core/{Spherize-DUQxwwCL.js → Spherize-SBfCc9Wk.js} +31 -37
- package/dist/core/{Spiral-DY1c-N4F.js → Spiral-iRrT222n.js} +36 -36
- package/dist/core/{Star-DRxNaHHo.js → Star-DL3d_HqY.js} +14 -13
- package/dist/core/{Stone-CUdcvOWd.js → Stone-OTsCM-rr.js} +2 -2
- package/dist/core/{Strands-CFxYJMFu.js → Strands-DjoQgGnd.js} +47 -49
- package/dist/core/{Stretch-DYrVdt8A.js → Stretch-CdzhxnbM.js} +19 -19
- package/dist/core/{Stripes-BvnoWdwn.js → Stripes-CsBgKYdp.js} +39 -39
- package/dist/core/{StudioBackground-srQGUpfZ.js → StudioBackground-D8EdrLg5.js} +67 -68
- package/dist/core/{SunBurst-COsVDZ4e.js → SunBurst-ErBFL-nF.js} +18 -20
- package/dist/core/{Surface3D-TsGPzdGm.js → Surface3D-CLjX61TZ.js} +144 -144
- package/dist/core/{Swirl-nXMWVY2X.js → Swirl-DDQif_lC.js} +18 -21
- package/dist/core/{Teardrop-Bjtkigk4.js → Teardrop-CvpdElTs.js} +13 -12
- package/dist/core/{Text-BGdsqRl5.js → Text-vyzeMvhl.js} +20 -21
- package/dist/core/{ThinFilm-DhMKI5e2.js → ThinFilm-CbkMTbD2.js} +59 -67
- package/dist/core/{TiltShift-BwuYyXB6.js → TiltShift-BVMyB8lF.js} +66 -67
- package/dist/core/{TimeTrail-CE2XumxR.js → TimeTrail-CuFGvzFi.js} +91 -94
- package/dist/core/{Tint-BTmcGjEl.js → Tint-C6zMMsYH.js} +25 -26
- package/dist/core/{Trapezoid-CiZCh8QS.js → Trapezoid-kFuxWONU.js} +14 -13
- package/dist/core/{TriangularGrid-BnQOEljy.js → TriangularGrid-FIrpI_qE.js} +34 -36
- package/dist/core/{Tritone-Ta084wlF.js → Tritone-DyLGtOug.js} +7 -10
- package/dist/core/{Truchet-BxCh_IIp.js → Truchet-B4NI56Zz.js} +31 -33
- package/dist/core/{Twirl-Cw4jm59Q.js → Twirl-CuzhWXfj.js} +16 -16
- package/dist/core/{VHS-Nwk0E-tf.js → VHS-DYbzndAZ.js} +68 -69
- package/dist/core/{VenetianBlinds-BZ0sS97G.js → VenetianBlinds-DVopy3xp.js} +22 -23
- package/dist/core/{Vesica-Cf1KiSzK.js → Vesica-Cd-XyG3F.js} +13 -12
- package/dist/core/{Vibrance-qWGvLkrW.js → Vibrance-CvXatkfO.js} +7 -8
- package/dist/core/{VideoTexture-48ylVDvN.js → VideoTexture-C5PS6Vly.js} +34 -39
- package/dist/core/{Vignette-CK_Li7v2.js → Vignette-DtBpWWxW.js} +20 -22
- package/dist/core/{Voronoi-DMYFDwIS.js → Voronoi-CRH2cGlR.js} +33 -37
- package/dist/core/{Water-D74wbHmn.js → Water-CneenzRZ.js} +101 -108
- package/dist/core/{Watercolor-zo8-4Vqx.js → Watercolor-B343pgM-.js} +63 -64
- package/dist/core/{WaveDistortion-BLrvGOzF.js → WaveDistortion-DHz1FxLT.js} +80 -82
- package/dist/core/{WaveletNoise-a5OpO8-D.js → WaveletNoise-CsLE9gbM.js} +16 -14
- package/dist/core/{Weave-D1D3kuUg.js → Weave-CQEF71nr.js} +28 -31
- package/dist/core/{WebcamTexture-pBETyQYG.js → WebcamTexture-BcsYFM_g.js} +7 -7
- package/dist/core/{Wool-CMnWPdy9.js → Wool-BFSicimy.js} +2 -2
- package/dist/core/{WorleyNoise-BAEo0duh.js → WorleyNoise-BKq3es5v.js} +69 -70
- package/dist/core/{ZoomBlur-CnBNmcfx.js → ZoomBlur-Bu1SlmS2.js} +12 -12
- package/dist/core/agents-Bv3--qPL.js +997 -0
- package/dist/core/blur-tvWOoxKt.js +2247 -0
- package/dist/core/compute-BjeJ0sIA.js +31 -0
- package/dist/core/dataEncoding-CEmpiitu.js +24 -0
- package/dist/core/device-BODv_4aH.js +10 -0
- package/dist/core/edges-BXNBKxSN.js +29857 -0
- package/dist/core/{glass-sOqjtPJD.js → glass-IfoQ8Prf.js} +164 -172
- package/dist/core/gpu/index.d.ts.map +1 -1
- package/dist/core/index.js +320 -229
- package/dist/core/media-B9BNeMPu.js +757 -0
- package/dist/core/noise-wTSHXgFz.js +12033 -0
- package/dist/core/noiseColor-CPakiKNF.js +103 -0
- package/dist/core/{noiseColor-CRpf22bk.js → noiseColor-DscZM9CO.js} +2 -2
- package/dist/core/noiseStylize-BXpflWPW.js +359 -0
- package/dist/core/porters-DBK1Aipq.js +991 -0
- package/dist/core/presetRenderer.d.ts.map +1 -1
- package/dist/core/registry.js +208 -199
- package/dist/core/sdf-R0EN3EvS.js +5174 -0
- package/dist/core/shaderRegistry-CcvE7wN0.js +425 -0
- package/dist/core/shaders/AngularBlur/index.js +5 -4
- package/dist/core/shaders/Arc/index.js +7 -4
- package/dist/core/shaders/Ascii/index.js +5 -4
- package/dist/core/shaders/Aurora/index.js +6 -4
- package/dist/core/shaders/BarShift/index.js +5 -4
- package/dist/core/shaders/BarnDoors/index.js +5 -4
- package/dist/core/shaders/Beam/index.js +5 -4
- package/dist/core/shaders/Bend/index.js +5 -4
- package/dist/core/shaders/Blob/index.js +5 -4
- package/dist/core/shaders/BlockDissolve/index.js +6 -4
- package/dist/core/shaders/BlockNoise/index.js +8 -5
- package/dist/core/shaders/BlueNoise/index.js +8 -5
- package/dist/core/shaders/Blur/index.js +6 -4
- package/dist/core/shaders/Boids/index.js +7 -4
- package/dist/core/shaders/BokehBlur/index.js +6 -4
- package/dist/core/shaders/BrickPattern/index.js +5 -4
- package/dist/core/shaders/BrightnessContrast/index.js +5 -4
- package/dist/core/shaders/BrushedMetal/index.js +11 -6
- package/dist/core/shaders/Bulge/index.js +5 -4
- package/dist/core/shaders/CRTScreen/index.js +5 -4
- package/dist/core/shaders/CarbonFiber/index.js +11 -6
- package/dist/core/shaders/Chalkboard/index.js +5 -4
- package/dist/core/shaders/ChannelBlur/index.js +6 -4
- package/dist/core/shaders/CheckerWipe/index.js +5 -4
- package/dist/core/shaders/Checkerboard/index.js +5 -4
- package/dist/core/shaders/Chevron/index.js +5 -4
- package/dist/core/shaders/ChromaFlow/index.js +6 -4
- package/dist/core/shaders/ChromaticAberration/index.js +5 -4
- package/dist/core/shaders/Circle/index.js +7 -4
- package/dist/core/shaders/ColorWheel/index.js +5 -4
- package/dist/core/shaders/CompressionArtifacts/index.js +5 -4
- package/dist/core/shaders/ConcentricSpin/index.js +5 -4
- package/dist/core/shaders/ConicGradient/index.js +5 -4
- package/dist/core/shaders/ContourLines/index.js +5 -4
- package/dist/core/shaders/CornerPin/index.js +5 -4
- package/dist/core/shaders/Crescent/index.js +7 -4
- package/dist/core/shaders/Cross/index.js +7 -4
- package/dist/core/shaders/Crystal/index.js +11 -6
- package/dist/core/shaders/CurlNoise/index.js +8 -5
- package/dist/core/shaders/CursorRipples/index.js +5 -4
- package/dist/core/shaders/CursorTrail/index.js +5 -4
- package/dist/core/shaders/DataMosh/index.js +5 -4
- package/dist/core/shaders/DiamondGradient/index.js +5 -4
- package/dist/core/shaders/DiamondWipe/index.js +5 -4
- package/dist/core/shaders/DiffuseBlur/index.js +5 -4
- package/dist/core/shaders/DisplacementMap/index.js +5 -4
- package/dist/core/shaders/Dither/index.js +5 -4
- package/dist/core/shaders/DotGrid/index.js +5 -4
- package/dist/core/shaders/DropShadow/index.js +5 -4
- package/dist/core/shaders/Duotone/index.js +5 -4
- package/dist/core/shaders/Ellipse/index.js +7 -4
- package/dist/core/shaders/Emboss/index.js +10 -6
- package/dist/core/shaders/Engraving/index.js +6 -4
- package/dist/core/shaders/ErosionNoise/index.js +8 -5
- package/dist/core/shaders/Exposure/index.js +5 -4
- package/dist/core/shaders/FallingLines/index.js +5 -4
- package/dist/core/shaders/FilmGrain/index.js +5 -4
- package/dist/core/shaders/FilmStock/index.js +6 -4
- package/dist/core/shaders/Flip/index.js +5 -4
- package/dist/core/shaders/FloatingParticles/index.js +7 -4
- package/dist/core/shaders/FlowField/index.js +6 -4
- package/dist/core/shaders/Flower/index.js +7 -4
- package/dist/core/shaders/FlowingGradient/index.js +6 -4
- package/dist/core/shaders/FlutedGlass/index.js +5 -4
- package/dist/core/shaders/Fog/index.js +5 -4
- package/dist/core/shaders/Form3D/index.js +5 -4
- package/dist/core/shaders/FractalNoise/index.js +7 -4
- package/dist/core/shaders/Frost/index.js +11 -6
- package/dist/core/shaders/GaborNoise/index.js +8 -5
- package/dist/core/shaders/Glass/index.js +11 -6
- package/dist/core/shaders/GlassTiles/index.js +5 -4
- package/dist/core/shaders/Glitch/index.js +5 -4
- package/dist/core/shaders/Glow/index.js +6 -4
- package/dist/core/shaders/Godrays/index.js +5 -4
- package/dist/core/shaders/Goo/index.js +10 -6
- package/dist/core/shaders/GradientMap/index.js +5 -4
- package/dist/core/shaders/Grayscale/index.js +5 -4
- package/dist/core/shaders/Grid/index.js +5 -4
- package/dist/core/shaders/GridDistortion/index.js +5 -4
- package/dist/core/shaders/Group/index.js +5 -4
- package/dist/core/shaders/HTMLInCanvas/index.js +5 -4
- package/dist/core/shaders/Halftone/index.js +5 -4
- package/dist/core/shaders/Heart/index.js +7 -4
- package/dist/core/shaders/Heatmap/index.js +11 -6
- package/dist/core/shaders/HexGrid/index.js +5 -4
- package/dist/core/shaders/Hologram/index.js +11 -6
- package/dist/core/shaders/Holographic/index.js +11 -6
- package/dist/core/shaders/HueShift/index.js +5 -4
- package/dist/core/shaders/ImageTexture/index.js +7 -5
- package/dist/core/shaders/InkFlow/index.js +5 -4
- package/dist/core/shaders/Invert/index.js +5 -4
- package/dist/core/shaders/IrisWipe/index.js +5 -4
- package/dist/core/shaders/IsometricCubes/index.js +5 -4
- package/dist/core/shaders/Kaleidoscope/index.js +5 -4
- package/dist/core/shaders/KeyFrames/index.js +5 -4
- package/dist/core/shaders/LensFlare/index.js +5 -4
- package/dist/core/shaders/LightEdge/index.js +11 -6
- package/dist/core/shaders/LightLeak/index.js +6 -4
- package/dist/core/shaders/LinearBlur/index.js +5 -4
- package/dist/core/shaders/LinearGradient/index.js +5 -4
- package/dist/core/shaders/LinearWipe/index.js +5 -4
- package/dist/core/shaders/LiquidMetal/index.js +11 -6
- package/dist/core/shaders/Liquify/index.js +5 -4
- package/dist/core/shaders/MagneticFilings/index.js +7 -4
- package/dist/core/shaders/Marble/index.js +6 -4
- package/dist/core/shaders/Mirror/index.js +5 -4
- package/dist/core/shaders/MultiPointGradient/index.js +5 -4
- package/dist/core/shaders/Neon/index.js +9 -5
- package/dist/core/shaders/NoiseDissolve/index.js +6 -4
- package/dist/core/shaders/ObjectTracker/index.js +6 -5
- package/dist/core/shaders/PagePeel/index.js +5 -4
- package/dist/core/shaders/Paper/index.js +6 -4
- package/dist/core/shaders/Parallelogram/index.js +7 -4
- package/dist/core/shaders/ParticleField/index.js +8 -4
- package/dist/core/shaders/ParticleFlow/index.js +7 -4
- package/dist/core/shaders/Particles/index.js +11 -5
- package/dist/core/shaders/PerlinNoise/index.js +8 -5
- package/dist/core/shaders/Perspective/index.js +5 -4
- package/dist/core/shaders/PixelSort/index.js +5 -4
- package/dist/core/shaders/PixelThrow/index.js +6 -4
- package/dist/core/shaders/Pixelate/index.js +5 -4
- package/dist/core/shaders/Plasma/index.js +6 -4
- package/dist/core/shaders/Plastic/index.js +11 -6
- package/dist/core/shaders/PolarCoordinates/index.js +5 -4
- package/dist/core/shaders/Polygon/index.js +7 -4
- package/dist/core/shaders/Posterize/index.js +5 -4
- package/dist/core/shaders/Prism/index.js +5 -4
- package/dist/core/shaders/ProgressiveBlur/index.js +6 -4
- package/dist/core/shaders/RadialGradient/index.js +5 -4
- package/dist/core/shaders/RadialWipe/index.js +5 -4
- package/dist/core/shaders/RandomBars/index.js +6 -4
- package/dist/core/shaders/ReactionDiffusion/index.js +5 -4
- package/dist/core/shaders/RectangularCoordinates/index.js +5 -4
- package/dist/core/shaders/ReflectivePlane/index.js +6 -4
- package/dist/core/shaders/Repeater/index.js +5 -4
- package/dist/core/shaders/Ring/index.js +7 -4
- package/dist/core/shaders/RippleWipe/index.js +5 -4
- package/dist/core/shaders/Ripples/index.js +5 -4
- package/dist/core/shaders/RoundedRect/index.js +7 -4
- package/dist/core/shaders/Saturation/index.js +5 -4
- package/dist/core/shaders/Scratches/index.js +8 -5
- package/dist/core/shaders/Sharpness/index.js +5 -4
- package/dist/core/shaders/Shatter/index.js +6 -4
- package/dist/core/shaders/SimplexNoise/index.js +7 -4
- package/dist/core/shaders/SineWave/index.js +5 -4
- package/dist/core/shaders/SliceWipe/index.js +5 -4
- package/dist/core/shaders/Smoke/index.js +5 -4
- package/dist/core/shaders/SmokeFill/index.js +10 -6
- package/dist/core/shaders/SmokeFlow/index.js +5 -4
- package/dist/core/shaders/Solarize/index.js +5 -4
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +5 -4
- package/dist/core/shaders/Spiral/index.js +5 -4
- package/dist/core/shaders/Star/index.js +7 -4
- package/dist/core/shaders/Stone/index.js +4 -3
- package/dist/core/shaders/Strands/index.js +5 -4
- package/dist/core/shaders/Stretch/index.js +5 -4
- package/dist/core/shaders/Stripes/index.js +5 -4
- package/dist/core/shaders/StudioBackground/index.js +5 -4
- package/dist/core/shaders/SunBurst/index.js +5 -4
- package/dist/core/shaders/Surface3D/index.js +6 -4
- package/dist/core/shaders/Swirl/index.js +5 -4
- package/dist/core/shaders/Teardrop/index.js +7 -4
- package/dist/core/shaders/Text/index.js +6 -5
- package/dist/core/shaders/ThinFilm/index.js +9 -5
- package/dist/core/shaders/TiltShift/index.js +6 -4
- package/dist/core/shaders/TimeTrail/index.js +5 -4
- package/dist/core/shaders/Tint/index.js +5 -4
- package/dist/core/shaders/Trapezoid/index.js +7 -4
- package/dist/core/shaders/TriangularGrid/index.js +5 -4
- package/dist/core/shaders/Tritone/index.js +5 -4
- package/dist/core/shaders/Truchet/index.js +5 -4
- package/dist/core/shaders/Twirl/index.js +5 -4
- package/dist/core/shaders/VHS/index.js +5 -4
- package/dist/core/shaders/VenetianBlinds/index.js +5 -4
- package/dist/core/shaders/Vesica/index.js +7 -4
- package/dist/core/shaders/Vibrance/index.js +5 -4
- package/dist/core/shaders/VideoTexture/index.js +6 -5
- package/dist/core/shaders/Vignette/index.js +5 -4
- package/dist/core/shaders/Voronoi/index.js +5 -4
- package/dist/core/shaders/Water/index.js +11 -6
- package/dist/core/shaders/Watercolor/index.js +5 -4
- package/dist/core/shaders/WaveDistortion/index.js +5 -4
- package/dist/core/shaders/WaveletNoise/index.js +8 -5
- package/dist/core/shaders/Weave/index.js +5 -4
- package/dist/core/shaders/WebcamTexture/index.js +7 -5
- package/dist/core/shaders/Wool/index.js +4 -3
- package/dist/core/shaders/WorleyNoise/index.js +5 -4
- package/dist/core/shaders/ZoomBlur/index.js +5 -4
- package/dist/core/shapeEffectBounds-CtKwBX8c.js +19213 -0
- package/dist/core/utilities/transformations/index.js +1 -1
- package/dist/js/bundle.js +188 -184
- package/dist/js/createShader.js +1 -1
- package/dist/react/Shader.js +1 -1
- package/dist/react/bundle.js +197 -193
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/svelte/index.js +1 -1
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/package.json +1 -1
- package/dist/core/coords-BkIjixe_.js +0 -55724
- package/dist/core/noiseStylize-J6sFKoTh.js +0 -65
- package/dist/core/porters-BmU6G9TR.js +0 -321
- package/dist/core/shaderRegistry-D75z2sND.js +0 -425
- package/dist/core/shapeEffectBounds-PQqKLQXO.js +0 -406
- /package/dist/core/{fonts-DwhbVe2B.js → fonts-v_F1SFl9.js} +0 -0
- /package/dist/core/{naturalSize-Caz3-kRv.js → naturalSize-B679wTgN.js} +0 -0
- /package/dist/core/{transformations-t0d2-uSX.js → transformations-CsPUHppB.js} +0 -0
|
@@ -0,0 +1,5174 @@
|
|
|
1
|
+
import { $t as vec2f, Ct as floor, Dt as min, Et as max, Ft as sign, It as sin, Lt as smoothstep, Ot as mix, Rt as sqrt, Vt as data_exports, Xt as struct, _ as floatE, _t as clamp, an as f32, cn as __export, et as src_default, gt as atan2, in as vec4f, mt as abs, nt as std_exports, p as call, pt as select, vt as cos } from "./edges-BXNBKxSN.js";
|
|
2
|
+
import { r as debugWarn } from "./support-6QRFK3xB.js";
|
|
3
|
+
import { t as toHalfFloat } from "./dataEncoding-CEmpiitu.js";
|
|
4
|
+
var sdf_exports = /* @__PURE__ */ __export({
|
|
5
|
+
ANALYTIC_SDF_EXTRA_FIELDS: () => ANALYTIC_SDF_EXTRA_FIELDS,
|
|
6
|
+
SVG_SDF_SIZE: () => 512,
|
|
7
|
+
ShapeMask: () => ShapeMask,
|
|
8
|
+
arcSdf: () => arcSdf,
|
|
9
|
+
buildAnalyticSdfFn: () => buildAnalyticSdfFn,
|
|
10
|
+
circleSdf: () => circleSdf,
|
|
11
|
+
createAnalyticSdfSampler: () => createAnalyticSdfSampler,
|
|
12
|
+
createSdfDataTexture: () => createSdfDataTexture,
|
|
13
|
+
createSvgSdfSampler: () => createSvgSdfSampler,
|
|
14
|
+
createSvgSdfSamplerWithGradients: () => createSvgSdfSamplerWithGradients,
|
|
15
|
+
crescentSdf: () => crescentSdf,
|
|
16
|
+
crossSdf: () => crossSdf,
|
|
17
|
+
driveAnalyticSubProps: () => driveAnalyticSubProps,
|
|
18
|
+
ellipseSdf: () => ellipseSdf,
|
|
19
|
+
flowerSdf: () => flowerSdf,
|
|
20
|
+
heartSdf: () => heartSdf,
|
|
21
|
+
loadSdfFromUrl: () => loadSdfFromUrl,
|
|
22
|
+
parallelogramSdf: () => parallelogramSdf,
|
|
23
|
+
polygonSdf: () => polygonSdf,
|
|
24
|
+
ringSdf: () => ringSdf,
|
|
25
|
+
roundedRectSdf: () => roundedRectSdf,
|
|
26
|
+
shapeLocalCoords: () => shapeLocalCoords,
|
|
27
|
+
starSdf: () => starSdf,
|
|
28
|
+
strokeMaskFromSdf: () => strokeMaskFromSdf,
|
|
29
|
+
teardropSdf: () => teardropSdf,
|
|
30
|
+
trapezoidSdf: () => trapezoidSdf,
|
|
31
|
+
vesicaSdf: () => vesicaSdf
|
|
32
|
+
});
|
|
33
|
+
const SVG_SDF_SIZE = 512;
|
|
34
|
+
var PI = 3.141592653589793;
|
|
35
|
+
var TWO_PI = 6.283185307179586;
|
|
36
|
+
var SQRT2_OVER_4 = .35355339059327373;
|
|
37
|
+
var DEG_TO_RAD = .017453292519943295;
|
|
38
|
+
const circleSdf = src_default.fn([
|
|
39
|
+
f32,
|
|
40
|
+
f32,
|
|
41
|
+
f32
|
|
42
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radius) => {
|
|
43
|
+
"use gpu";
|
|
44
|
+
return __tsover_sub(sqrt(__tsover_add(__tsover_mul(dx, dx), __tsover_mul(dy, dy))), radius);
|
|
45
|
+
}), {
|
|
46
|
+
v: 1,
|
|
47
|
+
name: void 0,
|
|
48
|
+
ast: {
|
|
49
|
+
"params": [
|
|
50
|
+
{
|
|
51
|
+
"type": "i",
|
|
52
|
+
"name": "dx"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "i",
|
|
56
|
+
"name": "dy"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "i",
|
|
60
|
+
"name": "radius"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"body": [0, [[10, [
|
|
64
|
+
1,
|
|
65
|
+
[
|
|
66
|
+
6,
|
|
67
|
+
[
|
|
68
|
+
7,
|
|
69
|
+
"std",
|
|
70
|
+
"sqrt"
|
|
71
|
+
],
|
|
72
|
+
[[
|
|
73
|
+
1,
|
|
74
|
+
[
|
|
75
|
+
1,
|
|
76
|
+
"dx",
|
|
77
|
+
"*",
|
|
78
|
+
"dx"
|
|
79
|
+
],
|
|
80
|
+
"+",
|
|
81
|
+
[
|
|
82
|
+
1,
|
|
83
|
+
"dy",
|
|
84
|
+
"*",
|
|
85
|
+
"dy"
|
|
86
|
+
]
|
|
87
|
+
]]
|
|
88
|
+
],
|
|
89
|
+
"-",
|
|
90
|
+
"radius"
|
|
91
|
+
]]]],
|
|
92
|
+
"externalNames": ["std"]
|
|
93
|
+
},
|
|
94
|
+
externals: () => ({ std: std_exports })
|
|
95
|
+
}) && $.f)({}));
|
|
96
|
+
const polygonSdf = src_default.fn([
|
|
97
|
+
f32,
|
|
98
|
+
f32,
|
|
99
|
+
f32,
|
|
100
|
+
f32
|
|
101
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radius, sides) => {
|
|
102
|
+
"use gpu";
|
|
103
|
+
const len = sqrt(__tsover_add(__tsover_mul(dx, dx), __tsover_mul(dy, dy)));
|
|
104
|
+
const angle = atan2(dy, dx);
|
|
105
|
+
const sectorAngle = __tsover_div(TWO_PI, sides);
|
|
106
|
+
const sectorIdx = floor(__tsover_add(__tsover_div(angle, sectorAngle), .5));
|
|
107
|
+
const canonicalAngle = __tsover_sub(angle, __tsover_mul(sectorIdx, sectorAngle));
|
|
108
|
+
return __tsover_sub(__tsover_mul(len, cos(canonicalAngle)), radius);
|
|
109
|
+
}), {
|
|
110
|
+
v: 1,
|
|
111
|
+
name: void 0,
|
|
112
|
+
ast: {
|
|
113
|
+
"params": [
|
|
114
|
+
{
|
|
115
|
+
"type": "i",
|
|
116
|
+
"name": "dx"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "i",
|
|
120
|
+
"name": "dy"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "i",
|
|
124
|
+
"name": "radius"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"type": "i",
|
|
128
|
+
"name": "sides"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"body": [0, [
|
|
132
|
+
[
|
|
133
|
+
13,
|
|
134
|
+
"len",
|
|
135
|
+
[
|
|
136
|
+
6,
|
|
137
|
+
[
|
|
138
|
+
7,
|
|
139
|
+
"std",
|
|
140
|
+
"sqrt"
|
|
141
|
+
],
|
|
142
|
+
[[
|
|
143
|
+
1,
|
|
144
|
+
[
|
|
145
|
+
1,
|
|
146
|
+
"dx",
|
|
147
|
+
"*",
|
|
148
|
+
"dx"
|
|
149
|
+
],
|
|
150
|
+
"+",
|
|
151
|
+
[
|
|
152
|
+
1,
|
|
153
|
+
"dy",
|
|
154
|
+
"*",
|
|
155
|
+
"dy"
|
|
156
|
+
]
|
|
157
|
+
]]
|
|
158
|
+
]
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
13,
|
|
162
|
+
"angle",
|
|
163
|
+
[
|
|
164
|
+
6,
|
|
165
|
+
[
|
|
166
|
+
7,
|
|
167
|
+
"std",
|
|
168
|
+
"atan2"
|
|
169
|
+
],
|
|
170
|
+
["dy", "dx"]
|
|
171
|
+
]
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
13,
|
|
175
|
+
"sectorAngle",
|
|
176
|
+
[
|
|
177
|
+
1,
|
|
178
|
+
"TWO_PI",
|
|
179
|
+
"/",
|
|
180
|
+
"sides"
|
|
181
|
+
]
|
|
182
|
+
],
|
|
183
|
+
[
|
|
184
|
+
13,
|
|
185
|
+
"sectorIdx",
|
|
186
|
+
[
|
|
187
|
+
6,
|
|
188
|
+
[
|
|
189
|
+
7,
|
|
190
|
+
"std",
|
|
191
|
+
"floor"
|
|
192
|
+
],
|
|
193
|
+
[[
|
|
194
|
+
1,
|
|
195
|
+
[
|
|
196
|
+
1,
|
|
197
|
+
"angle",
|
|
198
|
+
"/",
|
|
199
|
+
"sectorAngle"
|
|
200
|
+
],
|
|
201
|
+
"+",
|
|
202
|
+
[5, "0.5"]
|
|
203
|
+
]]
|
|
204
|
+
]
|
|
205
|
+
],
|
|
206
|
+
[
|
|
207
|
+
13,
|
|
208
|
+
"canonicalAngle",
|
|
209
|
+
[
|
|
210
|
+
1,
|
|
211
|
+
"angle",
|
|
212
|
+
"-",
|
|
213
|
+
[
|
|
214
|
+
1,
|
|
215
|
+
"sectorIdx",
|
|
216
|
+
"*",
|
|
217
|
+
"sectorAngle"
|
|
218
|
+
]
|
|
219
|
+
]
|
|
220
|
+
],
|
|
221
|
+
[10, [
|
|
222
|
+
1,
|
|
223
|
+
[
|
|
224
|
+
1,
|
|
225
|
+
"len",
|
|
226
|
+
"*",
|
|
227
|
+
[
|
|
228
|
+
6,
|
|
229
|
+
[
|
|
230
|
+
7,
|
|
231
|
+
"std",
|
|
232
|
+
"cos"
|
|
233
|
+
],
|
|
234
|
+
["canonicalAngle"]
|
|
235
|
+
]
|
|
236
|
+
],
|
|
237
|
+
"-",
|
|
238
|
+
"radius"
|
|
239
|
+
]]
|
|
240
|
+
]],
|
|
241
|
+
"externalNames": ["std", "TWO_PI"]
|
|
242
|
+
},
|
|
243
|
+
externals: () => ({
|
|
244
|
+
std: std_exports,
|
|
245
|
+
TWO_PI
|
|
246
|
+
})
|
|
247
|
+
}) && $.f)({}));
|
|
248
|
+
const flowerSdf = src_default.fn([
|
|
249
|
+
f32,
|
|
250
|
+
f32,
|
|
251
|
+
f32,
|
|
252
|
+
f32,
|
|
253
|
+
f32
|
|
254
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, outerRadius, sides, innerRatio) => {
|
|
255
|
+
"use gpu";
|
|
256
|
+
const angle = atan2(dy, dx);
|
|
257
|
+
const len = sqrt(__tsover_add(__tsover_mul(dx, dx), __tsover_mul(dy, dy)));
|
|
258
|
+
const innerRadius = __tsover_mul(outerRadius, innerRatio);
|
|
259
|
+
const tAngle = __tsover_div(__tsover_mul(angle, sides), TWO_PI);
|
|
260
|
+
const tFrac = __tsover_sub(tAngle, floor(tAngle));
|
|
261
|
+
const t = abs(__tsover_sub(__tsover_mul(tFrac, 2), 1));
|
|
262
|
+
const boundaryR = __tsover_add(innerRadius, __tsover_mul(__tsover_sub(outerRadius, innerRadius), t));
|
|
263
|
+
return __tsover_sub(len, boundaryR);
|
|
264
|
+
}), {
|
|
265
|
+
v: 1,
|
|
266
|
+
name: void 0,
|
|
267
|
+
ast: {
|
|
268
|
+
"params": [
|
|
269
|
+
{
|
|
270
|
+
"type": "i",
|
|
271
|
+
"name": "dx"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"type": "i",
|
|
275
|
+
"name": "dy"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"type": "i",
|
|
279
|
+
"name": "outerRadius"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"type": "i",
|
|
283
|
+
"name": "sides"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"type": "i",
|
|
287
|
+
"name": "innerRatio"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"body": [0, [
|
|
291
|
+
[
|
|
292
|
+
13,
|
|
293
|
+
"angle",
|
|
294
|
+
[
|
|
295
|
+
6,
|
|
296
|
+
[
|
|
297
|
+
7,
|
|
298
|
+
"std",
|
|
299
|
+
"atan2"
|
|
300
|
+
],
|
|
301
|
+
["dy", "dx"]
|
|
302
|
+
]
|
|
303
|
+
],
|
|
304
|
+
[
|
|
305
|
+
13,
|
|
306
|
+
"len",
|
|
307
|
+
[
|
|
308
|
+
6,
|
|
309
|
+
[
|
|
310
|
+
7,
|
|
311
|
+
"std",
|
|
312
|
+
"sqrt"
|
|
313
|
+
],
|
|
314
|
+
[[
|
|
315
|
+
1,
|
|
316
|
+
[
|
|
317
|
+
1,
|
|
318
|
+
"dx",
|
|
319
|
+
"*",
|
|
320
|
+
"dx"
|
|
321
|
+
],
|
|
322
|
+
"+",
|
|
323
|
+
[
|
|
324
|
+
1,
|
|
325
|
+
"dy",
|
|
326
|
+
"*",
|
|
327
|
+
"dy"
|
|
328
|
+
]
|
|
329
|
+
]]
|
|
330
|
+
]
|
|
331
|
+
],
|
|
332
|
+
[
|
|
333
|
+
13,
|
|
334
|
+
"innerRadius",
|
|
335
|
+
[
|
|
336
|
+
1,
|
|
337
|
+
"outerRadius",
|
|
338
|
+
"*",
|
|
339
|
+
"innerRatio"
|
|
340
|
+
]
|
|
341
|
+
],
|
|
342
|
+
[
|
|
343
|
+
13,
|
|
344
|
+
"tAngle",
|
|
345
|
+
[
|
|
346
|
+
1,
|
|
347
|
+
[
|
|
348
|
+
1,
|
|
349
|
+
"angle",
|
|
350
|
+
"*",
|
|
351
|
+
"sides"
|
|
352
|
+
],
|
|
353
|
+
"/",
|
|
354
|
+
"TWO_PI"
|
|
355
|
+
]
|
|
356
|
+
],
|
|
357
|
+
[
|
|
358
|
+
13,
|
|
359
|
+
"tFrac",
|
|
360
|
+
[
|
|
361
|
+
1,
|
|
362
|
+
"tAngle",
|
|
363
|
+
"-",
|
|
364
|
+
[
|
|
365
|
+
6,
|
|
366
|
+
[
|
|
367
|
+
7,
|
|
368
|
+
"std",
|
|
369
|
+
"floor"
|
|
370
|
+
],
|
|
371
|
+
["tAngle"]
|
|
372
|
+
]
|
|
373
|
+
]
|
|
374
|
+
],
|
|
375
|
+
[
|
|
376
|
+
13,
|
|
377
|
+
"t",
|
|
378
|
+
[
|
|
379
|
+
6,
|
|
380
|
+
[
|
|
381
|
+
7,
|
|
382
|
+
"std",
|
|
383
|
+
"abs"
|
|
384
|
+
],
|
|
385
|
+
[[
|
|
386
|
+
1,
|
|
387
|
+
[
|
|
388
|
+
1,
|
|
389
|
+
"tFrac",
|
|
390
|
+
"*",
|
|
391
|
+
[5, "2"]
|
|
392
|
+
],
|
|
393
|
+
"-",
|
|
394
|
+
[5, "1"]
|
|
395
|
+
]]
|
|
396
|
+
]
|
|
397
|
+
],
|
|
398
|
+
[
|
|
399
|
+
13,
|
|
400
|
+
"boundaryR",
|
|
401
|
+
[
|
|
402
|
+
1,
|
|
403
|
+
"innerRadius",
|
|
404
|
+
"+",
|
|
405
|
+
[
|
|
406
|
+
1,
|
|
407
|
+
[
|
|
408
|
+
1,
|
|
409
|
+
"outerRadius",
|
|
410
|
+
"-",
|
|
411
|
+
"innerRadius"
|
|
412
|
+
],
|
|
413
|
+
"*",
|
|
414
|
+
"t"
|
|
415
|
+
]
|
|
416
|
+
]
|
|
417
|
+
],
|
|
418
|
+
[10, [
|
|
419
|
+
1,
|
|
420
|
+
"len",
|
|
421
|
+
"-",
|
|
422
|
+
"boundaryR"
|
|
423
|
+
]]
|
|
424
|
+
]],
|
|
425
|
+
"externalNames": ["std", "TWO_PI"]
|
|
426
|
+
},
|
|
427
|
+
externals: () => ({
|
|
428
|
+
std: std_exports,
|
|
429
|
+
TWO_PI
|
|
430
|
+
})
|
|
431
|
+
}) && $.f)({}));
|
|
432
|
+
const starSdf = src_default.fn([
|
|
433
|
+
f32,
|
|
434
|
+
f32,
|
|
435
|
+
f32,
|
|
436
|
+
f32,
|
|
437
|
+
f32
|
|
438
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, outerRadius, sides, innerRatio) => {
|
|
439
|
+
"use gpu";
|
|
440
|
+
const innerRadius = __tsover_mul(outerRadius, innerRatio);
|
|
441
|
+
const len = sqrt(__tsover_add(__tsover_mul(dx, dx), __tsover_mul(dy, dy)));
|
|
442
|
+
const angle = atan2(dy, dx);
|
|
443
|
+
const sectorAngle = __tsover_div(TWO_PI, sides);
|
|
444
|
+
const sectorIdx = floor(__tsover_add(__tsover_div(angle, sectorAngle), .5));
|
|
445
|
+
const bn = __tsover_sub(angle, __tsover_mul(sectorIdx, sectorAngle));
|
|
446
|
+
const fpx = abs(__tsover_mul(len, sin(bn)));
|
|
447
|
+
const fpy = __tsover_mul(len, cos(bn));
|
|
448
|
+
const an = __tsover_div(PI, sides);
|
|
449
|
+
const sinAn = sin(an);
|
|
450
|
+
const cosAn = cos(an);
|
|
451
|
+
const ex = __tsover_mul(innerRadius, sinAn);
|
|
452
|
+
const ey = __tsover_sub(__tsover_mul(innerRadius, cosAn), outerRadius);
|
|
453
|
+
const qx = fpx;
|
|
454
|
+
const qy = __tsover_sub(fpy, outerRadius);
|
|
455
|
+
const dotQE = __tsover_add(__tsover_mul(qx, ex), __tsover_mul(qy, ey));
|
|
456
|
+
const dotEE = __tsover_add(__tsover_mul(ex, ex), __tsover_mul(ey, ey));
|
|
457
|
+
const t = clamp(__tsover_div(dotQE, dotEE), 0, 1);
|
|
458
|
+
const nx = __tsover_sub(fpx, __tsover_mul(ex, t));
|
|
459
|
+
const ny = __tsover_sub(fpy, __tsover_add(outerRadius, __tsover_mul(ey, t)));
|
|
460
|
+
const dist = sqrt(__tsover_add(__tsover_mul(nx, nx), __tsover_mul(ny, ny)));
|
|
461
|
+
const cross = __tsover_sub(__tsover_mul(ex, qy), __tsover_mul(ey, qx));
|
|
462
|
+
return __tsover_mul(dist, sign(cross));
|
|
463
|
+
}), {
|
|
464
|
+
v: 1,
|
|
465
|
+
name: void 0,
|
|
466
|
+
ast: {
|
|
467
|
+
"params": [
|
|
468
|
+
{
|
|
469
|
+
"type": "i",
|
|
470
|
+
"name": "dx"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"type": "i",
|
|
474
|
+
"name": "dy"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"type": "i",
|
|
478
|
+
"name": "outerRadius"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"type": "i",
|
|
482
|
+
"name": "sides"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"type": "i",
|
|
486
|
+
"name": "innerRatio"
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
"body": [0, [
|
|
490
|
+
[
|
|
491
|
+
13,
|
|
492
|
+
"innerRadius",
|
|
493
|
+
[
|
|
494
|
+
1,
|
|
495
|
+
"outerRadius",
|
|
496
|
+
"*",
|
|
497
|
+
"innerRatio"
|
|
498
|
+
]
|
|
499
|
+
],
|
|
500
|
+
[
|
|
501
|
+
13,
|
|
502
|
+
"len",
|
|
503
|
+
[
|
|
504
|
+
6,
|
|
505
|
+
[
|
|
506
|
+
7,
|
|
507
|
+
"std",
|
|
508
|
+
"sqrt"
|
|
509
|
+
],
|
|
510
|
+
[[
|
|
511
|
+
1,
|
|
512
|
+
[
|
|
513
|
+
1,
|
|
514
|
+
"dx",
|
|
515
|
+
"*",
|
|
516
|
+
"dx"
|
|
517
|
+
],
|
|
518
|
+
"+",
|
|
519
|
+
[
|
|
520
|
+
1,
|
|
521
|
+
"dy",
|
|
522
|
+
"*",
|
|
523
|
+
"dy"
|
|
524
|
+
]
|
|
525
|
+
]]
|
|
526
|
+
]
|
|
527
|
+
],
|
|
528
|
+
[
|
|
529
|
+
13,
|
|
530
|
+
"angle",
|
|
531
|
+
[
|
|
532
|
+
6,
|
|
533
|
+
[
|
|
534
|
+
7,
|
|
535
|
+
"std",
|
|
536
|
+
"atan2"
|
|
537
|
+
],
|
|
538
|
+
["dy", "dx"]
|
|
539
|
+
]
|
|
540
|
+
],
|
|
541
|
+
[
|
|
542
|
+
13,
|
|
543
|
+
"sectorAngle",
|
|
544
|
+
[
|
|
545
|
+
1,
|
|
546
|
+
"TWO_PI",
|
|
547
|
+
"/",
|
|
548
|
+
"sides"
|
|
549
|
+
]
|
|
550
|
+
],
|
|
551
|
+
[
|
|
552
|
+
13,
|
|
553
|
+
"sectorIdx",
|
|
554
|
+
[
|
|
555
|
+
6,
|
|
556
|
+
[
|
|
557
|
+
7,
|
|
558
|
+
"std",
|
|
559
|
+
"floor"
|
|
560
|
+
],
|
|
561
|
+
[[
|
|
562
|
+
1,
|
|
563
|
+
[
|
|
564
|
+
1,
|
|
565
|
+
"angle",
|
|
566
|
+
"/",
|
|
567
|
+
"sectorAngle"
|
|
568
|
+
],
|
|
569
|
+
"+",
|
|
570
|
+
[5, "0.5"]
|
|
571
|
+
]]
|
|
572
|
+
]
|
|
573
|
+
],
|
|
574
|
+
[
|
|
575
|
+
13,
|
|
576
|
+
"bn",
|
|
577
|
+
[
|
|
578
|
+
1,
|
|
579
|
+
"angle",
|
|
580
|
+
"-",
|
|
581
|
+
[
|
|
582
|
+
1,
|
|
583
|
+
"sectorIdx",
|
|
584
|
+
"*",
|
|
585
|
+
"sectorAngle"
|
|
586
|
+
]
|
|
587
|
+
]
|
|
588
|
+
],
|
|
589
|
+
[
|
|
590
|
+
13,
|
|
591
|
+
"fpx",
|
|
592
|
+
[
|
|
593
|
+
6,
|
|
594
|
+
[
|
|
595
|
+
7,
|
|
596
|
+
"std",
|
|
597
|
+
"abs"
|
|
598
|
+
],
|
|
599
|
+
[[
|
|
600
|
+
1,
|
|
601
|
+
"len",
|
|
602
|
+
"*",
|
|
603
|
+
[
|
|
604
|
+
6,
|
|
605
|
+
[
|
|
606
|
+
7,
|
|
607
|
+
"std",
|
|
608
|
+
"sin"
|
|
609
|
+
],
|
|
610
|
+
["bn"]
|
|
611
|
+
]
|
|
612
|
+
]]
|
|
613
|
+
]
|
|
614
|
+
],
|
|
615
|
+
[
|
|
616
|
+
13,
|
|
617
|
+
"fpy",
|
|
618
|
+
[
|
|
619
|
+
1,
|
|
620
|
+
"len",
|
|
621
|
+
"*",
|
|
622
|
+
[
|
|
623
|
+
6,
|
|
624
|
+
[
|
|
625
|
+
7,
|
|
626
|
+
"std",
|
|
627
|
+
"cos"
|
|
628
|
+
],
|
|
629
|
+
["bn"]
|
|
630
|
+
]
|
|
631
|
+
]
|
|
632
|
+
],
|
|
633
|
+
[
|
|
634
|
+
13,
|
|
635
|
+
"an",
|
|
636
|
+
[
|
|
637
|
+
1,
|
|
638
|
+
"PI",
|
|
639
|
+
"/",
|
|
640
|
+
"sides"
|
|
641
|
+
]
|
|
642
|
+
],
|
|
643
|
+
[
|
|
644
|
+
13,
|
|
645
|
+
"sinAn",
|
|
646
|
+
[
|
|
647
|
+
6,
|
|
648
|
+
[
|
|
649
|
+
7,
|
|
650
|
+
"std",
|
|
651
|
+
"sin"
|
|
652
|
+
],
|
|
653
|
+
["an"]
|
|
654
|
+
]
|
|
655
|
+
],
|
|
656
|
+
[
|
|
657
|
+
13,
|
|
658
|
+
"cosAn",
|
|
659
|
+
[
|
|
660
|
+
6,
|
|
661
|
+
[
|
|
662
|
+
7,
|
|
663
|
+
"std",
|
|
664
|
+
"cos"
|
|
665
|
+
],
|
|
666
|
+
["an"]
|
|
667
|
+
]
|
|
668
|
+
],
|
|
669
|
+
[
|
|
670
|
+
13,
|
|
671
|
+
"ex",
|
|
672
|
+
[
|
|
673
|
+
1,
|
|
674
|
+
"innerRadius",
|
|
675
|
+
"*",
|
|
676
|
+
"sinAn"
|
|
677
|
+
]
|
|
678
|
+
],
|
|
679
|
+
[
|
|
680
|
+
13,
|
|
681
|
+
"ey",
|
|
682
|
+
[
|
|
683
|
+
1,
|
|
684
|
+
[
|
|
685
|
+
1,
|
|
686
|
+
"innerRadius",
|
|
687
|
+
"*",
|
|
688
|
+
"cosAn"
|
|
689
|
+
],
|
|
690
|
+
"-",
|
|
691
|
+
"outerRadius"
|
|
692
|
+
]
|
|
693
|
+
],
|
|
694
|
+
[
|
|
695
|
+
13,
|
|
696
|
+
"qx",
|
|
697
|
+
"fpx"
|
|
698
|
+
],
|
|
699
|
+
[
|
|
700
|
+
13,
|
|
701
|
+
"qy",
|
|
702
|
+
[
|
|
703
|
+
1,
|
|
704
|
+
"fpy",
|
|
705
|
+
"-",
|
|
706
|
+
"outerRadius"
|
|
707
|
+
]
|
|
708
|
+
],
|
|
709
|
+
[
|
|
710
|
+
13,
|
|
711
|
+
"dotQE",
|
|
712
|
+
[
|
|
713
|
+
1,
|
|
714
|
+
[
|
|
715
|
+
1,
|
|
716
|
+
"qx",
|
|
717
|
+
"*",
|
|
718
|
+
"ex"
|
|
719
|
+
],
|
|
720
|
+
"+",
|
|
721
|
+
[
|
|
722
|
+
1,
|
|
723
|
+
"qy",
|
|
724
|
+
"*",
|
|
725
|
+
"ey"
|
|
726
|
+
]
|
|
727
|
+
]
|
|
728
|
+
],
|
|
729
|
+
[
|
|
730
|
+
13,
|
|
731
|
+
"dotEE",
|
|
732
|
+
[
|
|
733
|
+
1,
|
|
734
|
+
[
|
|
735
|
+
1,
|
|
736
|
+
"ex",
|
|
737
|
+
"*",
|
|
738
|
+
"ex"
|
|
739
|
+
],
|
|
740
|
+
"+",
|
|
741
|
+
[
|
|
742
|
+
1,
|
|
743
|
+
"ey",
|
|
744
|
+
"*",
|
|
745
|
+
"ey"
|
|
746
|
+
]
|
|
747
|
+
]
|
|
748
|
+
],
|
|
749
|
+
[
|
|
750
|
+
13,
|
|
751
|
+
"t",
|
|
752
|
+
[
|
|
753
|
+
6,
|
|
754
|
+
[
|
|
755
|
+
7,
|
|
756
|
+
"std",
|
|
757
|
+
"clamp"
|
|
758
|
+
],
|
|
759
|
+
[
|
|
760
|
+
[
|
|
761
|
+
1,
|
|
762
|
+
"dotQE",
|
|
763
|
+
"/",
|
|
764
|
+
"dotEE"
|
|
765
|
+
],
|
|
766
|
+
[5, "0"],
|
|
767
|
+
[5, "1"]
|
|
768
|
+
]
|
|
769
|
+
]
|
|
770
|
+
],
|
|
771
|
+
[
|
|
772
|
+
13,
|
|
773
|
+
"nx",
|
|
774
|
+
[
|
|
775
|
+
1,
|
|
776
|
+
"fpx",
|
|
777
|
+
"-",
|
|
778
|
+
[
|
|
779
|
+
1,
|
|
780
|
+
"ex",
|
|
781
|
+
"*",
|
|
782
|
+
"t"
|
|
783
|
+
]
|
|
784
|
+
]
|
|
785
|
+
],
|
|
786
|
+
[
|
|
787
|
+
13,
|
|
788
|
+
"ny",
|
|
789
|
+
[
|
|
790
|
+
1,
|
|
791
|
+
"fpy",
|
|
792
|
+
"-",
|
|
793
|
+
[
|
|
794
|
+
1,
|
|
795
|
+
"outerRadius",
|
|
796
|
+
"+",
|
|
797
|
+
[
|
|
798
|
+
1,
|
|
799
|
+
"ey",
|
|
800
|
+
"*",
|
|
801
|
+
"t"
|
|
802
|
+
]
|
|
803
|
+
]
|
|
804
|
+
]
|
|
805
|
+
],
|
|
806
|
+
[
|
|
807
|
+
13,
|
|
808
|
+
"dist",
|
|
809
|
+
[
|
|
810
|
+
6,
|
|
811
|
+
[
|
|
812
|
+
7,
|
|
813
|
+
"std",
|
|
814
|
+
"sqrt"
|
|
815
|
+
],
|
|
816
|
+
[[
|
|
817
|
+
1,
|
|
818
|
+
[
|
|
819
|
+
1,
|
|
820
|
+
"nx",
|
|
821
|
+
"*",
|
|
822
|
+
"nx"
|
|
823
|
+
],
|
|
824
|
+
"+",
|
|
825
|
+
[
|
|
826
|
+
1,
|
|
827
|
+
"ny",
|
|
828
|
+
"*",
|
|
829
|
+
"ny"
|
|
830
|
+
]
|
|
831
|
+
]]
|
|
832
|
+
]
|
|
833
|
+
],
|
|
834
|
+
[
|
|
835
|
+
13,
|
|
836
|
+
"cross",
|
|
837
|
+
[
|
|
838
|
+
1,
|
|
839
|
+
[
|
|
840
|
+
1,
|
|
841
|
+
"ex",
|
|
842
|
+
"*",
|
|
843
|
+
"qy"
|
|
844
|
+
],
|
|
845
|
+
"-",
|
|
846
|
+
[
|
|
847
|
+
1,
|
|
848
|
+
"ey",
|
|
849
|
+
"*",
|
|
850
|
+
"qx"
|
|
851
|
+
]
|
|
852
|
+
]
|
|
853
|
+
],
|
|
854
|
+
[10, [
|
|
855
|
+
1,
|
|
856
|
+
"dist",
|
|
857
|
+
"*",
|
|
858
|
+
[
|
|
859
|
+
6,
|
|
860
|
+
[
|
|
861
|
+
7,
|
|
862
|
+
"std",
|
|
863
|
+
"sign"
|
|
864
|
+
],
|
|
865
|
+
["cross"]
|
|
866
|
+
]
|
|
867
|
+
]]
|
|
868
|
+
]],
|
|
869
|
+
"externalNames": [
|
|
870
|
+
"std",
|
|
871
|
+
"TWO_PI",
|
|
872
|
+
"PI"
|
|
873
|
+
]
|
|
874
|
+
},
|
|
875
|
+
externals: () => ({
|
|
876
|
+
std: std_exports,
|
|
877
|
+
TWO_PI,
|
|
878
|
+
PI
|
|
879
|
+
})
|
|
880
|
+
}) && $.f)({}));
|
|
881
|
+
const ringSdf = src_default.fn([
|
|
882
|
+
f32,
|
|
883
|
+
f32,
|
|
884
|
+
f32,
|
|
885
|
+
f32
|
|
886
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radius, thickness) => {
|
|
887
|
+
"use gpu";
|
|
888
|
+
const len = sqrt(__tsover_add(__tsover_mul(dx, dx), __tsover_mul(dy, dy)));
|
|
889
|
+
return __tsover_sub(abs(__tsover_sub(len, radius)), thickness);
|
|
890
|
+
}), {
|
|
891
|
+
v: 1,
|
|
892
|
+
name: void 0,
|
|
893
|
+
ast: {
|
|
894
|
+
"params": [
|
|
895
|
+
{
|
|
896
|
+
"type": "i",
|
|
897
|
+
"name": "dx"
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
"type": "i",
|
|
901
|
+
"name": "dy"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"type": "i",
|
|
905
|
+
"name": "radius"
|
|
906
|
+
},
|
|
907
|
+
{
|
|
908
|
+
"type": "i",
|
|
909
|
+
"name": "thickness"
|
|
910
|
+
}
|
|
911
|
+
],
|
|
912
|
+
"body": [0, [[
|
|
913
|
+
13,
|
|
914
|
+
"len",
|
|
915
|
+
[
|
|
916
|
+
6,
|
|
917
|
+
[
|
|
918
|
+
7,
|
|
919
|
+
"std",
|
|
920
|
+
"sqrt"
|
|
921
|
+
],
|
|
922
|
+
[[
|
|
923
|
+
1,
|
|
924
|
+
[
|
|
925
|
+
1,
|
|
926
|
+
"dx",
|
|
927
|
+
"*",
|
|
928
|
+
"dx"
|
|
929
|
+
],
|
|
930
|
+
"+",
|
|
931
|
+
[
|
|
932
|
+
1,
|
|
933
|
+
"dy",
|
|
934
|
+
"*",
|
|
935
|
+
"dy"
|
|
936
|
+
]
|
|
937
|
+
]]
|
|
938
|
+
]
|
|
939
|
+
], [10, [
|
|
940
|
+
1,
|
|
941
|
+
[
|
|
942
|
+
6,
|
|
943
|
+
[
|
|
944
|
+
7,
|
|
945
|
+
"std",
|
|
946
|
+
"abs"
|
|
947
|
+
],
|
|
948
|
+
[[
|
|
949
|
+
1,
|
|
950
|
+
"len",
|
|
951
|
+
"-",
|
|
952
|
+
"radius"
|
|
953
|
+
]]
|
|
954
|
+
],
|
|
955
|
+
"-",
|
|
956
|
+
"thickness"
|
|
957
|
+
]]]],
|
|
958
|
+
"externalNames": ["std"]
|
|
959
|
+
},
|
|
960
|
+
externals: () => ({ std: std_exports })
|
|
961
|
+
}) && $.f)({}));
|
|
962
|
+
const crossSdf = src_default.fn([
|
|
963
|
+
f32,
|
|
964
|
+
f32,
|
|
965
|
+
f32,
|
|
966
|
+
f32,
|
|
967
|
+
f32
|
|
968
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, size, thickness, rounding) => {
|
|
969
|
+
"use gpu";
|
|
970
|
+
const px = abs(dx);
|
|
971
|
+
const py = abs(dy);
|
|
972
|
+
const dHoriz = max(__tsover_sub(px, size), __tsover_sub(py, thickness));
|
|
973
|
+
const dVert = max(__tsover_sub(py, size), __tsover_sub(px, thickness));
|
|
974
|
+
return __tsover_sub(min(dHoriz, dVert), rounding);
|
|
975
|
+
}), {
|
|
976
|
+
v: 1,
|
|
977
|
+
name: void 0,
|
|
978
|
+
ast: {
|
|
979
|
+
"params": [
|
|
980
|
+
{
|
|
981
|
+
"type": "i",
|
|
982
|
+
"name": "dx"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
"type": "i",
|
|
986
|
+
"name": "dy"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"type": "i",
|
|
990
|
+
"name": "size"
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"type": "i",
|
|
994
|
+
"name": "thickness"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"type": "i",
|
|
998
|
+
"name": "rounding"
|
|
999
|
+
}
|
|
1000
|
+
],
|
|
1001
|
+
"body": [0, [
|
|
1002
|
+
[
|
|
1003
|
+
13,
|
|
1004
|
+
"px",
|
|
1005
|
+
[
|
|
1006
|
+
6,
|
|
1007
|
+
[
|
|
1008
|
+
7,
|
|
1009
|
+
"std",
|
|
1010
|
+
"abs"
|
|
1011
|
+
],
|
|
1012
|
+
["dx"]
|
|
1013
|
+
]
|
|
1014
|
+
],
|
|
1015
|
+
[
|
|
1016
|
+
13,
|
|
1017
|
+
"py",
|
|
1018
|
+
[
|
|
1019
|
+
6,
|
|
1020
|
+
[
|
|
1021
|
+
7,
|
|
1022
|
+
"std",
|
|
1023
|
+
"abs"
|
|
1024
|
+
],
|
|
1025
|
+
["dy"]
|
|
1026
|
+
]
|
|
1027
|
+
],
|
|
1028
|
+
[
|
|
1029
|
+
13,
|
|
1030
|
+
"dHoriz",
|
|
1031
|
+
[
|
|
1032
|
+
6,
|
|
1033
|
+
[
|
|
1034
|
+
7,
|
|
1035
|
+
"std",
|
|
1036
|
+
"max"
|
|
1037
|
+
],
|
|
1038
|
+
[[
|
|
1039
|
+
1,
|
|
1040
|
+
"px",
|
|
1041
|
+
"-",
|
|
1042
|
+
"size"
|
|
1043
|
+
], [
|
|
1044
|
+
1,
|
|
1045
|
+
"py",
|
|
1046
|
+
"-",
|
|
1047
|
+
"thickness"
|
|
1048
|
+
]]
|
|
1049
|
+
]
|
|
1050
|
+
],
|
|
1051
|
+
[
|
|
1052
|
+
13,
|
|
1053
|
+
"dVert",
|
|
1054
|
+
[
|
|
1055
|
+
6,
|
|
1056
|
+
[
|
|
1057
|
+
7,
|
|
1058
|
+
"std",
|
|
1059
|
+
"max"
|
|
1060
|
+
],
|
|
1061
|
+
[[
|
|
1062
|
+
1,
|
|
1063
|
+
"py",
|
|
1064
|
+
"-",
|
|
1065
|
+
"size"
|
|
1066
|
+
], [
|
|
1067
|
+
1,
|
|
1068
|
+
"px",
|
|
1069
|
+
"-",
|
|
1070
|
+
"thickness"
|
|
1071
|
+
]]
|
|
1072
|
+
]
|
|
1073
|
+
],
|
|
1074
|
+
[10, [
|
|
1075
|
+
1,
|
|
1076
|
+
[
|
|
1077
|
+
6,
|
|
1078
|
+
[
|
|
1079
|
+
7,
|
|
1080
|
+
"std",
|
|
1081
|
+
"min"
|
|
1082
|
+
],
|
|
1083
|
+
["dHoriz", "dVert"]
|
|
1084
|
+
],
|
|
1085
|
+
"-",
|
|
1086
|
+
"rounding"
|
|
1087
|
+
]]
|
|
1088
|
+
]],
|
|
1089
|
+
"externalNames": ["std"]
|
|
1090
|
+
},
|
|
1091
|
+
externals: () => ({ std: std_exports })
|
|
1092
|
+
}) && $.f)({}));
|
|
1093
|
+
const roundedRectSdf = src_default.fn([
|
|
1094
|
+
f32,
|
|
1095
|
+
f32,
|
|
1096
|
+
f32,
|
|
1097
|
+
f32,
|
|
1098
|
+
f32
|
|
1099
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, width, height, rounding) => {
|
|
1100
|
+
"use gpu";
|
|
1101
|
+
const qx = __tsover_add(__tsover_sub(abs(dx), width), rounding);
|
|
1102
|
+
const qy = __tsover_add(__tsover_sub(abs(dy), height), rounding);
|
|
1103
|
+
const mqx = max(qx, 0);
|
|
1104
|
+
const mqy = max(qy, 0);
|
|
1105
|
+
const outerDist = sqrt(__tsover_add(__tsover_mul(mqx, mqx), __tsover_mul(mqy, mqy)));
|
|
1106
|
+
const innerDist = min(max(qx, qy), 0);
|
|
1107
|
+
return __tsover_sub(__tsover_add(outerDist, innerDist), rounding);
|
|
1108
|
+
}), {
|
|
1109
|
+
v: 1,
|
|
1110
|
+
name: void 0,
|
|
1111
|
+
ast: {
|
|
1112
|
+
"params": [
|
|
1113
|
+
{
|
|
1114
|
+
"type": "i",
|
|
1115
|
+
"name": "dx"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
"type": "i",
|
|
1119
|
+
"name": "dy"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"type": "i",
|
|
1123
|
+
"name": "width"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
"type": "i",
|
|
1127
|
+
"name": "height"
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"type": "i",
|
|
1131
|
+
"name": "rounding"
|
|
1132
|
+
}
|
|
1133
|
+
],
|
|
1134
|
+
"body": [0, [
|
|
1135
|
+
[
|
|
1136
|
+
13,
|
|
1137
|
+
"qx",
|
|
1138
|
+
[
|
|
1139
|
+
1,
|
|
1140
|
+
[
|
|
1141
|
+
1,
|
|
1142
|
+
[
|
|
1143
|
+
6,
|
|
1144
|
+
[
|
|
1145
|
+
7,
|
|
1146
|
+
"std",
|
|
1147
|
+
"abs"
|
|
1148
|
+
],
|
|
1149
|
+
["dx"]
|
|
1150
|
+
],
|
|
1151
|
+
"-",
|
|
1152
|
+
"width"
|
|
1153
|
+
],
|
|
1154
|
+
"+",
|
|
1155
|
+
"rounding"
|
|
1156
|
+
]
|
|
1157
|
+
],
|
|
1158
|
+
[
|
|
1159
|
+
13,
|
|
1160
|
+
"qy",
|
|
1161
|
+
[
|
|
1162
|
+
1,
|
|
1163
|
+
[
|
|
1164
|
+
1,
|
|
1165
|
+
[
|
|
1166
|
+
6,
|
|
1167
|
+
[
|
|
1168
|
+
7,
|
|
1169
|
+
"std",
|
|
1170
|
+
"abs"
|
|
1171
|
+
],
|
|
1172
|
+
["dy"]
|
|
1173
|
+
],
|
|
1174
|
+
"-",
|
|
1175
|
+
"height"
|
|
1176
|
+
],
|
|
1177
|
+
"+",
|
|
1178
|
+
"rounding"
|
|
1179
|
+
]
|
|
1180
|
+
],
|
|
1181
|
+
[
|
|
1182
|
+
13,
|
|
1183
|
+
"mqx",
|
|
1184
|
+
[
|
|
1185
|
+
6,
|
|
1186
|
+
[
|
|
1187
|
+
7,
|
|
1188
|
+
"std",
|
|
1189
|
+
"max"
|
|
1190
|
+
],
|
|
1191
|
+
["qx", [5, "0"]]
|
|
1192
|
+
]
|
|
1193
|
+
],
|
|
1194
|
+
[
|
|
1195
|
+
13,
|
|
1196
|
+
"mqy",
|
|
1197
|
+
[
|
|
1198
|
+
6,
|
|
1199
|
+
[
|
|
1200
|
+
7,
|
|
1201
|
+
"std",
|
|
1202
|
+
"max"
|
|
1203
|
+
],
|
|
1204
|
+
["qy", [5, "0"]]
|
|
1205
|
+
]
|
|
1206
|
+
],
|
|
1207
|
+
[
|
|
1208
|
+
13,
|
|
1209
|
+
"outerDist",
|
|
1210
|
+
[
|
|
1211
|
+
6,
|
|
1212
|
+
[
|
|
1213
|
+
7,
|
|
1214
|
+
"std",
|
|
1215
|
+
"sqrt"
|
|
1216
|
+
],
|
|
1217
|
+
[[
|
|
1218
|
+
1,
|
|
1219
|
+
[
|
|
1220
|
+
1,
|
|
1221
|
+
"mqx",
|
|
1222
|
+
"*",
|
|
1223
|
+
"mqx"
|
|
1224
|
+
],
|
|
1225
|
+
"+",
|
|
1226
|
+
[
|
|
1227
|
+
1,
|
|
1228
|
+
"mqy",
|
|
1229
|
+
"*",
|
|
1230
|
+
"mqy"
|
|
1231
|
+
]
|
|
1232
|
+
]]
|
|
1233
|
+
]
|
|
1234
|
+
],
|
|
1235
|
+
[
|
|
1236
|
+
13,
|
|
1237
|
+
"innerDist",
|
|
1238
|
+
[
|
|
1239
|
+
6,
|
|
1240
|
+
[
|
|
1241
|
+
7,
|
|
1242
|
+
"std",
|
|
1243
|
+
"min"
|
|
1244
|
+
],
|
|
1245
|
+
[[
|
|
1246
|
+
6,
|
|
1247
|
+
[
|
|
1248
|
+
7,
|
|
1249
|
+
"std",
|
|
1250
|
+
"max"
|
|
1251
|
+
],
|
|
1252
|
+
["qx", "qy"]
|
|
1253
|
+
], [5, "0"]]
|
|
1254
|
+
]
|
|
1255
|
+
],
|
|
1256
|
+
[10, [
|
|
1257
|
+
1,
|
|
1258
|
+
[
|
|
1259
|
+
1,
|
|
1260
|
+
"outerDist",
|
|
1261
|
+
"+",
|
|
1262
|
+
"innerDist"
|
|
1263
|
+
],
|
|
1264
|
+
"-",
|
|
1265
|
+
"rounding"
|
|
1266
|
+
]]
|
|
1267
|
+
]],
|
|
1268
|
+
"externalNames": ["std"]
|
|
1269
|
+
},
|
|
1270
|
+
externals: () => ({ std: std_exports })
|
|
1271
|
+
}) && $.f)({}));
|
|
1272
|
+
const ellipseSdf = src_default.fn([
|
|
1273
|
+
f32,
|
|
1274
|
+
f32,
|
|
1275
|
+
f32,
|
|
1276
|
+
f32
|
|
1277
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radiusX, radiusY) => {
|
|
1278
|
+
"use gpu";
|
|
1279
|
+
const nx = __tsover_div(dx, radiusX);
|
|
1280
|
+
const ny = __tsover_div(dy, radiusY);
|
|
1281
|
+
const k = sqrt(__tsover_add(__tsover_mul(nx, nx), __tsover_mul(ny, ny)));
|
|
1282
|
+
return __tsover_mul(__tsover_sub(k, 1), min(radiusX, radiusY));
|
|
1283
|
+
}), {
|
|
1284
|
+
v: 1,
|
|
1285
|
+
name: void 0,
|
|
1286
|
+
ast: {
|
|
1287
|
+
"params": [
|
|
1288
|
+
{
|
|
1289
|
+
"type": "i",
|
|
1290
|
+
"name": "dx"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
"type": "i",
|
|
1294
|
+
"name": "dy"
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
"type": "i",
|
|
1298
|
+
"name": "radiusX"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
"type": "i",
|
|
1302
|
+
"name": "radiusY"
|
|
1303
|
+
}
|
|
1304
|
+
],
|
|
1305
|
+
"body": [0, [
|
|
1306
|
+
[
|
|
1307
|
+
13,
|
|
1308
|
+
"nx",
|
|
1309
|
+
[
|
|
1310
|
+
1,
|
|
1311
|
+
"dx",
|
|
1312
|
+
"/",
|
|
1313
|
+
"radiusX"
|
|
1314
|
+
]
|
|
1315
|
+
],
|
|
1316
|
+
[
|
|
1317
|
+
13,
|
|
1318
|
+
"ny",
|
|
1319
|
+
[
|
|
1320
|
+
1,
|
|
1321
|
+
"dy",
|
|
1322
|
+
"/",
|
|
1323
|
+
"radiusY"
|
|
1324
|
+
]
|
|
1325
|
+
],
|
|
1326
|
+
[
|
|
1327
|
+
13,
|
|
1328
|
+
"k",
|
|
1329
|
+
[
|
|
1330
|
+
6,
|
|
1331
|
+
[
|
|
1332
|
+
7,
|
|
1333
|
+
"std",
|
|
1334
|
+
"sqrt"
|
|
1335
|
+
],
|
|
1336
|
+
[[
|
|
1337
|
+
1,
|
|
1338
|
+
[
|
|
1339
|
+
1,
|
|
1340
|
+
"nx",
|
|
1341
|
+
"*",
|
|
1342
|
+
"nx"
|
|
1343
|
+
],
|
|
1344
|
+
"+",
|
|
1345
|
+
[
|
|
1346
|
+
1,
|
|
1347
|
+
"ny",
|
|
1348
|
+
"*",
|
|
1349
|
+
"ny"
|
|
1350
|
+
]
|
|
1351
|
+
]]
|
|
1352
|
+
]
|
|
1353
|
+
],
|
|
1354
|
+
[10, [
|
|
1355
|
+
1,
|
|
1356
|
+
[
|
|
1357
|
+
1,
|
|
1358
|
+
"k",
|
|
1359
|
+
"-",
|
|
1360
|
+
[5, "1"]
|
|
1361
|
+
],
|
|
1362
|
+
"*",
|
|
1363
|
+
[
|
|
1364
|
+
6,
|
|
1365
|
+
[
|
|
1366
|
+
7,
|
|
1367
|
+
"std",
|
|
1368
|
+
"min"
|
|
1369
|
+
],
|
|
1370
|
+
["radiusX", "radiusY"]
|
|
1371
|
+
]
|
|
1372
|
+
]]
|
|
1373
|
+
]],
|
|
1374
|
+
"externalNames": ["std"]
|
|
1375
|
+
},
|
|
1376
|
+
externals: () => ({ std: std_exports })
|
|
1377
|
+
}) && $.f)({}));
|
|
1378
|
+
const vesicaSdf = src_default.fn([
|
|
1379
|
+
f32,
|
|
1380
|
+
f32,
|
|
1381
|
+
f32,
|
|
1382
|
+
f32
|
|
1383
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radius, spread) => {
|
|
1384
|
+
"use gpu";
|
|
1385
|
+
const px = abs(dx);
|
|
1386
|
+
const py = abs(dy);
|
|
1387
|
+
const dd = __tsover_mul(radius, spread);
|
|
1388
|
+
const b = sqrt(max(__tsover_sub(__tsover_mul(radius, radius), __tsover_mul(dd, dd)), 0));
|
|
1389
|
+
const cond = __tsover_mul(__tsover_sub(py, b), dd) > __tsover_mul(px, b);
|
|
1390
|
+
const dist1 = sqrt(__tsover_add(__tsover_mul(px, px), __tsover_mul(__tsover_sub(py, b), __tsover_sub(py, b))));
|
|
1391
|
+
return select(__tsover_sub(sqrt(__tsover_add(__tsover_mul(__tsover_add(px, dd), __tsover_add(px, dd)), __tsover_mul(py, py))), radius), dist1, cond);
|
|
1392
|
+
}), {
|
|
1393
|
+
v: 1,
|
|
1394
|
+
name: void 0,
|
|
1395
|
+
ast: {
|
|
1396
|
+
"params": [
|
|
1397
|
+
{
|
|
1398
|
+
"type": "i",
|
|
1399
|
+
"name": "dx"
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
"type": "i",
|
|
1403
|
+
"name": "dy"
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
"type": "i",
|
|
1407
|
+
"name": "radius"
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
"type": "i",
|
|
1411
|
+
"name": "spread"
|
|
1412
|
+
}
|
|
1413
|
+
],
|
|
1414
|
+
"body": [0, [
|
|
1415
|
+
[
|
|
1416
|
+
13,
|
|
1417
|
+
"px",
|
|
1418
|
+
[
|
|
1419
|
+
6,
|
|
1420
|
+
[
|
|
1421
|
+
7,
|
|
1422
|
+
"std",
|
|
1423
|
+
"abs"
|
|
1424
|
+
],
|
|
1425
|
+
["dx"]
|
|
1426
|
+
]
|
|
1427
|
+
],
|
|
1428
|
+
[
|
|
1429
|
+
13,
|
|
1430
|
+
"py",
|
|
1431
|
+
[
|
|
1432
|
+
6,
|
|
1433
|
+
[
|
|
1434
|
+
7,
|
|
1435
|
+
"std",
|
|
1436
|
+
"abs"
|
|
1437
|
+
],
|
|
1438
|
+
["dy"]
|
|
1439
|
+
]
|
|
1440
|
+
],
|
|
1441
|
+
[
|
|
1442
|
+
13,
|
|
1443
|
+
"dd",
|
|
1444
|
+
[
|
|
1445
|
+
1,
|
|
1446
|
+
"radius",
|
|
1447
|
+
"*",
|
|
1448
|
+
"spread"
|
|
1449
|
+
]
|
|
1450
|
+
],
|
|
1451
|
+
[
|
|
1452
|
+
13,
|
|
1453
|
+
"b",
|
|
1454
|
+
[
|
|
1455
|
+
6,
|
|
1456
|
+
[
|
|
1457
|
+
7,
|
|
1458
|
+
"std",
|
|
1459
|
+
"sqrt"
|
|
1460
|
+
],
|
|
1461
|
+
[[
|
|
1462
|
+
6,
|
|
1463
|
+
[
|
|
1464
|
+
7,
|
|
1465
|
+
"std",
|
|
1466
|
+
"max"
|
|
1467
|
+
],
|
|
1468
|
+
[[
|
|
1469
|
+
1,
|
|
1470
|
+
[
|
|
1471
|
+
1,
|
|
1472
|
+
"radius",
|
|
1473
|
+
"*",
|
|
1474
|
+
"radius"
|
|
1475
|
+
],
|
|
1476
|
+
"-",
|
|
1477
|
+
[
|
|
1478
|
+
1,
|
|
1479
|
+
"dd",
|
|
1480
|
+
"*",
|
|
1481
|
+
"dd"
|
|
1482
|
+
]
|
|
1483
|
+
], [5, "0"]]
|
|
1484
|
+
]]
|
|
1485
|
+
]
|
|
1486
|
+
],
|
|
1487
|
+
[
|
|
1488
|
+
13,
|
|
1489
|
+
"cond",
|
|
1490
|
+
[
|
|
1491
|
+
1,
|
|
1492
|
+
[
|
|
1493
|
+
1,
|
|
1494
|
+
[
|
|
1495
|
+
1,
|
|
1496
|
+
"py",
|
|
1497
|
+
"-",
|
|
1498
|
+
"b"
|
|
1499
|
+
],
|
|
1500
|
+
"*",
|
|
1501
|
+
"dd"
|
|
1502
|
+
],
|
|
1503
|
+
">",
|
|
1504
|
+
[
|
|
1505
|
+
1,
|
|
1506
|
+
"px",
|
|
1507
|
+
"*",
|
|
1508
|
+
"b"
|
|
1509
|
+
]
|
|
1510
|
+
]
|
|
1511
|
+
],
|
|
1512
|
+
[
|
|
1513
|
+
13,
|
|
1514
|
+
"dist1",
|
|
1515
|
+
[
|
|
1516
|
+
6,
|
|
1517
|
+
[
|
|
1518
|
+
7,
|
|
1519
|
+
"std",
|
|
1520
|
+
"sqrt"
|
|
1521
|
+
],
|
|
1522
|
+
[[
|
|
1523
|
+
1,
|
|
1524
|
+
[
|
|
1525
|
+
1,
|
|
1526
|
+
"px",
|
|
1527
|
+
"*",
|
|
1528
|
+
"px"
|
|
1529
|
+
],
|
|
1530
|
+
"+",
|
|
1531
|
+
[
|
|
1532
|
+
1,
|
|
1533
|
+
[
|
|
1534
|
+
1,
|
|
1535
|
+
"py",
|
|
1536
|
+
"-",
|
|
1537
|
+
"b"
|
|
1538
|
+
],
|
|
1539
|
+
"*",
|
|
1540
|
+
[
|
|
1541
|
+
1,
|
|
1542
|
+
"py",
|
|
1543
|
+
"-",
|
|
1544
|
+
"b"
|
|
1545
|
+
]
|
|
1546
|
+
]
|
|
1547
|
+
]]
|
|
1548
|
+
]
|
|
1549
|
+
],
|
|
1550
|
+
[
|
|
1551
|
+
13,
|
|
1552
|
+
"dist2",
|
|
1553
|
+
[
|
|
1554
|
+
1,
|
|
1555
|
+
[
|
|
1556
|
+
6,
|
|
1557
|
+
[
|
|
1558
|
+
7,
|
|
1559
|
+
"std",
|
|
1560
|
+
"sqrt"
|
|
1561
|
+
],
|
|
1562
|
+
[[
|
|
1563
|
+
1,
|
|
1564
|
+
[
|
|
1565
|
+
1,
|
|
1566
|
+
[
|
|
1567
|
+
1,
|
|
1568
|
+
"px",
|
|
1569
|
+
"+",
|
|
1570
|
+
"dd"
|
|
1571
|
+
],
|
|
1572
|
+
"*",
|
|
1573
|
+
[
|
|
1574
|
+
1,
|
|
1575
|
+
"px",
|
|
1576
|
+
"+",
|
|
1577
|
+
"dd"
|
|
1578
|
+
]
|
|
1579
|
+
],
|
|
1580
|
+
"+",
|
|
1581
|
+
[
|
|
1582
|
+
1,
|
|
1583
|
+
"py",
|
|
1584
|
+
"*",
|
|
1585
|
+
"py"
|
|
1586
|
+
]
|
|
1587
|
+
]]
|
|
1588
|
+
],
|
|
1589
|
+
"-",
|
|
1590
|
+
"radius"
|
|
1591
|
+
]
|
|
1592
|
+
],
|
|
1593
|
+
[10, [
|
|
1594
|
+
6,
|
|
1595
|
+
[
|
|
1596
|
+
7,
|
|
1597
|
+
"std",
|
|
1598
|
+
"select"
|
|
1599
|
+
],
|
|
1600
|
+
[
|
|
1601
|
+
"dist2",
|
|
1602
|
+
"dist1",
|
|
1603
|
+
"cond"
|
|
1604
|
+
]
|
|
1605
|
+
]]
|
|
1606
|
+
]],
|
|
1607
|
+
"externalNames": ["std"]
|
|
1608
|
+
},
|
|
1609
|
+
externals: () => ({ std: std_exports })
|
|
1610
|
+
}) && $.f)({}));
|
|
1611
|
+
const crescentSdf = src_default.fn([
|
|
1612
|
+
f32,
|
|
1613
|
+
f32,
|
|
1614
|
+
f32,
|
|
1615
|
+
f32,
|
|
1616
|
+
f32
|
|
1617
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, outerRadius, innerRatio, offset) => {
|
|
1618
|
+
"use gpu";
|
|
1619
|
+
const py = abs(dy);
|
|
1620
|
+
const ra = outerRadius;
|
|
1621
|
+
const rb = __tsover_mul(outerRadius, innerRatio);
|
|
1622
|
+
const off = offset;
|
|
1623
|
+
const a = __tsover_div(__tsover_add(__tsover_sub(__tsover_mul(ra, ra), __tsover_mul(rb, rb)), __tsover_mul(off, off)), max(__tsover_mul(off, 2), .001));
|
|
1624
|
+
const b = sqrt(max(__tsover_sub(__tsover_mul(ra, ra), __tsover_mul(a, a)), 0));
|
|
1625
|
+
const lhs = __tsover_mul(off, __tsover_sub(__tsover_mul(dx, b), __tsover_mul(py, a)));
|
|
1626
|
+
const rhs = __tsover_mul(__tsover_mul(off, off), max(__tsover_sub(b, py), 0));
|
|
1627
|
+
const d1x = __tsover_sub(dx, a);
|
|
1628
|
+
const d1y = __tsover_sub(py, b);
|
|
1629
|
+
const dist1 = sqrt(__tsover_add(__tsover_mul(d1x, d1x), __tsover_mul(d1y, d1y)));
|
|
1630
|
+
const lenP = sqrt(__tsover_add(__tsover_mul(dx, dx), __tsover_mul(py, py)));
|
|
1631
|
+
const innerX = __tsover_sub(dx, off);
|
|
1632
|
+
const lenInner = sqrt(__tsover_add(__tsover_mul(innerX, innerX), __tsover_mul(py, py)));
|
|
1633
|
+
return select(max(__tsover_sub(lenP, ra), __tsover_mul(__tsover_sub(lenInner, rb), -1)), dist1, lhs > rhs);
|
|
1634
|
+
}), {
|
|
1635
|
+
v: 1,
|
|
1636
|
+
name: void 0,
|
|
1637
|
+
ast: {
|
|
1638
|
+
"params": [
|
|
1639
|
+
{
|
|
1640
|
+
"type": "i",
|
|
1641
|
+
"name": "dx"
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
"type": "i",
|
|
1645
|
+
"name": "dy"
|
|
1646
|
+
},
|
|
1647
|
+
{
|
|
1648
|
+
"type": "i",
|
|
1649
|
+
"name": "outerRadius"
|
|
1650
|
+
},
|
|
1651
|
+
{
|
|
1652
|
+
"type": "i",
|
|
1653
|
+
"name": "innerRatio"
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
"type": "i",
|
|
1657
|
+
"name": "offset"
|
|
1658
|
+
}
|
|
1659
|
+
],
|
|
1660
|
+
"body": [0, [
|
|
1661
|
+
[
|
|
1662
|
+
13,
|
|
1663
|
+
"py",
|
|
1664
|
+
[
|
|
1665
|
+
6,
|
|
1666
|
+
[
|
|
1667
|
+
7,
|
|
1668
|
+
"std",
|
|
1669
|
+
"abs"
|
|
1670
|
+
],
|
|
1671
|
+
["dy"]
|
|
1672
|
+
]
|
|
1673
|
+
],
|
|
1674
|
+
[
|
|
1675
|
+
13,
|
|
1676
|
+
"ra",
|
|
1677
|
+
"outerRadius"
|
|
1678
|
+
],
|
|
1679
|
+
[
|
|
1680
|
+
13,
|
|
1681
|
+
"rb",
|
|
1682
|
+
[
|
|
1683
|
+
1,
|
|
1684
|
+
"outerRadius",
|
|
1685
|
+
"*",
|
|
1686
|
+
"innerRatio"
|
|
1687
|
+
]
|
|
1688
|
+
],
|
|
1689
|
+
[
|
|
1690
|
+
13,
|
|
1691
|
+
"off",
|
|
1692
|
+
"offset"
|
|
1693
|
+
],
|
|
1694
|
+
[
|
|
1695
|
+
13,
|
|
1696
|
+
"a",
|
|
1697
|
+
[
|
|
1698
|
+
1,
|
|
1699
|
+
[
|
|
1700
|
+
1,
|
|
1701
|
+
[
|
|
1702
|
+
1,
|
|
1703
|
+
[
|
|
1704
|
+
1,
|
|
1705
|
+
"ra",
|
|
1706
|
+
"*",
|
|
1707
|
+
"ra"
|
|
1708
|
+
],
|
|
1709
|
+
"-",
|
|
1710
|
+
[
|
|
1711
|
+
1,
|
|
1712
|
+
"rb",
|
|
1713
|
+
"*",
|
|
1714
|
+
"rb"
|
|
1715
|
+
]
|
|
1716
|
+
],
|
|
1717
|
+
"+",
|
|
1718
|
+
[
|
|
1719
|
+
1,
|
|
1720
|
+
"off",
|
|
1721
|
+
"*",
|
|
1722
|
+
"off"
|
|
1723
|
+
]
|
|
1724
|
+
],
|
|
1725
|
+
"/",
|
|
1726
|
+
[
|
|
1727
|
+
6,
|
|
1728
|
+
[
|
|
1729
|
+
7,
|
|
1730
|
+
"std",
|
|
1731
|
+
"max"
|
|
1732
|
+
],
|
|
1733
|
+
[[
|
|
1734
|
+
1,
|
|
1735
|
+
"off",
|
|
1736
|
+
"*",
|
|
1737
|
+
[5, "2"]
|
|
1738
|
+
], [5, "0.001"]]
|
|
1739
|
+
]
|
|
1740
|
+
]
|
|
1741
|
+
],
|
|
1742
|
+
[
|
|
1743
|
+
13,
|
|
1744
|
+
"bSq",
|
|
1745
|
+
[
|
|
1746
|
+
6,
|
|
1747
|
+
[
|
|
1748
|
+
7,
|
|
1749
|
+
"std",
|
|
1750
|
+
"max"
|
|
1751
|
+
],
|
|
1752
|
+
[[
|
|
1753
|
+
1,
|
|
1754
|
+
[
|
|
1755
|
+
1,
|
|
1756
|
+
"ra",
|
|
1757
|
+
"*",
|
|
1758
|
+
"ra"
|
|
1759
|
+
],
|
|
1760
|
+
"-",
|
|
1761
|
+
[
|
|
1762
|
+
1,
|
|
1763
|
+
"a",
|
|
1764
|
+
"*",
|
|
1765
|
+
"a"
|
|
1766
|
+
]
|
|
1767
|
+
], [5, "0"]]
|
|
1768
|
+
]
|
|
1769
|
+
],
|
|
1770
|
+
[
|
|
1771
|
+
13,
|
|
1772
|
+
"b",
|
|
1773
|
+
[
|
|
1774
|
+
6,
|
|
1775
|
+
[
|
|
1776
|
+
7,
|
|
1777
|
+
"std",
|
|
1778
|
+
"sqrt"
|
|
1779
|
+
],
|
|
1780
|
+
["bSq"]
|
|
1781
|
+
]
|
|
1782
|
+
],
|
|
1783
|
+
[
|
|
1784
|
+
13,
|
|
1785
|
+
"lhs",
|
|
1786
|
+
[
|
|
1787
|
+
1,
|
|
1788
|
+
"off",
|
|
1789
|
+
"*",
|
|
1790
|
+
[
|
|
1791
|
+
1,
|
|
1792
|
+
[
|
|
1793
|
+
1,
|
|
1794
|
+
"dx",
|
|
1795
|
+
"*",
|
|
1796
|
+
"b"
|
|
1797
|
+
],
|
|
1798
|
+
"-",
|
|
1799
|
+
[
|
|
1800
|
+
1,
|
|
1801
|
+
"py",
|
|
1802
|
+
"*",
|
|
1803
|
+
"a"
|
|
1804
|
+
]
|
|
1805
|
+
]
|
|
1806
|
+
]
|
|
1807
|
+
],
|
|
1808
|
+
[
|
|
1809
|
+
13,
|
|
1810
|
+
"rhs",
|
|
1811
|
+
[
|
|
1812
|
+
1,
|
|
1813
|
+
[
|
|
1814
|
+
1,
|
|
1815
|
+
"off",
|
|
1816
|
+
"*",
|
|
1817
|
+
"off"
|
|
1818
|
+
],
|
|
1819
|
+
"*",
|
|
1820
|
+
[
|
|
1821
|
+
6,
|
|
1822
|
+
[
|
|
1823
|
+
7,
|
|
1824
|
+
"std",
|
|
1825
|
+
"max"
|
|
1826
|
+
],
|
|
1827
|
+
[[
|
|
1828
|
+
1,
|
|
1829
|
+
"b",
|
|
1830
|
+
"-",
|
|
1831
|
+
"py"
|
|
1832
|
+
], [5, "0"]]
|
|
1833
|
+
]
|
|
1834
|
+
]
|
|
1835
|
+
],
|
|
1836
|
+
[
|
|
1837
|
+
13,
|
|
1838
|
+
"d1x",
|
|
1839
|
+
[
|
|
1840
|
+
1,
|
|
1841
|
+
"dx",
|
|
1842
|
+
"-",
|
|
1843
|
+
"a"
|
|
1844
|
+
]
|
|
1845
|
+
],
|
|
1846
|
+
[
|
|
1847
|
+
13,
|
|
1848
|
+
"d1y",
|
|
1849
|
+
[
|
|
1850
|
+
1,
|
|
1851
|
+
"py",
|
|
1852
|
+
"-",
|
|
1853
|
+
"b"
|
|
1854
|
+
]
|
|
1855
|
+
],
|
|
1856
|
+
[
|
|
1857
|
+
13,
|
|
1858
|
+
"dist1",
|
|
1859
|
+
[
|
|
1860
|
+
6,
|
|
1861
|
+
[
|
|
1862
|
+
7,
|
|
1863
|
+
"std",
|
|
1864
|
+
"sqrt"
|
|
1865
|
+
],
|
|
1866
|
+
[[
|
|
1867
|
+
1,
|
|
1868
|
+
[
|
|
1869
|
+
1,
|
|
1870
|
+
"d1x",
|
|
1871
|
+
"*",
|
|
1872
|
+
"d1x"
|
|
1873
|
+
],
|
|
1874
|
+
"+",
|
|
1875
|
+
[
|
|
1876
|
+
1,
|
|
1877
|
+
"d1y",
|
|
1878
|
+
"*",
|
|
1879
|
+
"d1y"
|
|
1880
|
+
]
|
|
1881
|
+
]]
|
|
1882
|
+
]
|
|
1883
|
+
],
|
|
1884
|
+
[
|
|
1885
|
+
13,
|
|
1886
|
+
"lenP",
|
|
1887
|
+
[
|
|
1888
|
+
6,
|
|
1889
|
+
[
|
|
1890
|
+
7,
|
|
1891
|
+
"std",
|
|
1892
|
+
"sqrt"
|
|
1893
|
+
],
|
|
1894
|
+
[[
|
|
1895
|
+
1,
|
|
1896
|
+
[
|
|
1897
|
+
1,
|
|
1898
|
+
"dx",
|
|
1899
|
+
"*",
|
|
1900
|
+
"dx"
|
|
1901
|
+
],
|
|
1902
|
+
"+",
|
|
1903
|
+
[
|
|
1904
|
+
1,
|
|
1905
|
+
"py",
|
|
1906
|
+
"*",
|
|
1907
|
+
"py"
|
|
1908
|
+
]
|
|
1909
|
+
]]
|
|
1910
|
+
]
|
|
1911
|
+
],
|
|
1912
|
+
[
|
|
1913
|
+
13,
|
|
1914
|
+
"innerX",
|
|
1915
|
+
[
|
|
1916
|
+
1,
|
|
1917
|
+
"dx",
|
|
1918
|
+
"-",
|
|
1919
|
+
"off"
|
|
1920
|
+
]
|
|
1921
|
+
],
|
|
1922
|
+
[
|
|
1923
|
+
13,
|
|
1924
|
+
"lenInner",
|
|
1925
|
+
[
|
|
1926
|
+
6,
|
|
1927
|
+
[
|
|
1928
|
+
7,
|
|
1929
|
+
"std",
|
|
1930
|
+
"sqrt"
|
|
1931
|
+
],
|
|
1932
|
+
[[
|
|
1933
|
+
1,
|
|
1934
|
+
[
|
|
1935
|
+
1,
|
|
1936
|
+
"innerX",
|
|
1937
|
+
"*",
|
|
1938
|
+
"innerX"
|
|
1939
|
+
],
|
|
1940
|
+
"+",
|
|
1941
|
+
[
|
|
1942
|
+
1,
|
|
1943
|
+
"py",
|
|
1944
|
+
"*",
|
|
1945
|
+
"py"
|
|
1946
|
+
]
|
|
1947
|
+
]]
|
|
1948
|
+
]
|
|
1949
|
+
],
|
|
1950
|
+
[
|
|
1951
|
+
13,
|
|
1952
|
+
"dist2",
|
|
1953
|
+
[
|
|
1954
|
+
6,
|
|
1955
|
+
[
|
|
1956
|
+
7,
|
|
1957
|
+
"std",
|
|
1958
|
+
"max"
|
|
1959
|
+
],
|
|
1960
|
+
[[
|
|
1961
|
+
1,
|
|
1962
|
+
"lenP",
|
|
1963
|
+
"-",
|
|
1964
|
+
"ra"
|
|
1965
|
+
], [
|
|
1966
|
+
1,
|
|
1967
|
+
[
|
|
1968
|
+
1,
|
|
1969
|
+
"lenInner",
|
|
1970
|
+
"-",
|
|
1971
|
+
"rb"
|
|
1972
|
+
],
|
|
1973
|
+
"*",
|
|
1974
|
+
[
|
|
1975
|
+
4,
|
|
1976
|
+
"-",
|
|
1977
|
+
[5, "1"]
|
|
1978
|
+
]
|
|
1979
|
+
]]
|
|
1980
|
+
]
|
|
1981
|
+
],
|
|
1982
|
+
[10, [
|
|
1983
|
+
6,
|
|
1984
|
+
[
|
|
1985
|
+
7,
|
|
1986
|
+
"std",
|
|
1987
|
+
"select"
|
|
1988
|
+
],
|
|
1989
|
+
[
|
|
1990
|
+
"dist2",
|
|
1991
|
+
"dist1",
|
|
1992
|
+
[
|
|
1993
|
+
1,
|
|
1994
|
+
"lhs",
|
|
1995
|
+
">",
|
|
1996
|
+
"rhs"
|
|
1997
|
+
]
|
|
1998
|
+
]
|
|
1999
|
+
]]
|
|
2000
|
+
]],
|
|
2001
|
+
"externalNames": ["std"]
|
|
2002
|
+
},
|
|
2003
|
+
externals: () => ({ std: std_exports })
|
|
2004
|
+
}) && $.f)({}));
|
|
2005
|
+
const trapezoidSdf = src_default.fn([
|
|
2006
|
+
f32,
|
|
2007
|
+
f32,
|
|
2008
|
+
f32,
|
|
2009
|
+
f32,
|
|
2010
|
+
f32
|
|
2011
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, r1, r2, he) => {
|
|
2012
|
+
"use gpu";
|
|
2013
|
+
const px = abs(dx);
|
|
2014
|
+
const k1x = r2;
|
|
2015
|
+
const k1y = he;
|
|
2016
|
+
const k2x = __tsover_sub(r2, r1);
|
|
2017
|
+
const k2y = __tsover_mul(he, 2);
|
|
2018
|
+
const clampWidth = select(r2, r1, dy < 0);
|
|
2019
|
+
const cax = __tsover_sub(px, min(px, clampWidth));
|
|
2020
|
+
const cay = __tsover_sub(abs(dy), he);
|
|
2021
|
+
const diffX = __tsover_sub(k1x, px);
|
|
2022
|
+
const diffY = __tsover_sub(k1y, dy);
|
|
2023
|
+
const dotNum = __tsover_add(__tsover_mul(diffX, k2x), __tsover_mul(diffY, k2y));
|
|
2024
|
+
const dotDen = max(__tsover_add(__tsover_mul(k2x, k2x), __tsover_mul(k2y, k2y)), 1e-4);
|
|
2025
|
+
const t = clamp(__tsover_div(dotNum, dotDen), 0, 1);
|
|
2026
|
+
const cbx = __tsover_add(__tsover_sub(px, k1x), __tsover_mul(k2x, t));
|
|
2027
|
+
const cby = __tsover_add(__tsover_sub(dy, k1y), __tsover_mul(k2y, t));
|
|
2028
|
+
const sInner = select(f32(1), f32(-1), cay < 0);
|
|
2029
|
+
const s = select(f32(1), sInner, cbx < 0);
|
|
2030
|
+
const dca = __tsover_add(__tsover_mul(cax, cax), __tsover_mul(cay, cay));
|
|
2031
|
+
const dcb = __tsover_add(__tsover_mul(cbx, cbx), __tsover_mul(cby, cby));
|
|
2032
|
+
return __tsover_mul(s, sqrt(min(dca, dcb)));
|
|
2033
|
+
}), {
|
|
2034
|
+
v: 1,
|
|
2035
|
+
name: void 0,
|
|
2036
|
+
ast: {
|
|
2037
|
+
"params": [
|
|
2038
|
+
{
|
|
2039
|
+
"type": "i",
|
|
2040
|
+
"name": "dx"
|
|
2041
|
+
},
|
|
2042
|
+
{
|
|
2043
|
+
"type": "i",
|
|
2044
|
+
"name": "dy"
|
|
2045
|
+
},
|
|
2046
|
+
{
|
|
2047
|
+
"type": "i",
|
|
2048
|
+
"name": "r1"
|
|
2049
|
+
},
|
|
2050
|
+
{
|
|
2051
|
+
"type": "i",
|
|
2052
|
+
"name": "r2"
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"type": "i",
|
|
2056
|
+
"name": "he"
|
|
2057
|
+
}
|
|
2058
|
+
],
|
|
2059
|
+
"body": [0, [
|
|
2060
|
+
[
|
|
2061
|
+
13,
|
|
2062
|
+
"px",
|
|
2063
|
+
[
|
|
2064
|
+
6,
|
|
2065
|
+
[
|
|
2066
|
+
7,
|
|
2067
|
+
"std",
|
|
2068
|
+
"abs"
|
|
2069
|
+
],
|
|
2070
|
+
["dx"]
|
|
2071
|
+
]
|
|
2072
|
+
],
|
|
2073
|
+
[
|
|
2074
|
+
13,
|
|
2075
|
+
"k1x",
|
|
2076
|
+
"r2"
|
|
2077
|
+
],
|
|
2078
|
+
[
|
|
2079
|
+
13,
|
|
2080
|
+
"k1y",
|
|
2081
|
+
"he"
|
|
2082
|
+
],
|
|
2083
|
+
[
|
|
2084
|
+
13,
|
|
2085
|
+
"k2x",
|
|
2086
|
+
[
|
|
2087
|
+
1,
|
|
2088
|
+
"r2",
|
|
2089
|
+
"-",
|
|
2090
|
+
"r1"
|
|
2091
|
+
]
|
|
2092
|
+
],
|
|
2093
|
+
[
|
|
2094
|
+
13,
|
|
2095
|
+
"k2y",
|
|
2096
|
+
[
|
|
2097
|
+
1,
|
|
2098
|
+
"he",
|
|
2099
|
+
"*",
|
|
2100
|
+
[5, "2"]
|
|
2101
|
+
]
|
|
2102
|
+
],
|
|
2103
|
+
[
|
|
2104
|
+
13,
|
|
2105
|
+
"clampWidth",
|
|
2106
|
+
[
|
|
2107
|
+
6,
|
|
2108
|
+
[
|
|
2109
|
+
7,
|
|
2110
|
+
"std",
|
|
2111
|
+
"select"
|
|
2112
|
+
],
|
|
2113
|
+
[
|
|
2114
|
+
"r2",
|
|
2115
|
+
"r1",
|
|
2116
|
+
[
|
|
2117
|
+
1,
|
|
2118
|
+
"dy",
|
|
2119
|
+
"<",
|
|
2120
|
+
[5, "0"]
|
|
2121
|
+
]
|
|
2122
|
+
]
|
|
2123
|
+
]
|
|
2124
|
+
],
|
|
2125
|
+
[
|
|
2126
|
+
13,
|
|
2127
|
+
"cax",
|
|
2128
|
+
[
|
|
2129
|
+
1,
|
|
2130
|
+
"px",
|
|
2131
|
+
"-",
|
|
2132
|
+
[
|
|
2133
|
+
6,
|
|
2134
|
+
[
|
|
2135
|
+
7,
|
|
2136
|
+
"std",
|
|
2137
|
+
"min"
|
|
2138
|
+
],
|
|
2139
|
+
["px", "clampWidth"]
|
|
2140
|
+
]
|
|
2141
|
+
]
|
|
2142
|
+
],
|
|
2143
|
+
[
|
|
2144
|
+
13,
|
|
2145
|
+
"cay",
|
|
2146
|
+
[
|
|
2147
|
+
1,
|
|
2148
|
+
[
|
|
2149
|
+
6,
|
|
2150
|
+
[
|
|
2151
|
+
7,
|
|
2152
|
+
"std",
|
|
2153
|
+
"abs"
|
|
2154
|
+
],
|
|
2155
|
+
["dy"]
|
|
2156
|
+
],
|
|
2157
|
+
"-",
|
|
2158
|
+
"he"
|
|
2159
|
+
]
|
|
2160
|
+
],
|
|
2161
|
+
[
|
|
2162
|
+
13,
|
|
2163
|
+
"diffX",
|
|
2164
|
+
[
|
|
2165
|
+
1,
|
|
2166
|
+
"k1x",
|
|
2167
|
+
"-",
|
|
2168
|
+
"px"
|
|
2169
|
+
]
|
|
2170
|
+
],
|
|
2171
|
+
[
|
|
2172
|
+
13,
|
|
2173
|
+
"diffY",
|
|
2174
|
+
[
|
|
2175
|
+
1,
|
|
2176
|
+
"k1y",
|
|
2177
|
+
"-",
|
|
2178
|
+
"dy"
|
|
2179
|
+
]
|
|
2180
|
+
],
|
|
2181
|
+
[
|
|
2182
|
+
13,
|
|
2183
|
+
"dotNum",
|
|
2184
|
+
[
|
|
2185
|
+
1,
|
|
2186
|
+
[
|
|
2187
|
+
1,
|
|
2188
|
+
"diffX",
|
|
2189
|
+
"*",
|
|
2190
|
+
"k2x"
|
|
2191
|
+
],
|
|
2192
|
+
"+",
|
|
2193
|
+
[
|
|
2194
|
+
1,
|
|
2195
|
+
"diffY",
|
|
2196
|
+
"*",
|
|
2197
|
+
"k2y"
|
|
2198
|
+
]
|
|
2199
|
+
]
|
|
2200
|
+
],
|
|
2201
|
+
[
|
|
2202
|
+
13,
|
|
2203
|
+
"dotDen",
|
|
2204
|
+
[
|
|
2205
|
+
6,
|
|
2206
|
+
[
|
|
2207
|
+
7,
|
|
2208
|
+
"std",
|
|
2209
|
+
"max"
|
|
2210
|
+
],
|
|
2211
|
+
[[
|
|
2212
|
+
1,
|
|
2213
|
+
[
|
|
2214
|
+
1,
|
|
2215
|
+
"k2x",
|
|
2216
|
+
"*",
|
|
2217
|
+
"k2x"
|
|
2218
|
+
],
|
|
2219
|
+
"+",
|
|
2220
|
+
[
|
|
2221
|
+
1,
|
|
2222
|
+
"k2y",
|
|
2223
|
+
"*",
|
|
2224
|
+
"k2y"
|
|
2225
|
+
]
|
|
2226
|
+
], [5, "0.0001"]]
|
|
2227
|
+
]
|
|
2228
|
+
],
|
|
2229
|
+
[
|
|
2230
|
+
13,
|
|
2231
|
+
"t",
|
|
2232
|
+
[
|
|
2233
|
+
6,
|
|
2234
|
+
[
|
|
2235
|
+
7,
|
|
2236
|
+
"std",
|
|
2237
|
+
"clamp"
|
|
2238
|
+
],
|
|
2239
|
+
[
|
|
2240
|
+
[
|
|
2241
|
+
1,
|
|
2242
|
+
"dotNum",
|
|
2243
|
+
"/",
|
|
2244
|
+
"dotDen"
|
|
2245
|
+
],
|
|
2246
|
+
[5, "0"],
|
|
2247
|
+
[5, "1"]
|
|
2248
|
+
]
|
|
2249
|
+
]
|
|
2250
|
+
],
|
|
2251
|
+
[
|
|
2252
|
+
13,
|
|
2253
|
+
"cbx",
|
|
2254
|
+
[
|
|
2255
|
+
1,
|
|
2256
|
+
[
|
|
2257
|
+
1,
|
|
2258
|
+
"px",
|
|
2259
|
+
"-",
|
|
2260
|
+
"k1x"
|
|
2261
|
+
],
|
|
2262
|
+
"+",
|
|
2263
|
+
[
|
|
2264
|
+
1,
|
|
2265
|
+
"k2x",
|
|
2266
|
+
"*",
|
|
2267
|
+
"t"
|
|
2268
|
+
]
|
|
2269
|
+
]
|
|
2270
|
+
],
|
|
2271
|
+
[
|
|
2272
|
+
13,
|
|
2273
|
+
"cby",
|
|
2274
|
+
[
|
|
2275
|
+
1,
|
|
2276
|
+
[
|
|
2277
|
+
1,
|
|
2278
|
+
"dy",
|
|
2279
|
+
"-",
|
|
2280
|
+
"k1y"
|
|
2281
|
+
],
|
|
2282
|
+
"+",
|
|
2283
|
+
[
|
|
2284
|
+
1,
|
|
2285
|
+
"k2y",
|
|
2286
|
+
"*",
|
|
2287
|
+
"t"
|
|
2288
|
+
]
|
|
2289
|
+
]
|
|
2290
|
+
],
|
|
2291
|
+
[
|
|
2292
|
+
13,
|
|
2293
|
+
"sInner",
|
|
2294
|
+
[
|
|
2295
|
+
6,
|
|
2296
|
+
[
|
|
2297
|
+
7,
|
|
2298
|
+
"std",
|
|
2299
|
+
"select"
|
|
2300
|
+
],
|
|
2301
|
+
[
|
|
2302
|
+
[
|
|
2303
|
+
6,
|
|
2304
|
+
[
|
|
2305
|
+
7,
|
|
2306
|
+
"d",
|
|
2307
|
+
"f32"
|
|
2308
|
+
],
|
|
2309
|
+
[[5, "1"]]
|
|
2310
|
+
],
|
|
2311
|
+
[
|
|
2312
|
+
6,
|
|
2313
|
+
[
|
|
2314
|
+
7,
|
|
2315
|
+
"d",
|
|
2316
|
+
"f32"
|
|
2317
|
+
],
|
|
2318
|
+
[[
|
|
2319
|
+
4,
|
|
2320
|
+
"-",
|
|
2321
|
+
[5, "1"]
|
|
2322
|
+
]]
|
|
2323
|
+
],
|
|
2324
|
+
[
|
|
2325
|
+
1,
|
|
2326
|
+
"cay",
|
|
2327
|
+
"<",
|
|
2328
|
+
[5, "0"]
|
|
2329
|
+
]
|
|
2330
|
+
]
|
|
2331
|
+
]
|
|
2332
|
+
],
|
|
2333
|
+
[
|
|
2334
|
+
13,
|
|
2335
|
+
"s",
|
|
2336
|
+
[
|
|
2337
|
+
6,
|
|
2338
|
+
[
|
|
2339
|
+
7,
|
|
2340
|
+
"std",
|
|
2341
|
+
"select"
|
|
2342
|
+
],
|
|
2343
|
+
[
|
|
2344
|
+
[
|
|
2345
|
+
6,
|
|
2346
|
+
[
|
|
2347
|
+
7,
|
|
2348
|
+
"d",
|
|
2349
|
+
"f32"
|
|
2350
|
+
],
|
|
2351
|
+
[[5, "1"]]
|
|
2352
|
+
],
|
|
2353
|
+
"sInner",
|
|
2354
|
+
[
|
|
2355
|
+
1,
|
|
2356
|
+
"cbx",
|
|
2357
|
+
"<",
|
|
2358
|
+
[5, "0"]
|
|
2359
|
+
]
|
|
2360
|
+
]
|
|
2361
|
+
]
|
|
2362
|
+
],
|
|
2363
|
+
[
|
|
2364
|
+
13,
|
|
2365
|
+
"dca",
|
|
2366
|
+
[
|
|
2367
|
+
1,
|
|
2368
|
+
[
|
|
2369
|
+
1,
|
|
2370
|
+
"cax",
|
|
2371
|
+
"*",
|
|
2372
|
+
"cax"
|
|
2373
|
+
],
|
|
2374
|
+
"+",
|
|
2375
|
+
[
|
|
2376
|
+
1,
|
|
2377
|
+
"cay",
|
|
2378
|
+
"*",
|
|
2379
|
+
"cay"
|
|
2380
|
+
]
|
|
2381
|
+
]
|
|
2382
|
+
],
|
|
2383
|
+
[
|
|
2384
|
+
13,
|
|
2385
|
+
"dcb",
|
|
2386
|
+
[
|
|
2387
|
+
1,
|
|
2388
|
+
[
|
|
2389
|
+
1,
|
|
2390
|
+
"cbx",
|
|
2391
|
+
"*",
|
|
2392
|
+
"cbx"
|
|
2393
|
+
],
|
|
2394
|
+
"+",
|
|
2395
|
+
[
|
|
2396
|
+
1,
|
|
2397
|
+
"cby",
|
|
2398
|
+
"*",
|
|
2399
|
+
"cby"
|
|
2400
|
+
]
|
|
2401
|
+
]
|
|
2402
|
+
],
|
|
2403
|
+
[10, [
|
|
2404
|
+
1,
|
|
2405
|
+
"s",
|
|
2406
|
+
"*",
|
|
2407
|
+
[
|
|
2408
|
+
6,
|
|
2409
|
+
[
|
|
2410
|
+
7,
|
|
2411
|
+
"std",
|
|
2412
|
+
"sqrt"
|
|
2413
|
+
],
|
|
2414
|
+
[[
|
|
2415
|
+
6,
|
|
2416
|
+
[
|
|
2417
|
+
7,
|
|
2418
|
+
"std",
|
|
2419
|
+
"min"
|
|
2420
|
+
],
|
|
2421
|
+
["dca", "dcb"]
|
|
2422
|
+
]]
|
|
2423
|
+
]
|
|
2424
|
+
]]
|
|
2425
|
+
]],
|
|
2426
|
+
"externalNames": ["std", "d"]
|
|
2427
|
+
},
|
|
2428
|
+
externals: () => ({
|
|
2429
|
+
std: std_exports,
|
|
2430
|
+
d: data_exports
|
|
2431
|
+
})
|
|
2432
|
+
}) && $.f)({}));
|
|
2433
|
+
const heartSdf = src_default.fn([
|
|
2434
|
+
f32,
|
|
2435
|
+
f32,
|
|
2436
|
+
f32
|
|
2437
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radius) => {
|
|
2438
|
+
"use gpu";
|
|
2439
|
+
const S = __tsover_div(radius, .75);
|
|
2440
|
+
const px = __tsover_div(abs(dx), S);
|
|
2441
|
+
const py = __tsover_add(__tsover_div(__tsover_mul(dy, -1), S), .6);
|
|
2442
|
+
const ax = __tsover_sub(px, .25);
|
|
2443
|
+
const ay = __tsover_sub(py, .75);
|
|
2444
|
+
const distA = __tsover_sub(sqrt(__tsover_add(__tsover_mul(ax, ax), __tsover_mul(ay, ay))), SQRT2_OVER_4);
|
|
2445
|
+
const b1y = __tsover_sub(py, 1);
|
|
2446
|
+
const dot1 = __tsover_add(__tsover_mul(px, px), __tsover_mul(b1y, b1y));
|
|
2447
|
+
const m = __tsover_mul(max(__tsover_add(px, py), 0), .5);
|
|
2448
|
+
const b2x = __tsover_sub(px, m);
|
|
2449
|
+
const b2y = __tsover_sub(py, m);
|
|
2450
|
+
const dot2v = __tsover_add(__tsover_mul(b2x, b2x), __tsover_mul(b2y, b2y));
|
|
2451
|
+
const distB = __tsover_mul(sqrt(min(dot1, dot2v)), sign(__tsover_sub(px, py)));
|
|
2452
|
+
return __tsover_mul(select(distB, distA, __tsover_add(px, py) > 1), S);
|
|
2453
|
+
}), {
|
|
2454
|
+
v: 1,
|
|
2455
|
+
name: void 0,
|
|
2456
|
+
ast: {
|
|
2457
|
+
"params": [
|
|
2458
|
+
{
|
|
2459
|
+
"type": "i",
|
|
2460
|
+
"name": "dx"
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
"type": "i",
|
|
2464
|
+
"name": "dy"
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
"type": "i",
|
|
2468
|
+
"name": "radius"
|
|
2469
|
+
}
|
|
2470
|
+
],
|
|
2471
|
+
"body": [0, [
|
|
2472
|
+
[
|
|
2473
|
+
13,
|
|
2474
|
+
"S",
|
|
2475
|
+
[
|
|
2476
|
+
1,
|
|
2477
|
+
"radius",
|
|
2478
|
+
"/",
|
|
2479
|
+
[5, "0.75"]
|
|
2480
|
+
]
|
|
2481
|
+
],
|
|
2482
|
+
[
|
|
2483
|
+
13,
|
|
2484
|
+
"px",
|
|
2485
|
+
[
|
|
2486
|
+
1,
|
|
2487
|
+
[
|
|
2488
|
+
6,
|
|
2489
|
+
[
|
|
2490
|
+
7,
|
|
2491
|
+
"std",
|
|
2492
|
+
"abs"
|
|
2493
|
+
],
|
|
2494
|
+
["dx"]
|
|
2495
|
+
],
|
|
2496
|
+
"/",
|
|
2497
|
+
"S"
|
|
2498
|
+
]
|
|
2499
|
+
],
|
|
2500
|
+
[
|
|
2501
|
+
13,
|
|
2502
|
+
"py",
|
|
2503
|
+
[
|
|
2504
|
+
1,
|
|
2505
|
+
[
|
|
2506
|
+
1,
|
|
2507
|
+
[
|
|
2508
|
+
1,
|
|
2509
|
+
"dy",
|
|
2510
|
+
"*",
|
|
2511
|
+
[
|
|
2512
|
+
4,
|
|
2513
|
+
"-",
|
|
2514
|
+
[5, "1"]
|
|
2515
|
+
]
|
|
2516
|
+
],
|
|
2517
|
+
"/",
|
|
2518
|
+
"S"
|
|
2519
|
+
],
|
|
2520
|
+
"+",
|
|
2521
|
+
[5, "0.6"]
|
|
2522
|
+
]
|
|
2523
|
+
],
|
|
2524
|
+
[
|
|
2525
|
+
13,
|
|
2526
|
+
"ax",
|
|
2527
|
+
[
|
|
2528
|
+
1,
|
|
2529
|
+
"px",
|
|
2530
|
+
"-",
|
|
2531
|
+
[5, "0.25"]
|
|
2532
|
+
]
|
|
2533
|
+
],
|
|
2534
|
+
[
|
|
2535
|
+
13,
|
|
2536
|
+
"ay",
|
|
2537
|
+
[
|
|
2538
|
+
1,
|
|
2539
|
+
"py",
|
|
2540
|
+
"-",
|
|
2541
|
+
[5, "0.75"]
|
|
2542
|
+
]
|
|
2543
|
+
],
|
|
2544
|
+
[
|
|
2545
|
+
13,
|
|
2546
|
+
"distA",
|
|
2547
|
+
[
|
|
2548
|
+
1,
|
|
2549
|
+
[
|
|
2550
|
+
6,
|
|
2551
|
+
[
|
|
2552
|
+
7,
|
|
2553
|
+
"std",
|
|
2554
|
+
"sqrt"
|
|
2555
|
+
],
|
|
2556
|
+
[[
|
|
2557
|
+
1,
|
|
2558
|
+
[
|
|
2559
|
+
1,
|
|
2560
|
+
"ax",
|
|
2561
|
+
"*",
|
|
2562
|
+
"ax"
|
|
2563
|
+
],
|
|
2564
|
+
"+",
|
|
2565
|
+
[
|
|
2566
|
+
1,
|
|
2567
|
+
"ay",
|
|
2568
|
+
"*",
|
|
2569
|
+
"ay"
|
|
2570
|
+
]
|
|
2571
|
+
]]
|
|
2572
|
+
],
|
|
2573
|
+
"-",
|
|
2574
|
+
"SQRT2_OVER_4"
|
|
2575
|
+
]
|
|
2576
|
+
],
|
|
2577
|
+
[
|
|
2578
|
+
13,
|
|
2579
|
+
"b1y",
|
|
2580
|
+
[
|
|
2581
|
+
1,
|
|
2582
|
+
"py",
|
|
2583
|
+
"-",
|
|
2584
|
+
[5, "1"]
|
|
2585
|
+
]
|
|
2586
|
+
],
|
|
2587
|
+
[
|
|
2588
|
+
13,
|
|
2589
|
+
"dot1",
|
|
2590
|
+
[
|
|
2591
|
+
1,
|
|
2592
|
+
[
|
|
2593
|
+
1,
|
|
2594
|
+
"px",
|
|
2595
|
+
"*",
|
|
2596
|
+
"px"
|
|
2597
|
+
],
|
|
2598
|
+
"+",
|
|
2599
|
+
[
|
|
2600
|
+
1,
|
|
2601
|
+
"b1y",
|
|
2602
|
+
"*",
|
|
2603
|
+
"b1y"
|
|
2604
|
+
]
|
|
2605
|
+
]
|
|
2606
|
+
],
|
|
2607
|
+
[
|
|
2608
|
+
13,
|
|
2609
|
+
"m",
|
|
2610
|
+
[
|
|
2611
|
+
1,
|
|
2612
|
+
[
|
|
2613
|
+
6,
|
|
2614
|
+
[
|
|
2615
|
+
7,
|
|
2616
|
+
"std",
|
|
2617
|
+
"max"
|
|
2618
|
+
],
|
|
2619
|
+
[[
|
|
2620
|
+
1,
|
|
2621
|
+
"px",
|
|
2622
|
+
"+",
|
|
2623
|
+
"py"
|
|
2624
|
+
], [5, "0"]]
|
|
2625
|
+
],
|
|
2626
|
+
"*",
|
|
2627
|
+
[5, "0.5"]
|
|
2628
|
+
]
|
|
2629
|
+
],
|
|
2630
|
+
[
|
|
2631
|
+
13,
|
|
2632
|
+
"b2x",
|
|
2633
|
+
[
|
|
2634
|
+
1,
|
|
2635
|
+
"px",
|
|
2636
|
+
"-",
|
|
2637
|
+
"m"
|
|
2638
|
+
]
|
|
2639
|
+
],
|
|
2640
|
+
[
|
|
2641
|
+
13,
|
|
2642
|
+
"b2y",
|
|
2643
|
+
[
|
|
2644
|
+
1,
|
|
2645
|
+
"py",
|
|
2646
|
+
"-",
|
|
2647
|
+
"m"
|
|
2648
|
+
]
|
|
2649
|
+
],
|
|
2650
|
+
[
|
|
2651
|
+
13,
|
|
2652
|
+
"dot2v",
|
|
2653
|
+
[
|
|
2654
|
+
1,
|
|
2655
|
+
[
|
|
2656
|
+
1,
|
|
2657
|
+
"b2x",
|
|
2658
|
+
"*",
|
|
2659
|
+
"b2x"
|
|
2660
|
+
],
|
|
2661
|
+
"+",
|
|
2662
|
+
[
|
|
2663
|
+
1,
|
|
2664
|
+
"b2y",
|
|
2665
|
+
"*",
|
|
2666
|
+
"b2y"
|
|
2667
|
+
]
|
|
2668
|
+
]
|
|
2669
|
+
],
|
|
2670
|
+
[
|
|
2671
|
+
13,
|
|
2672
|
+
"distB",
|
|
2673
|
+
[
|
|
2674
|
+
1,
|
|
2675
|
+
[
|
|
2676
|
+
6,
|
|
2677
|
+
[
|
|
2678
|
+
7,
|
|
2679
|
+
"std",
|
|
2680
|
+
"sqrt"
|
|
2681
|
+
],
|
|
2682
|
+
[[
|
|
2683
|
+
6,
|
|
2684
|
+
[
|
|
2685
|
+
7,
|
|
2686
|
+
"std",
|
|
2687
|
+
"min"
|
|
2688
|
+
],
|
|
2689
|
+
["dot1", "dot2v"]
|
|
2690
|
+
]]
|
|
2691
|
+
],
|
|
2692
|
+
"*",
|
|
2693
|
+
[
|
|
2694
|
+
6,
|
|
2695
|
+
[
|
|
2696
|
+
7,
|
|
2697
|
+
"std",
|
|
2698
|
+
"sign"
|
|
2699
|
+
],
|
|
2700
|
+
[[
|
|
2701
|
+
1,
|
|
2702
|
+
"px",
|
|
2703
|
+
"-",
|
|
2704
|
+
"py"
|
|
2705
|
+
]]
|
|
2706
|
+
]
|
|
2707
|
+
]
|
|
2708
|
+
],
|
|
2709
|
+
[10, [
|
|
2710
|
+
1,
|
|
2711
|
+
[
|
|
2712
|
+
6,
|
|
2713
|
+
[
|
|
2714
|
+
7,
|
|
2715
|
+
"std",
|
|
2716
|
+
"select"
|
|
2717
|
+
],
|
|
2718
|
+
[
|
|
2719
|
+
"distB",
|
|
2720
|
+
"distA",
|
|
2721
|
+
[
|
|
2722
|
+
1,
|
|
2723
|
+
[
|
|
2724
|
+
1,
|
|
2725
|
+
"px",
|
|
2726
|
+
"+",
|
|
2727
|
+
"py"
|
|
2728
|
+
],
|
|
2729
|
+
">",
|
|
2730
|
+
[5, "1"]
|
|
2731
|
+
]
|
|
2732
|
+
]
|
|
2733
|
+
],
|
|
2734
|
+
"*",
|
|
2735
|
+
"S"
|
|
2736
|
+
]]
|
|
2737
|
+
]],
|
|
2738
|
+
"externalNames": ["std", "SQRT2_OVER_4"]
|
|
2739
|
+
},
|
|
2740
|
+
externals: () => ({
|
|
2741
|
+
std: std_exports,
|
|
2742
|
+
SQRT2_OVER_4
|
|
2743
|
+
})
|
|
2744
|
+
}) && $.f)({}));
|
|
2745
|
+
const arcSdf = src_default.fn([
|
|
2746
|
+
f32,
|
|
2747
|
+
f32,
|
|
2748
|
+
f32,
|
|
2749
|
+
f32
|
|
2750
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radius, halfAngle) => {
|
|
2751
|
+
"use gpu";
|
|
2752
|
+
const px = abs(dx);
|
|
2753
|
+
const cx = sin(halfAngle);
|
|
2754
|
+
const cy = cos(halfAngle);
|
|
2755
|
+
const l = __tsover_sub(sqrt(__tsover_add(__tsover_mul(px, px), __tsover_mul(dy, dy))), radius);
|
|
2756
|
+
const clamped = clamp(__tsover_add(__tsover_mul(px, cx), __tsover_mul(dy, cy)), 0, radius);
|
|
2757
|
+
const mx = __tsover_sub(px, __tsover_mul(cx, clamped));
|
|
2758
|
+
const my = __tsover_sub(dy, __tsover_mul(cy, clamped));
|
|
2759
|
+
const m = sqrt(__tsover_add(__tsover_mul(mx, mx), __tsover_mul(my, my)));
|
|
2760
|
+
return max(l, __tsover_mul(m, sign(__tsover_sub(__tsover_mul(cy, px), __tsover_mul(cx, dy)))));
|
|
2761
|
+
}), {
|
|
2762
|
+
v: 1,
|
|
2763
|
+
name: void 0,
|
|
2764
|
+
ast: {
|
|
2765
|
+
"params": [
|
|
2766
|
+
{
|
|
2767
|
+
"type": "i",
|
|
2768
|
+
"name": "dx"
|
|
2769
|
+
},
|
|
2770
|
+
{
|
|
2771
|
+
"type": "i",
|
|
2772
|
+
"name": "dy"
|
|
2773
|
+
},
|
|
2774
|
+
{
|
|
2775
|
+
"type": "i",
|
|
2776
|
+
"name": "radius"
|
|
2777
|
+
},
|
|
2778
|
+
{
|
|
2779
|
+
"type": "i",
|
|
2780
|
+
"name": "halfAngle"
|
|
2781
|
+
}
|
|
2782
|
+
],
|
|
2783
|
+
"body": [0, [
|
|
2784
|
+
[
|
|
2785
|
+
13,
|
|
2786
|
+
"px",
|
|
2787
|
+
[
|
|
2788
|
+
6,
|
|
2789
|
+
[
|
|
2790
|
+
7,
|
|
2791
|
+
"std",
|
|
2792
|
+
"abs"
|
|
2793
|
+
],
|
|
2794
|
+
["dx"]
|
|
2795
|
+
]
|
|
2796
|
+
],
|
|
2797
|
+
[
|
|
2798
|
+
13,
|
|
2799
|
+
"cx",
|
|
2800
|
+
[
|
|
2801
|
+
6,
|
|
2802
|
+
[
|
|
2803
|
+
7,
|
|
2804
|
+
"std",
|
|
2805
|
+
"sin"
|
|
2806
|
+
],
|
|
2807
|
+
["halfAngle"]
|
|
2808
|
+
]
|
|
2809
|
+
],
|
|
2810
|
+
[
|
|
2811
|
+
13,
|
|
2812
|
+
"cy",
|
|
2813
|
+
[
|
|
2814
|
+
6,
|
|
2815
|
+
[
|
|
2816
|
+
7,
|
|
2817
|
+
"std",
|
|
2818
|
+
"cos"
|
|
2819
|
+
],
|
|
2820
|
+
["halfAngle"]
|
|
2821
|
+
]
|
|
2822
|
+
],
|
|
2823
|
+
[
|
|
2824
|
+
13,
|
|
2825
|
+
"l",
|
|
2826
|
+
[
|
|
2827
|
+
1,
|
|
2828
|
+
[
|
|
2829
|
+
6,
|
|
2830
|
+
[
|
|
2831
|
+
7,
|
|
2832
|
+
"std",
|
|
2833
|
+
"sqrt"
|
|
2834
|
+
],
|
|
2835
|
+
[[
|
|
2836
|
+
1,
|
|
2837
|
+
[
|
|
2838
|
+
1,
|
|
2839
|
+
"px",
|
|
2840
|
+
"*",
|
|
2841
|
+
"px"
|
|
2842
|
+
],
|
|
2843
|
+
"+",
|
|
2844
|
+
[
|
|
2845
|
+
1,
|
|
2846
|
+
"dy",
|
|
2847
|
+
"*",
|
|
2848
|
+
"dy"
|
|
2849
|
+
]
|
|
2850
|
+
]]
|
|
2851
|
+
],
|
|
2852
|
+
"-",
|
|
2853
|
+
"radius"
|
|
2854
|
+
]
|
|
2855
|
+
],
|
|
2856
|
+
[
|
|
2857
|
+
13,
|
|
2858
|
+
"clamped",
|
|
2859
|
+
[
|
|
2860
|
+
6,
|
|
2861
|
+
[
|
|
2862
|
+
7,
|
|
2863
|
+
"std",
|
|
2864
|
+
"clamp"
|
|
2865
|
+
],
|
|
2866
|
+
[
|
|
2867
|
+
[
|
|
2868
|
+
1,
|
|
2869
|
+
[
|
|
2870
|
+
1,
|
|
2871
|
+
"px",
|
|
2872
|
+
"*",
|
|
2873
|
+
"cx"
|
|
2874
|
+
],
|
|
2875
|
+
"+",
|
|
2876
|
+
[
|
|
2877
|
+
1,
|
|
2878
|
+
"dy",
|
|
2879
|
+
"*",
|
|
2880
|
+
"cy"
|
|
2881
|
+
]
|
|
2882
|
+
],
|
|
2883
|
+
[5, "0"],
|
|
2884
|
+
"radius"
|
|
2885
|
+
]
|
|
2886
|
+
]
|
|
2887
|
+
],
|
|
2888
|
+
[
|
|
2889
|
+
13,
|
|
2890
|
+
"mx",
|
|
2891
|
+
[
|
|
2892
|
+
1,
|
|
2893
|
+
"px",
|
|
2894
|
+
"-",
|
|
2895
|
+
[
|
|
2896
|
+
1,
|
|
2897
|
+
"cx",
|
|
2898
|
+
"*",
|
|
2899
|
+
"clamped"
|
|
2900
|
+
]
|
|
2901
|
+
]
|
|
2902
|
+
],
|
|
2903
|
+
[
|
|
2904
|
+
13,
|
|
2905
|
+
"my",
|
|
2906
|
+
[
|
|
2907
|
+
1,
|
|
2908
|
+
"dy",
|
|
2909
|
+
"-",
|
|
2910
|
+
[
|
|
2911
|
+
1,
|
|
2912
|
+
"cy",
|
|
2913
|
+
"*",
|
|
2914
|
+
"clamped"
|
|
2915
|
+
]
|
|
2916
|
+
]
|
|
2917
|
+
],
|
|
2918
|
+
[
|
|
2919
|
+
13,
|
|
2920
|
+
"m",
|
|
2921
|
+
[
|
|
2922
|
+
6,
|
|
2923
|
+
[
|
|
2924
|
+
7,
|
|
2925
|
+
"std",
|
|
2926
|
+
"sqrt"
|
|
2927
|
+
],
|
|
2928
|
+
[[
|
|
2929
|
+
1,
|
|
2930
|
+
[
|
|
2931
|
+
1,
|
|
2932
|
+
"mx",
|
|
2933
|
+
"*",
|
|
2934
|
+
"mx"
|
|
2935
|
+
],
|
|
2936
|
+
"+",
|
|
2937
|
+
[
|
|
2938
|
+
1,
|
|
2939
|
+
"my",
|
|
2940
|
+
"*",
|
|
2941
|
+
"my"
|
|
2942
|
+
]
|
|
2943
|
+
]]
|
|
2944
|
+
]
|
|
2945
|
+
],
|
|
2946
|
+
[10, [
|
|
2947
|
+
6,
|
|
2948
|
+
[
|
|
2949
|
+
7,
|
|
2950
|
+
"std",
|
|
2951
|
+
"max"
|
|
2952
|
+
],
|
|
2953
|
+
["l", [
|
|
2954
|
+
1,
|
|
2955
|
+
"m",
|
|
2956
|
+
"*",
|
|
2957
|
+
[
|
|
2958
|
+
6,
|
|
2959
|
+
[
|
|
2960
|
+
7,
|
|
2961
|
+
"std",
|
|
2962
|
+
"sign"
|
|
2963
|
+
],
|
|
2964
|
+
[[
|
|
2965
|
+
1,
|
|
2966
|
+
[
|
|
2967
|
+
1,
|
|
2968
|
+
"cy",
|
|
2969
|
+
"*",
|
|
2970
|
+
"px"
|
|
2971
|
+
],
|
|
2972
|
+
"-",
|
|
2973
|
+
[
|
|
2974
|
+
1,
|
|
2975
|
+
"cx",
|
|
2976
|
+
"*",
|
|
2977
|
+
"dy"
|
|
2978
|
+
]
|
|
2979
|
+
]]
|
|
2980
|
+
]
|
|
2981
|
+
]]
|
|
2982
|
+
]]
|
|
2983
|
+
]],
|
|
2984
|
+
"externalNames": ["std"]
|
|
2985
|
+
},
|
|
2986
|
+
externals: () => ({ std: std_exports })
|
|
2987
|
+
}) && $.f)({}));
|
|
2988
|
+
const teardropSdf = src_default.fn([
|
|
2989
|
+
f32,
|
|
2990
|
+
f32,
|
|
2991
|
+
f32,
|
|
2992
|
+
f32
|
|
2993
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, radius, h) => {
|
|
2994
|
+
"use gpu";
|
|
2995
|
+
const mid = __tsover_mul(__tsover_sub(h, radius), .5);
|
|
2996
|
+
const qx = abs(dx);
|
|
2997
|
+
const qy = __tsover_add(__tsover_mul(dy, -1), mid);
|
|
2998
|
+
const hSafe = max(h, 1e-4);
|
|
2999
|
+
const b = __tsover_div(radius, hSafe);
|
|
3000
|
+
const a = sqrt(max(__tsover_sub(1, __tsover_mul(b, b)), 0));
|
|
3001
|
+
const k = __tsover_add(__tsover_mul(qx, __tsover_mul(b, -1)), __tsover_mul(qy, a));
|
|
3002
|
+
const cap0 = __tsover_sub(sqrt(__tsover_add(__tsover_mul(qx, qx), __tsover_mul(qy, qy))), radius);
|
|
3003
|
+
const qyTip = __tsover_sub(qy, h);
|
|
3004
|
+
const cap1 = sqrt(__tsover_add(__tsover_mul(qx, qx), __tsover_mul(qyTip, qyTip)));
|
|
3005
|
+
return select(select(__tsover_sub(__tsover_add(__tsover_mul(qx, a), __tsover_mul(qy, b)), radius), cap1, k > __tsover_mul(a, h)), cap0, k < 0);
|
|
3006
|
+
}), {
|
|
3007
|
+
v: 1,
|
|
3008
|
+
name: void 0,
|
|
3009
|
+
ast: {
|
|
3010
|
+
"params": [
|
|
3011
|
+
{
|
|
3012
|
+
"type": "i",
|
|
3013
|
+
"name": "dx"
|
|
3014
|
+
},
|
|
3015
|
+
{
|
|
3016
|
+
"type": "i",
|
|
3017
|
+
"name": "dy"
|
|
3018
|
+
},
|
|
3019
|
+
{
|
|
3020
|
+
"type": "i",
|
|
3021
|
+
"name": "radius"
|
|
3022
|
+
},
|
|
3023
|
+
{
|
|
3024
|
+
"type": "i",
|
|
3025
|
+
"name": "h"
|
|
3026
|
+
}
|
|
3027
|
+
],
|
|
3028
|
+
"body": [0, [
|
|
3029
|
+
[
|
|
3030
|
+
13,
|
|
3031
|
+
"mid",
|
|
3032
|
+
[
|
|
3033
|
+
1,
|
|
3034
|
+
[
|
|
3035
|
+
1,
|
|
3036
|
+
"h",
|
|
3037
|
+
"-",
|
|
3038
|
+
"radius"
|
|
3039
|
+
],
|
|
3040
|
+
"*",
|
|
3041
|
+
[5, "0.5"]
|
|
3042
|
+
]
|
|
3043
|
+
],
|
|
3044
|
+
[
|
|
3045
|
+
13,
|
|
3046
|
+
"qx",
|
|
3047
|
+
[
|
|
3048
|
+
6,
|
|
3049
|
+
[
|
|
3050
|
+
7,
|
|
3051
|
+
"std",
|
|
3052
|
+
"abs"
|
|
3053
|
+
],
|
|
3054
|
+
["dx"]
|
|
3055
|
+
]
|
|
3056
|
+
],
|
|
3057
|
+
[
|
|
3058
|
+
13,
|
|
3059
|
+
"qy",
|
|
3060
|
+
[
|
|
3061
|
+
1,
|
|
3062
|
+
[
|
|
3063
|
+
1,
|
|
3064
|
+
"dy",
|
|
3065
|
+
"*",
|
|
3066
|
+
[
|
|
3067
|
+
4,
|
|
3068
|
+
"-",
|
|
3069
|
+
[5, "1"]
|
|
3070
|
+
]
|
|
3071
|
+
],
|
|
3072
|
+
"+",
|
|
3073
|
+
"mid"
|
|
3074
|
+
]
|
|
3075
|
+
],
|
|
3076
|
+
[
|
|
3077
|
+
13,
|
|
3078
|
+
"hSafe",
|
|
3079
|
+
[
|
|
3080
|
+
6,
|
|
3081
|
+
[
|
|
3082
|
+
7,
|
|
3083
|
+
"std",
|
|
3084
|
+
"max"
|
|
3085
|
+
],
|
|
3086
|
+
["h", [5, "0.0001"]]
|
|
3087
|
+
]
|
|
3088
|
+
],
|
|
3089
|
+
[
|
|
3090
|
+
13,
|
|
3091
|
+
"b",
|
|
3092
|
+
[
|
|
3093
|
+
1,
|
|
3094
|
+
"radius",
|
|
3095
|
+
"/",
|
|
3096
|
+
"hSafe"
|
|
3097
|
+
]
|
|
3098
|
+
],
|
|
3099
|
+
[
|
|
3100
|
+
13,
|
|
3101
|
+
"a",
|
|
3102
|
+
[
|
|
3103
|
+
6,
|
|
3104
|
+
[
|
|
3105
|
+
7,
|
|
3106
|
+
"std",
|
|
3107
|
+
"sqrt"
|
|
3108
|
+
],
|
|
3109
|
+
[[
|
|
3110
|
+
6,
|
|
3111
|
+
[
|
|
3112
|
+
7,
|
|
3113
|
+
"std",
|
|
3114
|
+
"max"
|
|
3115
|
+
],
|
|
3116
|
+
[[
|
|
3117
|
+
1,
|
|
3118
|
+
[5, "1"],
|
|
3119
|
+
"-",
|
|
3120
|
+
[
|
|
3121
|
+
1,
|
|
3122
|
+
"b",
|
|
3123
|
+
"*",
|
|
3124
|
+
"b"
|
|
3125
|
+
]
|
|
3126
|
+
], [5, "0"]]
|
|
3127
|
+
]]
|
|
3128
|
+
]
|
|
3129
|
+
],
|
|
3130
|
+
[
|
|
3131
|
+
13,
|
|
3132
|
+
"k",
|
|
3133
|
+
[
|
|
3134
|
+
1,
|
|
3135
|
+
[
|
|
3136
|
+
1,
|
|
3137
|
+
"qx",
|
|
3138
|
+
"*",
|
|
3139
|
+
[
|
|
3140
|
+
1,
|
|
3141
|
+
"b",
|
|
3142
|
+
"*",
|
|
3143
|
+
[
|
|
3144
|
+
4,
|
|
3145
|
+
"-",
|
|
3146
|
+
[5, "1"]
|
|
3147
|
+
]
|
|
3148
|
+
]
|
|
3149
|
+
],
|
|
3150
|
+
"+",
|
|
3151
|
+
[
|
|
3152
|
+
1,
|
|
3153
|
+
"qy",
|
|
3154
|
+
"*",
|
|
3155
|
+
"a"
|
|
3156
|
+
]
|
|
3157
|
+
]
|
|
3158
|
+
],
|
|
3159
|
+
[
|
|
3160
|
+
13,
|
|
3161
|
+
"cap0",
|
|
3162
|
+
[
|
|
3163
|
+
1,
|
|
3164
|
+
[
|
|
3165
|
+
6,
|
|
3166
|
+
[
|
|
3167
|
+
7,
|
|
3168
|
+
"std",
|
|
3169
|
+
"sqrt"
|
|
3170
|
+
],
|
|
3171
|
+
[[
|
|
3172
|
+
1,
|
|
3173
|
+
[
|
|
3174
|
+
1,
|
|
3175
|
+
"qx",
|
|
3176
|
+
"*",
|
|
3177
|
+
"qx"
|
|
3178
|
+
],
|
|
3179
|
+
"+",
|
|
3180
|
+
[
|
|
3181
|
+
1,
|
|
3182
|
+
"qy",
|
|
3183
|
+
"*",
|
|
3184
|
+
"qy"
|
|
3185
|
+
]
|
|
3186
|
+
]]
|
|
3187
|
+
],
|
|
3188
|
+
"-",
|
|
3189
|
+
"radius"
|
|
3190
|
+
]
|
|
3191
|
+
],
|
|
3192
|
+
[
|
|
3193
|
+
13,
|
|
3194
|
+
"qyTip",
|
|
3195
|
+
[
|
|
3196
|
+
1,
|
|
3197
|
+
"qy",
|
|
3198
|
+
"-",
|
|
3199
|
+
"h"
|
|
3200
|
+
]
|
|
3201
|
+
],
|
|
3202
|
+
[
|
|
3203
|
+
13,
|
|
3204
|
+
"cap1",
|
|
3205
|
+
[
|
|
3206
|
+
6,
|
|
3207
|
+
[
|
|
3208
|
+
7,
|
|
3209
|
+
"std",
|
|
3210
|
+
"sqrt"
|
|
3211
|
+
],
|
|
3212
|
+
[[
|
|
3213
|
+
1,
|
|
3214
|
+
[
|
|
3215
|
+
1,
|
|
3216
|
+
"qx",
|
|
3217
|
+
"*",
|
|
3218
|
+
"qx"
|
|
3219
|
+
],
|
|
3220
|
+
"+",
|
|
3221
|
+
[
|
|
3222
|
+
1,
|
|
3223
|
+
"qyTip",
|
|
3224
|
+
"*",
|
|
3225
|
+
"qyTip"
|
|
3226
|
+
]
|
|
3227
|
+
]]
|
|
3228
|
+
]
|
|
3229
|
+
],
|
|
3230
|
+
[
|
|
3231
|
+
13,
|
|
3232
|
+
"body",
|
|
3233
|
+
[
|
|
3234
|
+
1,
|
|
3235
|
+
[
|
|
3236
|
+
1,
|
|
3237
|
+
[
|
|
3238
|
+
1,
|
|
3239
|
+
"qx",
|
|
3240
|
+
"*",
|
|
3241
|
+
"a"
|
|
3242
|
+
],
|
|
3243
|
+
"+",
|
|
3244
|
+
[
|
|
3245
|
+
1,
|
|
3246
|
+
"qy",
|
|
3247
|
+
"*",
|
|
3248
|
+
"b"
|
|
3249
|
+
]
|
|
3250
|
+
],
|
|
3251
|
+
"-",
|
|
3252
|
+
"radius"
|
|
3253
|
+
]
|
|
3254
|
+
],
|
|
3255
|
+
[10, [
|
|
3256
|
+
6,
|
|
3257
|
+
[
|
|
3258
|
+
7,
|
|
3259
|
+
"std",
|
|
3260
|
+
"select"
|
|
3261
|
+
],
|
|
3262
|
+
[
|
|
3263
|
+
[
|
|
3264
|
+
6,
|
|
3265
|
+
[
|
|
3266
|
+
7,
|
|
3267
|
+
"std",
|
|
3268
|
+
"select"
|
|
3269
|
+
],
|
|
3270
|
+
[
|
|
3271
|
+
"body",
|
|
3272
|
+
"cap1",
|
|
3273
|
+
[
|
|
3274
|
+
1,
|
|
3275
|
+
"k",
|
|
3276
|
+
">",
|
|
3277
|
+
[
|
|
3278
|
+
1,
|
|
3279
|
+
"a",
|
|
3280
|
+
"*",
|
|
3281
|
+
"h"
|
|
3282
|
+
]
|
|
3283
|
+
]
|
|
3284
|
+
]
|
|
3285
|
+
],
|
|
3286
|
+
"cap0",
|
|
3287
|
+
[
|
|
3288
|
+
1,
|
|
3289
|
+
"k",
|
|
3290
|
+
"<",
|
|
3291
|
+
[5, "0"]
|
|
3292
|
+
]
|
|
3293
|
+
]
|
|
3294
|
+
]]
|
|
3295
|
+
]],
|
|
3296
|
+
"externalNames": ["std"]
|
|
3297
|
+
},
|
|
3298
|
+
externals: () => ({ std: std_exports })
|
|
3299
|
+
}) && $.f)({}));
|
|
3300
|
+
const parallelogramSdf = src_default.fn([
|
|
3301
|
+
f32,
|
|
3302
|
+
f32,
|
|
3303
|
+
f32,
|
|
3304
|
+
f32,
|
|
3305
|
+
f32
|
|
3306
|
+
], f32)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dx, dy, wi, he, sk) => {
|
|
3307
|
+
"use gpu";
|
|
3308
|
+
const ex = sk;
|
|
3309
|
+
const ey = he;
|
|
3310
|
+
const flip1 = dy < 0;
|
|
3311
|
+
const px0 = select(dx, __tsover_mul(dx, -1), flip1);
|
|
3312
|
+
const py0 = select(dy, __tsover_mul(dy, -1), flip1);
|
|
3313
|
+
const wx0 = __tsover_sub(px0, ex);
|
|
3314
|
+
const wy = __tsover_sub(py0, ey);
|
|
3315
|
+
const wx = __tsover_sub(wx0, clamp(wx0, __tsover_mul(wi, -1), wi));
|
|
3316
|
+
const dX = __tsover_add(__tsover_mul(wx, wx), __tsover_mul(wy, wy));
|
|
3317
|
+
const dY = __tsover_mul(wy, -1);
|
|
3318
|
+
const s = __tsover_sub(__tsover_mul(px0, ey), __tsover_mul(py0, ex));
|
|
3319
|
+
const flip2 = s < 0;
|
|
3320
|
+
const px = select(px0, __tsover_mul(px0, -1), flip2);
|
|
3321
|
+
const py = select(py0, __tsover_mul(py0, -1), flip2);
|
|
3322
|
+
const vx0 = __tsover_sub(px, wi);
|
|
3323
|
+
const dotve = __tsover_add(__tsover_mul(vx0, ex), __tsover_mul(py, ey));
|
|
3324
|
+
const dotee = max(__tsover_add(__tsover_mul(ex, ex), __tsover_mul(ey, ey)), 1e-4);
|
|
3325
|
+
const tt = clamp(__tsover_div(dotve, dotee), -1, 1);
|
|
3326
|
+
const vx = __tsover_sub(vx0, __tsover_mul(ex, tt));
|
|
3327
|
+
const vy = __tsover_sub(py, __tsover_mul(ey, tt));
|
|
3328
|
+
const finalX = min(dX, __tsover_add(__tsover_mul(vx, vx), __tsover_mul(vy, vy)));
|
|
3329
|
+
const finalY = min(dY, __tsover_sub(__tsover_mul(wi, he), abs(s)));
|
|
3330
|
+
return __tsover_mul(sqrt(finalX), sign(__tsover_mul(finalY, -1)));
|
|
3331
|
+
}), {
|
|
3332
|
+
v: 1,
|
|
3333
|
+
name: void 0,
|
|
3334
|
+
ast: {
|
|
3335
|
+
"params": [
|
|
3336
|
+
{
|
|
3337
|
+
"type": "i",
|
|
3338
|
+
"name": "dx"
|
|
3339
|
+
},
|
|
3340
|
+
{
|
|
3341
|
+
"type": "i",
|
|
3342
|
+
"name": "dy"
|
|
3343
|
+
},
|
|
3344
|
+
{
|
|
3345
|
+
"type": "i",
|
|
3346
|
+
"name": "wi"
|
|
3347
|
+
},
|
|
3348
|
+
{
|
|
3349
|
+
"type": "i",
|
|
3350
|
+
"name": "he"
|
|
3351
|
+
},
|
|
3352
|
+
{
|
|
3353
|
+
"type": "i",
|
|
3354
|
+
"name": "sk"
|
|
3355
|
+
}
|
|
3356
|
+
],
|
|
3357
|
+
"body": [0, [
|
|
3358
|
+
[
|
|
3359
|
+
13,
|
|
3360
|
+
"ex",
|
|
3361
|
+
"sk"
|
|
3362
|
+
],
|
|
3363
|
+
[
|
|
3364
|
+
13,
|
|
3365
|
+
"ey",
|
|
3366
|
+
"he"
|
|
3367
|
+
],
|
|
3368
|
+
[
|
|
3369
|
+
13,
|
|
3370
|
+
"flip1",
|
|
3371
|
+
[
|
|
3372
|
+
1,
|
|
3373
|
+
"dy",
|
|
3374
|
+
"<",
|
|
3375
|
+
[5, "0"]
|
|
3376
|
+
]
|
|
3377
|
+
],
|
|
3378
|
+
[
|
|
3379
|
+
13,
|
|
3380
|
+
"px0",
|
|
3381
|
+
[
|
|
3382
|
+
6,
|
|
3383
|
+
[
|
|
3384
|
+
7,
|
|
3385
|
+
"std",
|
|
3386
|
+
"select"
|
|
3387
|
+
],
|
|
3388
|
+
[
|
|
3389
|
+
"dx",
|
|
3390
|
+
[
|
|
3391
|
+
1,
|
|
3392
|
+
"dx",
|
|
3393
|
+
"*",
|
|
3394
|
+
[
|
|
3395
|
+
4,
|
|
3396
|
+
"-",
|
|
3397
|
+
[5, "1"]
|
|
3398
|
+
]
|
|
3399
|
+
],
|
|
3400
|
+
"flip1"
|
|
3401
|
+
]
|
|
3402
|
+
]
|
|
3403
|
+
],
|
|
3404
|
+
[
|
|
3405
|
+
13,
|
|
3406
|
+
"py0",
|
|
3407
|
+
[
|
|
3408
|
+
6,
|
|
3409
|
+
[
|
|
3410
|
+
7,
|
|
3411
|
+
"std",
|
|
3412
|
+
"select"
|
|
3413
|
+
],
|
|
3414
|
+
[
|
|
3415
|
+
"dy",
|
|
3416
|
+
[
|
|
3417
|
+
1,
|
|
3418
|
+
"dy",
|
|
3419
|
+
"*",
|
|
3420
|
+
[
|
|
3421
|
+
4,
|
|
3422
|
+
"-",
|
|
3423
|
+
[5, "1"]
|
|
3424
|
+
]
|
|
3425
|
+
],
|
|
3426
|
+
"flip1"
|
|
3427
|
+
]
|
|
3428
|
+
]
|
|
3429
|
+
],
|
|
3430
|
+
[
|
|
3431
|
+
13,
|
|
3432
|
+
"wx0",
|
|
3433
|
+
[
|
|
3434
|
+
1,
|
|
3435
|
+
"px0",
|
|
3436
|
+
"-",
|
|
3437
|
+
"ex"
|
|
3438
|
+
]
|
|
3439
|
+
],
|
|
3440
|
+
[
|
|
3441
|
+
13,
|
|
3442
|
+
"wy",
|
|
3443
|
+
[
|
|
3444
|
+
1,
|
|
3445
|
+
"py0",
|
|
3446
|
+
"-",
|
|
3447
|
+
"ey"
|
|
3448
|
+
]
|
|
3449
|
+
],
|
|
3450
|
+
[
|
|
3451
|
+
13,
|
|
3452
|
+
"wx",
|
|
3453
|
+
[
|
|
3454
|
+
1,
|
|
3455
|
+
"wx0",
|
|
3456
|
+
"-",
|
|
3457
|
+
[
|
|
3458
|
+
6,
|
|
3459
|
+
[
|
|
3460
|
+
7,
|
|
3461
|
+
"std",
|
|
3462
|
+
"clamp"
|
|
3463
|
+
],
|
|
3464
|
+
[
|
|
3465
|
+
"wx0",
|
|
3466
|
+
[
|
|
3467
|
+
1,
|
|
3468
|
+
"wi",
|
|
3469
|
+
"*",
|
|
3470
|
+
[
|
|
3471
|
+
4,
|
|
3472
|
+
"-",
|
|
3473
|
+
[5, "1"]
|
|
3474
|
+
]
|
|
3475
|
+
],
|
|
3476
|
+
"wi"
|
|
3477
|
+
]
|
|
3478
|
+
]
|
|
3479
|
+
]
|
|
3480
|
+
],
|
|
3481
|
+
[
|
|
3482
|
+
13,
|
|
3483
|
+
"dX",
|
|
3484
|
+
[
|
|
3485
|
+
1,
|
|
3486
|
+
[
|
|
3487
|
+
1,
|
|
3488
|
+
"wx",
|
|
3489
|
+
"*",
|
|
3490
|
+
"wx"
|
|
3491
|
+
],
|
|
3492
|
+
"+",
|
|
3493
|
+
[
|
|
3494
|
+
1,
|
|
3495
|
+
"wy",
|
|
3496
|
+
"*",
|
|
3497
|
+
"wy"
|
|
3498
|
+
]
|
|
3499
|
+
]
|
|
3500
|
+
],
|
|
3501
|
+
[
|
|
3502
|
+
13,
|
|
3503
|
+
"dY",
|
|
3504
|
+
[
|
|
3505
|
+
1,
|
|
3506
|
+
"wy",
|
|
3507
|
+
"*",
|
|
3508
|
+
[
|
|
3509
|
+
4,
|
|
3510
|
+
"-",
|
|
3511
|
+
[5, "1"]
|
|
3512
|
+
]
|
|
3513
|
+
]
|
|
3514
|
+
],
|
|
3515
|
+
[
|
|
3516
|
+
13,
|
|
3517
|
+
"s",
|
|
3518
|
+
[
|
|
3519
|
+
1,
|
|
3520
|
+
[
|
|
3521
|
+
1,
|
|
3522
|
+
"px0",
|
|
3523
|
+
"*",
|
|
3524
|
+
"ey"
|
|
3525
|
+
],
|
|
3526
|
+
"-",
|
|
3527
|
+
[
|
|
3528
|
+
1,
|
|
3529
|
+
"py0",
|
|
3530
|
+
"*",
|
|
3531
|
+
"ex"
|
|
3532
|
+
]
|
|
3533
|
+
]
|
|
3534
|
+
],
|
|
3535
|
+
[
|
|
3536
|
+
13,
|
|
3537
|
+
"flip2",
|
|
3538
|
+
[
|
|
3539
|
+
1,
|
|
3540
|
+
"s",
|
|
3541
|
+
"<",
|
|
3542
|
+
[5, "0"]
|
|
3543
|
+
]
|
|
3544
|
+
],
|
|
3545
|
+
[
|
|
3546
|
+
13,
|
|
3547
|
+
"px",
|
|
3548
|
+
[
|
|
3549
|
+
6,
|
|
3550
|
+
[
|
|
3551
|
+
7,
|
|
3552
|
+
"std",
|
|
3553
|
+
"select"
|
|
3554
|
+
],
|
|
3555
|
+
[
|
|
3556
|
+
"px0",
|
|
3557
|
+
[
|
|
3558
|
+
1,
|
|
3559
|
+
"px0",
|
|
3560
|
+
"*",
|
|
3561
|
+
[
|
|
3562
|
+
4,
|
|
3563
|
+
"-",
|
|
3564
|
+
[5, "1"]
|
|
3565
|
+
]
|
|
3566
|
+
],
|
|
3567
|
+
"flip2"
|
|
3568
|
+
]
|
|
3569
|
+
]
|
|
3570
|
+
],
|
|
3571
|
+
[
|
|
3572
|
+
13,
|
|
3573
|
+
"py",
|
|
3574
|
+
[
|
|
3575
|
+
6,
|
|
3576
|
+
[
|
|
3577
|
+
7,
|
|
3578
|
+
"std",
|
|
3579
|
+
"select"
|
|
3580
|
+
],
|
|
3581
|
+
[
|
|
3582
|
+
"py0",
|
|
3583
|
+
[
|
|
3584
|
+
1,
|
|
3585
|
+
"py0",
|
|
3586
|
+
"*",
|
|
3587
|
+
[
|
|
3588
|
+
4,
|
|
3589
|
+
"-",
|
|
3590
|
+
[5, "1"]
|
|
3591
|
+
]
|
|
3592
|
+
],
|
|
3593
|
+
"flip2"
|
|
3594
|
+
]
|
|
3595
|
+
]
|
|
3596
|
+
],
|
|
3597
|
+
[
|
|
3598
|
+
13,
|
|
3599
|
+
"vx0",
|
|
3600
|
+
[
|
|
3601
|
+
1,
|
|
3602
|
+
"px",
|
|
3603
|
+
"-",
|
|
3604
|
+
"wi"
|
|
3605
|
+
]
|
|
3606
|
+
],
|
|
3607
|
+
[
|
|
3608
|
+
13,
|
|
3609
|
+
"dotve",
|
|
3610
|
+
[
|
|
3611
|
+
1,
|
|
3612
|
+
[
|
|
3613
|
+
1,
|
|
3614
|
+
"vx0",
|
|
3615
|
+
"*",
|
|
3616
|
+
"ex"
|
|
3617
|
+
],
|
|
3618
|
+
"+",
|
|
3619
|
+
[
|
|
3620
|
+
1,
|
|
3621
|
+
"py",
|
|
3622
|
+
"*",
|
|
3623
|
+
"ey"
|
|
3624
|
+
]
|
|
3625
|
+
]
|
|
3626
|
+
],
|
|
3627
|
+
[
|
|
3628
|
+
13,
|
|
3629
|
+
"dotee",
|
|
3630
|
+
[
|
|
3631
|
+
6,
|
|
3632
|
+
[
|
|
3633
|
+
7,
|
|
3634
|
+
"std",
|
|
3635
|
+
"max"
|
|
3636
|
+
],
|
|
3637
|
+
[[
|
|
3638
|
+
1,
|
|
3639
|
+
[
|
|
3640
|
+
1,
|
|
3641
|
+
"ex",
|
|
3642
|
+
"*",
|
|
3643
|
+
"ex"
|
|
3644
|
+
],
|
|
3645
|
+
"+",
|
|
3646
|
+
[
|
|
3647
|
+
1,
|
|
3648
|
+
"ey",
|
|
3649
|
+
"*",
|
|
3650
|
+
"ey"
|
|
3651
|
+
]
|
|
3652
|
+
], [5, "0.0001"]]
|
|
3653
|
+
]
|
|
3654
|
+
],
|
|
3655
|
+
[
|
|
3656
|
+
13,
|
|
3657
|
+
"tt",
|
|
3658
|
+
[
|
|
3659
|
+
6,
|
|
3660
|
+
[
|
|
3661
|
+
7,
|
|
3662
|
+
"std",
|
|
3663
|
+
"clamp"
|
|
3664
|
+
],
|
|
3665
|
+
[
|
|
3666
|
+
[
|
|
3667
|
+
1,
|
|
3668
|
+
"dotve",
|
|
3669
|
+
"/",
|
|
3670
|
+
"dotee"
|
|
3671
|
+
],
|
|
3672
|
+
[
|
|
3673
|
+
4,
|
|
3674
|
+
"-",
|
|
3675
|
+
[5, "1"]
|
|
3676
|
+
],
|
|
3677
|
+
[5, "1"]
|
|
3678
|
+
]
|
|
3679
|
+
]
|
|
3680
|
+
],
|
|
3681
|
+
[
|
|
3682
|
+
13,
|
|
3683
|
+
"vx",
|
|
3684
|
+
[
|
|
3685
|
+
1,
|
|
3686
|
+
"vx0",
|
|
3687
|
+
"-",
|
|
3688
|
+
[
|
|
3689
|
+
1,
|
|
3690
|
+
"ex",
|
|
3691
|
+
"*",
|
|
3692
|
+
"tt"
|
|
3693
|
+
]
|
|
3694
|
+
]
|
|
3695
|
+
],
|
|
3696
|
+
[
|
|
3697
|
+
13,
|
|
3698
|
+
"vy",
|
|
3699
|
+
[
|
|
3700
|
+
1,
|
|
3701
|
+
"py",
|
|
3702
|
+
"-",
|
|
3703
|
+
[
|
|
3704
|
+
1,
|
|
3705
|
+
"ey",
|
|
3706
|
+
"*",
|
|
3707
|
+
"tt"
|
|
3708
|
+
]
|
|
3709
|
+
]
|
|
3710
|
+
],
|
|
3711
|
+
[
|
|
3712
|
+
13,
|
|
3713
|
+
"finalX",
|
|
3714
|
+
[
|
|
3715
|
+
6,
|
|
3716
|
+
[
|
|
3717
|
+
7,
|
|
3718
|
+
"std",
|
|
3719
|
+
"min"
|
|
3720
|
+
],
|
|
3721
|
+
["dX", [
|
|
3722
|
+
1,
|
|
3723
|
+
[
|
|
3724
|
+
1,
|
|
3725
|
+
"vx",
|
|
3726
|
+
"*",
|
|
3727
|
+
"vx"
|
|
3728
|
+
],
|
|
3729
|
+
"+",
|
|
3730
|
+
[
|
|
3731
|
+
1,
|
|
3732
|
+
"vy",
|
|
3733
|
+
"*",
|
|
3734
|
+
"vy"
|
|
3735
|
+
]
|
|
3736
|
+
]]
|
|
3737
|
+
]
|
|
3738
|
+
],
|
|
3739
|
+
[
|
|
3740
|
+
13,
|
|
3741
|
+
"finalY",
|
|
3742
|
+
[
|
|
3743
|
+
6,
|
|
3744
|
+
[
|
|
3745
|
+
7,
|
|
3746
|
+
"std",
|
|
3747
|
+
"min"
|
|
3748
|
+
],
|
|
3749
|
+
["dY", [
|
|
3750
|
+
1,
|
|
3751
|
+
[
|
|
3752
|
+
1,
|
|
3753
|
+
"wi",
|
|
3754
|
+
"*",
|
|
3755
|
+
"he"
|
|
3756
|
+
],
|
|
3757
|
+
"-",
|
|
3758
|
+
[
|
|
3759
|
+
6,
|
|
3760
|
+
[
|
|
3761
|
+
7,
|
|
3762
|
+
"std",
|
|
3763
|
+
"abs"
|
|
3764
|
+
],
|
|
3765
|
+
["s"]
|
|
3766
|
+
]
|
|
3767
|
+
]]
|
|
3768
|
+
]
|
|
3769
|
+
],
|
|
3770
|
+
[10, [
|
|
3771
|
+
1,
|
|
3772
|
+
[
|
|
3773
|
+
6,
|
|
3774
|
+
[
|
|
3775
|
+
7,
|
|
3776
|
+
"std",
|
|
3777
|
+
"sqrt"
|
|
3778
|
+
],
|
|
3779
|
+
["finalX"]
|
|
3780
|
+
],
|
|
3781
|
+
"*",
|
|
3782
|
+
[
|
|
3783
|
+
6,
|
|
3784
|
+
[
|
|
3785
|
+
7,
|
|
3786
|
+
"std",
|
|
3787
|
+
"sign"
|
|
3788
|
+
],
|
|
3789
|
+
[[
|
|
3790
|
+
1,
|
|
3791
|
+
"finalY",
|
|
3792
|
+
"*",
|
|
3793
|
+
[
|
|
3794
|
+
4,
|
|
3795
|
+
"-",
|
|
3796
|
+
[5, "1"]
|
|
3797
|
+
]
|
|
3798
|
+
]]
|
|
3799
|
+
]
|
|
3800
|
+
]]
|
|
3801
|
+
]],
|
|
3802
|
+
"externalNames": ["std"]
|
|
3803
|
+
},
|
|
3804
|
+
externals: () => ({ std: std_exports })
|
|
3805
|
+
}) && $.f)({}));
|
|
3806
|
+
const shapeLocalCoords = src_default.fn([
|
|
3807
|
+
vec2f,
|
|
3808
|
+
f32,
|
|
3809
|
+
vec2f,
|
|
3810
|
+
f32
|
|
3811
|
+
], vec2f)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((center, rotation, uv, aspect) => {
|
|
3812
|
+
"use gpu";
|
|
3813
|
+
const aspectUV = vec2f(__tsover_mul(uv.x, aspect), uv.y);
|
|
3814
|
+
const centerPos = vec2f(__tsover_mul(center.x, aspect), __tsover_sub(1, center.y));
|
|
3815
|
+
const dx = __tsover_sub(aspectUV.x, centerPos.x);
|
|
3816
|
+
const dy = __tsover_sub(aspectUV.y, centerPos.y);
|
|
3817
|
+
const rotRad = __tsover_mul(rotation, DEG_TO_RAD);
|
|
3818
|
+
const cosR = cos(rotRad);
|
|
3819
|
+
const sinR = sin(rotRad);
|
|
3820
|
+
return vec2f(__tsover_add(__tsover_mul(dx, cosR), __tsover_mul(dy, sinR)), __tsover_sub(__tsover_mul(dy, cosR), __tsover_mul(dx, sinR)));
|
|
3821
|
+
}), {
|
|
3822
|
+
v: 1,
|
|
3823
|
+
name: void 0,
|
|
3824
|
+
ast: {
|
|
3825
|
+
"params": [
|
|
3826
|
+
{
|
|
3827
|
+
"type": "i",
|
|
3828
|
+
"name": "center"
|
|
3829
|
+
},
|
|
3830
|
+
{
|
|
3831
|
+
"type": "i",
|
|
3832
|
+
"name": "rotation"
|
|
3833
|
+
},
|
|
3834
|
+
{
|
|
3835
|
+
"type": "i",
|
|
3836
|
+
"name": "uv"
|
|
3837
|
+
},
|
|
3838
|
+
{
|
|
3839
|
+
"type": "i",
|
|
3840
|
+
"name": "aspect"
|
|
3841
|
+
}
|
|
3842
|
+
],
|
|
3843
|
+
"body": [0, [
|
|
3844
|
+
[
|
|
3845
|
+
13,
|
|
3846
|
+
"aspectUV",
|
|
3847
|
+
[
|
|
3848
|
+
6,
|
|
3849
|
+
[
|
|
3850
|
+
7,
|
|
3851
|
+
"d",
|
|
3852
|
+
"vec2f"
|
|
3853
|
+
],
|
|
3854
|
+
[[
|
|
3855
|
+
1,
|
|
3856
|
+
[
|
|
3857
|
+
7,
|
|
3858
|
+
"uv",
|
|
3859
|
+
"x"
|
|
3860
|
+
],
|
|
3861
|
+
"*",
|
|
3862
|
+
"aspect"
|
|
3863
|
+
], [
|
|
3864
|
+
7,
|
|
3865
|
+
"uv",
|
|
3866
|
+
"y"
|
|
3867
|
+
]]
|
|
3868
|
+
]
|
|
3869
|
+
],
|
|
3870
|
+
[
|
|
3871
|
+
13,
|
|
3872
|
+
"centerPos",
|
|
3873
|
+
[
|
|
3874
|
+
6,
|
|
3875
|
+
[
|
|
3876
|
+
7,
|
|
3877
|
+
"d",
|
|
3878
|
+
"vec2f"
|
|
3879
|
+
],
|
|
3880
|
+
[[
|
|
3881
|
+
1,
|
|
3882
|
+
[
|
|
3883
|
+
7,
|
|
3884
|
+
"center",
|
|
3885
|
+
"x"
|
|
3886
|
+
],
|
|
3887
|
+
"*",
|
|
3888
|
+
"aspect"
|
|
3889
|
+
], [
|
|
3890
|
+
1,
|
|
3891
|
+
[5, "1"],
|
|
3892
|
+
"-",
|
|
3893
|
+
[
|
|
3894
|
+
7,
|
|
3895
|
+
"center",
|
|
3896
|
+
"y"
|
|
3897
|
+
]
|
|
3898
|
+
]]
|
|
3899
|
+
]
|
|
3900
|
+
],
|
|
3901
|
+
[
|
|
3902
|
+
13,
|
|
3903
|
+
"dx",
|
|
3904
|
+
[
|
|
3905
|
+
1,
|
|
3906
|
+
[
|
|
3907
|
+
7,
|
|
3908
|
+
"aspectUV",
|
|
3909
|
+
"x"
|
|
3910
|
+
],
|
|
3911
|
+
"-",
|
|
3912
|
+
[
|
|
3913
|
+
7,
|
|
3914
|
+
"centerPos",
|
|
3915
|
+
"x"
|
|
3916
|
+
]
|
|
3917
|
+
]
|
|
3918
|
+
],
|
|
3919
|
+
[
|
|
3920
|
+
13,
|
|
3921
|
+
"dy",
|
|
3922
|
+
[
|
|
3923
|
+
1,
|
|
3924
|
+
[
|
|
3925
|
+
7,
|
|
3926
|
+
"aspectUV",
|
|
3927
|
+
"y"
|
|
3928
|
+
],
|
|
3929
|
+
"-",
|
|
3930
|
+
[
|
|
3931
|
+
7,
|
|
3932
|
+
"centerPos",
|
|
3933
|
+
"y"
|
|
3934
|
+
]
|
|
3935
|
+
]
|
|
3936
|
+
],
|
|
3937
|
+
[
|
|
3938
|
+
13,
|
|
3939
|
+
"rotRad",
|
|
3940
|
+
[
|
|
3941
|
+
1,
|
|
3942
|
+
"rotation",
|
|
3943
|
+
"*",
|
|
3944
|
+
"DEG_TO_RAD"
|
|
3945
|
+
]
|
|
3946
|
+
],
|
|
3947
|
+
[
|
|
3948
|
+
13,
|
|
3949
|
+
"cosR",
|
|
3950
|
+
[
|
|
3951
|
+
6,
|
|
3952
|
+
[
|
|
3953
|
+
7,
|
|
3954
|
+
"std",
|
|
3955
|
+
"cos"
|
|
3956
|
+
],
|
|
3957
|
+
["rotRad"]
|
|
3958
|
+
]
|
|
3959
|
+
],
|
|
3960
|
+
[
|
|
3961
|
+
13,
|
|
3962
|
+
"sinR",
|
|
3963
|
+
[
|
|
3964
|
+
6,
|
|
3965
|
+
[
|
|
3966
|
+
7,
|
|
3967
|
+
"std",
|
|
3968
|
+
"sin"
|
|
3969
|
+
],
|
|
3970
|
+
["rotRad"]
|
|
3971
|
+
]
|
|
3972
|
+
],
|
|
3973
|
+
[
|
|
3974
|
+
13,
|
|
3975
|
+
"rdx",
|
|
3976
|
+
[
|
|
3977
|
+
1,
|
|
3978
|
+
[
|
|
3979
|
+
1,
|
|
3980
|
+
"dx",
|
|
3981
|
+
"*",
|
|
3982
|
+
"cosR"
|
|
3983
|
+
],
|
|
3984
|
+
"+",
|
|
3985
|
+
[
|
|
3986
|
+
1,
|
|
3987
|
+
"dy",
|
|
3988
|
+
"*",
|
|
3989
|
+
"sinR"
|
|
3990
|
+
]
|
|
3991
|
+
]
|
|
3992
|
+
],
|
|
3993
|
+
[
|
|
3994
|
+
13,
|
|
3995
|
+
"rdy",
|
|
3996
|
+
[
|
|
3997
|
+
1,
|
|
3998
|
+
[
|
|
3999
|
+
1,
|
|
4000
|
+
"dy",
|
|
4001
|
+
"*",
|
|
4002
|
+
"cosR"
|
|
4003
|
+
],
|
|
4004
|
+
"-",
|
|
4005
|
+
[
|
|
4006
|
+
1,
|
|
4007
|
+
"dx",
|
|
4008
|
+
"*",
|
|
4009
|
+
"sinR"
|
|
4010
|
+
]
|
|
4011
|
+
]
|
|
4012
|
+
],
|
|
4013
|
+
[10, [
|
|
4014
|
+
6,
|
|
4015
|
+
[
|
|
4016
|
+
7,
|
|
4017
|
+
"d",
|
|
4018
|
+
"vec2f"
|
|
4019
|
+
],
|
|
4020
|
+
["rdx", "rdy"]
|
|
4021
|
+
]]
|
|
4022
|
+
]],
|
|
4023
|
+
"externalNames": [
|
|
4024
|
+
"d",
|
|
4025
|
+
"DEG_TO_RAD",
|
|
4026
|
+
"std"
|
|
4027
|
+
]
|
|
4028
|
+
},
|
|
4029
|
+
externals: () => ({
|
|
4030
|
+
d: data_exports,
|
|
4031
|
+
DEG_TO_RAD,
|
|
4032
|
+
std: std_exports
|
|
4033
|
+
})
|
|
4034
|
+
}) && $.f)({}));
|
|
4035
|
+
const ShapeMask = /* @__PURE__ */ (globalThis.__TYPEGPU_AUTONAME__ ?? ((a) => a))(struct({
|
|
4036
|
+
overallMask: f32,
|
|
4037
|
+
strokeBlend: f32
|
|
4038
|
+
}), "ShapeMask");
|
|
4039
|
+
const strokeMaskFromSdf = src_default.fn([
|
|
4040
|
+
f32,
|
|
4041
|
+
f32,
|
|
4042
|
+
f32,
|
|
4043
|
+
f32
|
|
4044
|
+
], ShapeMask)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((dist, softness, strokeThickness, strokePosition) => {
|
|
4045
|
+
"use gpu";
|
|
4046
|
+
const hasStroke = strokeThickness > 0;
|
|
4047
|
+
const isInside = strokePosition >= 1.5;
|
|
4048
|
+
const isCenterOrAbove = strokePosition >= .5;
|
|
4049
|
+
const halfThickness = __tsover_mul(strokeThickness, .5);
|
|
4050
|
+
const negThickness = __tsover_mul(strokeThickness, -1);
|
|
4051
|
+
const negHalf = __tsover_mul(halfThickness, -1);
|
|
4052
|
+
const strokeInner = select(select(f32(0), negHalf, isCenterOrAbove), negThickness, isInside);
|
|
4053
|
+
const strokeOuter = select(select(strokeThickness, halfThickness, isCenterOrAbove), f32(0), isInside);
|
|
4054
|
+
const overallMask = __tsover_sub(1, smoothstep(__tsover_sub(strokeOuter, softness), strokeOuter, dist));
|
|
4055
|
+
const blend = smoothstep(__tsover_sub(strokeInner, softness), strokeInner, dist);
|
|
4056
|
+
return ShapeMask({
|
|
4057
|
+
overallMask,
|
|
4058
|
+
strokeBlend: select(f32(0), blend, hasStroke)
|
|
4059
|
+
});
|
|
4060
|
+
}), {
|
|
4061
|
+
v: 1,
|
|
4062
|
+
name: void 0,
|
|
4063
|
+
ast: {
|
|
4064
|
+
"params": [
|
|
4065
|
+
{
|
|
4066
|
+
"type": "i",
|
|
4067
|
+
"name": "dist"
|
|
4068
|
+
},
|
|
4069
|
+
{
|
|
4070
|
+
"type": "i",
|
|
4071
|
+
"name": "softness"
|
|
4072
|
+
},
|
|
4073
|
+
{
|
|
4074
|
+
"type": "i",
|
|
4075
|
+
"name": "strokeThickness"
|
|
4076
|
+
},
|
|
4077
|
+
{
|
|
4078
|
+
"type": "i",
|
|
4079
|
+
"name": "strokePosition"
|
|
4080
|
+
}
|
|
4081
|
+
],
|
|
4082
|
+
"body": [0, [
|
|
4083
|
+
[
|
|
4084
|
+
13,
|
|
4085
|
+
"hasStroke",
|
|
4086
|
+
[
|
|
4087
|
+
1,
|
|
4088
|
+
"strokeThickness",
|
|
4089
|
+
">",
|
|
4090
|
+
[5, "0"]
|
|
4091
|
+
]
|
|
4092
|
+
],
|
|
4093
|
+
[
|
|
4094
|
+
13,
|
|
4095
|
+
"isInside",
|
|
4096
|
+
[
|
|
4097
|
+
1,
|
|
4098
|
+
"strokePosition",
|
|
4099
|
+
">=",
|
|
4100
|
+
[5, "1.5"]
|
|
4101
|
+
]
|
|
4102
|
+
],
|
|
4103
|
+
[
|
|
4104
|
+
13,
|
|
4105
|
+
"isCenterOrAbove",
|
|
4106
|
+
[
|
|
4107
|
+
1,
|
|
4108
|
+
"strokePosition",
|
|
4109
|
+
">=",
|
|
4110
|
+
[5, "0.5"]
|
|
4111
|
+
]
|
|
4112
|
+
],
|
|
4113
|
+
[
|
|
4114
|
+
13,
|
|
4115
|
+
"halfThickness",
|
|
4116
|
+
[
|
|
4117
|
+
1,
|
|
4118
|
+
"strokeThickness",
|
|
4119
|
+
"*",
|
|
4120
|
+
[5, "0.5"]
|
|
4121
|
+
]
|
|
4122
|
+
],
|
|
4123
|
+
[
|
|
4124
|
+
13,
|
|
4125
|
+
"negThickness",
|
|
4126
|
+
[
|
|
4127
|
+
1,
|
|
4128
|
+
"strokeThickness",
|
|
4129
|
+
"*",
|
|
4130
|
+
[
|
|
4131
|
+
4,
|
|
4132
|
+
"-",
|
|
4133
|
+
[5, "1"]
|
|
4134
|
+
]
|
|
4135
|
+
]
|
|
4136
|
+
],
|
|
4137
|
+
[
|
|
4138
|
+
13,
|
|
4139
|
+
"negHalf",
|
|
4140
|
+
[
|
|
4141
|
+
1,
|
|
4142
|
+
"halfThickness",
|
|
4143
|
+
"*",
|
|
4144
|
+
[
|
|
4145
|
+
4,
|
|
4146
|
+
"-",
|
|
4147
|
+
[5, "1"]
|
|
4148
|
+
]
|
|
4149
|
+
]
|
|
4150
|
+
],
|
|
4151
|
+
[
|
|
4152
|
+
13,
|
|
4153
|
+
"strokeInner",
|
|
4154
|
+
[
|
|
4155
|
+
6,
|
|
4156
|
+
[
|
|
4157
|
+
7,
|
|
4158
|
+
"std",
|
|
4159
|
+
"select"
|
|
4160
|
+
],
|
|
4161
|
+
[
|
|
4162
|
+
[
|
|
4163
|
+
6,
|
|
4164
|
+
[
|
|
4165
|
+
7,
|
|
4166
|
+
"std",
|
|
4167
|
+
"select"
|
|
4168
|
+
],
|
|
4169
|
+
[
|
|
4170
|
+
[
|
|
4171
|
+
6,
|
|
4172
|
+
[
|
|
4173
|
+
7,
|
|
4174
|
+
"d",
|
|
4175
|
+
"f32"
|
|
4176
|
+
],
|
|
4177
|
+
[[5, "0"]]
|
|
4178
|
+
],
|
|
4179
|
+
"negHalf",
|
|
4180
|
+
"isCenterOrAbove"
|
|
4181
|
+
]
|
|
4182
|
+
],
|
|
4183
|
+
"negThickness",
|
|
4184
|
+
"isInside"
|
|
4185
|
+
]
|
|
4186
|
+
]
|
|
4187
|
+
],
|
|
4188
|
+
[
|
|
4189
|
+
13,
|
|
4190
|
+
"strokeOuter",
|
|
4191
|
+
[
|
|
4192
|
+
6,
|
|
4193
|
+
[
|
|
4194
|
+
7,
|
|
4195
|
+
"std",
|
|
4196
|
+
"select"
|
|
4197
|
+
],
|
|
4198
|
+
[
|
|
4199
|
+
[
|
|
4200
|
+
6,
|
|
4201
|
+
[
|
|
4202
|
+
7,
|
|
4203
|
+
"std",
|
|
4204
|
+
"select"
|
|
4205
|
+
],
|
|
4206
|
+
[
|
|
4207
|
+
"strokeThickness",
|
|
4208
|
+
"halfThickness",
|
|
4209
|
+
"isCenterOrAbove"
|
|
4210
|
+
]
|
|
4211
|
+
],
|
|
4212
|
+
[
|
|
4213
|
+
6,
|
|
4214
|
+
[
|
|
4215
|
+
7,
|
|
4216
|
+
"d",
|
|
4217
|
+
"f32"
|
|
4218
|
+
],
|
|
4219
|
+
[[5, "0"]]
|
|
4220
|
+
],
|
|
4221
|
+
"isInside"
|
|
4222
|
+
]
|
|
4223
|
+
]
|
|
4224
|
+
],
|
|
4225
|
+
[
|
|
4226
|
+
13,
|
|
4227
|
+
"overallMask",
|
|
4228
|
+
[
|
|
4229
|
+
1,
|
|
4230
|
+
[5, "1"],
|
|
4231
|
+
"-",
|
|
4232
|
+
[
|
|
4233
|
+
6,
|
|
4234
|
+
[
|
|
4235
|
+
7,
|
|
4236
|
+
"std",
|
|
4237
|
+
"smoothstep"
|
|
4238
|
+
],
|
|
4239
|
+
[
|
|
4240
|
+
[
|
|
4241
|
+
1,
|
|
4242
|
+
"strokeOuter",
|
|
4243
|
+
"-",
|
|
4244
|
+
"softness"
|
|
4245
|
+
],
|
|
4246
|
+
"strokeOuter",
|
|
4247
|
+
"dist"
|
|
4248
|
+
]
|
|
4249
|
+
]
|
|
4250
|
+
]
|
|
4251
|
+
],
|
|
4252
|
+
[
|
|
4253
|
+
13,
|
|
4254
|
+
"blend",
|
|
4255
|
+
[
|
|
4256
|
+
6,
|
|
4257
|
+
[
|
|
4258
|
+
7,
|
|
4259
|
+
"std",
|
|
4260
|
+
"smoothstep"
|
|
4261
|
+
],
|
|
4262
|
+
[
|
|
4263
|
+
[
|
|
4264
|
+
1,
|
|
4265
|
+
"strokeInner",
|
|
4266
|
+
"-",
|
|
4267
|
+
"softness"
|
|
4268
|
+
],
|
|
4269
|
+
"strokeInner",
|
|
4270
|
+
"dist"
|
|
4271
|
+
]
|
|
4272
|
+
]
|
|
4273
|
+
],
|
|
4274
|
+
[
|
|
4275
|
+
13,
|
|
4276
|
+
"strokeBlend",
|
|
4277
|
+
[
|
|
4278
|
+
6,
|
|
4279
|
+
[
|
|
4280
|
+
7,
|
|
4281
|
+
"std",
|
|
4282
|
+
"select"
|
|
4283
|
+
],
|
|
4284
|
+
[
|
|
4285
|
+
[
|
|
4286
|
+
6,
|
|
4287
|
+
[
|
|
4288
|
+
7,
|
|
4289
|
+
"d",
|
|
4290
|
+
"f32"
|
|
4291
|
+
],
|
|
4292
|
+
[[5, "0"]]
|
|
4293
|
+
],
|
|
4294
|
+
"blend",
|
|
4295
|
+
"hasStroke"
|
|
4296
|
+
]
|
|
4297
|
+
]
|
|
4298
|
+
],
|
|
4299
|
+
[10, [
|
|
4300
|
+
6,
|
|
4301
|
+
"ShapeMask",
|
|
4302
|
+
[[104, {
|
|
4303
|
+
"overallMask": "overallMask",
|
|
4304
|
+
"strokeBlend": "strokeBlend"
|
|
4305
|
+
}]]
|
|
4306
|
+
]]
|
|
4307
|
+
]],
|
|
4308
|
+
"externalNames": [
|
|
4309
|
+
"std",
|
|
4310
|
+
"d",
|
|
4311
|
+
"ShapeMask"
|
|
4312
|
+
]
|
|
4313
|
+
},
|
|
4314
|
+
externals: () => ({
|
|
4315
|
+
std: std_exports,
|
|
4316
|
+
d: data_exports,
|
|
4317
|
+
ShapeMask
|
|
4318
|
+
})
|
|
4319
|
+
}) && $.f)({}));
|
|
4320
|
+
async function loadSdfFromUrl(url, sdfData) {
|
|
4321
|
+
const response = await fetch(url, { mode: "cors" });
|
|
4322
|
+
if (!response.ok) throw new Error(`SDF fetch failed: HTTP ${response.status}`);
|
|
4323
|
+
const buffer = await response.arrayBuffer();
|
|
4324
|
+
const pixelCount = 512 * 512;
|
|
4325
|
+
if (buffer.byteLength === pixelCount * 2) {
|
|
4326
|
+
const uint16 = new Uint16Array(buffer);
|
|
4327
|
+
const n = Math.min(uint16.length, sdfData.length);
|
|
4328
|
+
for (let i = 0; i < n; i++) sdfData[i] = uint16[i] / 32767.5 - 1;
|
|
4329
|
+
} else if (buffer.byteLength === pixelCount * 4) {
|
|
4330
|
+
const floats = new Float32Array(buffer);
|
|
4331
|
+
const n = Math.min(floats.length, sdfData.length);
|
|
4332
|
+
for (let i = 0; i < n; i++) sdfData[i] = floats[i];
|
|
4333
|
+
} else throw new Error(`SDF binary has unexpected size (${buffer.byteLength} bytes); expected ${pixelCount * 2} (compact) or ${pixelCount * 4} (legacy). The URL may point to a non-SDF file (e.g. the raw SVG).`);
|
|
4334
|
+
}
|
|
4335
|
+
function createSdfDataTexture(params, shapeSdfUrl) {
|
|
4336
|
+
const count = 512 * 512;
|
|
4337
|
+
const sdfData = new Float32Array(count).fill(.5);
|
|
4338
|
+
const texData = new Uint16Array(count);
|
|
4339
|
+
const halfHalf = toHalfFloat(.5);
|
|
4340
|
+
for (let i = 0; i < count; i++) texData[i] = halfHalf;
|
|
4341
|
+
const texture = params.createDataTexture({
|
|
4342
|
+
width: 512,
|
|
4343
|
+
height: 512,
|
|
4344
|
+
format: "r16float",
|
|
4345
|
+
data: texData,
|
|
4346
|
+
label: "svg-sdf"
|
|
4347
|
+
});
|
|
4348
|
+
params.onCleanup(() => texture.destroy());
|
|
4349
|
+
let needsUpload = false;
|
|
4350
|
+
let version = 0;
|
|
4351
|
+
if (shapeSdfUrl) loadSdfFromUrl(shapeSdfUrl, sdfData).then(() => {
|
|
4352
|
+
for (let i = 0; i < count; i++) texData[i] = toHalfFloat(sdfData[i]);
|
|
4353
|
+
needsUpload = true;
|
|
4354
|
+
}).catch((err) => debugWarn("[SDF] Failed to load SDF texture:", err));
|
|
4355
|
+
params.onBeforeRender(() => {
|
|
4356
|
+
if (needsUpload) {
|
|
4357
|
+
needsUpload = false;
|
|
4358
|
+
texture.write(texData);
|
|
4359
|
+
version++;
|
|
4360
|
+
}
|
|
4361
|
+
});
|
|
4362
|
+
return {
|
|
4363
|
+
kitTexture: params.registerMediaTexture(() => texture.texture),
|
|
4364
|
+
texture,
|
|
4365
|
+
getVersion: () => version
|
|
4366
|
+
};
|
|
4367
|
+
}
|
|
4368
|
+
function createSvgSdfSampler(params, shapeSdfUrl) {
|
|
4369
|
+
const { kitTexture } = createSdfDataTexture(params, shapeSdfUrl);
|
|
4370
|
+
return (uv) => kitTexture.sample(uv);
|
|
4371
|
+
}
|
|
4372
|
+
function createSvgSdfSamplerWithGradients(params, shapeSdfUrl) {
|
|
4373
|
+
const size = 512;
|
|
4374
|
+
const count = size * size;
|
|
4375
|
+
const sdfData = new Float32Array(count).fill(.5);
|
|
4376
|
+
const texData = new Uint16Array(count * 4);
|
|
4377
|
+
const halfHalf = toHalfFloat(.5);
|
|
4378
|
+
const halfOne = toHalfFloat(1);
|
|
4379
|
+
for (let i = 0; i < count; i++) {
|
|
4380
|
+
texData[i * 4] = halfHalf;
|
|
4381
|
+
texData[i * 4 + 3] = halfOne;
|
|
4382
|
+
}
|
|
4383
|
+
const texture = params.createMediaTexture({
|
|
4384
|
+
width: size,
|
|
4385
|
+
height: size,
|
|
4386
|
+
format: "rgba16float",
|
|
4387
|
+
label: "svg-sdf-grad"
|
|
4388
|
+
});
|
|
4389
|
+
params.onCleanup(() => texture.destroy());
|
|
4390
|
+
const sampleField = (tx, ty) => {
|
|
4391
|
+
const x0 = Math.floor(tx);
|
|
4392
|
+
const y0 = Math.floor(ty);
|
|
4393
|
+
const fx = tx - x0;
|
|
4394
|
+
const fy = ty - y0;
|
|
4395
|
+
const cl = (v) => Math.min(Math.max(v, 0), size - 1);
|
|
4396
|
+
const x0c = cl(x0), x1c = cl(x0 + 1), y0c = cl(y0), y1c = cl(y0 + 1);
|
|
4397
|
+
return sdfData[y0c * size + x0c] * (1 - fx) * (1 - fy) + sdfData[y0c * size + x1c] * fx * (1 - fy) + sdfData[y1c * size + x0c] * (1 - fx) * fy + sdfData[y1c * size + x1c] * fx * fy;
|
|
4398
|
+
};
|
|
4399
|
+
const EPS_UV = .01;
|
|
4400
|
+
const epsTexels = EPS_UV * size;
|
|
4401
|
+
const bake = () => {
|
|
4402
|
+
for (let y = 0; y < size; y++) for (let x = 0; x < size; x++) {
|
|
4403
|
+
const i = y * size + x;
|
|
4404
|
+
const f0 = sdfData[i];
|
|
4405
|
+
const gx = (sampleField(x + epsTexels, y) - f0) / EPS_UV;
|
|
4406
|
+
const gy = (sampleField(x, y + epsTexels) - f0) / EPS_UV;
|
|
4407
|
+
texData[i * 4] = toHalfFloat(f0);
|
|
4408
|
+
texData[i * 4 + 1] = toHalfFloat(gx);
|
|
4409
|
+
texData[i * 4 + 2] = toHalfFloat(gy);
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
let needsUpload = false;
|
|
4413
|
+
if (shapeSdfUrl) loadSdfFromUrl(shapeSdfUrl, sdfData).then(() => {
|
|
4414
|
+
bake();
|
|
4415
|
+
needsUpload = true;
|
|
4416
|
+
}).catch((err) => debugWarn("[SDF] Failed to load SDF texture:", err));
|
|
4417
|
+
params.onBeforeRender(() => {
|
|
4418
|
+
if (needsUpload) {
|
|
4419
|
+
needsUpload = false;
|
|
4420
|
+
texture.write(texData);
|
|
4421
|
+
}
|
|
4422
|
+
});
|
|
4423
|
+
const kitTexture = params.registerMediaTexture(() => texture.texture);
|
|
4424
|
+
return (uv) => kitTexture.sample(uv);
|
|
4425
|
+
}
|
|
4426
|
+
var APERTURE_TO_HALFANGLE = .008726646259971648;
|
|
4427
|
+
function buildAnalyticSdfFn(shapeType) {
|
|
4428
|
+
return src_default.fn([
|
|
4429
|
+
vec2f,
|
|
4430
|
+
f32,
|
|
4431
|
+
f32,
|
|
4432
|
+
f32,
|
|
4433
|
+
f32,
|
|
4434
|
+
f32,
|
|
4435
|
+
f32,
|
|
4436
|
+
f32,
|
|
4437
|
+
f32
|
|
4438
|
+
], vec4f)(/* @__PURE__ */ (($) => (globalThis.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap()).set($.f = ((uv, r, n, round, inner, rot, h, off, ap) => {
|
|
4439
|
+
"use gpu";
|
|
4440
|
+
const dx = __tsover_sub(uv.x, .5);
|
|
4441
|
+
const dy = __tsover_sub(uv.y, .5);
|
|
4442
|
+
const rotRad = __tsover_mul(rot, DEG_TO_RAD);
|
|
4443
|
+
const cosR = cos(rotRad);
|
|
4444
|
+
const sinR = sin(rotRad);
|
|
4445
|
+
const rdx = __tsover_add(__tsover_mul(dx, cosR), __tsover_mul(dy, sinR));
|
|
4446
|
+
const rdy = __tsover_sub(__tsover_mul(dy, cosR), __tsover_mul(dx, sinR));
|
|
4447
|
+
let dist = f32(0);
|
|
4448
|
+
if (shapeType === "polygonSDF") dist = mix(polygonSdf(rdx, rdy, r, n), circleSdf(rdx, rdy, r), round);
|
|
4449
|
+
else if (shapeType === "flowerSDF") dist = flowerSdf(rdx, rdy, r, n, inner);
|
|
4450
|
+
else if (shapeType === "ringSDF") dist = ringSdf(rdx, rdy, r, inner);
|
|
4451
|
+
else if (shapeType === "crossSDF") dist = crossSdf(rdx, rdy, r, inner, round);
|
|
4452
|
+
else if (shapeType === "starSDF") dist = starSdf(rdx, rdy, r, n, inner);
|
|
4453
|
+
else if (shapeType === "roundedRectSDF") dist = roundedRectSdf(rdx, rdy, r, h, round);
|
|
4454
|
+
else if (shapeType === "ellipseSDF") dist = ellipseSdf(rdx, rdy, r, h);
|
|
4455
|
+
else if (shapeType === "vesicaSDF") dist = vesicaSdf(rdx, rdy, r, inner);
|
|
4456
|
+
else if (shapeType === "crescentSDF") dist = crescentSdf(rdx, rdy, r, inner, off);
|
|
4457
|
+
else if (shapeType === "trapezoidSDF") dist = trapezoidSdf(rdx, rdy, inner, r, h);
|
|
4458
|
+
else if (shapeType === "heartSDF") dist = heartSdf(rdx, rdy, r);
|
|
4459
|
+
else if (shapeType === "arcSDF") dist = arcSdf(rdx, rdy, r, __tsover_mul(ap, APERTURE_TO_HALFANGLE));
|
|
4460
|
+
else if (shapeType === "teardropSDF") dist = teardropSdf(rdx, rdy, r, h);
|
|
4461
|
+
else if (shapeType === "parallelogramSDF") dist = parallelogramSdf(rdx, rdy, r, h, off);
|
|
4462
|
+
else dist = circleSdf(rdx, rdy, r);
|
|
4463
|
+
return vec4f(dist, 0, 0, 1);
|
|
4464
|
+
}), {
|
|
4465
|
+
v: 1,
|
|
4466
|
+
name: void 0,
|
|
4467
|
+
ast: {
|
|
4468
|
+
"params": [
|
|
4469
|
+
{
|
|
4470
|
+
"type": "i",
|
|
4471
|
+
"name": "uv"
|
|
4472
|
+
},
|
|
4473
|
+
{
|
|
4474
|
+
"type": "i",
|
|
4475
|
+
"name": "r"
|
|
4476
|
+
},
|
|
4477
|
+
{
|
|
4478
|
+
"type": "i",
|
|
4479
|
+
"name": "n"
|
|
4480
|
+
},
|
|
4481
|
+
{
|
|
4482
|
+
"type": "i",
|
|
4483
|
+
"name": "round"
|
|
4484
|
+
},
|
|
4485
|
+
{
|
|
4486
|
+
"type": "i",
|
|
4487
|
+
"name": "inner"
|
|
4488
|
+
},
|
|
4489
|
+
{
|
|
4490
|
+
"type": "i",
|
|
4491
|
+
"name": "rot"
|
|
4492
|
+
},
|
|
4493
|
+
{
|
|
4494
|
+
"type": "i",
|
|
4495
|
+
"name": "h"
|
|
4496
|
+
},
|
|
4497
|
+
{
|
|
4498
|
+
"type": "i",
|
|
4499
|
+
"name": "off"
|
|
4500
|
+
},
|
|
4501
|
+
{
|
|
4502
|
+
"type": "i",
|
|
4503
|
+
"name": "ap"
|
|
4504
|
+
}
|
|
4505
|
+
],
|
|
4506
|
+
"body": [0, [
|
|
4507
|
+
[
|
|
4508
|
+
13,
|
|
4509
|
+
"dx",
|
|
4510
|
+
[
|
|
4511
|
+
1,
|
|
4512
|
+
[
|
|
4513
|
+
7,
|
|
4514
|
+
"uv",
|
|
4515
|
+
"x"
|
|
4516
|
+
],
|
|
4517
|
+
"-",
|
|
4518
|
+
[5, "0.5"]
|
|
4519
|
+
]
|
|
4520
|
+
],
|
|
4521
|
+
[
|
|
4522
|
+
13,
|
|
4523
|
+
"dy",
|
|
4524
|
+
[
|
|
4525
|
+
1,
|
|
4526
|
+
[
|
|
4527
|
+
7,
|
|
4528
|
+
"uv",
|
|
4529
|
+
"y"
|
|
4530
|
+
],
|
|
4531
|
+
"-",
|
|
4532
|
+
[5, "0.5"]
|
|
4533
|
+
]
|
|
4534
|
+
],
|
|
4535
|
+
[
|
|
4536
|
+
13,
|
|
4537
|
+
"rotRad",
|
|
4538
|
+
[
|
|
4539
|
+
1,
|
|
4540
|
+
"rot",
|
|
4541
|
+
"*",
|
|
4542
|
+
"DEG_TO_RAD"
|
|
4543
|
+
]
|
|
4544
|
+
],
|
|
4545
|
+
[
|
|
4546
|
+
13,
|
|
4547
|
+
"cosR",
|
|
4548
|
+
[
|
|
4549
|
+
6,
|
|
4550
|
+
[
|
|
4551
|
+
7,
|
|
4552
|
+
"std",
|
|
4553
|
+
"cos"
|
|
4554
|
+
],
|
|
4555
|
+
["rotRad"]
|
|
4556
|
+
]
|
|
4557
|
+
],
|
|
4558
|
+
[
|
|
4559
|
+
13,
|
|
4560
|
+
"sinR",
|
|
4561
|
+
[
|
|
4562
|
+
6,
|
|
4563
|
+
[
|
|
4564
|
+
7,
|
|
4565
|
+
"std",
|
|
4566
|
+
"sin"
|
|
4567
|
+
],
|
|
4568
|
+
["rotRad"]
|
|
4569
|
+
]
|
|
4570
|
+
],
|
|
4571
|
+
[
|
|
4572
|
+
13,
|
|
4573
|
+
"rdx",
|
|
4574
|
+
[
|
|
4575
|
+
1,
|
|
4576
|
+
[
|
|
4577
|
+
1,
|
|
4578
|
+
"dx",
|
|
4579
|
+
"*",
|
|
4580
|
+
"cosR"
|
|
4581
|
+
],
|
|
4582
|
+
"+",
|
|
4583
|
+
[
|
|
4584
|
+
1,
|
|
4585
|
+
"dy",
|
|
4586
|
+
"*",
|
|
4587
|
+
"sinR"
|
|
4588
|
+
]
|
|
4589
|
+
]
|
|
4590
|
+
],
|
|
4591
|
+
[
|
|
4592
|
+
13,
|
|
4593
|
+
"rdy",
|
|
4594
|
+
[
|
|
4595
|
+
1,
|
|
4596
|
+
[
|
|
4597
|
+
1,
|
|
4598
|
+
"dy",
|
|
4599
|
+
"*",
|
|
4600
|
+
"cosR"
|
|
4601
|
+
],
|
|
4602
|
+
"-",
|
|
4603
|
+
[
|
|
4604
|
+
1,
|
|
4605
|
+
"dx",
|
|
4606
|
+
"*",
|
|
4607
|
+
"sinR"
|
|
4608
|
+
]
|
|
4609
|
+
]
|
|
4610
|
+
],
|
|
4611
|
+
[
|
|
4612
|
+
12,
|
|
4613
|
+
"dist",
|
|
4614
|
+
[
|
|
4615
|
+
6,
|
|
4616
|
+
[
|
|
4617
|
+
7,
|
|
4618
|
+
"d",
|
|
4619
|
+
"f32"
|
|
4620
|
+
],
|
|
4621
|
+
[[5, "0"]]
|
|
4622
|
+
]
|
|
4623
|
+
],
|
|
4624
|
+
[
|
|
4625
|
+
11,
|
|
4626
|
+
[
|
|
4627
|
+
1,
|
|
4628
|
+
"shapeType",
|
|
4629
|
+
"===",
|
|
4630
|
+
[103, "polygonSDF"]
|
|
4631
|
+
],
|
|
4632
|
+
[
|
|
4633
|
+
2,
|
|
4634
|
+
"dist",
|
|
4635
|
+
"=",
|
|
4636
|
+
[
|
|
4637
|
+
6,
|
|
4638
|
+
[
|
|
4639
|
+
7,
|
|
4640
|
+
"std",
|
|
4641
|
+
"mix"
|
|
4642
|
+
],
|
|
4643
|
+
[
|
|
4644
|
+
[
|
|
4645
|
+
6,
|
|
4646
|
+
"polygonSdf",
|
|
4647
|
+
[
|
|
4648
|
+
"rdx",
|
|
4649
|
+
"rdy",
|
|
4650
|
+
"r",
|
|
4651
|
+
"n"
|
|
4652
|
+
]
|
|
4653
|
+
],
|
|
4654
|
+
[
|
|
4655
|
+
6,
|
|
4656
|
+
"circleSdf",
|
|
4657
|
+
[
|
|
4658
|
+
"rdx",
|
|
4659
|
+
"rdy",
|
|
4660
|
+
"r"
|
|
4661
|
+
]
|
|
4662
|
+
],
|
|
4663
|
+
"round"
|
|
4664
|
+
]
|
|
4665
|
+
]
|
|
4666
|
+
],
|
|
4667
|
+
[
|
|
4668
|
+
11,
|
|
4669
|
+
[
|
|
4670
|
+
1,
|
|
4671
|
+
"shapeType",
|
|
4672
|
+
"===",
|
|
4673
|
+
[103, "flowerSDF"]
|
|
4674
|
+
],
|
|
4675
|
+
[
|
|
4676
|
+
2,
|
|
4677
|
+
"dist",
|
|
4678
|
+
"=",
|
|
4679
|
+
[
|
|
4680
|
+
6,
|
|
4681
|
+
"flowerSdf",
|
|
4682
|
+
[
|
|
4683
|
+
"rdx",
|
|
4684
|
+
"rdy",
|
|
4685
|
+
"r",
|
|
4686
|
+
"n",
|
|
4687
|
+
"inner"
|
|
4688
|
+
]
|
|
4689
|
+
]
|
|
4690
|
+
],
|
|
4691
|
+
[
|
|
4692
|
+
11,
|
|
4693
|
+
[
|
|
4694
|
+
1,
|
|
4695
|
+
"shapeType",
|
|
4696
|
+
"===",
|
|
4697
|
+
[103, "ringSDF"]
|
|
4698
|
+
],
|
|
4699
|
+
[
|
|
4700
|
+
2,
|
|
4701
|
+
"dist",
|
|
4702
|
+
"=",
|
|
4703
|
+
[
|
|
4704
|
+
6,
|
|
4705
|
+
"ringSdf",
|
|
4706
|
+
[
|
|
4707
|
+
"rdx",
|
|
4708
|
+
"rdy",
|
|
4709
|
+
"r",
|
|
4710
|
+
"inner"
|
|
4711
|
+
]
|
|
4712
|
+
]
|
|
4713
|
+
],
|
|
4714
|
+
[
|
|
4715
|
+
11,
|
|
4716
|
+
[
|
|
4717
|
+
1,
|
|
4718
|
+
"shapeType",
|
|
4719
|
+
"===",
|
|
4720
|
+
[103, "crossSDF"]
|
|
4721
|
+
],
|
|
4722
|
+
[
|
|
4723
|
+
2,
|
|
4724
|
+
"dist",
|
|
4725
|
+
"=",
|
|
4726
|
+
[
|
|
4727
|
+
6,
|
|
4728
|
+
"crossSdf",
|
|
4729
|
+
[
|
|
4730
|
+
"rdx",
|
|
4731
|
+
"rdy",
|
|
4732
|
+
"r",
|
|
4733
|
+
"inner",
|
|
4734
|
+
"round"
|
|
4735
|
+
]
|
|
4736
|
+
]
|
|
4737
|
+
],
|
|
4738
|
+
[
|
|
4739
|
+
11,
|
|
4740
|
+
[
|
|
4741
|
+
1,
|
|
4742
|
+
"shapeType",
|
|
4743
|
+
"===",
|
|
4744
|
+
[103, "starSDF"]
|
|
4745
|
+
],
|
|
4746
|
+
[
|
|
4747
|
+
2,
|
|
4748
|
+
"dist",
|
|
4749
|
+
"=",
|
|
4750
|
+
[
|
|
4751
|
+
6,
|
|
4752
|
+
"starSdf",
|
|
4753
|
+
[
|
|
4754
|
+
"rdx",
|
|
4755
|
+
"rdy",
|
|
4756
|
+
"r",
|
|
4757
|
+
"n",
|
|
4758
|
+
"inner"
|
|
4759
|
+
]
|
|
4760
|
+
]
|
|
4761
|
+
],
|
|
4762
|
+
[
|
|
4763
|
+
11,
|
|
4764
|
+
[
|
|
4765
|
+
1,
|
|
4766
|
+
"shapeType",
|
|
4767
|
+
"===",
|
|
4768
|
+
[103, "roundedRectSDF"]
|
|
4769
|
+
],
|
|
4770
|
+
[
|
|
4771
|
+
2,
|
|
4772
|
+
"dist",
|
|
4773
|
+
"=",
|
|
4774
|
+
[
|
|
4775
|
+
6,
|
|
4776
|
+
"roundedRectSdf",
|
|
4777
|
+
[
|
|
4778
|
+
"rdx",
|
|
4779
|
+
"rdy",
|
|
4780
|
+
"r",
|
|
4781
|
+
"h",
|
|
4782
|
+
"round"
|
|
4783
|
+
]
|
|
4784
|
+
]
|
|
4785
|
+
],
|
|
4786
|
+
[
|
|
4787
|
+
11,
|
|
4788
|
+
[
|
|
4789
|
+
1,
|
|
4790
|
+
"shapeType",
|
|
4791
|
+
"===",
|
|
4792
|
+
[103, "ellipseSDF"]
|
|
4793
|
+
],
|
|
4794
|
+
[
|
|
4795
|
+
2,
|
|
4796
|
+
"dist",
|
|
4797
|
+
"=",
|
|
4798
|
+
[
|
|
4799
|
+
6,
|
|
4800
|
+
"ellipseSdf",
|
|
4801
|
+
[
|
|
4802
|
+
"rdx",
|
|
4803
|
+
"rdy",
|
|
4804
|
+
"r",
|
|
4805
|
+
"h"
|
|
4806
|
+
]
|
|
4807
|
+
]
|
|
4808
|
+
],
|
|
4809
|
+
[
|
|
4810
|
+
11,
|
|
4811
|
+
[
|
|
4812
|
+
1,
|
|
4813
|
+
"shapeType",
|
|
4814
|
+
"===",
|
|
4815
|
+
[103, "vesicaSDF"]
|
|
4816
|
+
],
|
|
4817
|
+
[
|
|
4818
|
+
2,
|
|
4819
|
+
"dist",
|
|
4820
|
+
"=",
|
|
4821
|
+
[
|
|
4822
|
+
6,
|
|
4823
|
+
"vesicaSdf",
|
|
4824
|
+
[
|
|
4825
|
+
"rdx",
|
|
4826
|
+
"rdy",
|
|
4827
|
+
"r",
|
|
4828
|
+
"inner"
|
|
4829
|
+
]
|
|
4830
|
+
]
|
|
4831
|
+
],
|
|
4832
|
+
[
|
|
4833
|
+
11,
|
|
4834
|
+
[
|
|
4835
|
+
1,
|
|
4836
|
+
"shapeType",
|
|
4837
|
+
"===",
|
|
4838
|
+
[103, "crescentSDF"]
|
|
4839
|
+
],
|
|
4840
|
+
[
|
|
4841
|
+
2,
|
|
4842
|
+
"dist",
|
|
4843
|
+
"=",
|
|
4844
|
+
[
|
|
4845
|
+
6,
|
|
4846
|
+
"crescentSdf",
|
|
4847
|
+
[
|
|
4848
|
+
"rdx",
|
|
4849
|
+
"rdy",
|
|
4850
|
+
"r",
|
|
4851
|
+
"inner",
|
|
4852
|
+
"off"
|
|
4853
|
+
]
|
|
4854
|
+
]
|
|
4855
|
+
],
|
|
4856
|
+
[
|
|
4857
|
+
11,
|
|
4858
|
+
[
|
|
4859
|
+
1,
|
|
4860
|
+
"shapeType",
|
|
4861
|
+
"===",
|
|
4862
|
+
[103, "trapezoidSDF"]
|
|
4863
|
+
],
|
|
4864
|
+
[
|
|
4865
|
+
2,
|
|
4866
|
+
"dist",
|
|
4867
|
+
"=",
|
|
4868
|
+
[
|
|
4869
|
+
6,
|
|
4870
|
+
"trapezoidSdf",
|
|
4871
|
+
[
|
|
4872
|
+
"rdx",
|
|
4873
|
+
"rdy",
|
|
4874
|
+
"inner",
|
|
4875
|
+
"r",
|
|
4876
|
+
"h"
|
|
4877
|
+
]
|
|
4878
|
+
]
|
|
4879
|
+
],
|
|
4880
|
+
[
|
|
4881
|
+
11,
|
|
4882
|
+
[
|
|
4883
|
+
1,
|
|
4884
|
+
"shapeType",
|
|
4885
|
+
"===",
|
|
4886
|
+
[103, "heartSDF"]
|
|
4887
|
+
],
|
|
4888
|
+
[
|
|
4889
|
+
2,
|
|
4890
|
+
"dist",
|
|
4891
|
+
"=",
|
|
4892
|
+
[
|
|
4893
|
+
6,
|
|
4894
|
+
"heartSdf",
|
|
4895
|
+
[
|
|
4896
|
+
"rdx",
|
|
4897
|
+
"rdy",
|
|
4898
|
+
"r"
|
|
4899
|
+
]
|
|
4900
|
+
]
|
|
4901
|
+
],
|
|
4902
|
+
[
|
|
4903
|
+
11,
|
|
4904
|
+
[
|
|
4905
|
+
1,
|
|
4906
|
+
"shapeType",
|
|
4907
|
+
"===",
|
|
4908
|
+
[103, "arcSDF"]
|
|
4909
|
+
],
|
|
4910
|
+
[
|
|
4911
|
+
2,
|
|
4912
|
+
"dist",
|
|
4913
|
+
"=",
|
|
4914
|
+
[
|
|
4915
|
+
6,
|
|
4916
|
+
"arcSdf",
|
|
4917
|
+
[
|
|
4918
|
+
"rdx",
|
|
4919
|
+
"rdy",
|
|
4920
|
+
"r",
|
|
4921
|
+
[
|
|
4922
|
+
1,
|
|
4923
|
+
"ap",
|
|
4924
|
+
"*",
|
|
4925
|
+
"APERTURE_TO_HALFANGLE"
|
|
4926
|
+
]
|
|
4927
|
+
]
|
|
4928
|
+
]
|
|
4929
|
+
],
|
|
4930
|
+
[
|
|
4931
|
+
11,
|
|
4932
|
+
[
|
|
4933
|
+
1,
|
|
4934
|
+
"shapeType",
|
|
4935
|
+
"===",
|
|
4936
|
+
[103, "teardropSDF"]
|
|
4937
|
+
],
|
|
4938
|
+
[
|
|
4939
|
+
2,
|
|
4940
|
+
"dist",
|
|
4941
|
+
"=",
|
|
4942
|
+
[
|
|
4943
|
+
6,
|
|
4944
|
+
"teardropSdf",
|
|
4945
|
+
[
|
|
4946
|
+
"rdx",
|
|
4947
|
+
"rdy",
|
|
4948
|
+
"r",
|
|
4949
|
+
"h"
|
|
4950
|
+
]
|
|
4951
|
+
]
|
|
4952
|
+
],
|
|
4953
|
+
[
|
|
4954
|
+
11,
|
|
4955
|
+
[
|
|
4956
|
+
1,
|
|
4957
|
+
"shapeType",
|
|
4958
|
+
"===",
|
|
4959
|
+
[103, "parallelogramSDF"]
|
|
4960
|
+
],
|
|
4961
|
+
[
|
|
4962
|
+
2,
|
|
4963
|
+
"dist",
|
|
4964
|
+
"=",
|
|
4965
|
+
[
|
|
4966
|
+
6,
|
|
4967
|
+
"parallelogramSdf",
|
|
4968
|
+
[
|
|
4969
|
+
"rdx",
|
|
4970
|
+
"rdy",
|
|
4971
|
+
"r",
|
|
4972
|
+
"h",
|
|
4973
|
+
"off"
|
|
4974
|
+
]
|
|
4975
|
+
]
|
|
4976
|
+
],
|
|
4977
|
+
[
|
|
4978
|
+
2,
|
|
4979
|
+
"dist",
|
|
4980
|
+
"=",
|
|
4981
|
+
[
|
|
4982
|
+
6,
|
|
4983
|
+
"circleSdf",
|
|
4984
|
+
[
|
|
4985
|
+
"rdx",
|
|
4986
|
+
"rdy",
|
|
4987
|
+
"r"
|
|
4988
|
+
]
|
|
4989
|
+
]
|
|
4990
|
+
]
|
|
4991
|
+
]
|
|
4992
|
+
]
|
|
4993
|
+
]
|
|
4994
|
+
]
|
|
4995
|
+
]
|
|
4996
|
+
]
|
|
4997
|
+
]
|
|
4998
|
+
]
|
|
4999
|
+
]
|
|
5000
|
+
]
|
|
5001
|
+
]
|
|
5002
|
+
]
|
|
5003
|
+
]
|
|
5004
|
+
],
|
|
5005
|
+
[10, [
|
|
5006
|
+
6,
|
|
5007
|
+
[
|
|
5008
|
+
7,
|
|
5009
|
+
"d",
|
|
5010
|
+
"vec4f"
|
|
5011
|
+
],
|
|
5012
|
+
[
|
|
5013
|
+
"dist",
|
|
5014
|
+
[5, "0"],
|
|
5015
|
+
[5, "0"],
|
|
5016
|
+
[5, "1"]
|
|
5017
|
+
]
|
|
5018
|
+
]]
|
|
5019
|
+
]],
|
|
5020
|
+
"externalNames": [
|
|
5021
|
+
"DEG_TO_RAD",
|
|
5022
|
+
"std",
|
|
5023
|
+
"d",
|
|
5024
|
+
"shapeType",
|
|
5025
|
+
"polygonSdf",
|
|
5026
|
+
"circleSdf",
|
|
5027
|
+
"flowerSdf",
|
|
5028
|
+
"ringSdf",
|
|
5029
|
+
"crossSdf",
|
|
5030
|
+
"starSdf",
|
|
5031
|
+
"roundedRectSdf",
|
|
5032
|
+
"ellipseSdf",
|
|
5033
|
+
"vesicaSdf",
|
|
5034
|
+
"crescentSdf",
|
|
5035
|
+
"trapezoidSdf",
|
|
5036
|
+
"heartSdf",
|
|
5037
|
+
"arcSdf",
|
|
5038
|
+
"APERTURE_TO_HALFANGLE",
|
|
5039
|
+
"teardropSdf",
|
|
5040
|
+
"parallelogramSdf"
|
|
5041
|
+
]
|
|
5042
|
+
},
|
|
5043
|
+
externals: () => ({
|
|
5044
|
+
DEG_TO_RAD,
|
|
5045
|
+
std: std_exports,
|
|
5046
|
+
d: data_exports,
|
|
5047
|
+
shapeType,
|
|
5048
|
+
polygonSdf,
|
|
5049
|
+
circleSdf,
|
|
5050
|
+
flowerSdf,
|
|
5051
|
+
ringSdf,
|
|
5052
|
+
crossSdf,
|
|
5053
|
+
starSdf,
|
|
5054
|
+
roundedRectSdf,
|
|
5055
|
+
ellipseSdf,
|
|
5056
|
+
vesicaSdf,
|
|
5057
|
+
crescentSdf,
|
|
5058
|
+
trapezoidSdf,
|
|
5059
|
+
heartSdf,
|
|
5060
|
+
arcSdf,
|
|
5061
|
+
APERTURE_TO_HALFANGLE,
|
|
5062
|
+
teardropSdf,
|
|
5063
|
+
parallelogramSdf
|
|
5064
|
+
})
|
|
5065
|
+
}) && $.f)({})).$name(`analyticSdf_${shapeType}`);
|
|
5066
|
+
}
|
|
5067
|
+
function createAnalyticSdfSampler(shapeType, sub, _patternMode = "none") {
|
|
5068
|
+
const radius = sub.radius ?? floatE(0);
|
|
5069
|
+
const sides = sub.sides ?? floatE(0);
|
|
5070
|
+
const rounding = sub.rounding ?? floatE(0);
|
|
5071
|
+
const innerRatio = sub.innerRatio ?? floatE(0);
|
|
5072
|
+
const rotation = sub.rotation ?? floatE(0);
|
|
5073
|
+
const height = sub.height ?? floatE(0);
|
|
5074
|
+
const offset = sub.offset ?? floatE(0);
|
|
5075
|
+
const aperture = sub.aperture ?? floatE(0);
|
|
5076
|
+
const fn = buildAnalyticSdfFn(shapeType);
|
|
5077
|
+
return (uv) => call(fn, `analyticSdf_${shapeType}`, [
|
|
5078
|
+
uv,
|
|
5079
|
+
radius,
|
|
5080
|
+
sides,
|
|
5081
|
+
rounding,
|
|
5082
|
+
innerRatio,
|
|
5083
|
+
rotation,
|
|
5084
|
+
height,
|
|
5085
|
+
offset,
|
|
5086
|
+
aperture
|
|
5087
|
+
]);
|
|
5088
|
+
}
|
|
5089
|
+
const ANALYTIC_SDF_EXTRA_FIELDS = {
|
|
5090
|
+
_saRadius: {
|
|
5091
|
+
schema: f32,
|
|
5092
|
+
initial: .35
|
|
5093
|
+
},
|
|
5094
|
+
_saSides: {
|
|
5095
|
+
schema: f32,
|
|
5096
|
+
initial: 6
|
|
5097
|
+
},
|
|
5098
|
+
_saRounding: {
|
|
5099
|
+
schema: f32,
|
|
5100
|
+
initial: 0
|
|
5101
|
+
},
|
|
5102
|
+
_saInnerRatio: {
|
|
5103
|
+
schema: f32,
|
|
5104
|
+
initial: .4
|
|
5105
|
+
},
|
|
5106
|
+
_saRotation: {
|
|
5107
|
+
schema: f32,
|
|
5108
|
+
initial: 0
|
|
5109
|
+
},
|
|
5110
|
+
_saHeight: {
|
|
5111
|
+
schema: f32,
|
|
5112
|
+
initial: .25
|
|
5113
|
+
},
|
|
5114
|
+
_saOffset: {
|
|
5115
|
+
schema: f32,
|
|
5116
|
+
initial: .2
|
|
5117
|
+
},
|
|
5118
|
+
_saAperture: {
|
|
5119
|
+
schema: f32,
|
|
5120
|
+
initial: 270
|
|
5121
|
+
}
|
|
5122
|
+
};
|
|
5123
|
+
function driveAnalyticSubProps(params, getShapeConfig) {
|
|
5124
|
+
let lastShapeJson = "";
|
|
5125
|
+
let lastCfg = (() => {
|
|
5126
|
+
const raw = getShapeConfig();
|
|
5127
|
+
if (raw && typeof raw === "object") return raw;
|
|
5128
|
+
if (typeof raw === "string") try {
|
|
5129
|
+
return JSON.parse(raw);
|
|
5130
|
+
} catch {
|
|
5131
|
+
return {};
|
|
5132
|
+
}
|
|
5133
|
+
return {};
|
|
5134
|
+
})();
|
|
5135
|
+
const num = (v, f) => typeof v === "number" ? v : f;
|
|
5136
|
+
const write = () => {
|
|
5137
|
+
const c = lastCfg;
|
|
5138
|
+
params.setExtraField("_saRadius", num(c.radius, num(c.width, num(c.bottomWidth, .35))));
|
|
5139
|
+
params.setExtraField("_saSides", num(c.sides, 6));
|
|
5140
|
+
params.setExtraField("_saRounding", num(c.rounding, 0));
|
|
5141
|
+
params.setExtraField("_saInnerRatio", num(c.innerRatio, num(c.thickness, num(c.spread, num(c.topWidth, num(c.topRatio, .4))))));
|
|
5142
|
+
params.setExtraField("_saRotation", num(c.rotation, 0));
|
|
5143
|
+
params.setExtraField("_saHeight", num(c.height, .25));
|
|
5144
|
+
params.setExtraField("_saOffset", num(c.offset, num(c.skew, .2)));
|
|
5145
|
+
params.setExtraField("_saAperture", num(c.aperture, 270));
|
|
5146
|
+
};
|
|
5147
|
+
params.onBeforeRender(() => {
|
|
5148
|
+
const raw = getShapeConfig();
|
|
5149
|
+
if (raw && typeof raw === "object") lastCfg = raw;
|
|
5150
|
+
else if (typeof raw === "string") {
|
|
5151
|
+
if (raw !== lastShapeJson) {
|
|
5152
|
+
lastShapeJson = raw;
|
|
5153
|
+
try {
|
|
5154
|
+
lastCfg = JSON.parse(raw);
|
|
5155
|
+
} catch {
|
|
5156
|
+
return;
|
|
5157
|
+
}
|
|
5158
|
+
}
|
|
5159
|
+
}
|
|
5160
|
+
write();
|
|
5161
|
+
});
|
|
5162
|
+
const u = params.uniforms;
|
|
5163
|
+
return {
|
|
5164
|
+
radius: u._saRadius,
|
|
5165
|
+
sides: u._saSides,
|
|
5166
|
+
rounding: u._saRounding,
|
|
5167
|
+
innerRatio: u._saInnerRatio,
|
|
5168
|
+
rotation: u._saRotation,
|
|
5169
|
+
height: u._saHeight,
|
|
5170
|
+
offset: u._saOffset,
|
|
5171
|
+
aperture: u._saAperture
|
|
5172
|
+
};
|
|
5173
|
+
}
|
|
5174
|
+
export { starSdf as _, createSdfDataTexture as a, trapezoidSdf as b, ellipseSdf as c, parallelogramSdf as d, polygonSdf as f, shapeLocalCoords as g, sdf_exports as h, circleSdf as i, flowerSdf as l, roundedRectSdf as m, ShapeMask as n, crescentSdf as o, ringSdf as p, arcSdf as r, crossSdf as s, SVG_SDF_SIZE as t, heartSdf as u, strokeMaskFromSdf as v, vesicaSdf as x, teardropSdf as y };
|