shaders 3.2.474 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -142
- package/README.md +192 -19
- package/dist/cli.js +2 -2
- package/dist/core/{AngularBlur-g4-fDx1N.js → AngularBlur-BEBs-lRR.js} +2 -3
- package/dist/core/{Arc-B4VGPOtO.js → Arc-D-WnjM7T.js} +1 -3
- package/dist/core/{Ascii-DxiduEzP.js → Ascii-BGPIwMc3.js} +2 -5
- package/dist/core/{Aurora-FgWLcSkh.js → Aurora-DqJBPdMQ.js} +2 -11
- package/dist/core/{BarShift-BukEd3jr.js → BarShift-BcCOweUh.js} +2 -3
- package/dist/core/{BarnDoors-BC0LM0aD.js → BarnDoors-B9B-AmCV.js} +2 -3
- package/dist/core/{Beam-CxAXVlAf.js → Beam-QG_9OS8I.js} +2 -3
- package/dist/core/{Bend-BfVVIo2C.js → Bend-Cy9VAowL.js} +1 -2
- package/dist/core/{Blob-D_IbcUCc.js → Blob-C3txJeW0.js} +2 -10
- package/dist/core/{BlockDissolve-C9nsgIz9.js → BlockDissolve-C1SFUys7.js} +2 -3
- package/dist/core/{BlockNoise-BgwbD0rx.js → BlockNoise-Cm3y8hce.js} +2 -4
- package/dist/core/{BlueNoise-BdwOaq4G.js → BlueNoise-BCLObOMm.js} +2 -4
- package/dist/core/{Blur-ceuv7ZTm.js → Blur-Dg29SnXd.js} +1 -2
- package/dist/core/{Boids-DEHsYo46.js → Boids-rsGsPN5h.js} +2 -5
- package/dist/core/{BokehBlur-C8xJ0xA8.js → BokehBlur-rFSFEnb0.js} +3 -4
- package/dist/core/{BrickPattern-C-6QFzp6.js → BrickPattern-DqN6JKEN.js} +2 -3
- package/dist/core/{BrightnessContrast-CMUaNvo0.js → BrightnessContrast-J9fCSBiC.js} +1 -3
- package/dist/core/{BrushedMetal-CQsu_96R.js → BrushedMetal-74wSZKjG.js} +3 -8
- package/dist/core/{Bulge-CgO7_0fe.js → Bulge-BIk0oq8j.js} +1 -2
- package/dist/core/{CRTScreen-DNqe2klB.js → CRTScreen-hEH-JNRd.js} +2 -3
- package/dist/core/{CarbonFiber-D0vgwlrV.js → CarbonFiber-CZdUDvRU.js} +4 -8
- package/dist/core/{Chalkboard-CDUJz_Ae.js → Chalkboard-CClJHqvs.js} +2 -3
- package/dist/core/{ChannelBlur-Z8ZvN6W3.js → ChannelBlur-BEuEwQOC.js} +1 -2
- package/dist/core/{CheckerWipe-DXm9kDaS.js → CheckerWipe-KuAWj2qg.js} +2 -3
- package/dist/core/{Checkerboard-DZAABNKo.js → Checkerboard-Rq9ze1W3.js} +2 -3
- package/dist/core/{Chevron-Dn1iHSiS.js → Chevron-C1j6X2Ye.js} +2 -3
- package/dist/core/{ChromaFlow-lnaJ4o1Y.js → ChromaFlow-BgsCUYIl.js} +2 -5
- package/dist/core/{ChromaticAberration-CGOQe4Pp.js → ChromaticAberration-2_4tjQ0u.js} +2 -4
- package/dist/core/{Chrome-DPAmErfN.js → Chrome-Be3z6C5i.js} +5 -11
- package/dist/core/{Circle-DVPhvXdr.js → Circle-e_qQI3tU.js} +1 -3
- package/dist/core/{ColorWheel-DXkVOQl2.js → ColorWheel-s5ep1H7d.js} +2 -3
- package/dist/core/{CompressionArtifacts-CEw9gfTu.js → CompressionArtifacts-OE9U9Qrq.js} +1 -3
- package/dist/core/{ConcentricSpin-GtNEq1T1.js → ConcentricSpin-CLE_5yCJ.js} +1 -2
- package/dist/core/{ConicGradient-DYPNJAOg.js → ConicGradient-Cji2SgVO.js} +2 -4
- package/dist/core/{ContourLines-DEmEepvT.js → ContourLines-wpPK00cF.js} +2 -3
- package/dist/core/{CornerPin-CJJeGyVf.js → CornerPin-gYU0Uf2m.js} +2 -3
- package/dist/core/{Crescent-C7yy9-xf.js → Crescent-viNc7Unp.js} +1 -2
- package/dist/core/{Cross-DyYrdTVw.js → Cross-DyQSsw_k.js} +1 -2
- package/dist/core/{Crystal-DQJd5oAd.js → Crystal-Vjj8azWg.js} +4 -9
- package/dist/core/{CurlNoise-Bjc6hhjR.js → CurlNoise-C7PHjDht.js} +2 -4
- package/dist/core/{CursorRipples-C1PNyYcB.js → CursorRipples-BzPPNkA3.js} +3 -39
- package/dist/core/{CursorTrail-C6v97bId.js → CursorTrail-cBj0AuQA.js} +2 -4
- package/dist/core/{DataMosh-AX4kIi4R.js → DataMosh-5Yr9TyVx.js} +1 -3
- package/dist/core/{DiamondGradient-Bj6mUxOy.js → DiamondGradient-DZM7HwF5.js} +2 -4
- package/dist/core/{DiamondWipe-BNSkpUn9.js → DiamondWipe-CqeT7lCt.js} +2 -3
- package/dist/core/{DiffuseBlur-C7l-5Dw3.js → DiffuseBlur-Y5hSDTZF.js} +2 -3
- package/dist/core/{DisplacementMap-DGpLSlxs.js → DisplacementMap-FobRx5Ie.js} +2 -3
- package/dist/core/{Dither-C9KDpqgP.js → Dither-50rqHpt9.js} +2 -3
- package/dist/core/{DotGrid-CkAtf-j_.js → DotGrid-B6AGLUbR.js} +3 -4
- package/dist/core/{DropShadow-BxI_a7dC.js → DropShadow-CEPpgatB.js} +2 -3
- package/dist/core/{Duotone-CrJ0P0SL.js → Duotone-D76Kp7Pb.js} +2 -3
- package/dist/core/{Ellipse-C2Tie_19.js → Ellipse-BGod1LeG.js} +1 -2
- package/dist/core/{Emboss-BjOlYydL.js → Emboss-DMNFb_ww.js} +3 -6
- package/dist/core/{Engraving-RpxXPqQq.js → Engraving-Dj7bCATQ.js} +2 -3
- package/dist/core/{ErosionNoise-D0qefxhq.js → ErosionNoise-4O68wJQZ.js} +2 -4
- package/dist/core/{Exposure-B7W7AVbY.js → Exposure-h-vapOpj.js} +1 -3
- package/dist/core/{FallingLines-Cxhmtqf4.js → FallingLines-Dzop_89k.js} +2 -3
- package/dist/core/{FilmGrain-CghUJIeK.js → FilmGrain-Bs8PCfdf.js} +1 -3
- package/dist/core/{FilmStock-DmOaROtC.js → FilmStock-DBjVo6rL.js} +1 -4
- package/dist/core/{Flip-BuOdbWjK.js → Flip-CfrS4KfZ.js} +2 -3
- package/dist/core/{FloatingParticles-BfFlt06Y.js → FloatingParticles-D1R2tD2J.js} +2 -5
- package/dist/core/{FlowField-A2njOtGx.js → FlowField-Slirm5AI.js} +2 -3
- package/dist/core/{Flower-CwdJOVR1.js → Flower-Ddlut7QZ.js} +1 -2
- package/dist/core/{FlowingGradient-D3BG2FW9.js → FlowingGradient-CwIgTtbj.js} +2 -7
- package/dist/core/{FlutedGlass-BWlTrLF-.js → FlutedGlass-CMMy2GJ5.js} +2 -4
- package/dist/core/{Fog-CpmIyRtJ.js → Fog-DjjUkcTZ.js} +2 -4
- package/dist/core/{Form3D-D-eUD4_k.js → Form3D-DQDOHWpC.js} +2 -4
- package/dist/core/{FractalNoise-DsESU8cP.js → FractalNoise-BjI3IOIj.js} +2 -4
- package/dist/core/{Frost-B1s1W_Qm.js → Frost-CK12HnL1.js} +4 -9
- package/dist/core/{GaborNoise-D3U1iz9E.js → GaborNoise-DKEIvvRJ.js} +3 -5
- package/dist/core/{Glass-O5o5OxlN.js → Glass-CzcOVD5Y.js} +3 -8
- package/dist/core/{GlassTiles-BxdT6Ee8.js → GlassTiles-gjhc563g.js} +1 -2
- package/dist/core/{Glitch-DQeLaNdU.js → Glitch-C_XAWltC.js} +1 -2
- package/dist/core/{Glow-DksG7wdu.js → Glow-CrYCanBI.js} +1 -3
- package/dist/core/{Godrays-D2Pzd9K9.js → Godrays-BBTMOVLP.js} +2 -3
- package/dist/core/{Goo-BL_ifIPI.js → Goo-Brhjk8aS.js} +3 -8
- package/dist/core/{GradientMap-B-5yUYjX.js → GradientMap-C5325QWw.js} +2 -4
- package/dist/core/{Grayscale-g7jQsxgi.js → Grayscale-dPjs-wvf.js} +1 -2
- package/dist/core/{Grid-DAglpJFP.js → Grid-UjEd3O76.js} +3 -4
- package/dist/core/{GridDistortion-CNlIESbs.js → GridDistortion-vVgYya1U.js} +1 -5
- package/dist/core/{Group-CeOfFv2K.js → Group-KVdmAi5g.js} +1 -1
- package/dist/core/{HTMLInCanvas-BgwCnbYn.js → HTMLInCanvas-CKr2u76R.js} +1 -2
- package/dist/core/{Halftone-DCiP4EDq.js → Halftone-pRV3TRUW.js} +4 -5
- package/dist/core/{Heart-CQhtzwFu.js → Heart-CX7MvvHZ.js} +1 -2
- package/dist/core/{Heatmap-e-lF_uZu.js → Heatmap-Dn6qyd2e.js} +3 -8
- package/dist/core/{HexGrid-BY_BPH8J.js → HexGrid-BIfYhkfV.js} +3 -4
- package/dist/core/{Hologram-BA_LJPm0.js → Hologram-ou27baPQ.js} +4 -8
- package/dist/core/{Holographic-CX8OG-Wa.js → Holographic-CiHdBSMg.js} +3 -7
- package/dist/core/{HueShift-BnwOshrg.js → HueShift-CG7pcXfg.js} +1 -3
- package/dist/core/{ImageTexture-Cd6vH2Z0.js → ImageTexture-BiZuU58C.js} +1 -2
- package/dist/core/{InkFlow-B7F9i3Kd.js → InkFlow-D9_L7opB.js} +9 -12
- package/dist/core/{Invert-6Q5kX8vd.js → Invert-CHEaiQZO.js} +1 -2
- package/dist/core/{IrisWipe-Cl5yYdEi.js → IrisWipe-x22vOQHm.js} +2 -3
- package/dist/core/Irradiance-7yq2K87_.js +389 -0
- package/dist/core/{IsometricCubes-BhK9MhCy.js → IsometricCubes-CkPGWr7M.js} +2 -3
- package/dist/core/{Kaleidoscope-D4X5N_qk.js → Kaleidoscope-CEC5m1Ww.js} +1 -2
- package/dist/core/{KeyFrames-Dv1vFfMa.js → KeyFrames-BMGEZsAZ.js} +2 -3
- package/dist/core/{LensDistortion-BqVp5WBS.js → LensDistortion-DKo8PiO5.js} +2 -3
- package/dist/core/{LensFlare-z0k68uJ1.js → LensFlare-DMS-NUtK.js} +2 -3
- package/dist/core/LightEdge-DxmnCRls.js +315 -0
- package/dist/core/{LightLeak-BgFq4bLG.js → LightLeak-yoEsZtYg.js} +2 -4
- package/dist/core/{Line--Ur3CJp1.js → Line-D17XDUjO.js} +2 -3
- package/dist/core/{LinearBlur-BkHF6lVm.js → LinearBlur-CiyjPTUH.js} +2 -3
- package/dist/core/{LinearGradient-DIdq_fiw.js → LinearGradient-DfjKG70q.js} +2 -4
- package/dist/core/{LinearWipe-DuCB9oV_.js → LinearWipe-D9CtBg6S.js} +2 -3
- package/dist/core/{LiquidMetal-B2Cz80Ka.js → LiquidMetal-8EG6DwV6.js} +3 -8
- package/dist/core/{Liquify-CvPn1ze-.js → Liquify-BySXF1OB.js} +1 -4
- package/dist/core/{MagneticFilings-BOgYrPhz.js → MagneticFilings-DNESH3Zs.js} +2 -5
- package/dist/core/{Marble-c2QGDXxB.js → Marble-C9WvdxrP.js} +2 -7
- package/dist/core/{MeshGradient-DMsza5tg.js → MeshGradient-d9--RXOU.js} +2 -10
- package/dist/core/{Mirror-Ck8qk1Km.js → Mirror-1V2FF2kD.js} +1 -2
- package/dist/core/{MultiPointGradient-DwO6snxn.js → MultiPointGradient-cRA9ytgL.js} +2 -3
- package/dist/core/{Nebula-3a9pYBDC.js → Nebula-BRV-q74y.js} +7 -90
- package/dist/core/{Neon-Cf95sJ7W.js → Neon-4PemK9Rj.js} +3 -6
- package/dist/core/{NoiseDissolve-DgvzEFOD.js → NoiseDissolve-B7LgD46G.js} +2 -3
- package/dist/core/{ObjectTracker-IopW8Jvf.js → ObjectTracker-CdzDxhpy.js} +3 -4
- package/dist/core/{Obsidian-BL_0ordp.js → Obsidian-2J1eX9kT.js} +9 -15
- package/dist/core/{PagePeel-BeAr_n0U.js → PagePeel-D-ziraOm.js} +1 -2
- package/dist/core/{Paper-BDEsyIPI.js → Paper-BxzCLyzB.js} +1 -2
- package/dist/core/{Parallelogram-Duj-0MLr.js → Parallelogram-D4OflTwn.js} +1 -2
- package/dist/core/{ParticleField-gk7JuNx4.js → ParticleField-tWNicEDO.js} +1 -4
- package/dist/core/{ParticleFlow-BzWOl7Hm.js → ParticleFlow-BiEYFyWR.js} +2 -6
- package/dist/core/{Particles-DYAtR6jZ.js → Particles-B7W4yWgo.js} +3 -7
- package/dist/core/{PerlinNoise-BHQ318g4.js → PerlinNoise-C-irUxp9.js} +3 -5
- package/dist/core/{Perspective-xBfd9BSE.js → Perspective-DlnAW-pe.js} +2 -3
- package/dist/core/{PixelSort-Bx9sUnGm.js → PixelSort-BBOTYuOE.js} +1 -4
- package/dist/core/{PixelThrow-0nJiGsmZ.js → PixelThrow-DCJb9Lxd.js} +2 -4
- package/dist/core/{Pixelate-CvCzoA0h.js → Pixelate-CZdwB--K.js} +1 -2
- package/dist/core/{Plasma-Be1yxNcP.js → Plasma-CTOQJeqy.js} +2 -4
- package/dist/core/{Plastic-Bom1oFFR.js → Plastic-DvyH9x-4.js} +3 -8
- package/dist/core/{PolarCoordinates-BGwTZ6NO.js → PolarCoordinates-XhdDAOD0.js} +1 -2
- package/dist/core/{Polygon-Byw5C7Qy.js → Polygon-CLohB-Ly.js} +2 -4
- package/dist/core/{Posterize-BHOstvyj.js → Posterize-BAQfnvmK.js} +1 -2
- package/dist/core/{Prism-pNsLhW8w.js → Prism-DJVCVAXX.js} +4 -8
- package/dist/core/{ProgressiveBlur-CR1IbvKQ.js → ProgressiveBlur-Dirva1on.js} +2 -3
- package/dist/core/{RadialGradient-BFOrMAK1.js → RadialGradient-DuSKR8Ds.js} +2 -4
- package/dist/core/{RadialWipe-BYnlbrNm.js → RadialWipe-n8tON7x2.js} +2 -3
- package/dist/core/{RandomBars-B7erRRHx.js → RandomBars-BYouiIgQ.js} +2 -3
- package/dist/core/{ReactionDiffusion-BnY40jHs.js → ReactionDiffusion-CHDd3y2q.js} +2 -5
- package/dist/core/{RectangularCoordinates-D9-3PQAz.js → RectangularCoordinates-CYFfCawa.js} +1 -2
- package/dist/core/{ReflectivePlane-BI-LIR2c.js → ReflectivePlane-DFTl5U9q.js} +2 -3
- package/dist/core/Repeater-CnbzXuAe.js +473 -0
- package/dist/core/{Ring-CvvtJYAf.js → Ring-CGkHVSVd.js} +1 -2
- package/dist/core/{RippleWipe-kAzZWsjR.js → RippleWipe-DLjPzY6u.js} +2 -3
- package/dist/core/{Ripples-BFLep1r1.js → Ripples-C2tITU62.js} +2 -3
- package/dist/core/{RoundedRect-DirNijIY.js → RoundedRect-sfNTUaCY.js} +1 -2
- package/dist/core/{Saturation-CfkRhJpe.js → Saturation-BRkifYWj.js} +1 -3
- package/dist/core/{Scratches-Dchfw1_5.js → Scratches-D87O5C2K.js} +2 -4
- package/dist/core/{Sharpness-DZzAnlsl.js → Sharpness-BGv613Zw.js} +1 -3
- package/dist/core/Shatter-DuyCFU1f.js +328 -0
- package/dist/core/{SimplexNoise-CmV42gYT.js → SimplexNoise-CQJvmqd-.js} +2 -4
- package/dist/core/{SineWave-TqnpIKO4.js → SineWave-BfOgSGMP.js} +2 -3
- package/dist/core/{SliceWipe-Dz8vj6bi.js → SliceWipe-CD_D99sl.js} +1 -2
- package/dist/core/{Smoke-B1TnZnG6.js → Smoke-BDQYKRP1.js} +2 -4
- package/dist/core/{SmokeFill-C8gSZ22X.js → SmokeFill-CPnzQtQv.js} +3 -8
- package/dist/core/{SmokeFlow-dd5uLztm.js → SmokeFlow-BkPMjZq8.js} +2 -4
- package/dist/core/{Solarize-CIQa9pKw.js → Solarize-DSiS32QS.js} +1 -3
- package/dist/core/{SolidColor-DuoQVKGk.js → SolidColor-DEKpgy1c.js} +2 -3
- package/dist/core/Sparkle-BZur6gPW.js +178 -0
- package/dist/core/{Spherize-FWwWEUyE.js → Spherize-D9Yg4n6O.js} +2 -3
- package/dist/core/{Spiral-DI1eG0E3.js → Spiral-BCacfEpT.js} +2 -3
- package/dist/core/{Star-DT-hnlIJ.js → Star-Dnw1ihk7.js} +1 -2
- package/dist/core/{Stone-oW35zD22.js → Stone-Cje-_vAg.js} +1 -3
- package/dist/core/{Strands-asB3fUr9.js → Strands-CFRxS1G_.js} +2 -4
- package/dist/core/{Stretch-Cm_B4WGY.js → Stretch-DXVhfIqO.js} +1 -2
- package/dist/core/{Stripes-BnJiniJY.js → Stripes-CCADWwyq.js} +2 -3
- package/dist/core/{StudioBackground-DwSO5KNV.js → StudioBackground-BlzYNAsu.js} +2 -6
- package/dist/core/{SunBurst-BL-BryZO.js → SunBurst-CmWbI18r.js} +2 -3
- package/dist/core/{Surface3D-DSvh7Zof.js → Surface3D-Dmh98-0V.js} +2 -6
- package/dist/core/{Swirl-BVPy039a.js → Swirl-CzI1qSVc.js} +2 -4
- package/dist/core/{Teardrop-CR1UqYaF.js → Teardrop-D24uulL0.js} +1 -2
- package/dist/core/{Text-fP5temat.js → Text-CrZKvBw6.js} +2 -6
- package/dist/core/{ThinFilm-CTQeVw7E.js → ThinFilm-D7R2dt1O.js} +11 -14
- package/dist/core/{TiltShift-BvYpYELk.js → TiltShift-AMMDZBvf.js} +2 -3
- package/dist/core/{TimeTrail-DqdYuHn7.js → TimeTrail-BCYDP2ep.js} +4 -8
- package/dist/core/{Tint-BXJMHYvg.js → Tint-DHb5wBN5.js} +2 -3
- package/dist/core/{Trapezoid--AgyKOWQ.js → Trapezoid-CL5Fxvq7.js} +1 -2
- package/dist/core/{TriangularGrid-CmDApxz9.js → TriangularGrid-Bp-SJS-H.js} +2 -3
- package/dist/core/{Tritone-DCd_IRp7.js → Tritone-C0nx7OdC.js} +2 -3
- package/dist/core/{Truchet-g1_jcoZ4.js → Truchet-DCetyDaq.js} +2 -3
- package/dist/core/{Twirl-JY-PXDS2.js → Twirl-D_mv9KEi.js} +1 -2
- package/dist/core/{VHS-ZWR6D4Da.js → VHS-Cp9aDjti.js} +2 -3
- package/dist/core/{VenetianBlinds-B7laTyPO.js → VenetianBlinds-DUyvaT5w.js} +2 -3
- package/dist/core/{Vesica-BTNW2p5u.js → Vesica-BpzrTPTA.js} +1 -2
- package/dist/core/{Vibrance-DmhtRT2D.js → Vibrance-DW3J-pvW.js} +1 -3
- package/dist/core/{VideoTexture-DK3EaAHY.js → VideoTexture-zoKsSrex.js} +1 -2
- package/dist/core/{Vignette-hyFfUS20.js → Vignette-KKbP3qdZ.js} +2 -5
- package/dist/core/{Voronoi-DhexPwNM.js → Voronoi-Bp2-U6lm.js} +2 -5
- package/dist/core/Voxels-B3e3LHH5.js +469 -0
- package/dist/core/{Water-BsBnXYYB.js → Water-CoYwvqKx.js} +7 -12
- package/dist/core/{Watercolor-C1HipGGO.js → Watercolor-DUNjSIN1.js} +2 -4
- package/dist/core/{WaveDistortion-VXyHFcJ3.js → WaveDistortion-Dp8ws0z1.js} +1 -2
- package/dist/core/{Waveform-CSP_4nZF.js → Waveform-DDBLB6zu.js} +2 -9
- package/dist/core/{WaveletNoise-CQqAufyv.js → WaveletNoise-CpBkzfRT.js} +2 -4
- package/dist/core/{Weave-DwX8T4_Q.js → Weave-cWkvSEAy.js} +2 -3
- package/dist/core/{WebcamTexture-B4SLwIP1.js → WebcamTexture-D484SXSE.js} +1 -2
- package/dist/core/{Wool-qg-z_TFC.js → Wool-C9L7O9fD.js} +1 -3
- package/dist/core/{WorleyNoise-CjVw20Fl.js → WorleyNoise-B5j5lDQZ.js} +2 -3
- package/dist/core/{ZoomBlur-Lm_pVpMf.js → ZoomBlur-bPC1dBu2.js} +2 -3
- package/dist/core/customShaders.d.ts +71 -0
- package/dist/core/customShaders.d.ts.map +1 -0
- package/dist/core/docs-manifest.json +29177 -0
- package/dist/core/gpu/composer.d.ts +2 -0
- package/dist/core/gpu/composer.d.ts.map +1 -1
- package/dist/core/gpu/contract.d.ts +17 -2
- package/dist/core/gpu/contract.d.ts.map +1 -1
- package/dist/core/gpu/frame.d.ts +5 -2
- package/dist/core/gpu/frame.d.ts.map +1 -1
- package/dist/core/gpu/index.d.ts.map +1 -1
- package/dist/core/gpu/kit/aa.d.ts +1 -1
- package/dist/core/gpu/kit/agents.d.ts +1 -1
- package/dist/core/gpu/kit/blur.d.ts +4 -4
- package/dist/core/gpu/kit/cells.d.ts +3 -3
- package/dist/core/gpu/kit/cellular.d.ts +1 -1
- package/dist/core/gpu/kit/colorOps.d.ts +6 -6
- package/dist/core/gpu/kit/effects/glass.d.ts +2 -2
- package/dist/core/gpu/kit/effects/thinFilm.d.ts +4 -4
- package/dist/core/gpu/kit/fields.d.ts.map +1 -1
- package/dist/core/gpu/kit/host/pointer.d.ts +1 -1
- package/dist/core/gpu/kit/lensParts.d.ts +3 -3
- package/dist/core/gpu/kit/lightfields.d.ts +3 -3
- package/dist/core/gpu/kit/materialParts.d.ts +1 -1
- package/dist/core/gpu/kit/materialParts.d.ts.map +1 -1
- package/dist/core/gpu/kit/media.d.ts +1 -1
- package/dist/core/gpu/kit/media.d.ts.map +1 -1
- package/dist/core/gpu/kit/motionBlur.d.ts +2 -2
- package/dist/core/gpu/kit/noiseColor.d.ts +5 -5
- package/dist/core/gpu/kit/noiseColor.d.ts.map +1 -1
- package/dist/core/gpu/kit/noisePaints.d.ts +1 -1
- package/dist/core/gpu/kit/sdf.d.ts +2 -2
- package/dist/core/gpu/kit/stylizePaints.d.ts +1 -1
- package/dist/core/gpu/kit/stylizePaints.d.ts.map +1 -1
- package/dist/core/gpu/kit/tone.d.ts +1 -1
- package/dist/core/gpu/kit/waves.d.ts +6 -0
- package/dist/core/gpu/kit/waves.d.ts.map +1 -1
- package/dist/core/gpu/passManager.d.ts +1 -1
- package/dist/core/gpu/passManager.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/fluids.d.ts +7 -7
- package/dist/core/gpu/scaffolds/fluids.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/gridKernels.d.ts +8 -8
- package/dist/core/gpu/scaffolds/gridKernels.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/pointwiseFilter.d.ts +5 -5
- package/dist/core/gpu/scaffolds/pointwiseFilter.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/radiance.d.ts +5 -5
- package/dist/core/gpu/scaffolds/radiance.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/rttFilter.d.ts +2 -2
- package/dist/core/gpu/scaffolds/rttFilter.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/sdfShape.d.ts +2 -2
- package/dist/core/gpu/scaffolds/sdfShape.d.ts.map +1 -1
- package/dist/core/gpu/scaffolds/uvRemapShader.d.ts +4 -4
- package/dist/core/gpu/support.d.ts +12 -0
- package/dist/core/gpu/support.d.ts.map +1 -1
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +238 -255
- package/dist/core/llms.txt +1558 -0
- package/dist/core/{noiseColor-DuWjYRmO.js → noiseColor-D_bPhJ4m.js} +2 -2
- package/dist/core/presetRenderer.d.ts +4 -0
- package/dist/core/presetRenderer.d.ts.map +1 -1
- package/dist/core/registry.js +204 -248
- package/dist/core/shaderRegistry-BaozBFyh.js +445 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +4 -10
- package/dist/core/shaders/Arc/index.js +4 -6
- package/dist/core/shaders/Ascii/index.d.ts +1 -1
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +4 -11
- package/dist/core/shaders/Aurora/index.js +4 -21
- package/dist/core/shaders/BarShift/index.js +4 -8
- package/dist/core/shaders/BarnDoors/index.js +4 -7
- package/dist/core/shaders/Beam/index.js +4 -11
- package/dist/core/shaders/Bend/index.js +4 -8
- package/dist/core/shaders/Blob/index.js +4 -18
- package/dist/core/shaders/BlockDissolve/index.js +4 -7
- package/dist/core/shaders/BlockNoise/index.d.ts +1 -1
- package/dist/core/shaders/BlockNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/BlockNoise/index.js +5 -14
- package/dist/core/shaders/BlueNoise/index.d.ts +1 -1
- package/dist/core/shaders/BlueNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/BlueNoise/index.js +5 -14
- package/dist/core/shaders/Blur/index.d.ts +1 -1
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +4 -10
- package/dist/core/shaders/Boids/index.js +4 -9
- package/dist/core/shaders/BokehBlur/index.d.ts +1 -1
- package/dist/core/shaders/BokehBlur/index.js +4 -10
- package/dist/core/shaders/BrickPattern/index.d.ts +1 -1
- package/dist/core/shaders/BrickPattern/index.d.ts.map +1 -1
- package/dist/core/shaders/BrickPattern/index.js +4 -13
- package/dist/core/shaders/BrightnessContrast/index.js +4 -7
- package/dist/core/shaders/BrushedMetal/index.js +4 -11
- package/dist/core/shaders/Bulge/index.js +4 -8
- package/dist/core/shaders/CRTScreen/index.d.ts +2 -2
- package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +4 -10
- package/dist/core/shaders/CarbonFiber/index.d.ts +1 -1
- package/dist/core/shaders/CarbonFiber/index.js +4 -11
- package/dist/core/shaders/Chalkboard/index.d.ts +1 -1
- package/dist/core/shaders/Chalkboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Chalkboard/index.js +4 -9
- package/dist/core/shaders/ChannelBlur/index.d.ts +1 -1
- package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +4 -10
- package/dist/core/shaders/CheckerWipe/index.js +4 -7
- package/dist/core/shaders/Checkerboard/index.d.ts +1 -1
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +4 -13
- package/dist/core/shaders/Chevron/index.d.ts +1 -1
- package/dist/core/shaders/Chevron/index.d.ts.map +1 -1
- package/dist/core/shaders/Chevron/index.js +4 -13
- package/dist/core/shaders/ChromaFlow/index.js +4 -8
- package/dist/core/shaders/ChromaticAberration/index.js +4 -11
- package/dist/core/shaders/Chrome/index.d.ts +1 -1
- package/dist/core/shaders/Chrome/index.js +4 -10
- package/dist/core/shaders/Circle/index.js +4 -6
- package/dist/core/shaders/ColorWheel/index.js +4 -11
- package/dist/core/shaders/CompressionArtifacts/index.d.ts +2 -2
- package/dist/core/shaders/CompressionArtifacts/index.d.ts.map +1 -1
- package/dist/core/shaders/CompressionArtifacts/index.js +4 -7
- package/dist/core/shaders/ConcentricSpin/index.js +4 -8
- package/dist/core/shaders/ConicGradient/index.js +4 -11
- package/dist/core/shaders/ContourLines/index.js +4 -6
- package/dist/core/shaders/CornerPin/index.js +4 -8
- package/dist/core/shaders/Crescent/index.js +4 -5
- package/dist/core/shaders/Cross/index.js +4 -5
- package/dist/core/shaders/Crystal/index.js +4 -11
- package/dist/core/shaders/CurlNoise/index.d.ts +1 -1
- package/dist/core/shaders/CurlNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/CurlNoise/index.js +5 -14
- package/dist/core/shaders/CursorRipples/index.js +4 -7
- package/dist/core/shaders/CursorTrail/index.js +4 -7
- package/dist/core/shaders/DataMosh/index.js +4 -7
- package/dist/core/shaders/DiamondGradient/index.js +4 -11
- package/dist/core/shaders/DiamondWipe/index.js +4 -7
- package/dist/core/shaders/DiffuseBlur/index.d.ts +1 -1
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +4 -10
- package/dist/core/shaders/DisplacementMap/index.js +4 -8
- package/dist/core/shaders/Dither/index.d.ts +1 -1
- package/dist/core/shaders/Dither/index.d.ts.map +1 -1
- package/dist/core/shaders/Dither/index.js +4 -13
- package/dist/core/shaders/DotGrid/index.d.ts +2 -2
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +4 -13
- package/dist/core/shaders/DropShadow/index.d.ts +1 -1
- package/dist/core/shaders/DropShadow/index.d.ts.map +1 -1
- package/dist/core/shaders/DropShadow/index.js +4 -10
- package/dist/core/shaders/Duotone/index.js +4 -6
- package/dist/core/shaders/Ellipse/index.js +4 -5
- package/dist/core/shaders/Emboss/index.js +4 -9
- package/dist/core/shaders/Engraving/index.js +4 -9
- package/dist/core/shaders/ErosionNoise/index.d.ts +1 -1
- package/dist/core/shaders/ErosionNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/ErosionNoise/index.js +5 -14
- package/dist/core/shaders/Exposure/index.js +4 -7
- package/dist/core/shaders/FallingLines/index.d.ts +1 -1
- package/dist/core/shaders/FallingLines/index.d.ts.map +1 -1
- package/dist/core/shaders/FallingLines/index.js +4 -13
- package/dist/core/shaders/FilmGrain/index.js +4 -7
- package/dist/core/shaders/FilmStock/index.js +4 -13
- package/dist/core/shaders/Flip/index.js +4 -8
- package/dist/core/shaders/FloatingParticles/index.d.ts +2 -2
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +4 -9
- package/dist/core/shaders/FlowField/index.js +4 -8
- package/dist/core/shaders/Flower/index.js +4 -5
- package/dist/core/shaders/FlowingGradient/index.js +4 -15
- package/dist/core/shaders/FlutedGlass/index.js +4 -11
- package/dist/core/shaders/Fog/index.js +4 -7
- package/dist/core/shaders/Form3D/index.js +4 -7
- package/dist/core/shaders/FractalNoise/index.d.ts +1 -1
- package/dist/core/shaders/FractalNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/FractalNoise/index.js +4 -13
- package/dist/core/shaders/Frost/index.d.ts +1 -1
- package/dist/core/shaders/Frost/index.js +4 -11
- package/dist/core/shaders/GaborNoise/index.d.ts +2 -2
- package/dist/core/shaders/GaborNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/GaborNoise/index.js +5 -14
- package/dist/core/shaders/Glass/index.js +4 -11
- package/dist/core/shaders/GlassTiles/index.d.ts +1 -1
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +4 -8
- package/dist/core/shaders/Glitch/index.d.ts +1 -1
- package/dist/core/shaders/Glitch/index.d.ts.map +1 -1
- package/dist/core/shaders/Glitch/index.js +4 -10
- package/dist/core/shaders/Glow/index.d.ts +1 -1
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +4 -11
- package/dist/core/shaders/Godrays/index.js +4 -12
- package/dist/core/shaders/Goo/index.js +4 -11
- package/dist/core/shaders/GradientMap/index.js +4 -7
- package/dist/core/shaders/Grayscale/index.js +4 -6
- package/dist/core/shaders/Grid/index.d.ts +2 -2
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +4 -13
- package/dist/core/shaders/GridDistortion/index.js +4 -11
- package/dist/core/shaders/Group/index.js +4 -6
- package/dist/core/shaders/HTMLInCanvas/index.js +4 -7
- package/dist/core/shaders/Halftone/index.d.ts +3 -3
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +4 -13
- package/dist/core/shaders/Heart/index.js +4 -5
- package/dist/core/shaders/Heatmap/index.js +4 -11
- package/dist/core/shaders/HexGrid/index.d.ts +2 -2
- package/dist/core/shaders/HexGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/HexGrid/index.js +4 -13
- package/dist/core/shaders/Hologram/index.d.ts +1 -1
- package/dist/core/shaders/Hologram/index.js +4 -10
- package/dist/core/shaders/Holographic/index.js +4 -10
- package/dist/core/shaders/HueShift/index.js +4 -7
- package/dist/core/shaders/ImageTexture/index.js +4 -6
- package/dist/core/shaders/InkFlow/index.d.ts +7 -7
- package/dist/core/shaders/InkFlow/index.js +4 -8
- package/dist/core/shaders/Invert/index.js +4 -6
- package/dist/core/shaders/IrisWipe/index.js +4 -7
- package/dist/core/shaders/Irradiance/index.d.ts +1 -1
- package/dist/core/shaders/Irradiance/index.d.ts.map +1 -1
- package/dist/core/shaders/Irradiance/index.js +4 -13
- package/dist/core/shaders/IsometricCubes/index.d.ts +1 -1
- package/dist/core/shaders/IsometricCubes/index.d.ts.map +1 -1
- package/dist/core/shaders/IsometricCubes/index.js +4 -13
- package/dist/core/shaders/Kaleidoscope/index.js +4 -8
- package/dist/core/shaders/KeyFrames/index.js +4 -10
- package/dist/core/shaders/LensDistortion/index.js +4 -6
- package/dist/core/shaders/LensFlare/index.d.ts +1 -1
- package/dist/core/shaders/LensFlare/index.d.ts.map +1 -1
- package/dist/core/shaders/LensFlare/index.js +4 -12
- package/dist/core/shaders/LightEdge/index.js +4 -10
- package/dist/core/shaders/LightLeak/index.js +4 -12
- package/dist/core/shaders/Line/index.js +4 -10
- package/dist/core/shaders/LinearBlur/index.d.ts +1 -1
- package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearBlur/index.js +4 -10
- package/dist/core/shaders/LinearGradient/index.js +4 -11
- package/dist/core/shaders/LinearWipe/index.js +4 -7
- package/dist/core/shaders/LiquidMetal/index.js +4 -11
- package/dist/core/shaders/Liquify/index.js +4 -10
- package/dist/core/shaders/MagneticFilings/index.js +4 -9
- package/dist/core/shaders/Marble/index.d.ts +1 -1
- package/dist/core/shaders/Marble/index.d.ts.map +1 -1
- package/dist/core/shaders/Marble/index.js +4 -15
- package/dist/core/shaders/MeshGradient/index.js +4 -17
- package/dist/core/shaders/Mirror/index.js +4 -8
- package/dist/core/shaders/MultiPointGradient/index.js +4 -11
- package/dist/core/shaders/Nebula/index.d.ts +3 -3
- package/dist/core/shaders/Nebula/index.js +4 -13
- package/dist/core/shaders/Neon/index.js +4 -9
- package/dist/core/shaders/NoiseDissolve/index.js +4 -7
- package/dist/core/shaders/ObjectTracker/index.d.ts +1 -1
- package/dist/core/shaders/ObjectTracker/index.js +4 -10
- package/dist/core/shaders/Obsidian/index.d.ts +5 -5
- package/dist/core/shaders/Obsidian/index.js +4 -15
- package/dist/core/shaders/PagePeel/index.js +4 -10
- package/dist/core/shaders/Paper/index.d.ts +1 -1
- package/dist/core/shaders/Paper/index.d.ts.map +1 -1
- package/dist/core/shaders/Paper/index.js +4 -8
- package/dist/core/shaders/Parallelogram/index.js +4 -5
- package/dist/core/shaders/ParticleField/index.js +4 -9
- package/dist/core/shaders/ParticleFlow/index.js +4 -10
- package/dist/core/shaders/Particles/index.js +4 -9
- package/dist/core/shaders/PerlinNoise/index.d.ts +2 -2
- package/dist/core/shaders/PerlinNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/PerlinNoise/index.js +5 -14
- package/dist/core/shaders/Perspective/index.js +4 -8
- package/dist/core/shaders/PixelSort/index.js +4 -8
- package/dist/core/shaders/PixelThrow/index.js +4 -8
- package/dist/core/shaders/Pixelate/index.d.ts +1 -1
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +4 -10
- package/dist/core/shaders/Plasma/index.js +4 -11
- package/dist/core/shaders/Plastic/index.js +4 -11
- package/dist/core/shaders/PolarCoordinates/index.js +4 -8
- package/dist/core/shaders/Polygon/index.js +4 -6
- package/dist/core/shaders/Posterize/index.js +4 -6
- package/dist/core/shaders/Prism/index.d.ts +2 -2
- package/dist/core/shaders/Prism/index.js +4 -12
- package/dist/core/shaders/ProgressiveBlur/index.d.ts +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +4 -10
- package/dist/core/shaders/RadialGradient/index.js +4 -11
- package/dist/core/shaders/RadialWipe/index.js +4 -7
- package/dist/core/shaders/RandomBars/index.js +4 -7
- package/dist/core/shaders/ReactionDiffusion/index.js +4 -8
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
- package/dist/core/shaders/ReflectivePlane/index.js +4 -10
- package/dist/core/shaders/Repeater/index.js +4 -5
- package/dist/core/shaders/Ring/index.js +4 -5
- package/dist/core/shaders/RippleWipe/index.js +4 -7
- package/dist/core/shaders/Ripples/index.d.ts +1 -1
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +4 -13
- package/dist/core/shaders/RoundedRect/index.js +4 -5
- package/dist/core/shaders/Saturation/index.js +4 -7
- package/dist/core/shaders/Scratches/index.d.ts +1 -1
- package/dist/core/shaders/Scratches/index.d.ts.map +1 -1
- package/dist/core/shaders/Scratches/index.js +5 -14
- package/dist/core/shaders/Sharpness/index.d.ts +1 -1
- package/dist/core/shaders/Sharpness/index.d.ts.map +1 -1
- package/dist/core/shaders/Sharpness/index.js +4 -11
- package/dist/core/shaders/Shatter/index.js +4 -6
- package/dist/core/shaders/SimplexNoise/index.d.ts +1 -1
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +5 -14
- package/dist/core/shaders/SineWave/index.js +4 -10
- package/dist/core/shaders/SliceWipe/index.js +4 -8
- package/dist/core/shaders/Smoke/index.js +4 -7
- package/dist/core/shaders/SmokeFill/index.js +4 -10
- package/dist/core/shaders/SmokeFlow/index.js +4 -7
- package/dist/core/shaders/Solarize/index.js +4 -7
- package/dist/core/shaders/SolidColor/index.js +4 -11
- package/dist/core/shaders/Sparkle/index.d.ts +57 -0
- package/dist/core/shaders/Sparkle/index.d.ts.map +1 -0
- package/dist/core/shaders/Sparkle/index.js +5 -0
- package/dist/core/shaders/Spherize/index.d.ts +1 -1
- package/dist/core/shaders/Spherize/index.d.ts.map +1 -1
- package/dist/core/shaders/Spherize/index.js +4 -10
- package/dist/core/shaders/Spiral/index.js +4 -11
- package/dist/core/shaders/Star/index.js +4 -5
- package/dist/core/shaders/Stone/index.d.ts +1 -1
- package/dist/core/shaders/Stone/index.d.ts.map +1 -1
- package/dist/core/shaders/Stone/index.js +4 -14
- package/dist/core/shaders/Strands/index.d.ts +1 -1
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +4 -13
- package/dist/core/shaders/Stretch/index.js +4 -8
- package/dist/core/shaders/Stripes/index.d.ts +1 -1
- package/dist/core/shaders/Stripes/index.d.ts.map +1 -1
- package/dist/core/shaders/Stripes/index.js +4 -13
- package/dist/core/shaders/StudioBackground/index.js +4 -14
- package/dist/core/shaders/SunBurst/index.js +4 -12
- package/dist/core/shaders/Surface3D/index.js +4 -8
- package/dist/core/shaders/Swirl/index.js +4 -11
- package/dist/core/shaders/Teardrop/index.js +4 -5
- package/dist/core/shaders/Text/index.js +4 -12
- package/dist/core/shaders/ThinFilm/index.d.ts +8 -8
- package/dist/core/shaders/ThinFilm/index.js +4 -9
- package/dist/core/shaders/TiltShift/index.d.ts +1 -1
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +4 -10
- package/dist/core/shaders/TimeTrail/index.d.ts +2 -2
- package/dist/core/shaders/TimeTrail/index.js +4 -8
- package/dist/core/shaders/Tint/index.js +4 -6
- package/dist/core/shaders/Trapezoid/index.js +4 -5
- package/dist/core/shaders/TriangularGrid/index.d.ts +1 -1
- package/dist/core/shaders/TriangularGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/TriangularGrid/index.js +4 -13
- package/dist/core/shaders/Tritone/index.js +4 -6
- package/dist/core/shaders/Truchet/index.d.ts +1 -1
- package/dist/core/shaders/Truchet/index.d.ts.map +1 -1
- package/dist/core/shaders/Truchet/index.js +4 -13
- package/dist/core/shaders/Twirl/index.js +4 -8
- package/dist/core/shaders/VHS/index.d.ts +2 -2
- package/dist/core/shaders/VHS/index.d.ts.map +1 -1
- package/dist/core/shaders/VHS/index.js +4 -10
- package/dist/core/shaders/VenetianBlinds/index.js +4 -7
- package/dist/core/shaders/Vesica/index.js +4 -5
- package/dist/core/shaders/Vibrance/index.js +4 -7
- package/dist/core/shaders/VideoTexture/index.js +4 -6
- package/dist/core/shaders/Vignette/index.js +4 -8
- package/dist/core/shaders/Voronoi/index.d.ts +1 -1
- package/dist/core/shaders/Voronoi/index.d.ts.map +1 -1
- package/dist/core/shaders/Voronoi/index.js +4 -13
- package/dist/core/shaders/Voxels/index.d.ts +5 -5
- package/dist/core/shaders/Voxels/index.js +4 -14
- package/dist/core/shaders/Water/index.d.ts +3 -3
- package/dist/core/shaders/Water/index.js +4 -11
- package/dist/core/shaders/Watercolor/index.d.ts +1 -1
- package/dist/core/shaders/Watercolor/index.d.ts.map +1 -1
- package/dist/core/shaders/Watercolor/index.js +4 -10
- package/dist/core/shaders/WaveDistortion/index.js +4 -8
- package/dist/core/shaders/Waveform/index.js +4 -16
- package/dist/core/shaders/WaveletNoise/index.d.ts +1 -1
- package/dist/core/shaders/WaveletNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveletNoise/index.js +5 -14
- package/dist/core/shaders/Weave/index.d.ts +1 -1
- package/dist/core/shaders/Weave/index.d.ts.map +1 -1
- package/dist/core/shaders/Weave/index.js +4 -13
- package/dist/core/shaders/WebcamTexture/index.js +4 -6
- package/dist/core/shaders/Wool/index.d.ts +1 -1
- package/dist/core/shaders/Wool/index.d.ts.map +1 -1
- package/dist/core/shaders/Wool/index.js +4 -14
- package/dist/core/shaders/WorleyNoise/index.d.ts +1 -1
- package/dist/core/shaders/WorleyNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/WorleyNoise/index.js +4 -13
- package/dist/core/shaders/ZoomBlur/index.d.ts +1 -1
- package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +4 -10
- package/dist/core/std/effects/blurs.d.ts +656 -138
- package/dist/core/std/effects/blurs.d.ts.map +1 -1
- package/dist/core/std/effects/color.d.ts +209 -32
- package/dist/core/std/effects/color.d.ts.map +1 -1
- package/dist/core/std/effects/edgeGlow.d.ts +86 -17
- package/dist/core/std/effects/edgeGlow.d.ts.map +1 -1
- package/dist/core/std/effects/fracture.d.ts +72 -8
- package/dist/core/std/effects/fracture.d.ts.map +1 -1
- package/dist/core/std/effects/index.d.ts +15 -0
- package/dist/core/std/effects/index.d.ts.map +1 -0
- package/dist/core/std/effects/instances.d.ts +87 -8
- package/dist/core/std/effects/instances.d.ts.map +1 -1
- package/dist/core/std/effects/lens.d.ts +48 -12
- package/dist/core/std/effects/lens.d.ts.map +1 -1
- package/dist/core/std/effects/overlay.d.ts +63 -22
- package/dist/core/std/effects/overlay.d.ts.map +1 -1
- package/dist/core/std/effects/pointerFields.d.ts +45 -20
- package/dist/core/std/effects/pointerFields.d.ts.map +1 -1
- package/dist/core/std/effects/reveal.d.ts +118 -40
- package/dist/core/std/effects/reveal.d.ts.map +1 -1
- package/dist/core/std/effects/stylize.d.ts +139 -70
- package/dist/core/std/effects/stylize.d.ts.map +1 -1
- package/dist/core/std/filter.d.ts +72 -12
- package/dist/core/std/filter.d.ts.map +1 -1
- package/dist/core/std/frames.d.ts +91 -24
- package/dist/core/std/frames.d.ts.map +1 -1
- package/dist/core/std/index.d.ts +46 -8
- package/dist/core/std/index.d.ts.map +1 -1
- package/dist/core/std/index.js +4 -0
- package/dist/core/std/invoke.d.ts +107 -12
- package/dist/core/std/invoke.d.ts.map +1 -1
- package/dist/core/std/lists.d.ts +40 -10
- package/dist/core/std/lists.d.ts.map +1 -1
- package/dist/core/std/lower.d.ts +73 -1
- package/dist/core/std/lower.d.ts.map +1 -1
- package/dist/core/std/mask.d.ts +60 -17
- package/dist/core/std/mask.d.ts.map +1 -1
- package/dist/core/std/math.d.ts +484 -9
- package/dist/core/std/math.d.ts.map +1 -1
- package/dist/core/std/motion.d.ts +130 -10
- package/dist/core/std/motion.d.ts.map +1 -1
- package/dist/core/std/paint/compose.d.ts +57 -16
- package/dist/core/std/paint/compose.d.ts.map +1 -1
- package/dist/core/std/paint/fields.d.ts +378 -95
- package/dist/core/std/paint/fields.d.ts.map +1 -1
- package/dist/core/std/paint/figures.d.ts +32 -17
- package/dist/core/std/paint/figures.d.ts.map +1 -1
- package/dist/core/std/paint/gradients.d.ts +58 -25
- package/dist/core/std/paint/gradients.d.ts.map +1 -1
- package/dist/core/std/paint/light.d.ts +501 -77
- package/dist/core/std/paint/light.d.ts.map +1 -1
- package/dist/core/std/paint/materials.d.ts +678 -151
- package/dist/core/std/paint/materials.d.ts.map +1 -1
- package/dist/core/std/paint/media.d.ts +47 -32
- package/dist/core/std/paint/media.d.ts.map +1 -1
- package/dist/core/std/paint/noise.d.ts +436 -87
- package/dist/core/std/paint/noise.d.ts.map +1 -1
- package/dist/core/std/paint/patterns.d.ts +474 -92
- package/dist/core/std/paint/patterns.d.ts.map +1 -1
- package/dist/core/std/paint/radiance.d.ts +75 -29
- package/dist/core/std/paint/radiance.d.ts.map +1 -1
- package/dist/core/std/paint/volume.d.ts +68 -27
- package/dist/core/std/paint/volume.d.ts.map +1 -1
- package/dist/core/std/paint/voxels.d.ts +46 -26
- package/dist/core/std/paint/voxels.d.ts.map +1 -1
- package/dist/core/std/shape.d.ts +195 -1
- package/dist/core/std/shape.d.ts.map +1 -1
- package/dist/core/std/signal.d.ts +55 -15
- package/dist/core/std/signal.d.ts.map +1 -1
- package/dist/core/std/sim/agentForces.d.ts +441 -99
- package/dist/core/std/sim/agentForces.d.ts.map +1 -1
- package/dist/core/std/sim/agentFrame.d.ts +94 -20
- package/dist/core/std/sim/agentFrame.d.ts.map +1 -1
- package/dist/core/std/sim/agentRender.d.ts +187 -60
- package/dist/core/std/sim/agentRender.d.ts.map +1 -1
- package/dist/core/std/sim/agents.d.ts +99 -28
- package/dist/core/std/sim/agents.d.ts.map +1 -1
- package/dist/core/std/sim/feedback.d.ts +40 -19
- package/dist/core/std/sim/feedback.d.ts.map +1 -1
- package/dist/core/std/sim/fluids.d.ts +127 -63
- package/dist/core/std/sim/fluids.d.ts.map +1 -1
- package/dist/core/std/sim/grids.d.ts +200 -48
- package/dist/core/std/sim/grids.d.ts.map +1 -1
- package/dist/core/std/sim/index.d.ts +14 -0
- package/dist/core/std/sim/index.d.ts.map +1 -0
- package/dist/core/std/sim/shapeFields.d.ts +56 -0
- package/dist/core/std/sim/shapeFields.d.ts.map +1 -1
- package/dist/core/std/sim.d.ts +112 -10
- package/dist/core/std/sim.d.ts.map +1 -1
- package/dist/core/std/slots.d.ts +72 -6
- package/dist/core/std/slots.d.ts.map +1 -1
- package/dist/core/std/types.d.ts +97 -60
- package/dist/core/std/types.d.ts.map +1 -1
- package/dist/core/std/values.d.ts +33 -14
- package/dist/core/std/values.d.ts.map +1 -1
- package/dist/core/std/warps.d.ts +221 -76
- package/dist/core/std/warps.d.ts.map +1 -1
- package/dist/core/std/wgsl.d.ts +115 -0
- package/dist/core/std/wgsl.d.ts.map +1 -0
- package/dist/core/std-ClftfWpF.js +218889 -0
- package/dist/core/{support-GJphyuEe.js → support-D3W86vgR.js} +11 -1
- package/dist/core/telemetry/index.js +1 -1
- package/dist/core/utilities/colorStops.d.ts +2 -2
- package/dist/core/utilities/listProps.d.ts +2 -2
- package/dist/core/utilities/listProps.d.ts.map +1 -1
- package/dist/core/utilities/noiseColor.d.ts +3 -3
- package/dist/core/utilities/transformations/index.js +1 -1
- package/dist/js/bundle.js +182 -180
- package/dist/js/createShader.d.ts.map +1 -1
- package/dist/js/createShader.js +4 -3
- package/dist/js/types.d.ts +5 -0
- package/dist/js/types.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +35 -22
- package/dist/react/CustomShader.js +178 -0
- package/dist/react/Preview.js +1 -0
- package/dist/react/Shader.js +1 -1
- package/dist/react/Sparkle.js +226 -0
- package/dist/react/bundle.js +178 -176
- package/dist/react/components/Sparkle.d.ts +41 -0
- package/dist/react/components/Sparkle.d.ts.map +1 -0
- package/dist/react/engine/CustomShader.d.ts +37 -0
- package/dist/react/engine/CustomShader.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/index.d.ts +5 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -2
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +35 -22
- package/dist/registry.js +410 -158
- package/dist/solid/components/Sparkle.d.ts +38 -0
- package/dist/solid/components/Sparkle.d.ts.map +1 -0
- package/dist/solid/components/Sparkle.js +232 -0
- package/dist/solid/engine/CustomShader.d.ts +35 -0
- package/dist/solid/engine/CustomShader.d.ts.map +1 -0
- package/dist/solid/engine/CustomShader.js +160 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +319 -317
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/index.d.ts +5 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +95 -86
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +35 -22
- package/dist/svelte/components/Sparkle.svelte.d.ts +28 -0
- package/dist/svelte/engine/CustomShader.svelte.d.ts +40 -0
- package/dist/svelte/index.d.ts +4 -0
- package/dist/svelte/index.js +1237 -877
- package/dist/svelte/source/components/Sparkle.svelte +352 -0
- package/dist/svelte/source/engine/CustomShader.svelte +216 -0
- package/dist/svelte/source/engine/Preview.svelte +5 -3
- package/dist/svelte/source/index.js +4 -0
- package/dist/svelte/utils/generatePresetCode.js +35 -22
- package/dist/vue/CustomShader.js +3 -0
- package/dist/vue/CustomShader.vue_vue_type_script_setup_true_lang.js +173 -0
- package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/vue/Sparkle.js +3 -0
- package/dist/vue/Sparkle.vue_vue_type_script_setup_true_lang.js +233 -0
- package/dist/vue/components/Sparkle.vue.d.ts +63 -0
- package/dist/vue/components/Sparkle.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +4 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +4 -2
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +35 -22
- package/package.json +27 -2
- package/dist/core/Irradiance-B36wYze9.js +0 -4191
- package/dist/core/LightEdge-AFfkNhDP.js +0 -2339
- package/dist/core/Repeater-C5LILb_Y.js +0 -762
- package/dist/core/Shatter-Dz3sH2ON.js +0 -1479
- package/dist/core/Voxels-Ca-6rRrz.js +0 -8547
- package/dist/core/agents-CBSp2UK_.js +0 -15709
- package/dist/core/agents-DXoEcto0.js +0 -5357
- package/dist/core/blur-7yjVyMvI.js +0 -8015
- package/dist/core/blurs-d4B9aUyx.js +0 -1751
- package/dist/core/canvasRaster-DDBkrdY8.js +0 -80
- package/dist/core/color-Do6tU0ry.js +0 -3619
- package/dist/core/compose-Dkf3v-xS.js +0 -46
- package/dist/core/device-m0ud8-Fn.js +0 -10
- package/dist/core/feedback-Dro_hxd4.js +0 -46
- package/dist/core/fields-DgADOKsP.js +0 -475
- package/dist/core/figures-B3lUGP8u.js +0 -48
- package/dist/core/filter-BrhpSs3Z.js +0 -23
- package/dist/core/fluids-umEWgdvj.js +0 -226
- package/dist/core/fonts-BUXTd9qb.js +0 -59
- package/dist/core/frames-BLqt7oaW.js +0 -78
- package/dist/core/glass-ABppDbYG.js +0 -2532
- package/dist/core/gradientPaints-5HpJVNfb.js +0 -6564
- package/dist/core/gradients-CIxKrfME.js +0 -159
- package/dist/core/grids-Cv99xcJg.js +0 -151
- package/dist/core/lens-DJQNJKCW.js +0 -352
- package/dist/core/light-D3BIVkxy.js +0 -271
- package/dist/core/lightfields-DvrUaH_6.js +0 -2255
- package/dist/core/lower-Bd2jez_2.js +0 -49452
- package/dist/core/mask-CeSwL79Q.js +0 -28
- package/dist/core/materials-4Oqvm_9m.js +0 -2944
- package/dist/core/math-D864seEs.js +0 -56
- package/dist/core/media-DXUY3ltG.js +0 -832
- package/dist/core/mediaLifecycle-BTPb5i1-.js +0 -320
- package/dist/core/motionBlur-g_WSi2iq.js +0 -6766
- package/dist/core/noise-d7rmP9yc.js +0 -546
- package/dist/core/noisePaints-CfHcXL02.js +0 -3619
- package/dist/core/noiseStylize-CUrW_HiC.js +0 -65
- package/dist/core/overlay-D5w0585O.js +0 -4712
- package/dist/core/patterns-Bg8lSdqH.js +0 -9723
- package/dist/core/pointerFields-CRecZwuZ.js +0 -2339
- package/dist/core/porters-OTkIMOyl.js +0 -30201
- package/dist/core/reveal-CfaAg-rg.js +0 -1688
- package/dist/core/sdf3d-2AWC_wdn.js +0 -21082
- package/dist/core/shaderRegistry-BUvL8ZZS.js +0 -443
- package/dist/core/shape-CAkSlCi8.js +0 -20
- package/dist/core/shapePaints-Bg2UwCZo.js +0 -3354
- package/dist/core/signal-emJuvOI3.js +0 -34
- package/dist/core/slots-BqIef2iV.js +0 -32
- package/dist/core/stylize-DiuoSq16.js +0 -4541
- package/dist/core/tone-BKhfiOBn.js +0 -763
- package/dist/core/warpMaps-Y8xSo-QJ.js +0 -10773
- package/dist/core/warps-P5O3NWLe.js +0 -276
- /package/dist/core/{transformations-CzFmhZww.js → transformations-P50Uo_Ju.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GpuComputeNode, GpuFragmentParams } from '../../gpu/contract';
|
|
2
2
|
import { ComputeStep } from '../../gpu/compute';
|
|
3
3
|
|
|
4
|
-
/** The
|
|
4
|
+
/** The GPU device handle the build callback receives, for creating the buffers and passes your stages use. */
|
|
5
5
|
export type GridRoot = NonNullable<GpuFragmentParams['gpu']>['root'];
|
|
6
|
-
/**
|
|
6
|
+
/** What the renderer reports each frame: the pointer in uv, the frame delta in seconds, the canvas size in pixels. */
|
|
7
7
|
export interface GridFrameParams {
|
|
8
8
|
pointer?: {
|
|
9
9
|
x: number;
|
|
@@ -15,95 +15,210 @@ export interface GridFrameParams {
|
|
|
15
15
|
height: number;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
/** One frame
|
|
18
|
+
/** One frame, as every stage sees it: the clamped delta, the clock, and your props. */
|
|
19
19
|
export interface GridFrame {
|
|
20
|
-
/**
|
|
20
|
+
/** Seconds since the last frame, never more than `clampDt`. */
|
|
21
21
|
dt: number;
|
|
22
|
-
/**
|
|
22
|
+
/** Wall-clock milliseconds this frame. */
|
|
23
23
|
now: number;
|
|
24
|
+
/** A numeric prop's current value, or `fallback` when it is not a number this frame. */
|
|
24
25
|
num(key: string, fallback: number): number;
|
|
26
|
+
/** Any prop's current value. */
|
|
25
27
|
getCpuValue(key: string): unknown;
|
|
26
28
|
frameParams: GridFrameParams;
|
|
27
29
|
}
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* One stage of the frame. Build them with `op.*` rather than by hand.
|
|
32
|
+
*
|
|
33
|
+
* Each frame runs every stage's `ready`, then every `tick`, then every `skip`, then every
|
|
34
|
+
* `emit`, in list order.
|
|
35
|
+
*/
|
|
29
36
|
export interface GridStage {
|
|
30
|
-
/**
|
|
37
|
+
/** Return false to run nothing this frame (an input the stage needs has not arrived yet). */
|
|
31
38
|
ready?(): boolean;
|
|
32
|
-
/**
|
|
39
|
+
/** Bookkeeping before any gate: pointer smoothing, activity flags. */
|
|
33
40
|
tick?(f: GridFrame): void;
|
|
34
|
-
/**
|
|
41
|
+
/** Return true to skip the whole frame. The last published texture stays on screen. */
|
|
35
42
|
skip?(f: GridFrame): boolean;
|
|
36
|
-
/**
|
|
43
|
+
/** Add this stage's GPU passes and value writes to the frame. */
|
|
37
44
|
emit?(f: GridFrame, nodes: ComputeStep[]): void;
|
|
38
45
|
}
|
|
46
|
+
/** What a GPU grid simulation declares: its outputs, its frame-delta clamp, and its stages. */
|
|
39
47
|
export interface GridSimConfig {
|
|
40
|
-
/**
|
|
48
|
+
/** The textures the fragment samples, by the name it reads them under in `computeOutputs`. */
|
|
41
49
|
outputs: Record<string, unknown>;
|
|
42
|
-
/**
|
|
50
|
+
/** Receive the child's picture once it exists (it is allocated after the layer composes). */
|
|
43
51
|
bindInputs?: (resolve: (key: string) => {
|
|
44
52
|
texture: unknown;
|
|
45
53
|
} | undefined) => void;
|
|
46
|
-
/**
|
|
54
|
+
/** Longest frame step accepted, in seconds. 0.016–0.05 keeps a tab switch from jumping the field. */
|
|
47
55
|
clampDt: number;
|
|
48
|
-
/**
|
|
56
|
+
/** What to do on a frame with no elapsed time: run anyway (default) or skip it. */
|
|
49
57
|
zeroDt?: 'run' | 'skip';
|
|
58
|
+
/** The frame program, in order. */
|
|
50
59
|
stages: GridStage[];
|
|
51
60
|
}
|
|
52
61
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
62
|
+
* A field of cells advanced every frame by an ordered list of stages. Spread it into a
|
|
63
|
+
* definition next to a `gpu.fragment` that samples one of its outputs.
|
|
64
|
+
*
|
|
65
|
+
* The build callback runs once per instance of the layer, with the GPU device, and returns the
|
|
66
|
+
* outputs, the frame-delta clamp and the stages. Return null to run nothing (a required child is
|
|
67
|
+
* missing). Without a GPU the fragment should fall back to the child or to transparent.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* ...gridSim((params, root) => ({outputs: {state}, clampDt: 0.05, stages: [op.values('write', (f) => paramsU.write({dt: f.dt, radius: f.num('radius', 0.4)})), op.pass(update), op.publish(() => output)]}))
|
|
72
|
+
* ```
|
|
73
|
+
* @tip Everything created in the build callback (buffers, passes, trackers) belongs to that layer instance. Create nothing at module scope that holds per-frame state.
|
|
74
|
+
* @see op, hostGridProgram, simulate, fluidSim, feedbackSim
|
|
56
75
|
*/
|
|
57
76
|
export declare function gridSim(build: (params: GpuFragmentParams, root: GridRoot) => GridSimConfig | null): {
|
|
58
77
|
compute: GpuComputeNode;
|
|
59
78
|
};
|
|
60
|
-
/** A
|
|
79
|
+
/** A sort chain's stage, which also reports which of its two buffers holds the current result. */
|
|
61
80
|
export interface SortPassStage extends GridStage {
|
|
62
81
|
side(): 'A' | 'B';
|
|
63
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* The stages a grid frame is built from. List them in `stages` in the order they should run.
|
|
85
|
+
*
|
|
86
|
+
* Bookkeeping: `host` (before any gate), `values` (write this frame's values), `readyWhen`
|
|
87
|
+
* (wait for an input), `settle` (sleep once the field is still). Work: `pass` (one GPU pass),
|
|
88
|
+
* `cache` (a pass picked per frame), `seedOnce` (a one-shot reset), `iterate` (a pass N times),
|
|
89
|
+
* `sortPass` (a compare-swap chain), `publish` (write the result the layer samples).
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* stages: [op.readyWhen(() => ready), op.values('write', (f) => paramsU.write({dt: f.dt})), op.iterate({count: () => 8, step: (i, nodes) => nodes.push(react.with(i % 2 ? groupBA : groupAB))}), op.publish(() => output)]
|
|
94
|
+
* ```
|
|
95
|
+
* @tip A `values` stage sits before the passes that read it. Stages run in list order.
|
|
96
|
+
* @see gridSim
|
|
97
|
+
*/
|
|
64
98
|
export declare const op: {
|
|
65
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* A named step that runs before any gate: pointer smoothing, activity flags, anything a
|
|
101
|
+
* later `settle` needs to know.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* op.host('cursor', (f) => { active = (f.frameParams.pointer?.x ?? 0.5) !== lastX })
|
|
106
|
+
* ```
|
|
107
|
+
* @see values, settle
|
|
108
|
+
*/
|
|
66
109
|
readonly host: (name: string, run: (f: GridFrame) => void) => GridStage;
|
|
67
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* A named step that writes this frame's values for the passes after it.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* op.values('write', (f) => paramsU.write({dt: f.dt, radius: f.num('radius', 0.4)}))
|
|
116
|
+
* ```
|
|
117
|
+
* @tip Read props here with `f.num('prop', fallback)` so a prop that is briefly not a number cannot reach the GPU as `undefined`.
|
|
118
|
+
* @see host, pass
|
|
119
|
+
*/
|
|
68
120
|
readonly values: (name: string, run: (f: GridFrame) => void) => GridStage;
|
|
69
121
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
122
|
+
* Sleep the simulation once nothing has driven it for `settleMs` of simulated time. Frames
|
|
123
|
+
* are skipped and the last published texture stays on screen, so a still field costs nothing.
|
|
72
124
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
125
|
+
* `activeWhen` says whether something drove the field this frame. `settleMs` is how long the
|
|
126
|
+
* field takes to fade after the last activity, in milliseconds.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* op.settle({activeWhen: () => moving, settleMs: (f) => 4000 / Math.max(f.num('decay', 1), 0.1)})
|
|
131
|
+
* ```
|
|
132
|
+
* @tip Simulated time, not wall-clock: a hidden tab does not count, so the field is still fading when the user comes back.
|
|
133
|
+
* @see host
|
|
77
134
|
*/
|
|
78
135
|
readonly settle: (opts: {
|
|
79
136
|
activeWhen: (f: GridFrame) => boolean;
|
|
80
137
|
settleMs: (f: GridFrame) => number;
|
|
81
138
|
}) => GridStage;
|
|
82
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Run nothing until `fn` returns true, typically once the child's picture has arrived
|
|
141
|
+
* through `bindInputs`.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* op.readyWhen(() => lumaReady)
|
|
146
|
+
* ```
|
|
147
|
+
* @see cache
|
|
148
|
+
*/
|
|
83
149
|
readonly readyWhen: (fn: () => boolean) => GridStage;
|
|
84
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* One GPU pass, the same every frame.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* op.pass(update)
|
|
156
|
+
* ```
|
|
157
|
+
* @see cache, iterate, publish
|
|
158
|
+
*/
|
|
85
159
|
readonly pass: (step: ComputeStep) => GridStage;
|
|
86
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* A GPU pass chosen per frame, for a pass whose input is rebound after the frame starts.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* op.cache(() => lumaPipeline)
|
|
166
|
+
* ```
|
|
167
|
+
* @see readyWhen, pass
|
|
168
|
+
*/
|
|
87
169
|
readonly cache: (step: (f: GridFrame) => ComputeStep) => GridStage;
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
170
|
+
/**
|
|
171
|
+
* The last stage: write the state into the texture the layer samples. Chosen per frame so it
|
|
172
|
+
* can follow whichever buffer holds the current result.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* op.publish(() => outputPass.with(sort.side() === 'A' ? outputBgA : outputBgB))
|
|
177
|
+
* ```
|
|
178
|
+
* @see pass, sortPass
|
|
179
|
+
*/
|
|
90
180
|
readonly publish: (step: (f: GridFrame) => ComputeStep) => GridStage;
|
|
91
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* A one-shot reset run before the rest of the frame whenever `staleWhen` says the state is
|
|
183
|
+
* stale: on the first frame, or when a seed prop changes.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* op.seedOnce({pass: seed, staleWhen: () => needsSeed, onSeed: () => { needsSeed = false }})
|
|
188
|
+
* ```
|
|
189
|
+
* @see iterate
|
|
190
|
+
*/
|
|
92
191
|
readonly seedOnce: (opts: {
|
|
93
192
|
pass: ComputeStep;
|
|
94
193
|
staleWhen: (f: GridFrame) => boolean;
|
|
95
194
|
onSeed?: () => void;
|
|
96
195
|
}) => GridStage;
|
|
97
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* Run a step `count` times this frame. Your `step` adds the pass for iteration `i` and picks
|
|
198
|
+
* which buffer it reads and writes.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* op.iterate({count: (f) => Math.round(f.num('speed', 8)), step: (i, nodes) => nodes.push(react.with(i % 2 ? groupBA : groupAB))})
|
|
203
|
+
* ```
|
|
204
|
+
* @tip A reaction-diffusion field reads smoother when you raise the iteration count than when you raise the step size.
|
|
205
|
+
* @see pass, sortPass
|
|
206
|
+
*/
|
|
98
207
|
readonly iterate: (opts: {
|
|
99
208
|
count: (f: GridFrame) => number;
|
|
100
209
|
step: (i: number, nodes: ComputeStep[], f: GridFrame) => void;
|
|
101
210
|
}) => GridStage;
|
|
102
211
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
212
|
+
* A compare-and-swap sort that converges a little more every frame: `passes` swaps per frame,
|
|
213
|
+
* alternating odd and even pairs and the two buffers. `side()` tells `publish` which buffer
|
|
214
|
+
* holds the current order.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```ts
|
|
218
|
+
* const sort = op.sortPass({passes: () => 1 + Math.round(strength * 4), pass: (parity, side) => (parity ? swap1 : swap0).with(side === 'A' ? groupAB : groupBA)})
|
|
219
|
+
* ```
|
|
220
|
+
* @tip The alternation continues across frames instead of restarting, which is what makes the sort settle bit by bit.
|
|
221
|
+
* @see publish, iterate
|
|
107
222
|
*/
|
|
108
223
|
readonly sortPass: (opts: {
|
|
109
224
|
passes: (f: GridFrame) => number;
|
|
@@ -111,9 +226,18 @@ export declare const op: {
|
|
|
111
226
|
}) => SortPassStage;
|
|
112
227
|
};
|
|
113
228
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
229
|
+
* The canvas size in pixels, kept current across resizes, in the two forms a stage wants.
|
|
230
|
+
*
|
|
231
|
+
* `tracked()` is the size at the last resize, for a pass that works in the canvas's own pixels.
|
|
232
|
+
* `safe(fp)` prefers the size this frame reports and never returns less than 1, for an aspect
|
|
233
|
+
* ratio.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* const viewport = trackedViewport(params)
|
|
238
|
+
* op.values('write', (f) => { const s = viewport.safe(f.frameParams); paramsU.write({aspect: s.width / s.height}) })
|
|
239
|
+
* ```
|
|
240
|
+
* @see gridSim
|
|
117
241
|
*/
|
|
118
242
|
export declare function trackedViewport(params: GpuFragmentParams): {
|
|
119
243
|
tracked(): {
|
|
@@ -125,9 +249,9 @@ export declare function trackedViewport(params: GpuFragmentParams): {
|
|
|
125
249
|
height: number;
|
|
126
250
|
};
|
|
127
251
|
};
|
|
128
|
-
/** One frame of a
|
|
252
|
+
/** One frame of a JavaScript-stepped grid: the clamped delta, the clock and the pointer in uv. */
|
|
129
253
|
export interface HostFrame {
|
|
130
|
-
/**
|
|
254
|
+
/** Seconds since the last frame, never more than `clampDt`. */
|
|
131
255
|
dt: number;
|
|
132
256
|
now: number;
|
|
133
257
|
pointer: {
|
|
@@ -136,24 +260,52 @@ export interface HostFrame {
|
|
|
136
260
|
};
|
|
137
261
|
frameParams: unknown;
|
|
138
262
|
}
|
|
139
|
-
/**
|
|
263
|
+
/** One named JavaScript step. Return `'skip'` to end the frame early. */
|
|
140
264
|
export interface HostStep {
|
|
141
265
|
name: string;
|
|
142
266
|
run(f: HostFrame): void | 'skip';
|
|
143
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* One named step of a JavaScript-stepped grid. Return `'skip'` to end the frame here, which is
|
|
270
|
+
* how an idle gate is written.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```ts
|
|
274
|
+
* hostStep('dtGuard', (f) => (f.dt <= 0 ? 'skip' : undefined))
|
|
275
|
+
* ```
|
|
276
|
+
* @see hostGridProgram
|
|
277
|
+
*/
|
|
144
278
|
export declare const hostStep: (name: string, run: (f: HostFrame) => void | "skip") => HostStep;
|
|
145
279
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
280
|
+
* A frame program for a small grid stepped in plain JavaScript: the steps run in order every
|
|
281
|
+
* frame until one returns `'skip'`. Hand the result to `onBeforeRender`.
|
|
282
|
+
*
|
|
283
|
+
* Use it when the field is small (a 32×32 flow grid) and the arithmetic reads better as loops.
|
|
284
|
+
* Publish the cells with `hostFieldTexture` in the last step.
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```ts
|
|
288
|
+
* onBeforeRender(hostGridProgram({clampDt: 0.016, steps: [hostStep('advect', (f) => advect(f.dt)), hostStep('publish', () => { pack(field.texData); field.upload() })]}))
|
|
289
|
+
* ```
|
|
290
|
+
* @see hostStep, hostFieldTexture, gridSim
|
|
148
291
|
*/
|
|
149
292
|
export declare function hostGridProgram(opts: {
|
|
150
293
|
clampDt: number;
|
|
151
294
|
steps: HostStep[];
|
|
152
295
|
}): (fp: unknown) => void;
|
|
153
296
|
/**
|
|
154
|
-
* The
|
|
155
|
-
*
|
|
156
|
-
*
|
|
297
|
+
* The texture a JavaScript-stepped grid is read through. Pack the cells into `texData` (four
|
|
298
|
+
* half-floats per cell, row by row), call `upload()`, and sample `texture` in the fragment.
|
|
299
|
+
*
|
|
300
|
+
* `size` is the grid's side in cells. The texture filters smoothly, so a coarse grid reads as
|
|
301
|
+
* a continuous field.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```ts
|
|
305
|
+
* const field = hostFieldTexture(params, {size: 32, label: 'flow'})
|
|
306
|
+
* ```
|
|
307
|
+
* @tip Values go in as half-floats: convert each number with `toHalfFloat` before writing it into `texData`.
|
|
308
|
+
* @see hostGridProgram
|
|
157
309
|
*/
|
|
158
310
|
export declare function hostFieldTexture(params: GpuFragmentParams, opts: {
|
|
159
311
|
size: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grids.d.ts","sourceRoot":"","sources":["../../../src/std/sim/grids.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"grids.d.ts","sourceRoot":"","sources":["../../../src/std/sim/grids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA+BH,OAAO,KAAK,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAA;AACzE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAA;AAElD,8GAA8G;AAE9G,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpE,sHAAsH;AACtH,MAAM,WAAW,eAAe;IAC5B,OAAO,CAAC,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,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AK,EAAE,QAAQ,EAAE,CAAA;CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAUjG;AAED;;;;;;;;;;;;;GAaG;AAIH,wBAAgB,gBAAgB,CAC5B,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,GACpC;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAAC,MAAM,IAAI,IAAI,CAAA;CAAC,CAMxG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* std/sim — the simulation vocabulary (compute-backed state), grouped by family. The grid
|
|
3
|
+
* simulation nouns (`simulate`, `op`, `GridSim`) stay top-level on `shaders/std`; these are the
|
|
4
|
+
* L1 words the agent, fluid, feedback and grid simulations are built from.
|
|
5
|
+
*/
|
|
6
|
+
export * as agents from './agents';
|
|
7
|
+
export * as agentForces from './agentForces';
|
|
8
|
+
export * as agentFrame from './agentFrame';
|
|
9
|
+
export * as agentRender from './agentRender';
|
|
10
|
+
export * as feedback from './feedback';
|
|
11
|
+
export * as fluids from './fluids';
|
|
12
|
+
export * as grids from './grids';
|
|
13
|
+
export * as shapeFields from './shapeFields';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/std/sim/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAChC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA"}
|
|
@@ -77,10 +77,66 @@ declare function analytic3d(layout: RotatedFieldLayout, baked: ShapeField3): Sha
|
|
|
77
77
|
* border-touching feature can even read inside).
|
|
78
78
|
*/
|
|
79
79
|
declare function svgLifted3d(layout: RotatedFieldLayout, baked: ShapeField3): ShapeField3;
|
|
80
|
+
/**
|
|
81
|
+
* The signed-distance function of the shape a swarm lives in, for `force.containment`.
|
|
82
|
+
*
|
|
83
|
+
* Four builders, one per shape source. Each returns a `ShapeField3`: a GPU function from a
|
|
84
|
+
* shape-local 3D point to a signed distance, negative inside. `analyticExtruded` takes a flat
|
|
85
|
+
* shape (circle, polygon, star…) and gives it a depth from `params.halfDepth`. `svgExtruded`
|
|
86
|
+
* does the same for an SVG outline uploaded as a distance texture. `analytic3d` wraps a true
|
|
87
|
+
* 3D solid so it rotates under the swarm. `svgLifted3d` wraps an SVG lifted into 3D.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* force.containment(simLayout, {field: shapeField.analyticExtruded(simLayout, buildAnalyticSdfFn(shapeType)), gradEps: 0.02, wall: {featherFrom: -0.1, featherTo: 0.01, base: 1.1, springK: 22}, recall: {from: 1.5, to: 1.9, k: 9}, homing: {from: 0.12, to: 0.45, k: 5}, entrainment: {featherHalf: 0.05}})
|
|
92
|
+
* ```
|
|
93
|
+
* @tip Pick the builder at bake time from the shape props and hand ONE field to the integrator. The swarm never needs to know which kind it is.
|
|
94
|
+
* @see force, integrator
|
|
95
|
+
*/
|
|
80
96
|
export declare const shapeField: {
|
|
97
|
+
/**
|
|
98
|
+
* A flat shape given depth: the 2D distance of a circle, polygon or star, extruded in z by
|
|
99
|
+
* `params.halfDepth`. The shape's sub-props are read live from `params.sa*`.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* shapeField.analyticExtruded(simLayout, buildAnalyticSdfFn('hexagon'))
|
|
104
|
+
* ```
|
|
105
|
+
* @see svgExtruded, analytic3d
|
|
106
|
+
*/
|
|
81
107
|
readonly analyticExtruded: typeof analyticExtruded;
|
|
108
|
+
/**
|
|
109
|
+
* An SVG outline given depth: the outline's distance texture, extruded in z by
|
|
110
|
+
* `params.halfDepth`. `size` is the texture's side in texels.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* shapeField.svgExtruded(simLayout, svgSdfLayout, {size: 512})
|
|
115
|
+
* ```
|
|
116
|
+
* @tip Outside the texture's footprint the distance keeps growing, so strays still find their way back.
|
|
117
|
+
* @see analyticExtruded, svgLifted3d
|
|
118
|
+
*/
|
|
82
119
|
readonly svgExtruded: typeof svgExtruded;
|
|
120
|
+
/**
|
|
121
|
+
* A true 3D solid (sphere, torus, knot…) from its baked distance function, rotated by the
|
|
122
|
+
* shape's live rotation so the swarm follows the surface as it turns.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* shapeField.analytic3d(setup3d.layout, setup3d.sdfFn as ShapeField3)
|
|
127
|
+
* ```
|
|
128
|
+
* @see analyticExtruded, svgLifted3d
|
|
129
|
+
*/
|
|
83
130
|
readonly analytic3d: typeof analytic3d;
|
|
131
|
+
/**
|
|
132
|
+
* An SVG outline lifted into a 3D solid, rotated by the shape's live rotation.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* shapeField.svgLifted3d(setup3d.layout, setup3d.sdfFn as ShapeField3)
|
|
137
|
+
* ```
|
|
138
|
+
* @see svgExtruded, analytic3d
|
|
139
|
+
*/
|
|
84
140
|
readonly svgLifted3d: typeof svgLifted3d;
|
|
85
141
|
};
|
|
86
142
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapeFields.d.ts","sourceRoot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;;;OASG;;IAGH;;;;;;;;OAQG;;CAGG,CAAA"}
|
package/dist/core/std/sim.d.ts
CHANGED
|
@@ -1,62 +1,164 @@
|
|
|
1
1
|
import { PropRef } from './values';
|
|
2
2
|
import { PointerSignal, PointerSpeedSignal } from './signal';
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A step that makes the grid ripple like a water surface, fading by `damping`.
|
|
6
|
+
*
|
|
7
|
+
* Needs `history: 2` on the grid, because a wave reads the two previous frames. `damping`
|
|
8
|
+
* is a prop on a 0–20 scale: 0 rings forever, 20 dies in a few frames.
|
|
9
|
+
*/
|
|
5
10
|
export interface WaveOp {
|
|
6
11
|
readonly kind: 'op.wave';
|
|
7
12
|
readonly damping: PropRef;
|
|
8
13
|
}
|
|
9
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* A step that presses a soft round brush into the grid wherever the pointer moves.
|
|
16
|
+
*
|
|
17
|
+
* `at` is the pointer signal, `amount` the pointer-speed signal that scales the push (a still
|
|
18
|
+
* pointer adds nothing), `radius` a prop on a 0.1–1 scale.
|
|
19
|
+
*/
|
|
10
20
|
export interface SplatOp {
|
|
11
21
|
readonly kind: 'op.splat';
|
|
12
22
|
readonly at: PointerSignal;
|
|
13
23
|
readonly amount: PointerSpeedSignal;
|
|
14
24
|
readonly radius: PropRef;
|
|
15
25
|
}
|
|
16
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* A derived output: the slope of the grid at every cell, as a 2D vector.
|
|
28
|
+
*
|
|
29
|
+
* This is what a distortion wants: `displaceBy` moves each pixel along the slope.
|
|
30
|
+
*/
|
|
17
31
|
export interface GradientOp {
|
|
18
32
|
readonly kind: 'op.gradient';
|
|
19
33
|
}
|
|
34
|
+
/** Any step that advances the grid each frame. */
|
|
20
35
|
export type GridStepOp = WaveOp | SplatOp;
|
|
36
|
+
/** Any output derived from the grid after the steps have run. */
|
|
21
37
|
export type GridDeriveOp = GradientOp;
|
|
38
|
+
/**
|
|
39
|
+
* The steps and outputs a grid simulation is built from.
|
|
40
|
+
*
|
|
41
|
+
* `op.wave` and `op.splat` go in `step` and run in order once per frame. `op.gradient` goes in
|
|
42
|
+
* `derive`, named, and becomes an output an effect can read with `sim.output('name')`.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* step: [op.wave({damping: p('decay')}), op.splat({at: pointer({teleportGuard: 'on'}), amount: pointerSpeed({max: 2}), radius: p('radius')})],
|
|
47
|
+
* derive: {displacement: op.gradient()},
|
|
48
|
+
* ```
|
|
49
|
+
* @tip The current engine implements exactly `[op.wave, op.splat]` with `op.gradient` derived. Other combinations throw at definition time.
|
|
50
|
+
* @see simulate, GridSim
|
|
51
|
+
*/
|
|
22
52
|
export declare const op: {
|
|
53
|
+
/**
|
|
54
|
+
* A wave step: the grid ripples outward from any disturbance and fades by `damping` (a prop,
|
|
55
|
+
* 0–20).
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* op.wave({damping: p('decay')})
|
|
60
|
+
* ```
|
|
61
|
+
* @tip Declare `history: 2` on the grid. A wave needs the two previous frames.
|
|
62
|
+
* @see op.splat
|
|
63
|
+
*/
|
|
23
64
|
readonly wave: (config: {
|
|
24
65
|
damping: PropRef;
|
|
25
66
|
}) => WaveOp;
|
|
67
|
+
/**
|
|
68
|
+
* A brush step: a soft round push into the grid at the pointer, scaled by how fast it
|
|
69
|
+
* moves. `radius` is a prop on a 0.1–1 scale.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* op.splat({at: pointer({teleportGuard: 'on'}), amount: pointerSpeed({max: 2}), radius: p('radius')})
|
|
74
|
+
* ```
|
|
75
|
+
* @tip Use `pointer({teleportGuard: 'on'})`. The pointer entering the canvas is then not a stroke.
|
|
76
|
+
* @see op.wave, pointer, pointerSpeed
|
|
77
|
+
*/
|
|
26
78
|
readonly splat: (config: {
|
|
27
79
|
at: PointerSignal;
|
|
28
80
|
amount: PointerSpeedSignal;
|
|
29
81
|
radius: PropRef;
|
|
30
82
|
}) => SplatOp;
|
|
83
|
+
/**
|
|
84
|
+
* A derived output: the grid's slope at every cell as a 2D vector, ready for `displaceBy`.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* derive: {displacement: op.gradient()}
|
|
89
|
+
* ```
|
|
90
|
+
* @see displaceBy
|
|
91
|
+
*/
|
|
31
92
|
readonly gradient: () => GradientOp;
|
|
32
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* What a grid simulation declares: its size, how many past frames it keeps, its steps, and its
|
|
96
|
+
* named outputs.
|
|
97
|
+
*/
|
|
33
98
|
export interface GridSimConfig {
|
|
34
|
-
/**
|
|
99
|
+
/** Cells per side of the square grid. 128 is plenty for a ripple field. */
|
|
35
100
|
resolution: number;
|
|
36
|
-
/**
|
|
101
|
+
/** How many past frames the steps read. A wave needs 2. */
|
|
37
102
|
history: number;
|
|
38
|
-
/**
|
|
103
|
+
/** The steps that advance the grid, run in this order once per frame. */
|
|
39
104
|
step: GridStepOp[];
|
|
40
|
-
/** Named
|
|
105
|
+
/** Named outputs an effect can read through `sim.output(name)`. */
|
|
41
106
|
derive: Record<string, GridDeriveOp>;
|
|
42
|
-
/**
|
|
107
|
+
/** Let the engine stop running the simulation once the field has faded to nothing. */
|
|
43
108
|
rest?: {
|
|
44
109
|
settlesWhen: 'derived-from-damping';
|
|
45
110
|
};
|
|
46
111
|
}
|
|
47
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* A handle to one named output of a simulation, the thing you hand to `displaceBy`.
|
|
114
|
+
*
|
|
115
|
+
* @see displaceBy, GridSim
|
|
116
|
+
*/
|
|
48
117
|
export interface SimOutputRef {
|
|
49
118
|
readonly kind: 'simOutput';
|
|
50
119
|
readonly sim: GridSim;
|
|
51
120
|
readonly output: string;
|
|
52
121
|
}
|
|
53
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* A declared grid simulation. Read its outputs with `output('name')` and pass them to an effect.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* effect: displaceBy(waves.output('displacement'), {strength: p('intensity'), chromatic: p('chromaticSplit'), edges: p('edges')})
|
|
128
|
+
* ```
|
|
129
|
+
* @tip Asking for an output that was not declared in `derive` throws with the list of names that were.
|
|
130
|
+
* @see simulate, SimOutputRef
|
|
131
|
+
*/
|
|
54
132
|
export declare class GridSim {
|
|
55
133
|
readonly config: GridSimConfig;
|
|
56
134
|
constructor(config: GridSimConfig);
|
|
57
135
|
output(name: string): SimOutputRef;
|
|
58
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Declare a simulation the engine runs for you. `simulate.grid` gives a square grid of numbers
|
|
139
|
+
* advanced once per frame by the steps you list.
|
|
140
|
+
*
|
|
141
|
+
* Declare it once at module scope, then read its outputs inside the definition. The engine
|
|
142
|
+
* allocates the state, keeps the history, tracks the pointer and sleeps the simulation once it
|
|
143
|
+
* has settled.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* const waves = simulate.grid({resolution: 128, history: 2, step: [op.wave({damping: p('decay')}), op.splat({at: pointer({teleportGuard: 'on'}), amount: pointerSpeed({max: 2}), radius: p('radius')})], derive: {displacement: op.gradient()}, rest: {settlesWhen: 'derived-from-damping'}})
|
|
148
|
+
* ```
|
|
149
|
+
* @tip Reach for `sim.grids`, `sim.fluids`, `sim.feedback` or `sim.agents` only when the effect needs its own GPU step. If a wave field and a displacement say it, stay here.
|
|
150
|
+
* @see op, GridSim, displaceBy
|
|
151
|
+
*/
|
|
59
152
|
export declare const simulate: {
|
|
153
|
+
/**
|
|
154
|
+
* A square grid of numbers advanced once per frame by `step`, with named outputs in `derive`.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const waves = simulate.grid({resolution: 128, history: 2, step: [op.wave({damping: p('decay')}), op.splat({at: pointer({teleportGuard: 'on'}), amount: pointerSpeed({max: 2}), radius: p('radius')})], derive: {displacement: op.gradient()}})
|
|
159
|
+
* ```
|
|
160
|
+
* @see op, GridSim
|
|
161
|
+
*/
|
|
60
162
|
readonly grid: (config: GridSimConfig) => GridSim;
|
|
61
163
|
};
|
|
62
164
|
//# sourceMappingURL=sim.d.ts.map
|