shaders 2.5.81 → 2.5.83
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/core/{Crescent-B4Z_WAgY.js → Crescent-n3F1gT1y.js} +1 -1
- package/dist/core/{Cross-M5Vm5Kmy.js → Cross-CQmjBna4.js} +1 -1
- package/dist/core/{Ellipse-BjbjXlOx.js → Ellipse-DWQt5JTM.js} +1 -1
- package/dist/core/{Emboss-K5TExa67.js → Emboss-ShjCeQPU.js} +8 -61
- package/dist/core/{Flower-B-53jiUT.js → Flower-DZVbhEaA.js} +1 -1
- package/dist/core/FlowingGradient-DVproCI1.js +145 -0
- package/dist/core/{Glass-CRaFJ-8c.js → Glass-CrdewyrV.js} +9 -62
- package/dist/core/{Neon-E8whPM6C.js → Neon-DwAOiY8b.js} +7 -60
- package/dist/core/{Polygon-B4ab2iAo.js → Polygon-BrxPjS1j.js} +1 -1
- package/dist/core/{Ring-DVW66Ug0.js → Ring-CrnCOiYQ.js} +1 -1
- package/dist/core/{RoundedRect-B9y33WS5.js → RoundedRect-CyLsv0Vq.js} +1 -1
- package/dist/core/{Star-DB4dmzyz.js → Star-CAfXecya.js} +1 -1
- package/dist/core/{Trapezoid-Co8cWZTK.js → Trapezoid-DA0I90A2.js} +1 -1
- package/dist/core/{Vesica-C7tcbHbW.js → Vesica-RKKgxLKt.js} +1 -1
- package/dist/core/{VideoTexture-DDnc6aVv.js → VideoTexture-Dbsbgb1Y.js} +1 -1
- package/dist/core/{WebcamTexture-rb0dLKSc.js → WebcamTexture-xvb8MuFz.js} +1 -1
- package/dist/core/index.js +83 -67
- package/dist/core/registry.js +68 -67
- package/dist/core/renderer.d.ts +1 -0
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/{sdf-BDsv-WBk.js → sdf-vsljaiJ7.js} +82 -2
- package/dist/core/shaderRegistry-D0ny8qOF.js +220 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/Crescent/index.js +2 -2
- package/dist/core/shaders/Cross/index.js +2 -2
- package/dist/core/shaders/Ellipse/index.js +2 -2
- package/dist/core/shaders/Emboss/index.d.ts +6 -0
- package/dist/core/shaders/Emboss/index.d.ts.map +1 -1
- package/dist/core/shaders/Emboss/index.js +2 -2
- package/dist/core/shaders/Flower/index.js +2 -2
- package/dist/core/shaders/FlowingGradient/index.d.ts +62 -0
- package/dist/core/shaders/FlowingGradient/index.d.ts.map +1 -0
- package/dist/core/shaders/FlowingGradient/index.js +5 -0
- package/dist/core/shaders/Form3D/index.js +1 -1
- package/dist/core/shaders/Glass/index.d.ts +6 -0
- package/dist/core/shaders/Glass/index.d.ts.map +1 -1
- package/dist/core/shaders/Glass/index.js +2 -2
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Glitch/index.js +1 -1
- package/dist/core/shaders/Glow/index.js +1 -1
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/Grayscale/index.js +1 -1
- package/dist/core/shaders/Grid/index.js +1 -1
- package/dist/core/shaders/GridDistortion/index.js +1 -1
- package/dist/core/shaders/Group/index.js +1 -1
- package/dist/core/shaders/Halftone/index.js +1 -1
- package/dist/core/shaders/HueShift/index.js +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/Invert/index.js +1 -1
- package/dist/core/shaders/Kaleidoscope/index.js +1 -1
- package/dist/core/shaders/LensFlare/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Mirror/index.js +1 -1
- package/dist/core/shaders/Neon/index.d.ts +6 -0
- package/dist/core/shaders/Neon/index.d.ts.map +1 -1
- package/dist/core/shaders/Neon/index.js +2 -2
- package/dist/core/shaders/Paper/index.js +1 -1
- package/dist/core/shaders/Perspective/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/Plasma/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Polygon/index.js +2 -2
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
- package/dist/core/shaders/RadialGradient/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/Ring/index.js +2 -2
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/RoundedRect/index.js +2 -2
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/Sharpness/index.js +1 -1
- package/dist/core/shaders/Shatter/index.js +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +1 -1
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/SolidColor/index.js +1 -1
- package/dist/core/shaders/Spherize/index.js +1 -1
- package/dist/core/shaders/Spiral/index.js +1 -1
- package/dist/core/shaders/Star/index.js +2 -2
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Stretch/index.js +1 -1
- package/dist/core/shaders/Stripes/index.js +1 -1
- package/dist/core/shaders/StudioBackground/index.js +1 -1
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/Tint/index.js +1 -1
- package/dist/core/shaders/Trapezoid/index.js +2 -2
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vesica/index.js +2 -2
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/VideoTexture/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/WebcamTexture/index.js +2 -2
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/core/utilities/sdf.d.ts +5 -0
- package/dist/core/utilities/sdf.d.ts.map +1 -1
- package/dist/js/createShader.d.ts.map +1 -1
- package/dist/js/createShader.js +2 -1
- package/dist/js/types.d.ts +1 -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 +13 -0
- package/dist/react/FlowingGradient.js +180 -0
- package/dist/react/Preview.js +1 -0
- package/dist/react/Shader.js +10 -2
- package/dist/react/components/FlowingGradient.d.ts +34 -0
- package/dist/react/components/FlowingGradient.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/engine/Shader.d.ts +1 -0
- package/dist/react/engine/Shader.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 +13 -0
- package/dist/registry.js +257 -0
- package/dist/solid/components/FlowingGradient.d.ts +31 -0
- package/dist/solid/components/FlowingGradient.d.ts.map +1 -0
- package/dist/solid/components/FlowingGradient.js +183 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +64 -62
- package/dist/solid/engine/Shader.d.ts +1 -0
- package/dist/solid/engine/Shader.d.ts.map +1 -1
- package/dist/solid/engine/Shader.js +6 -2
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +124 -122
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +13 -0
- package/dist/svelte/components/FlowingGradient.svelte.d.ts +21 -0
- package/dist/svelte/engine/Shader.svelte.d.ts +1 -0
- package/dist/svelte/{generatePresetCode-6ecNqXs9.js → generatePresetCode-B9QYLcji.js} +13 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +450 -301
- package/dist/svelte/source/components/FlowingGradient.svelte +288 -0
- package/dist/svelte/source/engine/Preview.svelte +2 -0
- package/dist/svelte/source/engine/Shader.svelte +3 -1
- package/dist/svelte/source/index.js +1 -0
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/Emboss.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/vue/FlowingGradient.js +3 -0
- package/dist/vue/FlowingGradient.vue_vue_type_script_setup_true_lang.js +173 -0
- package/dist/vue/Glass.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/vue/Neon.vue_vue_type_script_setup_true_lang.js +2 -1
- 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 +5 -2
- package/dist/vue/components/FlowingGradient.vue.d.ts +56 -0
- package/dist/vue/components/FlowingGradient.vue.d.ts.map +1 -0
- package/dist/vue/engine/Shader.vue.d.ts +6 -2
- package/dist/vue/engine/Shader.vue.d.ts.map +1 -1
- 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 +13 -0
- package/package.json +9 -1
- package/dist/core/shaderRegistry-DnmRD6xy.js +0 -218
- /package/dist/core/{Form3D-D3MoN95S.js → Form3D-DhezVuyN.js} +0 -0
- /package/dist/core/{GlassTiles-C3PKMWgp.js → GlassTiles-ClrOIpCg.js} +0 -0
- /package/dist/core/{Glitch-MyIU0Bad.js → Glitch-DmWytiRl.js} +0 -0
- /package/dist/core/{Glow-1ee_R1fA.js → Glow-Dm4dfZ_m.js} +0 -0
- /package/dist/core/{Godrays-CvcPIegU.js → Godrays-CYILZUHg.js} +0 -0
- /package/dist/core/{Grayscale-8MPw9PHN.js → Grayscale-CPR_l4G2.js} +0 -0
- /package/dist/core/{Grid-D64zkkku.js → Grid-CCQZ3GhD.js} +0 -0
- /package/dist/core/{GridDistortion-B7PGORW3.js → GridDistortion-oGT8NaWa.js} +0 -0
- /package/dist/core/{Group-DoOcKuhW.js → Group-CC317vlL.js} +0 -0
- /package/dist/core/{Halftone-Co7P2SWy.js → Halftone-BZk1Hjz_.js} +0 -0
- /package/dist/core/{HueShift-Bvd9VTak.js → HueShift-CuE3YTBE.js} +0 -0
- /package/dist/core/{ImageTexture-BJ1udc62.js → ImageTexture-DWUSKXX0.js} +0 -0
- /package/dist/core/{Invert-5VR-fNRw.js → Invert-C9RiDYP_.js} +0 -0
- /package/dist/core/{Kaleidoscope-B0McCEhc.js → Kaleidoscope-DtVlQWKG.js} +0 -0
- /package/dist/core/{LensFlare-DXgpPyJK.js → LensFlare-AVpiDD1O.js} +0 -0
- /package/dist/core/{LinearBlur-CBl0B23J.js → LinearBlur-AR65FcZh.js} +0 -0
- /package/dist/core/{LinearGradient-C0FT7-Lc.js → LinearGradient-DXCXjS-K.js} +0 -0
- /package/dist/core/{Liquify-Cr-1qPxN.js → Liquify-mhzPd19o.js} +0 -0
- /package/dist/core/{Mirror-DfZBEOUf.js → Mirror-CSc5mJi1.js} +0 -0
- /package/dist/core/{Paper-DJwBbPxA.js → Paper-DfUka0dt.js} +0 -0
- /package/dist/core/{Perspective-BdHcCgqZ.js → Perspective-uPiPmWy_.js} +0 -0
- /package/dist/core/{Pixelate-B9x2E0k-.js → Pixelate-DRkAW4Lo.js} +0 -0
- /package/dist/core/{Plasma-CMXrHMJv.js → Plasma-ELzbK-Us.js} +0 -0
- /package/dist/core/{PolarCoordinates-tZbl0VOq.js → PolarCoordinates-CalS_TB6.js} +0 -0
- /package/dist/core/{Posterize-Big6cECo.js → Posterize-C4vtRmtA.js} +0 -0
- /package/dist/core/{ProgressiveBlur-D0ZlHOw4.js → ProgressiveBlur-CLYhfOvQ.js} +0 -0
- /package/dist/core/{RadialGradient-C1Uu5_bL.js → RadialGradient-DtD8HWdM.js} +0 -0
- /package/dist/core/{RectangularCoordinates-BB7_S4gH.js → RectangularCoordinates-B96mflF5.js} +0 -0
- /package/dist/core/{Ripples-DeRyNukC.js → Ripples-Cevf-Hvg.js} +0 -0
- /package/dist/core/{Saturation-NrGhLp0a.js → Saturation-CcDwPh2v.js} +0 -0
- /package/dist/core/{Sharpness-DAC9Qnh0.js → Sharpness-D_dXfDEo.js} +0 -0
- /package/dist/core/{Shatter-ZIaXf4fs.js → Shatter-NfZzVt54.js} +0 -0
- /package/dist/core/{SimplexNoise-mSsE7oXX.js → SimplexNoise-aipzNV5j.js} +0 -0
- /package/dist/core/{SineWave-BAhTQVXp.js → SineWave-CVeYx3n-.js} +0 -0
- /package/dist/core/{SolidColor-BQnId3qy.js → SolidColor-BdbBnLxX.js} +0 -0
- /package/dist/core/{Spherize-YvHlKrZy.js → Spherize-BRGwLGeu.js} +0 -0
- /package/dist/core/{Spiral-DUDZyQjj.js → Spiral-BkTBXb7z.js} +0 -0
- /package/dist/core/{Strands-CF49kt1s.js → Strands-Cjsw-cPu.js} +0 -0
- /package/dist/core/{Stretch-Dkhera5t.js → Stretch-9cta3Z1W.js} +0 -0
- /package/dist/core/{Stripes-BOROXiAH.js → Stripes-C0sCGCz_.js} +0 -0
- /package/dist/core/{StudioBackground-DNmf8LGj.js → StudioBackground-BYv_-8df.js} +0 -0
- /package/dist/core/{Swirl-C5RQIA6E.js → Swirl-DXjIXfy7.js} +0 -0
- /package/dist/core/{TiltShift-BgscLSg_.js → TiltShift-56lcZ4cJ.js} +0 -0
- /package/dist/core/{Tint-CvKUJTtg.js → Tint-8_WIy9_e.js} +0 -0
- /package/dist/core/{Tritone-Ss5m7yFO.js → Tritone-nyJyybHI.js} +0 -0
- /package/dist/core/{Twirl-CF_9ObSp.js → Twirl-BzSEz4xK.js} +0 -0
- /package/dist/core/{Vibrance-DVWcESAa.js → Vibrance-BETLN3Ie.js} +0 -0
- /package/dist/core/{WaveDistortion-Caj3cQz7.js → WaveDistortion-C-j597Jm.js} +0 -0
- /package/dist/core/{ZoomBlur-DUrSxwl0.js → ZoomBlur-DFw0J9x3.js} +0 -0
- /package/dist/core/{browser-daS5XZwr.js → browser-CqdrcD5J.js} +0 -0
package/dist/core/index.js
CHANGED
|
@@ -18,9 +18,9 @@ import "./ChromaticAberration-G8_bwQtD.js";
|
|
|
18
18
|
import "./Circle--0oHzoCi.js";
|
|
19
19
|
import "./ConcentricSpin-BzxzMieZ.js";
|
|
20
20
|
import "./ContourLines-yEb5IJ1Y.js";
|
|
21
|
-
import "./sdf-
|
|
22
|
-
import "./Crescent-
|
|
23
|
-
import "./Cross-
|
|
21
|
+
import "./sdf-vsljaiJ7.js";
|
|
22
|
+
import "./Crescent-n3F1gT1y.js";
|
|
23
|
+
import "./Cross-CQmjBna4.js";
|
|
24
24
|
import "./CRTScreen-BZ-sAmPZ.js";
|
|
25
25
|
import "./CursorRipples-BY1iu4MX.js";
|
|
26
26
|
import "./CursorTrail-BzrL2WMh.js";
|
|
@@ -28,74 +28,75 @@ import "./DiffuseBlur-Dyd42LXw.js";
|
|
|
28
28
|
import "./Dither-CTInG_SB.js";
|
|
29
29
|
import "./DotGrid-CsL0dnYB.js";
|
|
30
30
|
import "./Duotone-BbCFLFMK.js";
|
|
31
|
-
import "./Ellipse-
|
|
32
|
-
import "./Emboss-
|
|
31
|
+
import "./Ellipse-DWQt5JTM.js";
|
|
32
|
+
import "./Emboss-ShjCeQPU.js";
|
|
33
33
|
import "./FallingLines-DBNJVWio.js";
|
|
34
34
|
import "./FilmGrain-CSuerGc6.js";
|
|
35
35
|
import "./FloatingParticles-CoBM_CJ8.js";
|
|
36
|
-
import "./Flower-
|
|
36
|
+
import "./Flower-DZVbhEaA.js";
|
|
37
37
|
import "./FlowField-Bh3-dX6I.js";
|
|
38
|
-
import "./
|
|
39
|
-
import "./
|
|
40
|
-
import "./
|
|
41
|
-
import "./
|
|
42
|
-
import "./
|
|
43
|
-
import "./
|
|
44
|
-
import "./
|
|
45
|
-
import "./
|
|
46
|
-
import "./
|
|
47
|
-
import "./
|
|
48
|
-
import "./
|
|
49
|
-
import "./
|
|
50
|
-
import "./
|
|
51
|
-
import "./
|
|
52
|
-
import "./
|
|
53
|
-
import "./
|
|
54
|
-
import "./
|
|
55
|
-
import "./
|
|
56
|
-
import "./
|
|
57
|
-
import "./
|
|
58
|
-
import "./
|
|
59
|
-
import "./
|
|
60
|
-
import "./
|
|
61
|
-
import "./
|
|
62
|
-
import "./
|
|
63
|
-
import "./
|
|
64
|
-
import "./
|
|
65
|
-
import "./
|
|
66
|
-
import "./
|
|
67
|
-
import "./
|
|
68
|
-
import "./
|
|
69
|
-
import "./
|
|
70
|
-
import "./
|
|
71
|
-
import "./
|
|
72
|
-
import "./
|
|
73
|
-
import "./
|
|
74
|
-
import "./
|
|
75
|
-
import "./
|
|
76
|
-
import "./
|
|
77
|
-
import "./
|
|
78
|
-
import "./
|
|
79
|
-
import "./
|
|
80
|
-
import "./
|
|
81
|
-
import "./
|
|
82
|
-
import "./
|
|
83
|
-
import "./
|
|
84
|
-
import "./
|
|
85
|
-
import "./
|
|
86
|
-
import "./
|
|
87
|
-
import "./
|
|
88
|
-
import "./
|
|
89
|
-
import "./
|
|
90
|
-
import "./
|
|
91
|
-
import "./
|
|
92
|
-
import "./
|
|
93
|
-
import "./
|
|
94
|
-
import "./
|
|
95
|
-
import "./
|
|
96
|
-
import "./
|
|
97
|
-
import "./
|
|
98
|
-
import
|
|
38
|
+
import "./FlowingGradient-DVproCI1.js";
|
|
39
|
+
import "./Form3D-DhezVuyN.js";
|
|
40
|
+
import "./Glass-CrdewyrV.js";
|
|
41
|
+
import "./GlassTiles-ClrOIpCg.js";
|
|
42
|
+
import "./Glitch-DmWytiRl.js";
|
|
43
|
+
import "./Glow-Dm4dfZ_m.js";
|
|
44
|
+
import "./Godrays-CYILZUHg.js";
|
|
45
|
+
import "./Grayscale-CPR_l4G2.js";
|
|
46
|
+
import "./Grid-CCQZ3GhD.js";
|
|
47
|
+
import "./GridDistortion-oGT8NaWa.js";
|
|
48
|
+
import "./Group-CC317vlL.js";
|
|
49
|
+
import "./Halftone-BZk1Hjz_.js";
|
|
50
|
+
import "./HueShift-CuE3YTBE.js";
|
|
51
|
+
import "./ImageTexture-DWUSKXX0.js";
|
|
52
|
+
import "./Invert-C9RiDYP_.js";
|
|
53
|
+
import "./Kaleidoscope-DtVlQWKG.js";
|
|
54
|
+
import "./LensFlare-AVpiDD1O.js";
|
|
55
|
+
import "./LinearBlur-AR65FcZh.js";
|
|
56
|
+
import "./LinearGradient-DXCXjS-K.js";
|
|
57
|
+
import "./Liquify-mhzPd19o.js";
|
|
58
|
+
import "./Mirror-CSc5mJi1.js";
|
|
59
|
+
import "./Neon-DwAOiY8b.js";
|
|
60
|
+
import "./Paper-DfUka0dt.js";
|
|
61
|
+
import "./Perspective-uPiPmWy_.js";
|
|
62
|
+
import "./Pixelate-DRkAW4Lo.js";
|
|
63
|
+
import "./Plasma-ELzbK-Us.js";
|
|
64
|
+
import "./PolarCoordinates-CalS_TB6.js";
|
|
65
|
+
import "./Polygon-BrxPjS1j.js";
|
|
66
|
+
import "./Posterize-C4vtRmtA.js";
|
|
67
|
+
import "./ProgressiveBlur-CLYhfOvQ.js";
|
|
68
|
+
import "./RadialGradient-DtD8HWdM.js";
|
|
69
|
+
import "./RectangularCoordinates-B96mflF5.js";
|
|
70
|
+
import "./Ring-CrnCOiYQ.js";
|
|
71
|
+
import "./Ripples-Cevf-Hvg.js";
|
|
72
|
+
import "./RoundedRect-CyLsv0Vq.js";
|
|
73
|
+
import "./Saturation-CcDwPh2v.js";
|
|
74
|
+
import "./Sharpness-D_dXfDEo.js";
|
|
75
|
+
import "./Shatter-NfZzVt54.js";
|
|
76
|
+
import "./SimplexNoise-aipzNV5j.js";
|
|
77
|
+
import "./SineWave-CVeYx3n-.js";
|
|
78
|
+
import "./SolidColor-BdbBnLxX.js";
|
|
79
|
+
import "./Spherize-BRGwLGeu.js";
|
|
80
|
+
import "./Spiral-BkTBXb7z.js";
|
|
81
|
+
import "./Star-CAfXecya.js";
|
|
82
|
+
import "./Strands-Cjsw-cPu.js";
|
|
83
|
+
import "./Stretch-9cta3Z1W.js";
|
|
84
|
+
import "./Stripes-C0sCGCz_.js";
|
|
85
|
+
import "./StudioBackground-BYv_-8df.js";
|
|
86
|
+
import "./Swirl-DXjIXfy7.js";
|
|
87
|
+
import "./TiltShift-56lcZ4cJ.js";
|
|
88
|
+
import "./Tint-8_WIy9_e.js";
|
|
89
|
+
import "./Trapezoid-DA0I90A2.js";
|
|
90
|
+
import "./Tritone-nyJyybHI.js";
|
|
91
|
+
import "./Twirl-BzSEz4xK.js";
|
|
92
|
+
import "./Vesica-RKKgxLKt.js";
|
|
93
|
+
import "./Vibrance-BETLN3Ie.js";
|
|
94
|
+
import "./browser-CqdrcD5J.js";
|
|
95
|
+
import "./VideoTexture-Dbsbgb1Y.js";
|
|
96
|
+
import "./WaveDistortion-C-j597Jm.js";
|
|
97
|
+
import "./WebcamTexture-xvb8MuFz.js";
|
|
98
|
+
import "./ZoomBlur-DFw0J9x3.js";
|
|
99
|
+
import { t as getAllShaders } from "./shaderRegistry-D0ny8qOF.js";
|
|
99
100
|
import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, Vector2, WebGPURenderer } from "three/webgpu";
|
|
100
101
|
import { WebGLRenderer } from "three";
|
|
101
102
|
import { PI, abs, add, atan, clamp, convertToTexture, cos, div, dot, float, fract, max, min, mix, mul, pow, screenUV, sign, sin, smoothstep, sqrt, step, sub, time, uniform, uv, vec2, vec3, vec4 } from "three/tsl";
|
|
@@ -741,6 +742,9 @@ function shaderRenderer() {
|
|
|
741
742
|
const performanceTracker = new PerformanceTracker();
|
|
742
743
|
let pendingRegistrationQueue = [];
|
|
743
744
|
let isRendererReady = false;
|
|
745
|
+
let onReadyCallback = null;
|
|
746
|
+
let hasEmittedReady = false;
|
|
747
|
+
let firstRenderPending = false;
|
|
744
748
|
let materialUpdateBatchRAF = null;
|
|
745
749
|
let lastComposedNodes = /* @__PURE__ */ new Set();
|
|
746
750
|
let activeRTTNodes = /* @__PURE__ */ new Set();
|
|
@@ -883,6 +887,7 @@ function shaderRenderer() {
|
|
|
883
887
|
material = newMaterial;
|
|
884
888
|
needsMaterialRefresh = false;
|
|
885
889
|
lastComposedNodes = currentComposedNodes;
|
|
890
|
+
if (!hasEmittedReady && currentComposedNodes.size > 0) firstRenderPending = true;
|
|
886
891
|
}
|
|
887
892
|
}
|
|
888
893
|
} catch (error) {
|
|
@@ -1757,6 +1762,11 @@ function shaderRenderer() {
|
|
|
1757
1762
|
if (isUpdatingMaterial) return;
|
|
1758
1763
|
if (enablePerformanceTracking) performance.mark("shader-gpu-start");
|
|
1759
1764
|
renderer.render(scene, camera);
|
|
1765
|
+
if (firstRenderPending && !hasEmittedReady) {
|
|
1766
|
+
hasEmittedReady = true;
|
|
1767
|
+
firstRenderPending = false;
|
|
1768
|
+
if (onReadyCallback) queueMicrotask(onReadyCallback);
|
|
1769
|
+
}
|
|
1760
1770
|
executeAfterRenderCallbacks(cappedDeltaTime);
|
|
1761
1771
|
if (enablePerformanceTracking) {
|
|
1762
1772
|
performance.mark("shader-gpu-end");
|
|
@@ -2077,6 +2087,9 @@ function shaderRenderer() {
|
|
|
2077
2087
|
pointerY = .5;
|
|
2078
2088
|
pointerActive = false;
|
|
2079
2089
|
pendingNodeRemoval = false;
|
|
2090
|
+
onReadyCallback = null;
|
|
2091
|
+
hasEmittedReady = false;
|
|
2092
|
+
firstRenderPending = false;
|
|
2080
2093
|
};
|
|
2081
2094
|
const getRendererType = () => {
|
|
2082
2095
|
if (!renderer) return null;
|
|
@@ -2101,6 +2114,9 @@ function shaderRenderer() {
|
|
|
2101
2114
|
getNodeRegistry: () => ({ nodes: new Map(nodeRegistry.nodes) }),
|
|
2102
2115
|
getRendererType,
|
|
2103
2116
|
getInternalRenderer: () => renderer ?? null,
|
|
2117
|
+
setOnReady: (callback) => {
|
|
2118
|
+
onReadyCallback = callback;
|
|
2119
|
+
},
|
|
2104
2120
|
__testing: {
|
|
2105
2121
|
needsTransformation,
|
|
2106
2122
|
findChildNodes,
|
package/dist/core/registry.js
CHANGED
|
@@ -18,9 +18,9 @@ import "./ChromaticAberration-G8_bwQtD.js";
|
|
|
18
18
|
import "./Circle--0oHzoCi.js";
|
|
19
19
|
import "./ConcentricSpin-BzxzMieZ.js";
|
|
20
20
|
import "./ContourLines-yEb5IJ1Y.js";
|
|
21
|
-
import "./sdf-
|
|
22
|
-
import "./Crescent-
|
|
23
|
-
import "./Cross-
|
|
21
|
+
import "./sdf-vsljaiJ7.js";
|
|
22
|
+
import "./Crescent-n3F1gT1y.js";
|
|
23
|
+
import "./Cross-CQmjBna4.js";
|
|
24
24
|
import "./CRTScreen-BZ-sAmPZ.js";
|
|
25
25
|
import "./CursorRipples-BY1iu4MX.js";
|
|
26
26
|
import "./CursorTrail-BzrL2WMh.js";
|
|
@@ -28,72 +28,73 @@ import "./DiffuseBlur-Dyd42LXw.js";
|
|
|
28
28
|
import "./Dither-CTInG_SB.js";
|
|
29
29
|
import "./DotGrid-CsL0dnYB.js";
|
|
30
30
|
import "./Duotone-BbCFLFMK.js";
|
|
31
|
-
import "./Ellipse-
|
|
32
|
-
import "./Emboss-
|
|
31
|
+
import "./Ellipse-DWQt5JTM.js";
|
|
32
|
+
import "./Emboss-ShjCeQPU.js";
|
|
33
33
|
import "./FallingLines-DBNJVWio.js";
|
|
34
34
|
import "./FilmGrain-CSuerGc6.js";
|
|
35
35
|
import "./FloatingParticles-CoBM_CJ8.js";
|
|
36
|
-
import "./Flower-
|
|
36
|
+
import "./Flower-DZVbhEaA.js";
|
|
37
37
|
import "./FlowField-Bh3-dX6I.js";
|
|
38
|
-
import "./
|
|
39
|
-
import "./
|
|
40
|
-
import "./
|
|
41
|
-
import "./
|
|
42
|
-
import "./
|
|
43
|
-
import "./
|
|
44
|
-
import "./
|
|
45
|
-
import "./
|
|
46
|
-
import "./
|
|
47
|
-
import "./
|
|
48
|
-
import "./
|
|
49
|
-
import "./
|
|
50
|
-
import "./
|
|
51
|
-
import "./
|
|
52
|
-
import "./
|
|
53
|
-
import "./
|
|
54
|
-
import "./
|
|
55
|
-
import "./
|
|
56
|
-
import "./
|
|
57
|
-
import "./
|
|
58
|
-
import "./
|
|
59
|
-
import "./
|
|
60
|
-
import "./
|
|
61
|
-
import "./
|
|
62
|
-
import "./
|
|
63
|
-
import "./
|
|
64
|
-
import "./
|
|
65
|
-
import "./
|
|
66
|
-
import "./
|
|
67
|
-
import "./
|
|
68
|
-
import "./
|
|
69
|
-
import "./
|
|
70
|
-
import "./
|
|
71
|
-
import "./
|
|
72
|
-
import "./
|
|
73
|
-
import "./
|
|
74
|
-
import "./
|
|
75
|
-
import "./
|
|
76
|
-
import "./
|
|
77
|
-
import "./
|
|
78
|
-
import "./
|
|
79
|
-
import "./
|
|
80
|
-
import "./
|
|
81
|
-
import "./
|
|
82
|
-
import "./
|
|
83
|
-
import "./
|
|
84
|
-
import "./
|
|
85
|
-
import "./
|
|
86
|
-
import "./
|
|
87
|
-
import "./
|
|
88
|
-
import "./
|
|
89
|
-
import "./
|
|
90
|
-
import "./
|
|
91
|
-
import "./
|
|
92
|
-
import "./
|
|
93
|
-
import "./
|
|
94
|
-
import "./
|
|
95
|
-
import "./
|
|
96
|
-
import "./
|
|
97
|
-
import "./
|
|
98
|
-
import
|
|
38
|
+
import "./FlowingGradient-DVproCI1.js";
|
|
39
|
+
import "./Form3D-DhezVuyN.js";
|
|
40
|
+
import "./Glass-CrdewyrV.js";
|
|
41
|
+
import "./GlassTiles-ClrOIpCg.js";
|
|
42
|
+
import "./Glitch-DmWytiRl.js";
|
|
43
|
+
import "./Glow-Dm4dfZ_m.js";
|
|
44
|
+
import "./Godrays-CYILZUHg.js";
|
|
45
|
+
import "./Grayscale-CPR_l4G2.js";
|
|
46
|
+
import "./Grid-CCQZ3GhD.js";
|
|
47
|
+
import "./GridDistortion-oGT8NaWa.js";
|
|
48
|
+
import "./Group-CC317vlL.js";
|
|
49
|
+
import "./Halftone-BZk1Hjz_.js";
|
|
50
|
+
import "./HueShift-CuE3YTBE.js";
|
|
51
|
+
import "./ImageTexture-DWUSKXX0.js";
|
|
52
|
+
import "./Invert-C9RiDYP_.js";
|
|
53
|
+
import "./Kaleidoscope-DtVlQWKG.js";
|
|
54
|
+
import "./LensFlare-AVpiDD1O.js";
|
|
55
|
+
import "./LinearBlur-AR65FcZh.js";
|
|
56
|
+
import "./LinearGradient-DXCXjS-K.js";
|
|
57
|
+
import "./Liquify-mhzPd19o.js";
|
|
58
|
+
import "./Mirror-CSc5mJi1.js";
|
|
59
|
+
import "./Neon-DwAOiY8b.js";
|
|
60
|
+
import "./Paper-DfUka0dt.js";
|
|
61
|
+
import "./Perspective-uPiPmWy_.js";
|
|
62
|
+
import "./Pixelate-DRkAW4Lo.js";
|
|
63
|
+
import "./Plasma-ELzbK-Us.js";
|
|
64
|
+
import "./PolarCoordinates-CalS_TB6.js";
|
|
65
|
+
import "./Polygon-BrxPjS1j.js";
|
|
66
|
+
import "./Posterize-C4vtRmtA.js";
|
|
67
|
+
import "./ProgressiveBlur-CLYhfOvQ.js";
|
|
68
|
+
import "./RadialGradient-DtD8HWdM.js";
|
|
69
|
+
import "./RectangularCoordinates-B96mflF5.js";
|
|
70
|
+
import "./Ring-CrnCOiYQ.js";
|
|
71
|
+
import "./Ripples-Cevf-Hvg.js";
|
|
72
|
+
import "./RoundedRect-CyLsv0Vq.js";
|
|
73
|
+
import "./Saturation-CcDwPh2v.js";
|
|
74
|
+
import "./Sharpness-D_dXfDEo.js";
|
|
75
|
+
import "./Shatter-NfZzVt54.js";
|
|
76
|
+
import "./SimplexNoise-aipzNV5j.js";
|
|
77
|
+
import "./SineWave-CVeYx3n-.js";
|
|
78
|
+
import "./SolidColor-BdbBnLxX.js";
|
|
79
|
+
import "./Spherize-BRGwLGeu.js";
|
|
80
|
+
import "./Spiral-BkTBXb7z.js";
|
|
81
|
+
import "./Star-CAfXecya.js";
|
|
82
|
+
import "./Strands-Cjsw-cPu.js";
|
|
83
|
+
import "./Stretch-9cta3Z1W.js";
|
|
84
|
+
import "./Stripes-C0sCGCz_.js";
|
|
85
|
+
import "./StudioBackground-BYv_-8df.js";
|
|
86
|
+
import "./Swirl-DXjIXfy7.js";
|
|
87
|
+
import "./TiltShift-56lcZ4cJ.js";
|
|
88
|
+
import "./Tint-8_WIy9_e.js";
|
|
89
|
+
import "./Trapezoid-DA0I90A2.js";
|
|
90
|
+
import "./Tritone-nyJyybHI.js";
|
|
91
|
+
import "./Twirl-BzSEz4xK.js";
|
|
92
|
+
import "./Vesica-RKKgxLKt.js";
|
|
93
|
+
import "./Vibrance-BETLN3Ie.js";
|
|
94
|
+
import "./browser-CqdrcD5J.js";
|
|
95
|
+
import "./VideoTexture-Dbsbgb1Y.js";
|
|
96
|
+
import "./WaveDistortion-C-j597Jm.js";
|
|
97
|
+
import "./WebcamTexture-xvb8MuFz.js";
|
|
98
|
+
import "./ZoomBlur-DFw0J9x3.js";
|
|
99
|
+
import { a as shaderRegistry, i as getShadersByCategory, n as getShaderByName, r as getShaderCategories, t as getAllShaders } from "./shaderRegistry-D0ny8qOF.js";
|
|
99
100
|
export { getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, shaderRegistry };
|
package/dist/core/renderer.d.ts
CHANGED
|
@@ -168,6 +168,7 @@ export declare function shaderRenderer(): {
|
|
|
168
168
|
};
|
|
169
169
|
getRendererType: () => "webgpu" | "webgl" | null;
|
|
170
170
|
getInternalRenderer: () => WebGPURenderer | WebGLRenderer;
|
|
171
|
+
setOnReady: (callback: (() => void) | null) => void;
|
|
171
172
|
__testing: {
|
|
172
173
|
needsTransformation: (transform: import('./types').TransformConfig | undefined) => boolean;
|
|
173
174
|
findChildNodes: (parentId: string) => NodeInfo[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,IAAI,EAMT,cAAc,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAC,aAAa,EAAC,MAAM,OAAO,CAAA;AAInC,OAAO,EAAoB,eAAe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WAAW,GAAG,MAAM,CAAC;IAClC,OAAO,CAAC,EAAE,qBAAqB,GAAG,sBAAsB,CAAA;IACxD,GAAG,CAAC,EAAE;QACF,MAAM,EAAE,SAAS,CAAA;QACjB,OAAO,EAAE,UAAU,CAAA;KACtB,CAAA;IACD,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAiHD;;GAEG;AACH,wBAAgB,cAAc;kJAmtEG,iBAAiB;;uBA3/BpB,MAAM,oBAAoB,mBAAmB,CAAC,cAAc,CAAC,GAAG,IAAI,YAAY,MAAM,GAAG,IAAI,YAAY,YAAY,GAAG,IAAI,aAAY,WAAW,wBAA6B,mBAAmB,KAAG,IAAI;qBAsa5M,MAAM,KAAG,IAAI;iCA1QD,MAAM,eAAe,MAAM,SAAS,GAAG,KAAG,IAAI;iCA8C9C,MAAM,YAAY,OAAO,CAAC,YAAY,CAAC,KAAG,IAAI;;oBA8oC9D,MAAM,UAAU,MAAM;0BAngBf,IAAI;yBAyBL,IAAI;yBAzOE,OAAO,CAAC,IAAI,CAAC;+BA+Lb,gBAAgB;;eA4hBmB,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;;2BArBpE,QAAQ,GAAG,OAAO,GAAG,IAAI;;2BAwB1B,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;;;mCAhrEZ,MAAM,KAAG,QAAQ,EAAE;oCA+CzC,IAAI,YACF,QAAQ,UACV,MAAM,kBACE,GAAG,CAAC,MAAM,CAAC,gBACb,IAAI,KACnB,IAAI;0CA8SK,IAAI,YACF,QAAQ,KACnB,IAAI;;;;EA01DV"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataTexture, FloatType, LinearFilter, RedFormat } from "three";
|
|
2
|
-
import { abs, atan, cos, float, floor, max, min, sign, sin, sqrt, texture } from "three/tsl";
|
|
2
|
+
import { abs, atan, cos, float, floor, max, min, mix, sign, sin, sqrt, texture, uniform, vec4 } from "three/tsl";
|
|
3
3
|
function circleSdf(dx, dy, radius) {
|
|
4
4
|
return sqrt(dx.mul(dx).add(dy.mul(dy))).sub(radius);
|
|
5
5
|
}
|
|
@@ -148,4 +148,84 @@ function createSvgSdfSampler(shapeSdfUrl, onBeforeRender, onCleanup) {
|
|
|
148
148
|
const sdfNode = texture(sdfTexture);
|
|
149
149
|
return (uv$1) => sdfNode.sample(uv$1);
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
function createAnalyticSdfSampler(shapeType, initialConfig, shapeUniform, onBeforeRender) {
|
|
152
|
+
const radiusU = uniform(initialConfig.radius ?? .35);
|
|
153
|
+
const sidesU = uniform(initialConfig.sides ?? 6);
|
|
154
|
+
const roundingU = uniform(initialConfig.rounding ?? 0);
|
|
155
|
+
const innerRatioU = uniform(initialConfig.innerRatio ?? initialConfig.thickness ?? .4);
|
|
156
|
+
const rotationU = uniform(initialConfig.rotation ?? 0);
|
|
157
|
+
const heightU = uniform(initialConfig.height ?? .25);
|
|
158
|
+
const offsetU = uniform(initialConfig.offset ?? .2);
|
|
159
|
+
let lastShapeJson = "";
|
|
160
|
+
let lastCfg = initialConfig;
|
|
161
|
+
onBeforeRender(() => {
|
|
162
|
+
const raw = shapeUniform.uniform.value;
|
|
163
|
+
if (raw !== lastShapeJson) {
|
|
164
|
+
lastShapeJson = raw;
|
|
165
|
+
try {
|
|
166
|
+
lastCfg = JSON.parse(raw);
|
|
167
|
+
} catch {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
radiusU.value = lastCfg.radius ?? lastCfg.width ?? lastCfg.bottomWidth ?? .35;
|
|
172
|
+
sidesU.value = lastCfg.sides ?? 6;
|
|
173
|
+
roundingU.value = lastCfg.rounding ?? 0;
|
|
174
|
+
innerRatioU.value = lastCfg.innerRatio ?? lastCfg.thickness ?? lastCfg.spread ?? lastCfg.topWidth ?? lastCfg.topRatio ?? .4;
|
|
175
|
+
rotationU.value = lastCfg.rotation ?? 0;
|
|
176
|
+
heightU.value = lastCfg.height ?? .25;
|
|
177
|
+
offsetU.value = lastCfg.offset ?? .2;
|
|
178
|
+
});
|
|
179
|
+
const needsRotation = shapeType !== "circleSDF" && shapeType !== "ringSDF";
|
|
180
|
+
return (uv$1) => {
|
|
181
|
+
const dx = uv$1.x.sub(float(.5));
|
|
182
|
+
const dy = uv$1.y.sub(float(.5));
|
|
183
|
+
let rdx = dx, rdy = dy;
|
|
184
|
+
if (needsRotation) {
|
|
185
|
+
const rotRad = rotationU.mul(float(Math.PI / 180));
|
|
186
|
+
const cosR = cos(rotRad);
|
|
187
|
+
const sinR = sin(rotRad);
|
|
188
|
+
rdx = dx.mul(cosR).add(dy.mul(sinR));
|
|
189
|
+
rdy = dy.mul(cosR).sub(dx.mul(sinR));
|
|
190
|
+
}
|
|
191
|
+
let dist;
|
|
192
|
+
switch (shapeType) {
|
|
193
|
+
case "polygonSDF":
|
|
194
|
+
dist = mix(polygonSdf(rdx, rdy, radiusU, sidesU), circleSdf(dx, dy, radiusU), roundingU);
|
|
195
|
+
break;
|
|
196
|
+
case "flowerSDF":
|
|
197
|
+
dist = flowerSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
198
|
+
break;
|
|
199
|
+
case "ringSDF":
|
|
200
|
+
dist = ringSdf(dx, dy, radiusU, innerRatioU);
|
|
201
|
+
break;
|
|
202
|
+
case "crossSDF":
|
|
203
|
+
dist = crossSdf(rdx, rdy, radiusU, innerRatioU, roundingU);
|
|
204
|
+
break;
|
|
205
|
+
case "starSDF":
|
|
206
|
+
dist = starSdf(rdx, rdy, radiusU, sidesU, innerRatioU);
|
|
207
|
+
break;
|
|
208
|
+
case "roundedRectSDF":
|
|
209
|
+
dist = roundedRectSdf(rdx, rdy, radiusU, heightU, roundingU);
|
|
210
|
+
break;
|
|
211
|
+
case "ellipseSDF":
|
|
212
|
+
dist = ellipseSdf(rdx, rdy, radiusU, heightU);
|
|
213
|
+
break;
|
|
214
|
+
case "vesicaSDF":
|
|
215
|
+
dist = vesicaSdf(rdx, rdy, radiusU, innerRatioU);
|
|
216
|
+
break;
|
|
217
|
+
case "crescentSDF":
|
|
218
|
+
dist = crescentSdf(rdx, rdy, radiusU, innerRatioU, offsetU);
|
|
219
|
+
break;
|
|
220
|
+
case "trapezoidSDF":
|
|
221
|
+
dist = trapezoidSdf(rdx, rdy, innerRatioU, radiusU, heightU);
|
|
222
|
+
break;
|
|
223
|
+
case "circleSDF":
|
|
224
|
+
default:
|
|
225
|
+
dist = circleSdf(dx, dy, radiusU);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
return vec4(dist, float(0), float(0), float(1));
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
export { crossSdf as a, polygonSdf as c, starSdf as d, trapezoidSdf as f, crescentSdf as i, ringSdf as l, createAnalyticSdfSampler as n, ellipseSdf as o, vesicaSdf as p, createSvgSdfSampler as r, flowerSdf as s, circleSdf as t, roundedRectSdf as u };
|