shaders 3.1.456 → 3.1.458
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-CIw_xeFr.js → AngularBlur-BzY7RJ8k.js} +16 -32
- package/dist/core/{Arc-Dh0gjBrJ.js → Arc-mmJuqIrG.js} +15 -26
- package/dist/core/{Ascii-CUk527uY.js → Ascii-D67jsGPT.js} +64 -165
- package/dist/core/{Aurora-A5yag1_A.js → Aurora-CpHlaOfW.js} +93 -289
- package/dist/core/{BarShift-BrOamln6.js → BarShift-B9wsOKYJ.js} +33 -68
- package/dist/core/{BarnDoors-D_lVAMPJ.js → BarnDoors-C7Uzc1at.js} +16 -28
- package/dist/core/{Beam-CgpfMTUq.js → Beam-8CoTk23e.js} +22 -62
- package/dist/core/{Bend-CRuu6NuH.js → Bend-BYVoLE8C.js} +50 -161
- package/dist/core/{Blob-1mhEIcv5.js → Blob--way9kNy.js} +62 -189
- package/dist/core/{BlockDissolve-B9xWZC6U.js → BlockDissolve-f5fwwXWH.js} +17 -32
- package/dist/core/{BlockNoise-Csb39Mqw.js → BlockNoise-BpIuLPlC.js} +17 -29
- package/dist/core/{BlueNoise-CnSe6lOE.js → BlueNoise-C2tYHQRB.js} +14 -23
- package/dist/core/{Blur-Bc8evwsz.js → Blur-CmE46Bvp.js} +41 -114
- package/dist/core/{Boids-C7NstB5L.js → Boids-BgsVOmp1.js} +227 -734
- package/dist/core/{BokehBlur-CWQm00ut.js → BokehBlur-CU5Qphip.js} +197 -722
- package/dist/core/{BrickPattern-DomddM0C.js → BrickPattern-BIpInb0P.js} +41 -99
- package/dist/core/{BrightnessContrast-Bs8AV0he.js → BrightnessContrast-BAJYnvFu.js} +12 -22
- package/dist/core/{BrushedMetal-D2X_nM8z.js → BrushedMetal-C4a9G-dt.js} +113 -358
- package/dist/core/{Bulge-CdhRTWSH.js → Bulge-C7eYFYDP.js} +19 -46
- package/dist/core/{CRTScreen-BxnPxDw9.js → CRTScreen-CfCxUiP4.js} +34 -94
- package/dist/core/{CarbonFiber-BFogRBFa.js → CarbonFiber-CDWj-Oc3.js} +123 -420
- package/dist/core/{Chalkboard-DEuq4TWm.js → Chalkboard-BfiyhSfN.js} +86 -212
- package/dist/core/{ChannelBlur-Oz40DKPZ.js → ChannelBlur-D2pxXWLQ.js} +17 -45
- package/dist/core/{CheckerWipe-yv4dK6n5.js → CheckerWipe-Cxy0pc7v.js} +18 -36
- package/dist/core/{Checkerboard-Ynfnt3oJ.js → Checkerboard-Bdaf19G4.js} +12 -17
- package/dist/core/{Chevron-CEwNP2vt.js → Chevron-BsdILsaY.js} +28 -57
- package/dist/core/{ChromaFlow-BXw1jQkn.js → ChromaFlow-DGTgGdzI.js} +31 -86
- package/dist/core/{ChromaticAberration-CWhYEGDU.js → ChromaticAberration-npr_Zzu7.js} +15 -30
- package/dist/core/{Chrome-DdV9RY9D.js → Chrome-DirY2YRZ.js} +156 -546
- package/dist/core/{Circle-DGvP0Svo.js → Circle-CLO08218.js} +15 -31
- package/dist/core/{ColorWheel-BCReEdLZ.js → ColorWheel-D5Hfl4t7.js} +57 -128
- package/dist/core/{CompressionArtifacts-Cm0iOzys.js → CompressionArtifacts-DVlRMU-H.js} +119 -374
- package/dist/core/{ConcentricSpin-B3GHzoS1.js → ConcentricSpin-Dls_rak9.js} +41 -98
- package/dist/core/{ConicGradient-C3zzgyV4.js → ConicGradient-BjVmRAul.js} +18 -31
- package/dist/core/{ContourLines-DDzxvg9k.js → ContourLines-BKcyS-lX.js} +37 -81
- package/dist/core/{CornerPin-VFPI_Jzq.js → CornerPin-CrTdyHSy.js} +96 -268
- package/dist/core/{Crescent-DL6EeZZp.js → Crescent-C77DCA2i.js} +14 -23
- package/dist/core/{Cross-DQIgZt-C.js → Cross-C8SURmac.js} +14 -23
- package/dist/core/{Crystal-CB_U2g2k.js → Crystal-WbJgiOqh.js} +206 -753
- package/dist/core/{CurlNoise-CFAQHy-5.js → CurlNoise-BiFV2K5L.js} +17 -34
- package/dist/core/{CursorRipples-C1hLNWzZ.js → CursorRipples-hIYlb09k.js} +73 -200
- package/dist/core/{CursorTrail-CPW8orHG.js → CursorTrail-CjTJ9OJ0.js} +81 -172
- package/dist/core/{DataMosh-C_esIK54.js → DataMosh-Cmo5-E5_.js} +134 -521
- package/dist/core/{DiamondGradient-BkrLPdAd.js → DiamondGradient-DIxg1EP9.js} +31 -66
- package/dist/core/{DiamondWipe-Cscn7Dyy.js → DiamondWipe-D4T1q5ia.js} +17 -36
- package/dist/core/{DiffuseBlur-DmPHOfr_.js → DiffuseBlur-okj7zVss.js} +13 -22
- package/dist/core/{DisplacementMap-B-cVoGbC.js → DisplacementMap-CHB6_h0f.js} +31 -69
- package/dist/core/{Dither-CBsFenFW.js → Dither-DTnkeWP0.js} +161 -438
- package/dist/core/{DotGrid-CJJXTOk6.js → DotGrid-BJBEwt4L.js} +36 -77
- package/dist/core/{DropShadow-B4msUftn.js → DropShadow-CPT5vr4K.js} +39 -86
- package/dist/core/{Duotone-DF3dn0kC.js → Duotone-BWuTPBIw.js} +14 -26
- package/dist/core/{Ellipse-WuGsM7Gr.js → Ellipse-gVe3stQJ.js} +14 -23
- package/dist/core/{Emboss-D5RYAc-U.js → Emboss-DOPfz-ox.js} +85 -200
- package/dist/core/{Engraving-CmNKAHmF.js → Engraving-YNrPy-c7.js} +82 -222
- package/dist/core/{ErosionNoise-BjD0wAyD.js → ErosionNoise-X_2sjC-x.js} +14 -23
- package/dist/core/{Exposure-BSsbosYN.js → Exposure-xVgsHAWw.js} +7 -12
- package/dist/core/{FallingLines-C1YT49dj.js → FallingLines-DPHJRCvy.js} +68 -205
- package/dist/core/{FilmGrain-CgvcPFDC.js → FilmGrain-CDuL4T8C.js} +22 -51
- package/dist/core/{FilmStock-Bgn9OyQY.js → FilmStock-BmMC2ewO.js} +89 -264
- package/dist/core/{Flip-DJuox9qR.js → Flip-DhpEvnT7.js} +13 -26
- package/dist/core/{FloatingParticles-BGig0_Ks.js → FloatingParticles-Dx3J-Pbe.js} +177 -459
- package/dist/core/{FlowField-0I_PwtkD.js → FlowField-CLbiu5Xo.js} +38 -120
- package/dist/core/{Flower--1qeeCuA.js → Flower-nF4Zq0eP.js} +14 -23
- package/dist/core/{FlowingGradient-ClUwpsZJ.js → FlowingGradient-aNCwZ9nh.js} +61 -185
- package/dist/core/{FlutedGlass-CqSVa4kd.js → FlutedGlass-m19MvmKj.js} +44 -124
- package/dist/core/{Fog-DxFsHnT2.js → Fog-DVclS-y4.js} +125 -330
- package/dist/core/{Form3D-CabM27VZ.js → Form3D-Cv6l3hHQ.js} +328 -974
- package/dist/core/{FractalNoise-CgR9wvoG.js → FractalNoise-BMRqE4LG.js} +26 -55
- package/dist/core/{Frost-BL4zkGjj.js → Frost-Cqc7t9TR.js} +115 -422
- package/dist/core/{GaborNoise-BHDznYFh.js → GaborNoise-BL4TH_Yh.js} +15 -24
- package/dist/core/{Glass-DPa3OWjZ.js → Glass-D5jcM7J7.js} +6 -6
- package/dist/core/{GlassTiles-B4Y8x78X.js → GlassTiles-BeKB3vfh.js} +29 -90
- package/dist/core/{Glitch-D-QTlz5D.js → Glitch-BmJj_vgQ.js} +83 -295
- package/dist/core/{Glow-C3VfGUb6.js → Glow-wdFqXqWh.js} +11 -20
- package/dist/core/{Godrays-Bh6Idg3p.js → Godrays-CQ7Gpeni.js} +68 -179
- package/dist/core/{Goo-BPaUKk1S.js → Goo-nc_51UOr.js} +92 -323
- package/dist/core/{GradientMap-DQ4IbzIx.js → GradientMap-BU9r1enO.js} +61 -141
- package/dist/core/{Grayscale-Bpp1Q2KT.js → Grayscale-CGtMggTH.js} +13 -25
- package/dist/core/{Grid-BneV9T3T.js → Grid-BFx6ufzG.js} +51 -122
- package/dist/core/{GridDistortion-CAKSKhII.js → GridDistortion-B-Hq3rLo.js} +80 -195
- package/dist/core/{Group-UvbIuzy-.js → Group-DnA_clLB.js} +1 -1
- package/dist/core/{HTMLInCanvas-CMxSuq5H.js → HTMLInCanvas-DhCIQ97w.js} +2 -2
- package/dist/core/{Halftone-SiFx0wAg.js → Halftone-eX0AaYyB.js} +114 -283
- package/dist/core/{Heart-DLQnxsbQ.js → Heart-98zfiijj.js} +14 -23
- package/dist/core/{Heatmap-DhvtrL45.js → Heatmap-BCV4Pq0O.js} +92 -271
- package/dist/core/{HexGrid-LGx240mZ.js → HexGrid-BlRlo8z4.js} +46 -117
- package/dist/core/{Hologram-DR88qD5X.js → Hologram-B5iMaK95.js} +87 -258
- package/dist/core/{Holographic-DKc_nNnT.js → Holographic-DBdODPjj.js} +99 -333
- package/dist/core/{HueShift-B7l4vcZP.js → HueShift-AsoQKt_z.js} +16 -33
- package/dist/core/{ImageTexture-D41xKACO.js → ImageTexture-CRL52DxI.js} +3 -3
- package/dist/core/{InkFlow-Bd4RXQmm.js → InkFlow-JMUVdkv1.js} +60 -148
- package/dist/core/{Invert-CEfJB0WN.js → Invert-BWV7zcBe.js} +7 -12
- package/dist/core/{IrisWipe-O6dc-Aq2.js → IrisWipe-5LICL9Oq.js} +14 -23
- package/dist/core/{IsometricCubes-BQFwe-5s.js → IsometricCubes-DGFF6e8t.js} +61 -180
- package/dist/core/{Kaleidoscope-DQFV4-lX.js → Kaleidoscope-B7F2_L9x.js} +28 -69
- package/dist/core/{KeyFrames-BjH6gHSf.js → KeyFrames-CVH9NNY6.js} +298 -1172
- package/dist/core/{LensDistortion-BcodYk7_.js → LensDistortion-_QcaFbkh.js} +3 -3
- package/dist/core/{LensFlare-B4F0dq7O.js → LensFlare-h0EG0UVt.js} +119 -396
- package/dist/core/{LightEdge-CF0k0vMa.js → LightEdge-DO7stYlD.js} +169 -491
- package/dist/core/{LightLeak-Bu6xFjg-.js → LightLeak-BxqXrUyh.js} +80 -268
- package/dist/core/{Line-CRGYWOyW.js → Line-BtfkwqKJ.js} +79 -315
- package/dist/core/{LinearBlur-DGfbbIWb.js → LinearBlur-D0_W0tKF.js} +17 -33
- package/dist/core/{LinearGradient-DOWwm0bP.js → LinearGradient-BiATK9p7.js} +63 -145
- package/dist/core/{LinearWipe-0nTDgTcZ.js → LinearWipe-B1GFY0IT.js} +14 -23
- package/dist/core/{LiquidMetal-Bhenyeg-.js → LiquidMetal-07eJWR7z.js} +106 -341
- package/dist/core/{Liquify-Bg2tEc64.js → Liquify-CfPGxRC3.js} +72 -194
- package/dist/core/{MagneticFilings-Bn5DZWor.js → MagneticFilings-5iGBn4fr.js} +191 -545
- package/dist/core/{Marble-CSOGQ6C0.js → Marble-RK87t7fT.js} +30 -88
- package/dist/core/MeshGradient-DxUlAoDr.js +1508 -0
- package/dist/core/{Mirror-B_2eQT6d.js → Mirror-Bn0fpWtr.js} +26 -67
- package/dist/core/{MultiPointGradient-NJZfFGVb.js → MultiPointGradient-C44VD_6j.js} +26 -50
- package/dist/core/{Neon-m8PtEGdE.js → Neon-aO0w94H6.js} +119 -337
- package/dist/core/{NoiseDissolve-B-fFjiGJ.js → NoiseDissolve-BYyXZMjF.js} +23 -64
- package/dist/core/{ObjectTracker-DlVNN9LJ.js → ObjectTracker-ZgeKRvaK.js} +5 -5
- package/dist/core/{PagePeel-BZOvdHFV.js → PagePeel-DqrIEWWF.js} +67 -215
- package/dist/core/{Paper-w8M4w_Sm.js → Paper-q-nDnqsG.js} +19 -45
- package/dist/core/{Parallelogram-a6zB6mY9.js → Parallelogram-Cppv2GJm.js} +14 -23
- package/dist/core/{ParticleField-UGf3Daat.js → ParticleField-B-O9nxdw.js} +247 -765
- package/dist/core/{ParticleFlow-C7vEbMS3.js → ParticleFlow-DVgTyGq4.js} +283 -840
- package/dist/core/{Particles-CumYpD-5.js → Particles-B49_QWS_.js} +381 -1131
- package/dist/core/{PerlinNoise-sjc342lu.js → PerlinNoise-CZVb7VEh.js} +17 -29
- package/dist/core/{Perspective-S94umCQn.js → Perspective-Bl3AmawJ.js} +27 -73
- package/dist/core/{PixelSort-C7tv3A5u.js → PixelSort-7VoL4Ck8.js} +174 -500
- package/dist/core/{PixelThrow-2WPijuDY.js → PixelThrow-CPqOSAmc.js} +25 -56
- package/dist/core/{Pixelate-BLdO8qAT.js → Pixelate-jMtbtFMG.js} +35 -109
- package/dist/core/{Plasma-DBzZcfQN.js → Plasma-DbilAdXY.js} +23 -47
- package/dist/core/{Plastic-C0Sl_sV1.js → Plastic-DX61wGBx.js} +125 -379
- package/dist/core/{PolarCoordinates-DZNOyHmN.js → PolarCoordinates-KOCO2sd-.js} +19 -44
- package/dist/core/{Polygon-BM3xGxOC.js → Polygon-Citu4Kgl.js} +18 -36
- package/dist/core/{Posterize-BJl7Irml.js → Posterize-D2-WcAiP.js} +18 -45
- package/dist/core/{Prism-CaJyExNA.js → Prism-DYPWHdaf.js} +52 -144
- package/dist/core/{ProgressiveBlur-B1Ur87dm.js → ProgressiveBlur-CTxD1yoj.js} +87 -223
- package/dist/core/{RadialGradient-C1Fb8TaL.js → RadialGradient-B6I7KijG.js} +30 -63
- package/dist/core/{RadialWipe-CA5xWWPN.js → RadialWipe-CtjMG_pj.js} +14 -23
- package/dist/core/{RandomBars-B66TF6V8.js → RandomBars-C6ksDuSF.js} +21 -47
- package/dist/core/{ReactionDiffusion-cYvl6ks9.js → ReactionDiffusion-BzipteCn.js} +274 -755
- package/dist/core/{RectangularCoordinates-BEOFurXt.js → RectangularCoordinates-CfdZ347a.js} +18 -39
- package/dist/core/{ReflectivePlane-wERmyiKx.js → ReflectivePlane-Cpv1p9O3.js} +48 -109
- package/dist/core/{Repeater-Cy8up7cj.js → Repeater-H17zapDG.js} +2 -2
- package/dist/core/{Ring-Cogdtn-0.js → Ring-CDpyGwQ6.js} +15 -31
- package/dist/core/{RippleWipe-fJwyE4vj.js → RippleWipe-BqL3WbjT.js} +20 -41
- package/dist/core/{Ripples-BSHfhVG1.js → Ripples-OFXx87jz.js} +16 -31
- package/dist/core/{RoundedRect-D3intNNI.js → RoundedRect-CuFSyEfW.js} +14 -23
- package/dist/core/{Saturation-D42Bfc5P.js → Saturation-DjHX8rx2.js} +18 -45
- package/dist/core/{Scratches-CChXWpPg.js → Scratches-Glgspe1m.js} +16 -33
- package/dist/core/{Sharpness-Dyh6312-.js → Sharpness-CSOtgpDq.js} +19 -40
- package/dist/core/{Shatter-Qc5aMkWj.js → Shatter-ydD72wnA.js} +79 -199
- package/dist/core/{SimplexNoise-bCC60yB9.js → SimplexNoise-hkOBRbAM.js} +19 -35
- package/dist/core/{SineWave-CnPtZLSs.js → SineWave-Bp_0CoHZ.js} +20 -42
- package/dist/core/{SliceWipe-Byb46V6I.js → SliceWipe-B77JxKQI.js} +31 -86
- package/dist/core/{Smoke-5x6IAk2_.js → Smoke-BMhBhfbI.js} +50 -142
- package/dist/core/{SmokeFill-DOQpTlCv.js → SmokeFill-L_3k9mKj.js} +173 -497
- package/dist/core/{SmokeFlow-B4fdM2M-.js → SmokeFlow-BNzNH5BF.js} +41 -102
- package/dist/core/{Solarize-BB0bXhP0.js → Solarize-C7kAzXW_.js} +20 -50
- package/dist/core/{SolidColor-D-6N9JmI.js → SolidColor-Bp_KSGbp.js} +1 -1
- package/dist/core/{Spherize-aWpru70e.js → Spherize-Bj2nPPwK.js} +43 -125
- package/dist/core/{Spiral-Dbm2j7mM.js → Spiral-D3pxBQUb.js} +46 -115
- package/dist/core/{Star-XtB9FBhQ.js → Star-CEH9XN1n.js} +14 -23
- package/dist/core/{Stone-xSVm7jNc.js → Stone-DwYVLkb6.js} +2 -2
- package/dist/core/{Strands-BFaZBnNo.js → Strands-C3KJK5qj.js} +73 -224
- package/dist/core/{Stretch-BKg0gjm4.js → Stretch-D4dxm3Eq.js} +25 -62
- package/dist/core/{Stripes-B_SkTR2m.js → Stripes-C189VJJp.js} +27 -46
- package/dist/core/{StudioBackground-CUsUWJ2L.js → StudioBackground-DBftmr1t.js} +63 -207
- package/dist/core/{SunBurst-DiqSzz5A.js → SunBurst-BWiu3_T9.js} +20 -43
- package/dist/core/{Surface3D-Dd_T3xvt.js → Surface3D-BHj5scrr.js} +236 -806
- package/dist/core/{Swirl-DBxZ6Wud.js → Swirl-CG20s_S3.js} +35 -126
- package/dist/core/{Teardrop-CnhwMyQx.js → Teardrop-CaZaZqiU.js} +14 -23
- package/dist/core/{Text-Cb6QJNWo.js → Text-BbSkUuRh.js} +26 -64
- package/dist/core/{ThinFilm-B7CTONK1.js → ThinFilm-DT5F71JM.js} +77 -202
- package/dist/core/{TiltShift-DqEFOoJG.js → TiltShift-Bkj3TL8G.js} +90 -238
- package/dist/core/{TimeTrail-G_JamlY8.js → TimeTrail-DNI1as8t.js} +173 -403
- package/dist/core/{Tint-Dj1rSoJ0.js → Tint-C9ivnlbq.js} +35 -89
- package/dist/core/{Trapezoid-D2PMU9G3.js → Trapezoid-Ba413G93.js} +14 -23
- package/dist/core/{TriangularGrid-C3DBCmaj.js → TriangularGrid-Cq7BdUyV.js} +50 -126
- package/dist/core/{Tritone-DfULv51I.js → Tritone-C4qZhK3A.js} +17 -41
- package/dist/core/{Truchet-yjZm8xe3.js → Truchet-BXK_Ot95.js} +60 -152
- package/dist/core/{Twirl-DfRsql00.js → Twirl-BZDpTksa.js} +18 -41
- package/dist/core/{VHS-CGffLHVk.js → VHS-Ge_vluLk.js} +97 -295
- package/dist/core/{VenetianBlinds-CCucT73e.js → VenetianBlinds-Dp92230V.js} +16 -28
- package/dist/core/{Vesica-BIGpXjWv.js → Vesica-5kOz3lTP.js} +14 -23
- package/dist/core/{Vibrance-CtlvCONz.js → Vibrance-B0y3zjRl.js} +18 -45
- package/dist/core/{VideoTexture-DW6bQduh.js → VideoTexture-COYSXvPe.js} +3 -3
- package/dist/core/{Vignette-Dz3pPnPR.js → Vignette-BD_9PM6J.js} +23 -56
- package/dist/core/{Voronoi-5QA-0zme.js → Voronoi-DIpQvBqc.js} +21 -46
- package/dist/core/{Water-CGBvuzXj.js → Water-D6Y7PaqY.js} +179 -639
- package/dist/core/{Watercolor-CGOpgWt8.js → Watercolor-gXjW0cmP.js} +59 -184
- package/dist/core/{WaveDistortion-CRQzZDLP.js → WaveDistortion-CFVOiujJ.js} +84 -178
- package/dist/core/{WaveletNoise-B8MeveW8.js → WaveletNoise-Bm_C1dRt.js} +15 -24
- package/dist/core/{Weave-DpwAU5Rn.js → Weave-a9i8xeTZ.js} +34 -74
- package/dist/core/{WebcamTexture-DauLQjCl.js → WebcamTexture-BFP7WQuM.js} +13 -22
- package/dist/core/{Wool-CuhWR2jo.js → Wool-BwM9vbek.js} +2 -2
- package/dist/core/{WorleyNoise-CjRMr7xP.js → WorleyNoise-DsKMQk7S.js} +30 -56
- package/dist/core/{ZoomBlur-DgG9JA7a.js → ZoomBlur-DiEaGrqE.js} +10 -19
- package/dist/core/{aa-C8WSqiNB.js → aa-C759fSpb.js} +109 -278
- package/dist/core/{agents-C_kohsYu.js → agents-BrNOCcxk.js} +246 -298
- package/dist/core/{bevel-ogqjoZKV.js → bevel-1wa44FF7.js} +14 -34
- package/dist/core/{blur-CZuIxzX6.js → blur-fsxhpklK.js} +314 -925
- package/dist/core/{cells-CM9mfnTr.js → cells-CmYMp4aV.js} +92 -191
- package/dist/core/{cellular-qYnxKdPx.js → cellular-7Xgxfk7O.js} +134 -385
- package/dist/core/derivative-p1TouwZG.js +93 -0
- package/dist/core/{device-B0ZwBfOg.js → device-DWPzs8TD.js} +528 -778
- package/dist/core/{edges-CD7gCAto.js → edges-BvIjDyJK.js} +11467 -13731
- package/dist/core/{fields-CC0756V2.js → fields-DORoQP7V.js} +96 -260
- package/dist/core/{geom-90G-d_hc.js → geom-D1eEB6WE.js} +111 -220
- package/dist/core/{glass-D8xs_kIG.js → glass-DEHkelE5.js} +164 -391
- package/dist/core/index.js +253 -245
- package/dist/core/{lightfields-ffHoLyJn.js → lightfields-Btxs_pA3.js} +125 -320
- package/dist/core/{lighting-D3jc6qOc.js → lighting-CT_di0hW.js} +111 -248
- package/dist/core/{media-fQMXfvXd.js → media-B4AiE8Wu.js} +63 -141
- package/dist/core/{mediaLifecycle-yHZ8w5aj.js → mediaLifecycle-DHrjB2zB.js} +1 -1
- package/dist/core/{noise-DX5Y_I--.js → noise-Be9_Xz5F.js} +939 -2742
- package/dist/core/{noiseColor-DYhX5Js1.js → noiseColor-CCePJCFN.js} +3 -3
- package/dist/core/{noiseColor-DRDY44sf.js → noiseColor-D0SCfBYp.js} +2 -2
- package/dist/core/{noiseStylize-BZD5cOJl.js → noiseStylize-B7Mis4X3.js} +20 -35
- package/dist/core/{porters-DUtQounc.js → porters-BnG6v9YC.js} +762 -2282
- package/dist/core/{propConfigs-k3hs8KYL.js → propConfigs-CvzF7Ot8.js} +1 -1
- package/dist/core/registry.js +225 -223
- package/dist/core/{reveal-DhktaT1C.js → reveal-BPF3DkX1.js} +99 -258
- package/dist/core/{sdf3d-CP87OlsQ.js → sdf3d-OWBwV8hi.js} +931 -3004
- package/dist/core/shaderRegistry-CnWd3DKN.js +433 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +8 -8
- package/dist/core/shaders/Arc/index.js +7 -7
- package/dist/core/shaders/Ascii/index.js +9 -9
- package/dist/core/shaders/Aurora/index.js +11 -10
- package/dist/core/shaders/BarShift/index.js +8 -8
- package/dist/core/shaders/BarnDoors/index.js +9 -9
- package/dist/core/shaders/Beam/index.js +10 -10
- package/dist/core/shaders/Bend/index.js +8 -8
- package/dist/core/shaders/Blob/index.js +7 -7
- package/dist/core/shaders/BlockDissolve/index.js +11 -10
- package/dist/core/shaders/BlockNoise/index.js +15 -14
- package/dist/core/shaders/BlueNoise/index.js +15 -14
- package/dist/core/shaders/Blur/index.js +8 -8
- package/dist/core/shaders/Boids/index.js +11 -10
- package/dist/core/shaders/BokehBlur/index.js +9 -9
- package/dist/core/shaders/BrickPattern/index.js +12 -11
- package/dist/core/shaders/BrightnessContrast/index.js +7 -7
- package/dist/core/shaders/BrushedMetal/index.js +14 -13
- package/dist/core/shaders/Bulge/index.js +7 -7
- package/dist/core/shaders/CRTScreen/index.js +7 -7
- package/dist/core/shaders/CarbonFiber/index.js +14 -13
- package/dist/core/shaders/Chalkboard/index.js +9 -8
- package/dist/core/shaders/ChannelBlur/index.js +8 -8
- package/dist/core/shaders/CheckerWipe/index.js +9 -9
- package/dist/core/shaders/Checkerboard/index.js +10 -9
- package/dist/core/shaders/Chevron/index.js +10 -9
- package/dist/core/shaders/ChromaFlow/index.js +7 -7
- package/dist/core/shaders/ChromaticAberration/index.js +7 -7
- package/dist/core/shaders/Chrome/index.js +14 -13
- package/dist/core/shaders/Circle/index.js +7 -7
- package/dist/core/shaders/ColorWheel/index.js +9 -9
- package/dist/core/shaders/CompressionArtifacts/index.js +7 -7
- package/dist/core/shaders/ConcentricSpin/index.js +8 -8
- package/dist/core/shaders/ConicGradient/index.js +11 -11
- package/dist/core/shaders/ContourLines/index.js +9 -8
- package/dist/core/shaders/CornerPin/index.js +7 -7
- package/dist/core/shaders/Crescent/index.js +7 -7
- package/dist/core/shaders/Cross/index.js +7 -7
- package/dist/core/shaders/Crystal/index.js +13 -12
- package/dist/core/shaders/CurlNoise/index.js +15 -14
- package/dist/core/shaders/CursorRipples/index.js +8 -8
- package/dist/core/shaders/CursorTrail/index.js +8 -8
- package/dist/core/shaders/DataMosh/index.js +9 -8
- package/dist/core/shaders/DiamondGradient/index.js +11 -11
- package/dist/core/shaders/DiamondWipe/index.js +9 -9
- package/dist/core/shaders/DiffuseBlur/index.js +9 -8
- package/dist/core/shaders/DisplacementMap/index.js +8 -8
- package/dist/core/shaders/Dither/index.js +9 -8
- package/dist/core/shaders/DotGrid/index.js +12 -11
- package/dist/core/shaders/DropShadow/index.js +9 -9
- package/dist/core/shaders/Duotone/index.js +7 -7
- package/dist/core/shaders/Ellipse/index.js +7 -7
- package/dist/core/shaders/Emboss/index.js +9 -9
- package/dist/core/shaders/Engraving/index.js +10 -9
- package/dist/core/shaders/ErosionNoise/index.js +15 -14
- package/dist/core/shaders/Exposure/index.js +7 -7
- package/dist/core/shaders/FallingLines/index.js +10 -9
- package/dist/core/shaders/FilmGrain/index.js +9 -8
- package/dist/core/shaders/FilmStock/index.js +8 -8
- package/dist/core/shaders/Flip/index.js +7 -7
- package/dist/core/shaders/FloatingParticles/index.js +11 -10
- package/dist/core/shaders/FlowField/index.js +10 -9
- package/dist/core/shaders/Flower/index.js +7 -7
- package/dist/core/shaders/FlowingGradient/index.js +10 -9
- package/dist/core/shaders/FlutedGlass/index.js +8 -8
- package/dist/core/shaders/Fog/index.js +11 -10
- package/dist/core/shaders/Form3D/index.js +8 -8
- package/dist/core/shaders/FractalNoise/index.js +14 -13
- package/dist/core/shaders/Frost/index.js +13 -12
- package/dist/core/shaders/GaborNoise/index.js +15 -14
- package/dist/core/shaders/Glass/index.js +10 -10
- package/dist/core/shaders/GlassTiles/index.js +8 -8
- package/dist/core/shaders/Glitch/index.js +9 -8
- package/dist/core/shaders/Glow/index.js +8 -8
- package/dist/core/shaders/Godrays/index.js +12 -11
- package/dist/core/shaders/Goo/index.js +10 -10
- package/dist/core/shaders/GradientMap/index.js +8 -8
- package/dist/core/shaders/Grayscale/index.js +7 -7
- package/dist/core/shaders/Grid/index.js +12 -11
- package/dist/core/shaders/GridDistortion/index.js +7 -7
- package/dist/core/shaders/Group/index.js +7 -7
- package/dist/core/shaders/HTMLInCanvas/index.js +8 -8
- package/dist/core/shaders/Halftone/index.js +8 -8
- package/dist/core/shaders/Heart/index.js +7 -7
- package/dist/core/shaders/Heatmap/index.js +12 -11
- package/dist/core/shaders/HexGrid/index.js +12 -11
- package/dist/core/shaders/Hologram/index.js +12 -11
- package/dist/core/shaders/Holographic/index.js +13 -12
- package/dist/core/shaders/HueShift/index.js +8 -8
- package/dist/core/shaders/ImageTexture/index.js +7 -7
- package/dist/core/shaders/InkFlow/index.js +8 -8
- package/dist/core/shaders/Invert/index.js +7 -7
- package/dist/core/shaders/IrisWipe/index.js +9 -9
- package/dist/core/shaders/IsometricCubes/index.js +12 -11
- package/dist/core/shaders/Kaleidoscope/index.js +8 -8
- package/dist/core/shaders/KeyFrames/index.js +8 -8
- package/dist/core/shaders/LensDistortion/index.js +7 -7
- package/dist/core/shaders/LensFlare/index.js +11 -11
- package/dist/core/shaders/LightEdge/index.js +12 -11
- package/dist/core/shaders/LightLeak/index.js +12 -11
- package/dist/core/shaders/Line/index.js +7 -7
- package/dist/core/shaders/LinearBlur/index.js +9 -9
- package/dist/core/shaders/LinearGradient/index.js +9 -9
- package/dist/core/shaders/LinearWipe/index.js +9 -9
- package/dist/core/shaders/LiquidMetal/index.js +14 -13
- package/dist/core/shaders/Liquify/index.js +7 -7
- package/dist/core/shaders/MagneticFilings/index.js +11 -10
- package/dist/core/shaders/Marble/index.js +11 -10
- package/dist/core/shaders/MeshGradient/index.d.ts +87 -0
- package/dist/core/shaders/MeshGradient/index.d.ts.map +1 -0
- package/dist/core/shaders/MeshGradient/index.js +16 -0
- package/dist/core/shaders/Mirror/index.js +8 -8
- package/dist/core/shaders/MultiPointGradient/index.js +8 -8
- package/dist/core/shaders/Neon/index.js +7 -7
- package/dist/core/shaders/NoiseDissolve/index.js +11 -10
- package/dist/core/shaders/ObjectTracker/index.js +10 -10
- package/dist/core/shaders/PagePeel/index.js +8 -8
- package/dist/core/shaders/Paper/index.js +9 -8
- package/dist/core/shaders/Parallelogram/index.js +7 -7
- package/dist/core/shaders/ParticleField/index.js +11 -10
- package/dist/core/shaders/ParticleFlow/index.js +11 -10
- package/dist/core/shaders/Particles/index.js +12 -11
- package/dist/core/shaders/PerlinNoise/index.js +15 -14
- package/dist/core/shaders/Perspective/index.js +8 -8
- package/dist/core/shaders/PixelSort/index.js +9 -8
- package/dist/core/shaders/PixelThrow/index.js +7 -7
- package/dist/core/shaders/Pixelate/index.js +7 -7
- package/dist/core/shaders/Plasma/index.js +14 -13
- package/dist/core/shaders/Plastic/index.js +13 -12
- package/dist/core/shaders/PolarCoordinates/index.js +8 -8
- package/dist/core/shaders/Polygon/index.js +7 -7
- package/dist/core/shaders/Posterize/index.js +7 -7
- package/dist/core/shaders/Prism/index.js +7 -7
- package/dist/core/shaders/ProgressiveBlur/index.js +9 -9
- package/dist/core/shaders/RadialGradient/index.js +11 -11
- package/dist/core/shaders/RadialWipe/index.js +9 -9
- package/dist/core/shaders/RandomBars/index.js +11 -10
- package/dist/core/shaders/ReactionDiffusion/index.js +11 -10
- package/dist/core/shaders/RectangularCoordinates/index.js +8 -8
- package/dist/core/shaders/ReflectivePlane/index.js +8 -8
- package/dist/core/shaders/Repeater/index.js +7 -7
- package/dist/core/shaders/Ring/index.js +7 -7
- package/dist/core/shaders/RippleWipe/index.js +9 -9
- package/dist/core/shaders/Ripples/index.js +7 -7
- package/dist/core/shaders/RoundedRect/index.js +7 -7
- package/dist/core/shaders/Saturation/index.js +7 -7
- package/dist/core/shaders/Scratches/index.js +12 -11
- package/dist/core/shaders/Sharpness/index.js +7 -7
- package/dist/core/shaders/Shatter/index.js +7 -7
- package/dist/core/shaders/SimplexNoise/index.js +15 -14
- package/dist/core/shaders/SineWave/index.js +8 -8
- package/dist/core/shaders/SliceWipe/index.js +8 -8
- package/dist/core/shaders/Smoke/index.js +8 -8
- package/dist/core/shaders/SmokeFill/index.js +10 -10
- package/dist/core/shaders/SmokeFlow/index.js +8 -8
- package/dist/core/shaders/Solarize/index.js +7 -7
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +7 -7
- package/dist/core/shaders/Spiral/index.js +9 -8
- package/dist/core/shaders/Star/index.js +7 -7
- package/dist/core/shaders/Stone/index.js +6 -5
- package/dist/core/shaders/Strands/index.js +8 -8
- package/dist/core/shaders/Stretch/index.js +8 -8
- package/dist/core/shaders/Stripes/index.js +11 -10
- package/dist/core/shaders/StudioBackground/index.js +10 -10
- package/dist/core/shaders/SunBurst/index.js +10 -10
- package/dist/core/shaders/Surface3D/index.js +10 -9
- package/dist/core/shaders/Swirl/index.js +7 -7
- package/dist/core/shaders/Teardrop/index.js +7 -7
- package/dist/core/shaders/Text/index.js +11 -11
- package/dist/core/shaders/ThinFilm/index.js +9 -9
- package/dist/core/shaders/TiltShift/index.js +9 -9
- package/dist/core/shaders/TimeTrail/index.js +7 -7
- package/dist/core/shaders/Tint/index.js +7 -7
- package/dist/core/shaders/Trapezoid/index.js +7 -7
- package/dist/core/shaders/TriangularGrid/index.js +12 -11
- package/dist/core/shaders/Tritone/index.js +7 -7
- package/dist/core/shaders/Truchet/index.js +12 -11
- package/dist/core/shaders/Twirl/index.js +7 -7
- package/dist/core/shaders/VHS/index.js +9 -8
- package/dist/core/shaders/VenetianBlinds/index.js +9 -9
- package/dist/core/shaders/Vesica/index.js +7 -7
- package/dist/core/shaders/Vibrance/index.js +7 -7
- package/dist/core/shaders/VideoTexture/index.js +7 -7
- package/dist/core/shaders/Vignette/index.js +7 -7
- package/dist/core/shaders/Voronoi/index.js +12 -12
- package/dist/core/shaders/Water/index.js +13 -12
- package/dist/core/shaders/Watercolor/index.js +9 -8
- package/dist/core/shaders/WaveDistortion/index.js +8 -8
- package/dist/core/shaders/WaveletNoise/index.js +15 -14
- package/dist/core/shaders/Weave/index.js +12 -11
- package/dist/core/shaders/WebcamTexture/index.js +9 -9
- package/dist/core/shaders/Wool/index.js +6 -5
- package/dist/core/shaders/WorleyNoise/index.js +13 -13
- package/dist/core/shaders/ZoomBlur/index.js +8 -8
- package/dist/core/telemetry/index.js +1 -1
- package/dist/core/{tone-DPUvX6X0.js → tone-DgOOeWNY.js} +67 -137
- package/dist/core/utilities/transformations/index.js +1 -1
- package/dist/js/bundle.js +202 -187
- package/dist/js/createShader.js +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +38 -0
- package/dist/react/MeshGradient.js +226 -0
- package/dist/react/Preview.js +1 -0
- package/dist/react/Shader.js +1 -1
- package/dist/react/bundle.js +120 -105
- package/dist/react/components/MeshGradient.d.ts +41 -0
- package/dist/react/components/MeshGradient.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +38 -0
- package/dist/registry.js +418 -0
- package/dist/solid/components/MeshGradient.d.ts +38 -0
- package/dist/solid/components/MeshGradient.d.ts.map +1 -0
- package/dist/solid/components/MeshGradient.js +232 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +219 -217
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +174 -172
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +38 -0
- package/dist/svelte/components/MeshGradient.svelte.d.ts +28 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +2663 -2456
- package/dist/svelte/source/components/MeshGradient.svelte +352 -0
- package/dist/svelte/source/engine/Preview.svelte +2 -0
- package/dist/svelte/source/index.js +1 -0
- package/dist/svelte/utils/generatePresetCode.js +38 -0
- package/dist/vue/MeshGradient.js +3 -0
- package/dist/vue/MeshGradient.vue_vue_type_script_setup_true_lang.js +237 -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/components/MeshGradient.vue.d.ts +63 -0
- package/dist/vue/components/MeshGradient.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +2 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +38 -0
- package/package.json +10 -2
- package/dist/core/shaderRegistry-IG9k35Qx.js +0 -431
- /package/dist/core/{canvasRaster-BB2bNhS7.js → canvasRaster-B41z007g.js} +0 -0
- /package/dist/core/{constants-DoOzbl5b.js → constants-BKlzQFdJ.js} +0 -0
- /package/dist/core/{fonts-ScBvKolx.js → fonts-BMxmjoBM.js} +0 -0
- /package/dist/core/{pointer-DGDGF-yO.js → pointer-DKBz1Qcc.js} +0 -0
- /package/dist/core/{support-6QRFK3xB.js → support-DVuLvN48.js} +0 -0
- /package/dist/core/{transformations-B-zNWNdd.js → transformations-u-UZrXjj.js} +0 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext, setContext, onMount, onDestroy } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
createGpuUniformsMap,
|
|
5
|
+
resolveBoundingBox,
|
|
6
|
+
type GpuUniformsMap,
|
|
7
|
+
type BlendMode,
|
|
8
|
+
type NodeMetadata,
|
|
9
|
+
type PropConfig,
|
|
10
|
+
type MaskConfig,
|
|
11
|
+
type PropDriver,
|
|
12
|
+
type TransformConfig,
|
|
13
|
+
type BoundingBoxConfig,
|
|
14
|
+
type LayoutConfig
|
|
15
|
+
} from '../../../core/index.js';
|
|
16
|
+
import {setColorSpaceMode} from '../../../core/utilities/transformations/index.js';
|
|
17
|
+
|
|
18
|
+
// @ts-ignore - this import is replaced at build time
|
|
19
|
+
import { componentDefinition, type ComponentProps } from '../../../core/shaders/MeshGradient/index.js';
|
|
20
|
+
|
|
21
|
+
// Warn once per page load if this is an experimental component
|
|
22
|
+
let _experimentalWarnedOnce = false;
|
|
23
|
+
if ((componentDefinition as any).experimental && !_experimentalWarnedOnce) {
|
|
24
|
+
_experimentalWarnedOnce = true;
|
|
25
|
+
const _e = (componentDefinition as any).experimental;
|
|
26
|
+
console.info(`%c⚠ [Shaders] ${componentDefinition.name} is experimental: ${_e.message}`, 'color: #f59e0b; font-weight: bold');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Define component props including blend mode, opacity, visibility, masking, and transformation
|
|
31
|
+
*/
|
|
32
|
+
interface ExtendedComponentProps extends Partial<ComponentProps> {
|
|
33
|
+
smoothness?: ComponentProps['smoothness'] | PropDriver;
|
|
34
|
+
variation?: ComponentProps['variation'] | PropDriver;
|
|
35
|
+
swirl?: ComponentProps['swirl'] | PropDriver;
|
|
36
|
+
drift?: ComponentProps['drift'] | PropDriver;
|
|
37
|
+
wrapping?: ComponentProps['wrapping'] | PropDriver;
|
|
38
|
+
seed?: ComponentProps['seed'] | PropDriver;
|
|
39
|
+
blendMode?: BlendMode;
|
|
40
|
+
opacity?: number;
|
|
41
|
+
visible?: boolean;
|
|
42
|
+
id?: string;
|
|
43
|
+
maskSource?: string;
|
|
44
|
+
maskType?: string;
|
|
45
|
+
renderOrder?: number;
|
|
46
|
+
transform?: Partial<TransformConfig>;
|
|
47
|
+
boundingBox?: Partial<BoundingBoxConfig>;
|
|
48
|
+
flow?: LayoutConfig;
|
|
49
|
+
absolute?: boolean;
|
|
50
|
+
children?: import('svelte').Snippet;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isPropDriver(value: unknown): value is PropDriver {
|
|
54
|
+
return typeof value === 'object' && value !== null && 'type' in value &&
|
|
55
|
+
((value as any).type === 'map' || (value as any).type === 'mouse' || (value as any).type === 'mouse-position' || (value as any).type === 'auto-animate');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Default transform configuration (optimized for zero overhead)
|
|
60
|
+
*/
|
|
61
|
+
const DEFAULT_TRANSFORM: TransformConfig = {
|
|
62
|
+
offsetX: 0,
|
|
63
|
+
offsetY: 0,
|
|
64
|
+
rotation: 0,
|
|
65
|
+
scale: 1,
|
|
66
|
+
anchorX: 0.5,
|
|
67
|
+
anchorY: 0.5,
|
|
68
|
+
edges: 'transparent'
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Define the component props and their default values from the shader definition
|
|
72
|
+
const componentDefaults = {
|
|
73
|
+
blendMode: 'normal' as BlendMode,
|
|
74
|
+
visible: true,
|
|
75
|
+
// opacity intentionally has no default - handled by renderer
|
|
76
|
+
// transform intentionally has no default - handled by effectiveTransform
|
|
77
|
+
...Object.entries(componentDefinition.props).reduce(
|
|
78
|
+
(acc, [key, config]) => {
|
|
79
|
+
acc[key] = (config as unknown as PropConfig<typeof config>).default;
|
|
80
|
+
return acc;
|
|
81
|
+
},
|
|
82
|
+
{} as Record<string, any>
|
|
83
|
+
)
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// Declare props using Svelte 5's syntax
|
|
87
|
+
const props: ExtendedComponentProps = $props();
|
|
88
|
+
|
|
89
|
+
// Apply defaults manually since Svelte 5 doesn't have withDefaults equivalent
|
|
90
|
+
// Use $derived so the metadata $effect re-runs when any of these change at runtime
|
|
91
|
+
const blendMode = $derived(props.blendMode ?? componentDefaults.blendMode);
|
|
92
|
+
const opacity = $derived(props.opacity); // No default - handled by renderer
|
|
93
|
+
const visible = $derived(props.visible ?? componentDefaults.visible); // Default to true
|
|
94
|
+
const id = $derived(props.id);
|
|
95
|
+
const maskSource = $derived(props.maskSource);
|
|
96
|
+
const maskType = $derived(props.maskType);
|
|
97
|
+
const renderOrder = $derived(props.renderOrder);
|
|
98
|
+
const { children } = props;
|
|
99
|
+
|
|
100
|
+
// Collect PropDriver values from shader props into the maps metadata structure
|
|
101
|
+
const mapsFromProps = $derived.by(() => {
|
|
102
|
+
const maps: Record<string, PropDriver> = {};
|
|
103
|
+
for (const key of Object.keys(componentDefinition.props)) {
|
|
104
|
+
const val = (props as any)[key];
|
|
105
|
+
if (isPropDriver(val)) maps[key] = val as PropDriver;
|
|
106
|
+
}
|
|
107
|
+
return Object.keys(maps).length > 0 ? maps : undefined;
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Computed transform that merges user-provided values with defaults
|
|
112
|
+
*/
|
|
113
|
+
const effectiveTransform = $derived({
|
|
114
|
+
...DEFAULT_TRANSFORM,
|
|
115
|
+
...props.transform
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Effective bounding box — partial configs merge with full-frame defaults,
|
|
120
|
+
* absent stays undefined so the bbox render path is not activated
|
|
121
|
+
*/
|
|
122
|
+
const effectiveBoundingBox = $derived(resolveBoundingBox(props.boundingBox));
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* FIRST: Get the parent ID from context BEFORE setting our own context
|
|
126
|
+
*/
|
|
127
|
+
const parentId = getContext<string>('shaderParentId');
|
|
128
|
+
if (parentId === undefined) {
|
|
129
|
+
throw new Error('Shader components must be used inside an <Shader> component or another shader component');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Use the provided ID or generate a unique identifier for this component instance
|
|
134
|
+
*/
|
|
135
|
+
const instanceId = (id ? id.replace(/[^a-zA-Z0-9_]/g, '_') : null) || Math.random().toString(36).substring(2, 10);
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* THEN: Provide our unique identifier to child components
|
|
139
|
+
*/
|
|
140
|
+
setContext('shaderParentId', instanceId);
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Creates a non-reactive object containing only props that differ from defaults
|
|
144
|
+
* This optimization prevents unnecessary GPU uniform updates for unchanged values
|
|
145
|
+
* Special props like blendMode and opacity are handled separately
|
|
146
|
+
*/
|
|
147
|
+
const shaderReadyProps = $derived.by(() => {
|
|
148
|
+
let baseProps = { ...componentDefaults };
|
|
149
|
+
|
|
150
|
+
// Only include props that differ from defaults (excluding special props and PropDrivers)
|
|
151
|
+
for (const key in props) {
|
|
152
|
+
if (key !== 'blendMode' && key !== 'opacity' && key !== 'visible' &&
|
|
153
|
+
key !== 'id' && key !== 'maskSource' && key !== 'maskType' && key !== 'renderOrder' &&
|
|
154
|
+
key !== 'transform' && key !== 'boundingBox' && key !== 'flow' && key !== 'absolute' && key !== 'children') {
|
|
155
|
+
const propValue = (props as any)[key];
|
|
156
|
+
if (isPropDriver(propValue)) continue; // PropDrivers go to metadata.maps, not uniforms
|
|
157
|
+
const defaultValue = (componentDefaults as any)[key];
|
|
158
|
+
if (propValue !== undefined && propValue !== defaultValue) {
|
|
159
|
+
(baseProps as any)[key] = propValue;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return baseProps;
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Get the color space from the root Shader component.
|
|
168
|
+
* Used to set the global color space mode before creating uniforms.
|
|
169
|
+
*/
|
|
170
|
+
const shaderColorSpace = getContext<() => 'p3-linear' | 'srgb'>('shaderColorSpace');
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Creates the GPU uniform values map using only the changed props
|
|
174
|
+
* Set the global color space mode before creating uniforms so colors are transformed correctly
|
|
175
|
+
* Note: Intentionally captures initial value - props are immutable after initialization
|
|
176
|
+
*/
|
|
177
|
+
if (shaderColorSpace) {
|
|
178
|
+
setColorSpaceMode(shaderColorSpace());
|
|
179
|
+
}
|
|
180
|
+
// svelte-ignore state_referenced_locally
|
|
181
|
+
const uniforms: GpuUniformsMap = createGpuUniformsMap(componentDefinition, shaderReadyProps, instanceId);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Get the node registration function from parent context
|
|
185
|
+
*/
|
|
186
|
+
const parentRegister = getContext<(id: string, fragmentNodeFunc: any, parentId: string | null, metadata: NodeMetadata | null, uniforms: GpuUniformsMap | null, componentDefinition: any, domCanvas?: HTMLCanvasElement) => void>('shaderNodeRegister');
|
|
187
|
+
if (parentRegister === undefined) {
|
|
188
|
+
throw new Error('Shader components must be used inside an <Shader> component or another shader component');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Get the uniform update function from parent context
|
|
193
|
+
*/
|
|
194
|
+
const parentUniformUpdate = getContext<(nodeId: string, uniformName: string, value: any) => void>('shaderUniformUpdate');
|
|
195
|
+
if (parentUniformUpdate === undefined) {
|
|
196
|
+
throw new Error('Shader components require shaderUniformUpdate from parent');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Get the metadata update function from parent context
|
|
201
|
+
*/
|
|
202
|
+
const parentMetadataUpdate = getContext<(nodeId: string, metadata: NodeMetadata) => void>('shaderMetadataUpdate');
|
|
203
|
+
if (parentMetadataUpdate === undefined) {
|
|
204
|
+
throw new Error('Shader components require shaderMetadataUpdate from parent');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// capturesDOM — canvas layoutsubtree portal for HTMLInCanvas-style shaders
|
|
208
|
+
const isCapturesDOM = !!(componentDefinition as any).capturesDOM;
|
|
209
|
+
let captureCanvas: HTMLCanvasElement | undefined;
|
|
210
|
+
let captureW = $state(typeof window !== 'undefined' ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
211
|
+
let captureH = $state(typeof window !== 'undefined' ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
212
|
+
|
|
213
|
+
function teleportToBody(node: HTMLElement) {
|
|
214
|
+
document.body.appendChild(node);
|
|
215
|
+
return { destroy() { node.remove(); } };
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (isCapturesDOM) {
|
|
219
|
+
const onWinResize = () => {
|
|
220
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
221
|
+
captureW = Math.round(window.innerWidth * d);
|
|
222
|
+
captureH = Math.round(window.innerHeight * d);
|
|
223
|
+
};
|
|
224
|
+
onMount(() => { window.addEventListener('resize', onWinResize); });
|
|
225
|
+
onDestroy(() => { window.removeEventListener('resize', onWinResize); });
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// DOM marker ref for determining render order from template position
|
|
229
|
+
let orderMarker: HTMLSpanElement;
|
|
230
|
+
|
|
231
|
+
// Stores the DOM-detected render order
|
|
232
|
+
let detectedRenderOrder: number | undefined = undefined;
|
|
233
|
+
|
|
234
|
+
// Flag to track when component is registered
|
|
235
|
+
let isRegistered = $state(false);
|
|
236
|
+
|
|
237
|
+
// Setup uniform watchers with registration guard
|
|
238
|
+
Object.entries(uniforms).forEach(([propName, entry]) => {
|
|
239
|
+
$effect(() => {
|
|
240
|
+
// Only run after component is registered
|
|
241
|
+
if (!isRegistered) return;
|
|
242
|
+
|
|
243
|
+
// GPU bridge entries carry `.value` (no v1 `.uniform` node). colorStops expands into
|
|
244
|
+
// extra array fields (colorsArray/…) that aren't component props — their `props[name]`
|
|
245
|
+
// is always undefined, so the guard below skips them.
|
|
246
|
+
if (entry && entry.value !== undefined) {
|
|
247
|
+
const newValue = (props as any)[propName];
|
|
248
|
+
if (newValue !== undefined && !isPropDriver(newValue)) {
|
|
249
|
+
// Send raw value - renderer will handle transformation
|
|
250
|
+
// PropDriver values go to metadata.maps, not uniforms
|
|
251
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// Watch blend mode, opacity, visibility, masking, transformations, and prop maps changes
|
|
258
|
+
$effect(() => {
|
|
259
|
+
// Only run after component is registered
|
|
260
|
+
if (!isRegistered) return;
|
|
261
|
+
|
|
262
|
+
const metadata: NodeMetadata = {
|
|
263
|
+
blendMode,
|
|
264
|
+
opacity,
|
|
265
|
+
visible: visible === false ? false : true,
|
|
266
|
+
id,
|
|
267
|
+
mask: maskSource ? {
|
|
268
|
+
source: maskSource,
|
|
269
|
+
type: (maskType || 'alpha') as MaskConfig['type']
|
|
270
|
+
} : undefined,
|
|
271
|
+
maps: mapsFromProps,
|
|
272
|
+
renderOrder: renderOrder ?? detectedRenderOrder,
|
|
273
|
+
transform: effectiveTransform,
|
|
274
|
+
boundingBox: effectiveBoundingBox,
|
|
275
|
+
flow: props.flow,
|
|
276
|
+
absolute: props.absolute
|
|
277
|
+
};
|
|
278
|
+
parentMetadataUpdate(instanceId, metadata);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
// Register this component after mount to ensure parent is ready
|
|
282
|
+
onMount(() => {
|
|
283
|
+
// Register this component with safety check
|
|
284
|
+
if (componentDefinition && typeof componentDefinition.fragment === 'function') {
|
|
285
|
+
parentRegister(
|
|
286
|
+
instanceId,
|
|
287
|
+
componentDefinition.fragment,
|
|
288
|
+
parentId,
|
|
289
|
+
{
|
|
290
|
+
blendMode,
|
|
291
|
+
opacity,
|
|
292
|
+
visible: visible !== false ? true : false,
|
|
293
|
+
id,
|
|
294
|
+
mask: maskSource ? {
|
|
295
|
+
source: maskSource,
|
|
296
|
+
type: (maskType || 'alpha') as MaskConfig['type']
|
|
297
|
+
} as MaskConfig : undefined,
|
|
298
|
+
maps: mapsFromProps,
|
|
299
|
+
renderOrder: renderOrder ?? detectedRenderOrder,
|
|
300
|
+
transform: effectiveTransform,
|
|
301
|
+
boundingBox: effectiveBoundingBox,
|
|
302
|
+
flow: props.flow,
|
|
303
|
+
absolute: props.absolute
|
|
304
|
+
},
|
|
305
|
+
uniforms,
|
|
306
|
+
componentDefinition,
|
|
307
|
+
isCapturesDOM ? captureCanvas : undefined
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
// Set flag to enable effects after successful registration
|
|
311
|
+
isRegistered = true;
|
|
312
|
+
|
|
313
|
+
// Detect DOM position for correct render ordering
|
|
314
|
+
if (renderOrder === undefined && orderMarker) {
|
|
315
|
+
const parent = orderMarker.parentElement;
|
|
316
|
+
if (parent) {
|
|
317
|
+
const siblings = parent.querySelectorAll(':scope > [data-shader-id]');
|
|
318
|
+
const position = Array.from(siblings).indexOf(orderMarker);
|
|
319
|
+
if (position >= 0) {
|
|
320
|
+
detectedRenderOrder = position;
|
|
321
|
+
parentMetadataUpdate(instanceId, { renderOrder: position } as NodeMetadata);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
} else {
|
|
326
|
+
console.error('componentDefinition.fragment is not a function:', {
|
|
327
|
+
componentDefinition,
|
|
328
|
+
fragment: componentDefinition?.fragment,
|
|
329
|
+
type: typeof componentDefinition?.fragment
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
// Clean up node from registry when component is unmounted
|
|
335
|
+
onDestroy(() => {
|
|
336
|
+
isRegistered = false;
|
|
337
|
+
parentRegister(instanceId, null, null, null, null);
|
|
338
|
+
});
|
|
339
|
+
</script>
|
|
340
|
+
|
|
341
|
+
<span bind:this={orderMarker} style="display:contents" data-shader-id={instanceId}>
|
|
342
|
+
{#if !isCapturesDOM}
|
|
343
|
+
{@render children?.()}
|
|
344
|
+
{/if}
|
|
345
|
+
</span>
|
|
346
|
+
{#if isCapturesDOM}
|
|
347
|
+
<canvas use:teleportToBody bind:this={captureCanvas} layoutsubtree
|
|
348
|
+
width={captureW} height={captureH}
|
|
349
|
+
style="position:fixed;inset:0;width:100vw;height:100vh;z-index:-9999">
|
|
350
|
+
{@render children?.()}
|
|
351
|
+
</canvas>
|
|
352
|
+
{/if}
|
|
@@ -113,6 +113,7 @@ import LiquidMetal from '../components/LiquidMetal.svelte'
|
|
|
113
113
|
import Liquify from '../components/Liquify.svelte'
|
|
114
114
|
import MagneticFilings from '../components/MagneticFilings.svelte'
|
|
115
115
|
import Marble from '../components/Marble.svelte'
|
|
116
|
+
import MeshGradient from '../components/MeshGradient.svelte'
|
|
116
117
|
import Mirror from '../components/Mirror.svelte'
|
|
117
118
|
import MultiPointGradient from '../components/MultiPointGradient.svelte'
|
|
118
119
|
import Neon from '../components/Neon.svelte'
|
|
@@ -310,6 +311,7 @@ const componentMap: Record<string, any> = {
|
|
|
310
311
|
Liquify,
|
|
311
312
|
MagneticFilings,
|
|
312
313
|
Marble,
|
|
314
|
+
MeshGradient,
|
|
313
315
|
Mirror,
|
|
314
316
|
MultiPointGradient,
|
|
315
317
|
Neon,
|
|
@@ -108,6 +108,7 @@ export { default as LiquidMetal } from './components/LiquidMetal.svelte';
|
|
|
108
108
|
export { default as Liquify } from './components/Liquify.svelte';
|
|
109
109
|
export { default as MagneticFilings } from './components/MagneticFilings.svelte';
|
|
110
110
|
export { default as Marble } from './components/Marble.svelte';
|
|
111
|
+
export { default as MeshGradient } from './components/MeshGradient.svelte';
|
|
111
112
|
export { default as Mirror } from './components/Mirror.svelte';
|
|
112
113
|
export { default as MultiPointGradient } from './components/MultiPointGradient.svelte';
|
|
113
114
|
export { default as Neon } from './components/Neon.svelte';
|
|
@@ -1556,6 +1556,43 @@ var shaderMetadata = {
|
|
|
1556
1556
|
"seed": 0,
|
|
1557
1557
|
"colorSpace": "linear"
|
|
1558
1558
|
},
|
|
1559
|
+
"MeshGradient": {
|
|
1560
|
+
"opacity": 1,
|
|
1561
|
+
"blendMode": "normal",
|
|
1562
|
+
"colorA": "#1a0533",
|
|
1563
|
+
"colorB": "#ffdf8e",
|
|
1564
|
+
"stops": [
|
|
1565
|
+
{
|
|
1566
|
+
"color": "#1a0533",
|
|
1567
|
+
"position": 0
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
"color": "#6d2fd1",
|
|
1571
|
+
"position": .26
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
"color": "#e04b9e",
|
|
1575
|
+
"position": .52
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
"color": "#ff8c42",
|
|
1579
|
+
"position": .76
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
"color": "#ffdf8e",
|
|
1583
|
+
"position": 1
|
|
1584
|
+
}
|
|
1585
|
+
],
|
|
1586
|
+
"colorSpace": "oklab",
|
|
1587
|
+
"count": 5,
|
|
1588
|
+
"smoothness": 2,
|
|
1589
|
+
"variation": .35,
|
|
1590
|
+
"swirl": .3,
|
|
1591
|
+
"drift": .5,
|
|
1592
|
+
"wrapping": 0,
|
|
1593
|
+
"speed": 1,
|
|
1594
|
+
"seed": 0
|
|
1595
|
+
},
|
|
1559
1596
|
"Mirror": {
|
|
1560
1597
|
"opacity": 1,
|
|
1561
1598
|
"blendMode": "normal",
|
|
@@ -3074,6 +3111,7 @@ const availableComponents = [
|
|
|
3074
3111
|
"Liquify",
|
|
3075
3112
|
"MagneticFilings",
|
|
3076
3113
|
"Marble",
|
|
3114
|
+
"MeshGradient",
|
|
3077
3115
|
"Mirror",
|
|
3078
3116
|
"MultiPointGradient",
|
|
3079
3117
|
"Neon",
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, effectScope, inject, mergeDefaults, mergeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, toValue, unref, useId, watch } from "vue";
|
|
2
|
+
import { createGpuUniformsMap, resolveBoundingBox } from "../core/index.js";
|
|
3
|
+
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
4
|
+
import { componentDefinition } from "../core/shaders/MeshGradient/index.js";
|
|
5
|
+
var _hoisted_1 = ["data-shader-id"];
|
|
6
|
+
var _hoisted_2 = ["width", "height"];
|
|
7
|
+
var MeshGradient_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "MeshGradient",
|
|
9
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
10
|
+
smoothness: {},
|
|
11
|
+
variation: {},
|
|
12
|
+
swirl: {},
|
|
13
|
+
drift: {},
|
|
14
|
+
wrapping: {},
|
|
15
|
+
seed: {},
|
|
16
|
+
blendMode: {},
|
|
17
|
+
opacity: {},
|
|
18
|
+
visible: { type: Boolean },
|
|
19
|
+
id: {},
|
|
20
|
+
maskSource: {},
|
|
21
|
+
maskType: {},
|
|
22
|
+
renderOrder: {},
|
|
23
|
+
transform: {},
|
|
24
|
+
boundingBox: {},
|
|
25
|
+
flow: {},
|
|
26
|
+
absolute: { type: Boolean },
|
|
27
|
+
colorA: {},
|
|
28
|
+
colorB: {},
|
|
29
|
+
stops: {},
|
|
30
|
+
colorSpace: {},
|
|
31
|
+
count: {},
|
|
32
|
+
speed: {}
|
|
33
|
+
}, {
|
|
34
|
+
blendMode: "normal",
|
|
35
|
+
visible: true,
|
|
36
|
+
...Object.entries(componentDefinition.props).reduce((acc, [key, config]) => {
|
|
37
|
+
acc[key] = config.default;
|
|
38
|
+
return acc;
|
|
39
|
+
}, {})
|
|
40
|
+
}),
|
|
41
|
+
setup(__props) {
|
|
42
|
+
let _experimentalWarnedOnce = false;
|
|
43
|
+
if (componentDefinition.experimental && !_experimentalWarnedOnce) {
|
|
44
|
+
_experimentalWarnedOnce = true;
|
|
45
|
+
const _e = componentDefinition.experimental;
|
|
46
|
+
console.info(`%c⚠ [Shaders] ${componentDefinition.name} is experimental: ${_e.message}`, "color: #f59e0b; font-weight: bold");
|
|
47
|
+
}
|
|
48
|
+
function isPropDriver(value) {
|
|
49
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
50
|
+
}
|
|
51
|
+
const props = __props;
|
|
52
|
+
const instanceId = (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || useId().replace(/[^a-zA-Z0-9_]/g, "");
|
|
53
|
+
provide("shaderParentId", instanceId);
|
|
54
|
+
const DEFAULT_TRANSFORM = {
|
|
55
|
+
offsetX: 0,
|
|
56
|
+
offsetY: 0,
|
|
57
|
+
rotation: 0,
|
|
58
|
+
scale: 1,
|
|
59
|
+
anchorX: .5,
|
|
60
|
+
anchorY: .5,
|
|
61
|
+
edges: "transparent"
|
|
62
|
+
};
|
|
63
|
+
const effectiveTransform = computed(() => ({
|
|
64
|
+
...DEFAULT_TRANSFORM,
|
|
65
|
+
...props.transform
|
|
66
|
+
}));
|
|
67
|
+
const effectiveBoundingBox = computed(() => resolveBoundingBox(props.boundingBox));
|
|
68
|
+
const shaderReadyProps = computed(() => {
|
|
69
|
+
let baseProps = { ...Object.entries(componentDefinition.props).reduce((acc, [key, config]) => {
|
|
70
|
+
acc[key] = config.default;
|
|
71
|
+
return acc;
|
|
72
|
+
}, {}) };
|
|
73
|
+
for (const key in props) if (key !== "blendMode" && key !== "opacity" && key !== "visible" && key !== "id" && key !== "maskSource" && key !== "maskType" && key !== "renderOrder" && key !== "transform" && key !== "boundingBox" && key !== "flow" && key !== "absolute") {
|
|
74
|
+
const val = toValue(props[key]);
|
|
75
|
+
if (isPropDriver(val)) continue;
|
|
76
|
+
if (val !== Object.entries(componentDefinition.props).reduce((acc, [key$1, config]) => {
|
|
77
|
+
acc[key$1] = config.default;
|
|
78
|
+
return acc;
|
|
79
|
+
}, {})[key]) baseProps[key] = val;
|
|
80
|
+
}
|
|
81
|
+
return baseProps;
|
|
82
|
+
});
|
|
83
|
+
const mapsFromProps = computed(() => {
|
|
84
|
+
const maps = {};
|
|
85
|
+
for (const key of Object.keys(componentDefinition.props)) {
|
|
86
|
+
const val = props[key];
|
|
87
|
+
if (isPropDriver(val)) maps[key] = val;
|
|
88
|
+
}
|
|
89
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
90
|
+
});
|
|
91
|
+
const shaderColorSpace = inject("shaderColorSpace");
|
|
92
|
+
if (shaderColorSpace) setColorSpaceMode(shaderColorSpace.value);
|
|
93
|
+
const uniforms = createGpuUniformsMap(componentDefinition, shaderReadyProps.value, instanceId);
|
|
94
|
+
const parentId = inject("shaderParentId");
|
|
95
|
+
if (parentId === void 0) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
96
|
+
const parentRegister = inject("shaderNodeRegister");
|
|
97
|
+
if (parentRegister === void 0) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
98
|
+
const parentUniformUpdate = inject("shaderUniformUpdate");
|
|
99
|
+
if (parentUniformUpdate === void 0) throw new Error("Shader components require shaderUniformUpdate from parent");
|
|
100
|
+
const parentMetadataUpdate = inject("shaderMetadataUpdate");
|
|
101
|
+
if (parentMetadataUpdate === void 0) throw new Error("Shader components require shaderMetadataUpdate from parent");
|
|
102
|
+
const rendererResetSignal = inject("shaderRendererResetSignal");
|
|
103
|
+
const orderMarker = ref(null);
|
|
104
|
+
const isCapturesDOM = !!componentDefinition.capturesDOM;
|
|
105
|
+
const captureCanvas = ref(null);
|
|
106
|
+
const captureW = ref(typeof window !== "undefined" ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
107
|
+
const captureH = ref(typeof window !== "undefined" ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0);
|
|
108
|
+
const captureStyle = {
|
|
109
|
+
position: "fixed",
|
|
110
|
+
inset: "0",
|
|
111
|
+
width: "100vw",
|
|
112
|
+
height: "100vh",
|
|
113
|
+
zIndex: "-9999"
|
|
114
|
+
};
|
|
115
|
+
if (isCapturesDOM) {
|
|
116
|
+
const onWinResize = () => {
|
|
117
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
118
|
+
captureW.value = Math.round(window.innerWidth * d);
|
|
119
|
+
captureH.value = Math.round(window.innerHeight * d);
|
|
120
|
+
};
|
|
121
|
+
onMounted(() => {
|
|
122
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
123
|
+
captureW.value = Math.round(window.innerWidth * d);
|
|
124
|
+
captureH.value = Math.round(window.innerHeight * d);
|
|
125
|
+
window.addEventListener("resize", onWinResize);
|
|
126
|
+
});
|
|
127
|
+
onBeforeUnmount(() => {
|
|
128
|
+
window.removeEventListener("resize", onWinResize);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
let detectedRenderOrder = void 0;
|
|
132
|
+
const registerWithRenderer = () => {
|
|
133
|
+
parentRegister(instanceId, componentDefinition.fragment, parentId, {
|
|
134
|
+
blendMode: props.blendMode,
|
|
135
|
+
opacity: props.opacity,
|
|
136
|
+
visible: props.visible === false ? false : true,
|
|
137
|
+
id: props.id,
|
|
138
|
+
mask: props.maskSource ? {
|
|
139
|
+
source: props.maskSource,
|
|
140
|
+
type: props.maskType || "alpha"
|
|
141
|
+
} : void 0,
|
|
142
|
+
maps: mapsFromProps.value,
|
|
143
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
144
|
+
transform: effectiveTransform.value,
|
|
145
|
+
boundingBox: effectiveBoundingBox.value,
|
|
146
|
+
flow: props.flow,
|
|
147
|
+
absolute: props.absolute
|
|
148
|
+
}, uniforms, componentDefinition, isCapturesDOM ? captureCanvas.value ?? void 0 : void 0);
|
|
149
|
+
};
|
|
150
|
+
onMounted(() => {
|
|
151
|
+
if (props.renderOrder === void 0 && orderMarker.value) {
|
|
152
|
+
const parent = orderMarker.value.parentElement;
|
|
153
|
+
if (parent) {
|
|
154
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
155
|
+
const position = Array.from(siblings).indexOf(orderMarker.value);
|
|
156
|
+
if (position >= 0) {
|
|
157
|
+
detectedRenderOrder = position;
|
|
158
|
+
parentMetadataUpdate(instanceId, { renderOrder: position });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const setupUniformWatchers = () => {
|
|
164
|
+
const scope = effectScope();
|
|
165
|
+
scope.run(() => {
|
|
166
|
+
Object.entries(uniforms).forEach(([propName, entry]) => {
|
|
167
|
+
watch(() => props[propName], (newValue) => {
|
|
168
|
+
if (entry && entry.value !== void 0 && !isPropDriver(newValue)) parentUniformUpdate(instanceId, propName, newValue);
|
|
169
|
+
}, { deep: true });
|
|
170
|
+
});
|
|
171
|
+
watch(() => [
|
|
172
|
+
props.blendMode,
|
|
173
|
+
props.opacity,
|
|
174
|
+
props.visible,
|
|
175
|
+
props.id,
|
|
176
|
+
props.maskSource,
|
|
177
|
+
props.maskType,
|
|
178
|
+
props.renderOrder,
|
|
179
|
+
props.transform,
|
|
180
|
+
props.boundingBox,
|
|
181
|
+
props.flow,
|
|
182
|
+
props.absolute,
|
|
183
|
+
mapsFromProps.value
|
|
184
|
+
], ([blendMode, opacity, visible]) => {
|
|
185
|
+
parentMetadataUpdate(instanceId, {
|
|
186
|
+
blendMode,
|
|
187
|
+
opacity,
|
|
188
|
+
visible: visible === false ? false : true,
|
|
189
|
+
id: props.id,
|
|
190
|
+
mask: props.maskSource ? {
|
|
191
|
+
source: props.maskSource,
|
|
192
|
+
type: props.maskType || "alpha"
|
|
193
|
+
} : void 0,
|
|
194
|
+
maps: mapsFromProps.value,
|
|
195
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
196
|
+
transform: effectiveTransform.value,
|
|
197
|
+
boundingBox: effectiveBoundingBox.value,
|
|
198
|
+
flow: props.flow,
|
|
199
|
+
absolute: props.absolute
|
|
200
|
+
});
|
|
201
|
+
}, { deep: true });
|
|
202
|
+
if (rendererResetSignal) watch(() => rendererResetSignal.value, (newValue) => {
|
|
203
|
+
if (newValue > 0) registerWithRenderer();
|
|
204
|
+
}, { immediate: true });
|
|
205
|
+
});
|
|
206
|
+
onBeforeUnmount(() => {
|
|
207
|
+
scope.stop();
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
if (isCapturesDOM) onMounted(() => {
|
|
211
|
+
setupUniformWatchers();
|
|
212
|
+
});
|
|
213
|
+
else setupUniformWatchers();
|
|
214
|
+
onBeforeUnmount(() => {
|
|
215
|
+
parentRegister(instanceId, null, null, null, null, null);
|
|
216
|
+
});
|
|
217
|
+
return (_ctx, _cache) => {
|
|
218
|
+
return openBlock(), createElementBlock(Fragment, null, [createElementVNode("span", {
|
|
219
|
+
ref_key: "orderMarker",
|
|
220
|
+
ref: orderMarker,
|
|
221
|
+
style: { "display": "contents" },
|
|
222
|
+
"data-shader-id": unref(instanceId)
|
|
223
|
+
}, [!isCapturesDOM ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)], 8, _hoisted_1), isCapturesDOM ? (openBlock(), createBlock(Teleport, {
|
|
224
|
+
key: 0,
|
|
225
|
+
to: "body"
|
|
226
|
+
}, [createElementVNode("canvas", mergeProps({
|
|
227
|
+
ref_key: "captureCanvas",
|
|
228
|
+
ref: captureCanvas
|
|
229
|
+
}, { "layoutsubtree": "" }, {
|
|
230
|
+
width: captureW.value,
|
|
231
|
+
height: captureH.value,
|
|
232
|
+
style: captureStyle
|
|
233
|
+
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_2)])) : createCommentVNode("", true)], 64);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
export { MeshGradient_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -106,6 +106,7 @@ import LiquidMetal_default from "./LiquidMetal.js";
|
|
|
106
106
|
import Liquify_default from "./Liquify.js";
|
|
107
107
|
import MagneticFilings_default from "./MagneticFilings.js";
|
|
108
108
|
import Marble_default from "./Marble.js";
|
|
109
|
+
import MeshGradient_default from "./MeshGradient.js";
|
|
109
110
|
import Mirror_default from "./Mirror.js";
|
|
110
111
|
import MultiPointGradient_default from "./MultiPointGradient.js";
|
|
111
112
|
import Neon_default from "./Neon.js";
|
|
@@ -356,6 +357,7 @@ var Preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
|
|
|
356
357
|
Liquify: Liquify_default,
|
|
357
358
|
MagneticFilings: MagneticFilings_default,
|
|
358
359
|
Marble: Marble_default,
|
|
360
|
+
MeshGradient: MeshGradient_default,
|
|
359
361
|
Mirror: Mirror_default,
|
|
360
362
|
MultiPointGradient: MultiPointGradient_default,
|
|
361
363
|
Neon: Neon_default,
|