shaders 2.2.46 → 2.2.48
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/FlowField-BJFGOUZL.js +103 -0
- package/dist/core/Kaleidoscope-Dr-ja0XH.js +97 -0
- package/dist/core/Mirror-CnCw4TpZ.js +84 -0
- package/dist/core/registry.js +90 -84
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/FlowField/index.d.ts +36 -0
- package/dist/core/shaders/FlowField/index.d.ts.map +1 -0
- package/dist/core/shaders/FlowField/index.js +5 -0
- package/dist/core/shaders/GlassTiles/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.d.ts +36 -0
- package/dist/core/shaders/Kaleidoscope/index.d.ts.map +1 -0
- package/dist/core/shaders/Kaleidoscope/index.js +4 -0
- 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.d.ts +29 -0
- package/dist/core/shaders/Mirror/index.d.ts.map +1 -0
- package/dist/core/shaders/Mirror/index.js +4 -0
- package/dist/core/shaders/Perspective/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- 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/Ripples/index.js +1 -1
- 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/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/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/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/WebcamTexture/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/react/FlowField.js +144 -0
- package/dist/react/Kaleidoscope.js +144 -0
- package/dist/react/Mirror.js +144 -0
- package/dist/react/components/FlowField.d.ts +31 -0
- package/dist/react/components/FlowField.d.ts.map +1 -0
- package/dist/react/components/Kaleidoscope.d.ts +31 -0
- package/dist/react/components/Kaleidoscope.d.ts.map +1 -0
- package/dist/react/components/Mirror.d.ts +31 -0
- package/dist/react/components/Mirror.d.ts.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +15 -0
- package/dist/registry.js +386 -0
- package/dist/solid/components/FlowField.d.ts +28 -0
- package/dist/solid/components/FlowField.d.ts.map +1 -0
- package/dist/solid/components/FlowField.js +148 -0
- package/dist/solid/components/Kaleidoscope.d.ts +28 -0
- package/dist/solid/components/Kaleidoscope.d.ts.map +1 -0
- package/dist/solid/components/Kaleidoscope.js +148 -0
- package/dist/solid/components/Mirror.d.ts +28 -0
- package/dist/solid/components/Mirror.d.ts.map +1 -0
- package/dist/solid/components/Mirror.js +148 -0
- package/dist/solid/index.d.ts +3 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +92 -86
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +15 -0
- package/dist/svelte/components/FlowField.svelte.d.ts +19 -0
- package/dist/svelte/components/Kaleidoscope.svelte.d.ts +19 -0
- package/dist/svelte/components/Mirror.svelte.d.ts +19 -0
- package/dist/svelte/{generatePresetCode-CtXcoyI0.js → generatePresetCode-BD0Ac86C.js} +15 -0
- package/dist/svelte/index.d.ts +3 -0
- package/dist/svelte/index.js +419 -86
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/FlowField.js +3 -0
- package/dist/vue/FlowField.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Kaleidoscope.js +3 -0
- package/dist/vue/Kaleidoscope.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Mirror.js +3 -0
- package/dist/vue/Mirror.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/components/FlowField.vue.d.ts +57 -0
- package/dist/vue/components/FlowField.vue.d.ts.map +1 -0
- package/dist/vue/components/Kaleidoscope.vue.d.ts +57 -0
- package/dist/vue/components/Kaleidoscope.vue.d.ts.map +1 -0
- package/dist/vue/components/Mirror.vue.d.ts +57 -0
- package/dist/vue/components/Mirror.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +3 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +4 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +15 -0
- package/package.json +25 -1
- /package/dist/core/{GlassTiles-C6LLjlnB.js → GlassTiles-DzYvo92U.js} +0 -0
- /package/dist/core/{Glow-C2avDr73.js → Glow-C4JrnNxe.js} +0 -0
- /package/dist/core/{Godrays-RVh5ylQ-.js → Godrays-CPWOcLmc.js} +0 -0
- /package/dist/core/{Grayscale-BH3tLDGN.js → Grayscale-BFS-Abdh.js} +0 -0
- /package/dist/core/{Grid-CdslWvoH.js → Grid-CsIIl3LT.js} +0 -0
- /package/dist/core/{GridDistortion-fimECOse.js → GridDistortion-Cq3hRKXK.js} +0 -0
- /package/dist/core/{Group-ByGv48Lm.js → Group-DHokCeZ1.js} +0 -0
- /package/dist/core/{Halftone-Cb5yrPnj.js → Halftone-BQsMiTyE.js} +0 -0
- /package/dist/core/{HueShift-DQ2WgImx.js → HueShift-BTjEGl3Z.js} +0 -0
- /package/dist/core/{ImageTexture-DKFb8ze3.js → ImageTexture-CY8Q8h_o.js} +0 -0
- /package/dist/core/{Invert-w9duGaUu.js → Invert-B8vSeK8d.js} +0 -0
- /package/dist/core/{LinearBlur-CfMT259a.js → LinearBlur-DgT4B0nH.js} +0 -0
- /package/dist/core/{LinearGradient-Cn7w-umQ.js → LinearGradient-DTifAwSC.js} +0 -0
- /package/dist/core/{Liquify-BCkIt0A1.js → Liquify-_eLJRjd7.js} +0 -0
- /package/dist/core/{Perspective-CJOFHxEC.js → Perspective-BpgcHA7E.js} +0 -0
- /package/dist/core/{Pixelate-BhNAxBsT.js → Pixelate-Bt2jxIDd.js} +0 -0
- /package/dist/core/{PolarCoordinates-DLs3K__1.js → PolarCoordinates-BJ8-cfC7.js} +0 -0
- /package/dist/core/{Posterize-XoAqPWv2.js → Posterize-Bs-iNEVB.js} +0 -0
- /package/dist/core/{ProgressiveBlur-BIZSnUjp.js → ProgressiveBlur-DELpd9wJ.js} +0 -0
- /package/dist/core/{RadialGradient-sQgXXXQk.js → RadialGradient-DQ4JGS5G.js} +0 -0
- /package/dist/core/{RectangularCoordinates-CyarkXn0.js → RectangularCoordinates-DXSP_gdW.js} +0 -0
- /package/dist/core/{Ripples-Djjw66Bn.js → Ripples-DwDKIvtQ.js} +0 -0
- /package/dist/core/{Saturation-DLHW_GP6.js → Saturation-ekyl1D9y.js} +0 -0
- /package/dist/core/{Sharpness-DkGuV_dy.js → Sharpness-DlWZ-yPe.js} +0 -0
- /package/dist/core/{Shatter-DVgj2Ea3.js → Shatter-BeD72o80.js} +0 -0
- /package/dist/core/{SimplexNoise-BXtLTcAr.js → SimplexNoise-DIo9v2-R.js} +0 -0
- /package/dist/core/{SineWave-BxqFasFh.js → SineWave-DFNnXFYQ.js} +0 -0
- /package/dist/core/{SolidColor-DFkDBFq3.js → SolidColor-B4eYGf_i.js} +0 -0
- /package/dist/core/{Spherize-DIJ4c_EG.js → Spherize-BIVrRcZG.js} +0 -0
- /package/dist/core/{Spiral-BBtmU1Fv.js → Spiral-CqjRxq1I.js} +0 -0
- /package/dist/core/{Strands-D6UOhX0L.js → Strands-B-a2SQB2.js} +0 -0
- /package/dist/core/{Stretch-DLpz8Ofm.js → Stretch-CZv3u-3X.js} +0 -0
- /package/dist/core/{Stripes-Bre3Z2m_.js → Stripes-CXUFg1Gt.js} +0 -0
- /package/dist/core/{Swirl-CfsYsr4X.js → Swirl-BcEmYjJs.js} +0 -0
- /package/dist/core/{TiltShift-BPpXBzBg.js → TiltShift-679S-uVs.js} +0 -0
- /package/dist/core/{Tint-BazvezVn.js → Tint-DS7IJWfS.js} +0 -0
- /package/dist/core/{Tritone-w0h2ebDB.js → Tritone-m_0hwkvN.js} +0 -0
- /package/dist/core/{Twirl-dmfYS2Eo.js → Twirl-DcuGsZAB.js} +0 -0
- /package/dist/core/{Vibrance-BpWyAK9W.js → Vibrance-BafFCMLv.js} +0 -0
- /package/dist/core/{WaveDistortion-hWdvaZmT.js → WaveDistortion-CQkMSDMg.js} +0 -0
- /package/dist/core/{WebcamTexture-D4Uv7Plz.js → WebcamTexture-C5oIVQlF.js} +0 -0
- /package/dist/core/{ZoomBlur-DCI4uHOL.js → ZoomBlur-pFDohu2G.js} +0 -0
package/dist/registry.js
CHANGED
|
@@ -2672,6 +2672,142 @@ export const shaderRegistry = [
|
|
|
2672
2672
|
}
|
|
2673
2673
|
}
|
|
2674
2674
|
},
|
|
2675
|
+
{
|
|
2676
|
+
"name": "FlowField",
|
|
2677
|
+
"category": "Distortions",
|
|
2678
|
+
"description": "Fluid-like distortion with constant smooth motion",
|
|
2679
|
+
"fileName": "FlowField",
|
|
2680
|
+
"requiresChild": true,
|
|
2681
|
+
"definition": {
|
|
2682
|
+
"name": "FlowField",
|
|
2683
|
+
"category": "Distortions",
|
|
2684
|
+
"description": "Fluid-like distortion with constant smooth motion",
|
|
2685
|
+
"requiresRTT": true,
|
|
2686
|
+
"requiresChild": true,
|
|
2687
|
+
"props": {
|
|
2688
|
+
"strength": {
|
|
2689
|
+
"default": 0.15,
|
|
2690
|
+
"description": "Intensity of the flow distortion",
|
|
2691
|
+
"ui": {
|
|
2692
|
+
"type": "range",
|
|
2693
|
+
"min": 0,
|
|
2694
|
+
"max": 0.5,
|
|
2695
|
+
"step": 0.05,
|
|
2696
|
+
"label": "Strength"
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
"detail": {
|
|
2700
|
+
"default": 2,
|
|
2701
|
+
"description": "Scale of the flow patterns",
|
|
2702
|
+
"ui": {
|
|
2703
|
+
"type": "range",
|
|
2704
|
+
"min": 0.5,
|
|
2705
|
+
"max": 5,
|
|
2706
|
+
"step": 0.1,
|
|
2707
|
+
"label": "Detail"
|
|
2708
|
+
}
|
|
2709
|
+
},
|
|
2710
|
+
"speed": {
|
|
2711
|
+
"default": 1,
|
|
2712
|
+
"description": "Speed of the flow",
|
|
2713
|
+
"ui": {
|
|
2714
|
+
"type": "range",
|
|
2715
|
+
"min": 0,
|
|
2716
|
+
"max": 5,
|
|
2717
|
+
"step": 0.1,
|
|
2718
|
+
"label": "Speed"
|
|
2719
|
+
}
|
|
2720
|
+
},
|
|
2721
|
+
"edges": {
|
|
2722
|
+
"default": "mirror",
|
|
2723
|
+
"description": "How to handle edges when distortion pushes content out of bounds",
|
|
2724
|
+
"ui": {
|
|
2725
|
+
"type": "select",
|
|
2726
|
+
"options": [
|
|
2727
|
+
{
|
|
2728
|
+
"label": "Stretch",
|
|
2729
|
+
"value": "stretch"
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"label": "Transparent",
|
|
2733
|
+
"value": "transparent"
|
|
2734
|
+
},
|
|
2735
|
+
{
|
|
2736
|
+
"label": "Mirror",
|
|
2737
|
+
"value": "mirror"
|
|
2738
|
+
},
|
|
2739
|
+
{
|
|
2740
|
+
"label": "Wrap",
|
|
2741
|
+
"value": "wrap"
|
|
2742
|
+
}
|
|
2743
|
+
],
|
|
2744
|
+
"label": "Edges"
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
},
|
|
2749
|
+
"propsMetadata": {
|
|
2750
|
+
"strength": {
|
|
2751
|
+
"ui": {
|
|
2752
|
+
"type": "range",
|
|
2753
|
+
"min": 0,
|
|
2754
|
+
"max": 0.5,
|
|
2755
|
+
"step": 0.05,
|
|
2756
|
+
"label": "Strength"
|
|
2757
|
+
},
|
|
2758
|
+
"default": 0.15,
|
|
2759
|
+
"description": "Intensity of the flow distortion"
|
|
2760
|
+
},
|
|
2761
|
+
"detail": {
|
|
2762
|
+
"ui": {
|
|
2763
|
+
"type": "range",
|
|
2764
|
+
"min": 0.5,
|
|
2765
|
+
"max": 5,
|
|
2766
|
+
"step": 0.1,
|
|
2767
|
+
"label": "Detail"
|
|
2768
|
+
},
|
|
2769
|
+
"default": 2,
|
|
2770
|
+
"description": "Scale of the flow patterns"
|
|
2771
|
+
},
|
|
2772
|
+
"speed": {
|
|
2773
|
+
"ui": {
|
|
2774
|
+
"type": "range",
|
|
2775
|
+
"min": 0,
|
|
2776
|
+
"max": 5,
|
|
2777
|
+
"step": 0.1,
|
|
2778
|
+
"label": "Speed"
|
|
2779
|
+
},
|
|
2780
|
+
"default": 1,
|
|
2781
|
+
"description": "Speed of the flow"
|
|
2782
|
+
},
|
|
2783
|
+
"edges": {
|
|
2784
|
+
"ui": {
|
|
2785
|
+
"type": "select",
|
|
2786
|
+
"options": [
|
|
2787
|
+
{
|
|
2788
|
+
"label": "Stretch",
|
|
2789
|
+
"value": "stretch"
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
"label": "Transparent",
|
|
2793
|
+
"value": "transparent"
|
|
2794
|
+
},
|
|
2795
|
+
{
|
|
2796
|
+
"label": "Mirror",
|
|
2797
|
+
"value": "mirror"
|
|
2798
|
+
},
|
|
2799
|
+
{
|
|
2800
|
+
"label": "Wrap",
|
|
2801
|
+
"value": "wrap"
|
|
2802
|
+
}
|
|
2803
|
+
],
|
|
2804
|
+
"label": "Edges"
|
|
2805
|
+
},
|
|
2806
|
+
"default": "mirror",
|
|
2807
|
+
"description": "How to handle edges when distortion pushes content out of bounds"
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
},
|
|
2675
2811
|
{
|
|
2676
2812
|
"name": "GlassTiles",
|
|
2677
2813
|
"category": "Distortions",
|
|
@@ -3511,6 +3647,142 @@ export const shaderRegistry = [
|
|
|
3511
3647
|
},
|
|
3512
3648
|
"propsMetadata": {}
|
|
3513
3649
|
},
|
|
3650
|
+
{
|
|
3651
|
+
"name": "Kaleidoscope",
|
|
3652
|
+
"category": "Distortions",
|
|
3653
|
+
"description": "Create a kaleidoscope effect with radial mirrored segments",
|
|
3654
|
+
"fileName": "Kaleidoscope",
|
|
3655
|
+
"requiresChild": true,
|
|
3656
|
+
"definition": {
|
|
3657
|
+
"name": "Kaleidoscope",
|
|
3658
|
+
"category": "Distortions",
|
|
3659
|
+
"description": "Create a kaleidoscope effect with radial mirrored segments",
|
|
3660
|
+
"requiresRTT": true,
|
|
3661
|
+
"requiresChild": true,
|
|
3662
|
+
"props": {
|
|
3663
|
+
"center": {
|
|
3664
|
+
"default": {
|
|
3665
|
+
"x": 0.5,
|
|
3666
|
+
"y": 0.5
|
|
3667
|
+
},
|
|
3668
|
+
"description": "The center point of the kaleidoscope effect",
|
|
3669
|
+
"ui": {
|
|
3670
|
+
"type": "position",
|
|
3671
|
+
"label": "Center"
|
|
3672
|
+
}
|
|
3673
|
+
},
|
|
3674
|
+
"segments": {
|
|
3675
|
+
"default": 6,
|
|
3676
|
+
"description": "Number of radial segments in the kaleidoscope",
|
|
3677
|
+
"ui": {
|
|
3678
|
+
"type": "range",
|
|
3679
|
+
"min": 2,
|
|
3680
|
+
"max": 24,
|
|
3681
|
+
"step": 1,
|
|
3682
|
+
"label": "Segments"
|
|
3683
|
+
}
|
|
3684
|
+
},
|
|
3685
|
+
"angle": {
|
|
3686
|
+
"default": 0,
|
|
3687
|
+
"description": "Rotation offset for the entire kaleidoscope pattern",
|
|
3688
|
+
"ui": {
|
|
3689
|
+
"type": "range",
|
|
3690
|
+
"min": 0,
|
|
3691
|
+
"max": 360,
|
|
3692
|
+
"step": 1,
|
|
3693
|
+
"label": "Angle"
|
|
3694
|
+
}
|
|
3695
|
+
},
|
|
3696
|
+
"edges": {
|
|
3697
|
+
"default": "mirror",
|
|
3698
|
+
"description": "How to handle edges when distortion pushes content out of bounds",
|
|
3699
|
+
"ui": {
|
|
3700
|
+
"type": "select",
|
|
3701
|
+
"options": [
|
|
3702
|
+
{
|
|
3703
|
+
"label": "Stretch",
|
|
3704
|
+
"value": "stretch"
|
|
3705
|
+
},
|
|
3706
|
+
{
|
|
3707
|
+
"label": "Transparent",
|
|
3708
|
+
"value": "transparent"
|
|
3709
|
+
},
|
|
3710
|
+
{
|
|
3711
|
+
"label": "Mirror",
|
|
3712
|
+
"value": "mirror"
|
|
3713
|
+
},
|
|
3714
|
+
{
|
|
3715
|
+
"label": "Wrap",
|
|
3716
|
+
"value": "wrap"
|
|
3717
|
+
}
|
|
3718
|
+
],
|
|
3719
|
+
"label": "Edges"
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
},
|
|
3724
|
+
"propsMetadata": {
|
|
3725
|
+
"center": {
|
|
3726
|
+
"ui": {
|
|
3727
|
+
"type": "position",
|
|
3728
|
+
"label": "Center"
|
|
3729
|
+
},
|
|
3730
|
+
"default": {
|
|
3731
|
+
"x": 0.5,
|
|
3732
|
+
"y": 0.5
|
|
3733
|
+
},
|
|
3734
|
+
"description": "The center point of the kaleidoscope effect"
|
|
3735
|
+
},
|
|
3736
|
+
"segments": {
|
|
3737
|
+
"ui": {
|
|
3738
|
+
"type": "range",
|
|
3739
|
+
"min": 2,
|
|
3740
|
+
"max": 24,
|
|
3741
|
+
"step": 1,
|
|
3742
|
+
"label": "Segments"
|
|
3743
|
+
},
|
|
3744
|
+
"default": 6,
|
|
3745
|
+
"description": "Number of radial segments in the kaleidoscope"
|
|
3746
|
+
},
|
|
3747
|
+
"angle": {
|
|
3748
|
+
"ui": {
|
|
3749
|
+
"type": "range",
|
|
3750
|
+
"min": 0,
|
|
3751
|
+
"max": 360,
|
|
3752
|
+
"step": 1,
|
|
3753
|
+
"label": "Angle"
|
|
3754
|
+
},
|
|
3755
|
+
"default": 0,
|
|
3756
|
+
"description": "Rotation offset for the entire kaleidoscope pattern"
|
|
3757
|
+
},
|
|
3758
|
+
"edges": {
|
|
3759
|
+
"ui": {
|
|
3760
|
+
"type": "select",
|
|
3761
|
+
"options": [
|
|
3762
|
+
{
|
|
3763
|
+
"label": "Stretch",
|
|
3764
|
+
"value": "stretch"
|
|
3765
|
+
},
|
|
3766
|
+
{
|
|
3767
|
+
"label": "Transparent",
|
|
3768
|
+
"value": "transparent"
|
|
3769
|
+
},
|
|
3770
|
+
{
|
|
3771
|
+
"label": "Mirror",
|
|
3772
|
+
"value": "mirror"
|
|
3773
|
+
},
|
|
3774
|
+
{
|
|
3775
|
+
"label": "Wrap",
|
|
3776
|
+
"value": "wrap"
|
|
3777
|
+
}
|
|
3778
|
+
],
|
|
3779
|
+
"label": "Edges"
|
|
3780
|
+
},
|
|
3781
|
+
"default": "mirror",
|
|
3782
|
+
"description": "How to handle edges when distortion pushes content out of bounds"
|
|
3783
|
+
}
|
|
3784
|
+
}
|
|
3785
|
+
},
|
|
3514
3786
|
{
|
|
3515
3787
|
"name": "LinearBlur",
|
|
3516
3788
|
"category": "Blurs",
|
|
@@ -3918,6 +4190,120 @@ export const shaderRegistry = [
|
|
|
3918
4190
|
}
|
|
3919
4191
|
}
|
|
3920
4192
|
},
|
|
4193
|
+
{
|
|
4194
|
+
"name": "Mirror",
|
|
4195
|
+
"category": "Distortions",
|
|
4196
|
+
"description": "Mirror content across a line defined by center point and angle",
|
|
4197
|
+
"fileName": "Mirror",
|
|
4198
|
+
"requiresChild": true,
|
|
4199
|
+
"definition": {
|
|
4200
|
+
"name": "Mirror",
|
|
4201
|
+
"category": "Distortions",
|
|
4202
|
+
"description": "Mirror content across a line defined by center point and angle",
|
|
4203
|
+
"requiresRTT": true,
|
|
4204
|
+
"requiresChild": true,
|
|
4205
|
+
"props": {
|
|
4206
|
+
"center": {
|
|
4207
|
+
"default": {
|
|
4208
|
+
"x": 0.5,
|
|
4209
|
+
"y": 0.5
|
|
4210
|
+
},
|
|
4211
|
+
"description": "The point the mirror line passes through",
|
|
4212
|
+
"ui": {
|
|
4213
|
+
"type": "position",
|
|
4214
|
+
"label": "Center"
|
|
4215
|
+
}
|
|
4216
|
+
},
|
|
4217
|
+
"angle": {
|
|
4218
|
+
"default": 0,
|
|
4219
|
+
"description": "The angle of the mirror line in degrees",
|
|
4220
|
+
"ui": {
|
|
4221
|
+
"type": "range",
|
|
4222
|
+
"min": 0,
|
|
4223
|
+
"max": 360,
|
|
4224
|
+
"step": 1,
|
|
4225
|
+
"label": "Angle"
|
|
4226
|
+
}
|
|
4227
|
+
},
|
|
4228
|
+
"edges": {
|
|
4229
|
+
"default": "mirror",
|
|
4230
|
+
"description": "How to handle edges when distortion pushes content out of bounds",
|
|
4231
|
+
"ui": {
|
|
4232
|
+
"type": "select",
|
|
4233
|
+
"options": [
|
|
4234
|
+
{
|
|
4235
|
+
"label": "Stretch",
|
|
4236
|
+
"value": "stretch"
|
|
4237
|
+
},
|
|
4238
|
+
{
|
|
4239
|
+
"label": "Transparent",
|
|
4240
|
+
"value": "transparent"
|
|
4241
|
+
},
|
|
4242
|
+
{
|
|
4243
|
+
"label": "Mirror",
|
|
4244
|
+
"value": "mirror"
|
|
4245
|
+
},
|
|
4246
|
+
{
|
|
4247
|
+
"label": "Wrap",
|
|
4248
|
+
"value": "wrap"
|
|
4249
|
+
}
|
|
4250
|
+
],
|
|
4251
|
+
"label": "Edges"
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
},
|
|
4256
|
+
"propsMetadata": {
|
|
4257
|
+
"center": {
|
|
4258
|
+
"ui": {
|
|
4259
|
+
"type": "position",
|
|
4260
|
+
"label": "Center"
|
|
4261
|
+
},
|
|
4262
|
+
"default": {
|
|
4263
|
+
"x": 0.5,
|
|
4264
|
+
"y": 0.5
|
|
4265
|
+
},
|
|
4266
|
+
"description": "The point the mirror line passes through"
|
|
4267
|
+
},
|
|
4268
|
+
"angle": {
|
|
4269
|
+
"ui": {
|
|
4270
|
+
"type": "range",
|
|
4271
|
+
"min": 0,
|
|
4272
|
+
"max": 360,
|
|
4273
|
+
"step": 1,
|
|
4274
|
+
"label": "Angle"
|
|
4275
|
+
},
|
|
4276
|
+
"default": 0,
|
|
4277
|
+
"description": "The angle of the mirror line in degrees"
|
|
4278
|
+
},
|
|
4279
|
+
"edges": {
|
|
4280
|
+
"ui": {
|
|
4281
|
+
"type": "select",
|
|
4282
|
+
"options": [
|
|
4283
|
+
{
|
|
4284
|
+
"label": "Stretch",
|
|
4285
|
+
"value": "stretch"
|
|
4286
|
+
},
|
|
4287
|
+
{
|
|
4288
|
+
"label": "Transparent",
|
|
4289
|
+
"value": "transparent"
|
|
4290
|
+
},
|
|
4291
|
+
{
|
|
4292
|
+
"label": "Mirror",
|
|
4293
|
+
"value": "mirror"
|
|
4294
|
+
},
|
|
4295
|
+
{
|
|
4296
|
+
"label": "Wrap",
|
|
4297
|
+
"value": "wrap"
|
|
4298
|
+
}
|
|
4299
|
+
],
|
|
4300
|
+
"label": "Edges"
|
|
4301
|
+
},
|
|
4302
|
+
"default": "mirror",
|
|
4303
|
+
"description": "How to handle edges when distortion pushes content out of bounds"
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
},
|
|
3921
4307
|
{
|
|
3922
4308
|
"name": "Perspective",
|
|
3923
4309
|
"category": "Distortions",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { BlendMode, TransformConfig } from '../../core';
|
|
3
|
+
import { ComponentProps } from '../../core/shaders/FlowField';
|
|
4
|
+
export type { ComponentProps };
|
|
5
|
+
/**
|
|
6
|
+
* Base props that all shader components have
|
|
7
|
+
*/
|
|
8
|
+
interface BaseShaderProps {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
blendMode?: BlendMode;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
id?: string;
|
|
14
|
+
maskSource?: string;
|
|
15
|
+
maskType?: string;
|
|
16
|
+
renderOrder?: number;
|
|
17
|
+
transform?: Partial<TransformConfig>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Component-specific props that merge base props with shader-specific props
|
|
21
|
+
* Note: ComponentProps are made optional since they have defaults from the shader definition
|
|
22
|
+
*/
|
|
23
|
+
type ShaderComponentProps = BaseShaderProps & Partial<ComponentProps>;
|
|
24
|
+
/**
|
|
25
|
+
* The main Solid wrapper component for Shader shader nodes
|
|
26
|
+
*/
|
|
27
|
+
export default function ShaderComponent(props: ShaderComponentProps): JSX.Element;
|
|
28
|
+
//# sourceMappingURL=FlowField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowField.d.ts","sourceRoot":"","sources":["../../src/components/FlowField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAC9F,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGlF,YAAY,EAAE,cAAc,EAAE,CAAC;AAI/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAoCtE;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA4JlE"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createComponent } from "solid-js/web";
|
|
2
|
+
import { splitProps, createMemo, onMount, onCleanup, createEffect } from "solid-js";
|
|
3
|
+
import { createUniformsMap } from "../../core/index.js";
|
|
4
|
+
import { componentDefinition } from "../../core/shaders/FlowField/index.js";
|
|
5
|
+
import { useShaderContext, ShaderContext } from "../engine/Shader.js";
|
|
6
|
+
const DEFAULT_TRANSFORM = {
|
|
7
|
+
offsetX: 0,
|
|
8
|
+
offsetY: 0,
|
|
9
|
+
rotation: 0,
|
|
10
|
+
scale: 1,
|
|
11
|
+
anchorX: 0.5,
|
|
12
|
+
anchorY: 0.5,
|
|
13
|
+
edges: "transparent"
|
|
14
|
+
};
|
|
15
|
+
const defaultProps = {
|
|
16
|
+
blendMode: "normal",
|
|
17
|
+
renderOrder: 0,
|
|
18
|
+
visible: true
|
|
19
|
+
// opacity intentionally has no default - handled by renderer
|
|
20
|
+
// transform intentionally has no default - handled by effectiveTransform
|
|
21
|
+
};
|
|
22
|
+
try {
|
|
23
|
+
if (componentDefinition && componentDefinition.props) {
|
|
24
|
+
Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
25
|
+
const propConfig = config;
|
|
26
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) {
|
|
27
|
+
defaultProps[key] = propConfig.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
console.warn("Error extracting default props:", e);
|
|
33
|
+
}
|
|
34
|
+
function ShaderComponent(props) {
|
|
35
|
+
const [local, otherProps] = splitProps(props, ["children"]);
|
|
36
|
+
const context = useShaderContext();
|
|
37
|
+
const {
|
|
38
|
+
shaderParentId: parentId,
|
|
39
|
+
shaderNodeRegister: parentRegister,
|
|
40
|
+
shaderUniformUpdate: parentUniformUpdate,
|
|
41
|
+
shaderMetadataUpdate: parentMetadataUpdate
|
|
42
|
+
} = context;
|
|
43
|
+
const instanceId = props.id || `${componentDefinition.name.toLowerCase()}_${Math.random().toString(36).substring(7)}`;
|
|
44
|
+
const effectiveProps = createMemo(() => {
|
|
45
|
+
let baseProps = {
|
|
46
|
+
...defaultProps
|
|
47
|
+
};
|
|
48
|
+
for (const [key, value] of Object.entries(otherProps)) {
|
|
49
|
+
if (value !== void 0) {
|
|
50
|
+
baseProps[key] = value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return baseProps;
|
|
54
|
+
});
|
|
55
|
+
const effectiveTransform = createMemo(() => ({
|
|
56
|
+
...DEFAULT_TRANSFORM,
|
|
57
|
+
...props.transform
|
|
58
|
+
}));
|
|
59
|
+
let uniformsMap = null;
|
|
60
|
+
const getUniformsMap = () => {
|
|
61
|
+
if (!uniformsMap) {
|
|
62
|
+
uniformsMap = createUniformsMap(componentDefinition, effectiveProps(), instanceId);
|
|
63
|
+
}
|
|
64
|
+
return uniformsMap;
|
|
65
|
+
};
|
|
66
|
+
const childContextValue = createMemo(() => ({
|
|
67
|
+
...context,
|
|
68
|
+
shaderParentId: instanceId
|
|
69
|
+
}));
|
|
70
|
+
let isRegistered = false;
|
|
71
|
+
onMount(() => {
|
|
72
|
+
const uniforms = getUniformsMap();
|
|
73
|
+
if (!uniforms) return;
|
|
74
|
+
try {
|
|
75
|
+
const metadata = {
|
|
76
|
+
blendMode: props.blendMode || "normal",
|
|
77
|
+
opacity: props.opacity,
|
|
78
|
+
visible: props.visible === false ? false : true,
|
|
79
|
+
id: props.id,
|
|
80
|
+
mask: props.maskSource ? {
|
|
81
|
+
source: props.maskSource,
|
|
82
|
+
type: props.maskType || "alpha"
|
|
83
|
+
} : void 0,
|
|
84
|
+
renderOrder: props.renderOrder || 0,
|
|
85
|
+
transform: effectiveTransform()
|
|
86
|
+
};
|
|
87
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniforms, componentDefinition);
|
|
88
|
+
isRegistered = true;
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error("Error registering shader node:", error);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
onCleanup(() => {
|
|
94
|
+
isRegistered = false;
|
|
95
|
+
parentRegister(instanceId, null, null, null, null);
|
|
96
|
+
});
|
|
97
|
+
createEffect(() => {
|
|
98
|
+
if (!isRegistered) return;
|
|
99
|
+
const uniforms = getUniformsMap();
|
|
100
|
+
if (!uniforms) return;
|
|
101
|
+
try {
|
|
102
|
+
const props_snapshot = effectiveProps();
|
|
103
|
+
Object.entries(uniforms).forEach(([propName, uniformData]) => {
|
|
104
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
105
|
+
const {
|
|
106
|
+
uniform
|
|
107
|
+
} = uniformData;
|
|
108
|
+
if ((uniform == null ? void 0 : uniform.value) !== void 0 && propName in props_snapshot) {
|
|
109
|
+
const newValue = props_snapshot[propName];
|
|
110
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
} catch (error) {
|
|
114
|
+
console.error("Error updating uniforms:", error);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
createEffect(() => {
|
|
118
|
+
if (!isRegistered) return;
|
|
119
|
+
try {
|
|
120
|
+
const metadata = {
|
|
121
|
+
blendMode: props.blendMode || "normal",
|
|
122
|
+
opacity: props.opacity,
|
|
123
|
+
visible: props.visible === false ? false : true,
|
|
124
|
+
id: props.id,
|
|
125
|
+
mask: props.maskSource ? {
|
|
126
|
+
source: props.maskSource,
|
|
127
|
+
type: props.maskType || "alpha"
|
|
128
|
+
} : void 0,
|
|
129
|
+
renderOrder: props.renderOrder || 0,
|
|
130
|
+
transform: effectiveTransform()
|
|
131
|
+
};
|
|
132
|
+
parentMetadataUpdate(instanceId, metadata);
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.error("Error updating metadata:", error);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
return createComponent(ShaderContext.Provider, {
|
|
138
|
+
get value() {
|
|
139
|
+
return childContextValue();
|
|
140
|
+
},
|
|
141
|
+
get children() {
|
|
142
|
+
return local.children;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
ShaderComponent as default
|
|
148
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { BlendMode, TransformConfig } from '../../core';
|
|
3
|
+
import { ComponentProps } from '../../core/shaders/Kaleidoscope';
|
|
4
|
+
export type { ComponentProps };
|
|
5
|
+
/**
|
|
6
|
+
* Base props that all shader components have
|
|
7
|
+
*/
|
|
8
|
+
interface BaseShaderProps {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
blendMode?: BlendMode;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
id?: string;
|
|
14
|
+
maskSource?: string;
|
|
15
|
+
maskType?: string;
|
|
16
|
+
renderOrder?: number;
|
|
17
|
+
transform?: Partial<TransformConfig>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Component-specific props that merge base props with shader-specific props
|
|
21
|
+
* Note: ComponentProps are made optional since they have defaults from the shader definition
|
|
22
|
+
*/
|
|
23
|
+
type ShaderComponentProps = BaseShaderProps & Partial<ComponentProps>;
|
|
24
|
+
/**
|
|
25
|
+
* The main Solid wrapper component for Shader shader nodes
|
|
26
|
+
*/
|
|
27
|
+
export default function ShaderComponent(props: ShaderComponentProps): JSX.Element;
|
|
28
|
+
//# sourceMappingURL=Kaleidoscope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kaleidoscope.d.ts","sourceRoot":"","sources":["../../src/components/Kaleidoscope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAC9F,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGrF,YAAY,EAAE,cAAc,EAAE,CAAC;AAI/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAoCtE;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA4JlE"}
|