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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges } from "./transformations-YbhRK-rd.js";
|
|
3
|
+
import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
|
|
4
|
+
import { convertToTexture, cos, float, length, max, mx_noise_float, screenUV, sin, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
|
+
const componentDefinition = {
|
|
6
|
+
name: "FlowField",
|
|
7
|
+
category: "Distortions",
|
|
8
|
+
description: "Fluid-like distortion with constant smooth motion",
|
|
9
|
+
requiresRTT: true,
|
|
10
|
+
requiresChild: true,
|
|
11
|
+
props: {
|
|
12
|
+
strength: {
|
|
13
|
+
default: .15,
|
|
14
|
+
description: "Intensity of the flow distortion",
|
|
15
|
+
ui: {
|
|
16
|
+
type: "range",
|
|
17
|
+
min: 0,
|
|
18
|
+
max: .5,
|
|
19
|
+
step: .05,
|
|
20
|
+
label: "Strength"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
detail: {
|
|
24
|
+
default: 2,
|
|
25
|
+
description: "Scale of the flow patterns",
|
|
26
|
+
ui: {
|
|
27
|
+
type: "range",
|
|
28
|
+
min: .5,
|
|
29
|
+
max: 5,
|
|
30
|
+
step: .1,
|
|
31
|
+
label: "Detail"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
speed: {
|
|
35
|
+
default: 1,
|
|
36
|
+
description: "Speed of the flow",
|
|
37
|
+
ui: {
|
|
38
|
+
type: "range",
|
|
39
|
+
min: 0,
|
|
40
|
+
max: 5,
|
|
41
|
+
step: .1,
|
|
42
|
+
label: "Speed"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
edges: {
|
|
46
|
+
default: "mirror",
|
|
47
|
+
description: "How to handle edges when distortion pushes content out of bounds",
|
|
48
|
+
transform: transformEdges,
|
|
49
|
+
ui: {
|
|
50
|
+
type: "select",
|
|
51
|
+
options: [
|
|
52
|
+
{
|
|
53
|
+
label: "Stretch",
|
|
54
|
+
value: "stretch"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "Transparent",
|
|
58
|
+
value: "transparent"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: "Mirror",
|
|
62
|
+
value: "mirror"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "Wrap",
|
|
66
|
+
value: "wrap"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
label: "Edges"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
fragmentNode: (params) => {
|
|
74
|
+
const { uniforms, childNode, onCleanup } = params;
|
|
75
|
+
if (!childNode) return vec4(0, 0, 0, 0);
|
|
76
|
+
const childTexture = convertToTexture(childNode);
|
|
77
|
+
onCleanup(() => {
|
|
78
|
+
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
79
|
+
});
|
|
80
|
+
const time$1 = createAnimatedTime(params, uniforms.speed).mul(.1);
|
|
81
|
+
const aspect = viewportSize.x.div(viewportSize.y);
|
|
82
|
+
const aspectCorrectedUV = vec2(screenUV.x.mul(aspect), screenUV.y);
|
|
83
|
+
const scale = uniforms.detail.uniform;
|
|
84
|
+
const strength = uniforms.strength.uniform;
|
|
85
|
+
const drift1 = time$1.mul(.7);
|
|
86
|
+
const angle1 = mx_noise_float(vec3(aspectCorrectedUV.x.mul(scale).add(drift1.mul(.3)), aspectCorrectedUV.y.mul(scale).add(drift1.mul(.5)), drift1.mul(.2))).mul(Math.PI * 2);
|
|
87
|
+
const flow1 = vec2(cos(angle1), sin(angle1));
|
|
88
|
+
const drift2 = time$1.mul(.5);
|
|
89
|
+
const angle2 = mx_noise_float(vec3(aspectCorrectedUV.x.mul(scale.mul(2.3)).add(drift2.mul(-.4)).add(173.5), aspectCorrectedUV.y.mul(scale.mul(2.3)).add(drift2.mul(.3)).add(291.7), drift2.mul(.15).add(50))).mul(Math.PI * 2);
|
|
90
|
+
const flow2 = vec2(cos(angle2), sin(angle2));
|
|
91
|
+
const drift3 = time$1.mul(.3);
|
|
92
|
+
const angle3 = mx_noise_float(vec3(aspectCorrectedUV.x.mul(scale.mul(4.7)).add(drift3.mul(.2)).add(527.3), aspectCorrectedUV.y.mul(scale.mul(4.7)).add(drift3.mul(-.6)).add(839.1), drift3.mul(.1).add(100))).mul(Math.PI * 2);
|
|
93
|
+
const flow3 = vec2(cos(angle3), sin(angle3));
|
|
94
|
+
const combinedFlow = flow1.add(flow2.mul(.5)).add(flow3.mul(.25));
|
|
95
|
+
const flowLength = max(length(combinedFlow), float(.001));
|
|
96
|
+
const normalizedFlow = combinedFlow.div(flowLength);
|
|
97
|
+
const finalFlow = vec2(normalizedFlow.x.mul(strength).div(aspect), normalizedFlow.y.mul(strength));
|
|
98
|
+
const distortedUV = vec2(screenUV.x.add(finalFlow.x), screenUV.y.add(finalFlow.y));
|
|
99
|
+
return applyEdgeHandling(distortedUV, childTexture.sample(distortedUV), childTexture, uniforms.edges.uniform);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var FlowField_default = componentDefinition;
|
|
103
|
+
export { componentDefinition as n, FlowField_default as t };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
|
+
import { atan2, convertToTexture, cos, float, length, mod, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
|
+
const componentDefinition = {
|
|
5
|
+
name: "Kaleidoscope",
|
|
6
|
+
category: "Distortions",
|
|
7
|
+
description: "Create a kaleidoscope effect with radial mirrored segments",
|
|
8
|
+
requiresRTT: true,
|
|
9
|
+
requiresChild: true,
|
|
10
|
+
props: {
|
|
11
|
+
center: {
|
|
12
|
+
default: {
|
|
13
|
+
x: .5,
|
|
14
|
+
y: .5
|
|
15
|
+
},
|
|
16
|
+
transform: transformPosition,
|
|
17
|
+
description: "The center point of the kaleidoscope effect",
|
|
18
|
+
ui: {
|
|
19
|
+
type: "position",
|
|
20
|
+
label: "Center"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
segments: {
|
|
24
|
+
default: 6,
|
|
25
|
+
description: "Number of radial segments in the kaleidoscope",
|
|
26
|
+
ui: {
|
|
27
|
+
type: "range",
|
|
28
|
+
min: 2,
|
|
29
|
+
max: 24,
|
|
30
|
+
step: 1,
|
|
31
|
+
label: "Segments"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
angle: {
|
|
35
|
+
default: 0,
|
|
36
|
+
description: "Rotation offset for the entire kaleidoscope pattern",
|
|
37
|
+
ui: {
|
|
38
|
+
type: "range",
|
|
39
|
+
min: 0,
|
|
40
|
+
max: 360,
|
|
41
|
+
step: 1,
|
|
42
|
+
label: "Angle"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
edges: {
|
|
46
|
+
default: "mirror",
|
|
47
|
+
description: "How to handle edges when distortion pushes content out of bounds",
|
|
48
|
+
transform: transformEdges,
|
|
49
|
+
ui: {
|
|
50
|
+
type: "select",
|
|
51
|
+
options: [
|
|
52
|
+
{
|
|
53
|
+
label: "Stretch",
|
|
54
|
+
value: "stretch"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "Transparent",
|
|
58
|
+
value: "transparent"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: "Mirror",
|
|
62
|
+
value: "mirror"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "Wrap",
|
|
66
|
+
value: "wrap"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
label: "Edges"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
fragmentNode: ({ uniforms, childNode, onCleanup }) => {
|
|
74
|
+
if (!childNode) return vec4(0, 0, 0, 0);
|
|
75
|
+
const childTexture = convertToTexture(childNode);
|
|
76
|
+
onCleanup(() => {
|
|
77
|
+
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
78
|
+
});
|
|
79
|
+
const aspect = viewportSize.x.div(viewportSize.y);
|
|
80
|
+
const aspectCorrectedUV = vec2(screenUV.x.mul(aspect), screenUV.y);
|
|
81
|
+
const centerPos = vec2(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
|
|
82
|
+
const delta = aspectCorrectedUV.sub(centerPos);
|
|
83
|
+
const radius = length(delta);
|
|
84
|
+
const currentAngle = atan2(delta.y, delta.x);
|
|
85
|
+
const rotationRad = uniforms.angle.uniform.mul(Math.PI / 180);
|
|
86
|
+
const rotatedAngle = currentAngle.add(rotationRad);
|
|
87
|
+
const segmentAngle = float(Math.PI * 2).div(uniforms.segments.uniform);
|
|
88
|
+
const wrappedAngle = mod(rotatedAngle, segmentAngle.mul(2));
|
|
89
|
+
const finalAngle = wrappedAngle.greaterThan(segmentAngle).select(segmentAngle.mul(2).sub(wrappedAngle), wrappedAngle);
|
|
90
|
+
const kaleidoscopeDelta = vec2(cos(finalAngle).mul(radius), sin(finalAngle).mul(radius));
|
|
91
|
+
const kaleidoscopePos = centerPos.add(kaleidoscopeDelta);
|
|
92
|
+
const finalUV = vec2(kaleidoscopePos.x.div(aspect), kaleidoscopePos.y);
|
|
93
|
+
return applyEdgeHandling(finalUV, childTexture.sample(finalUV), childTexture, uniforms.edges.uniform);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var Kaleidoscope_default = componentDefinition;
|
|
97
|
+
export { componentDefinition as n, Kaleidoscope_default as t };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
|
+
import { convertToTexture, cos, mix, screenUV, sin, step, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
|
+
const componentDefinition = {
|
|
5
|
+
name: "Mirror",
|
|
6
|
+
category: "Distortions",
|
|
7
|
+
description: "Mirror content across a line defined by center point and angle",
|
|
8
|
+
requiresRTT: true,
|
|
9
|
+
requiresChild: true,
|
|
10
|
+
props: {
|
|
11
|
+
center: {
|
|
12
|
+
default: {
|
|
13
|
+
x: .5,
|
|
14
|
+
y: .5
|
|
15
|
+
},
|
|
16
|
+
transform: transformPosition,
|
|
17
|
+
description: "The point the mirror line passes through",
|
|
18
|
+
ui: {
|
|
19
|
+
type: "position",
|
|
20
|
+
label: "Center"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
angle: {
|
|
24
|
+
default: 0,
|
|
25
|
+
description: "The angle of the mirror line in degrees",
|
|
26
|
+
ui: {
|
|
27
|
+
type: "range",
|
|
28
|
+
min: 0,
|
|
29
|
+
max: 360,
|
|
30
|
+
step: 1,
|
|
31
|
+
label: "Angle"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
edges: {
|
|
35
|
+
default: "mirror",
|
|
36
|
+
description: "How to handle edges when distortion pushes content out of bounds",
|
|
37
|
+
transform: transformEdges,
|
|
38
|
+
ui: {
|
|
39
|
+
type: "select",
|
|
40
|
+
options: [
|
|
41
|
+
{
|
|
42
|
+
label: "Stretch",
|
|
43
|
+
value: "stretch"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Transparent",
|
|
47
|
+
value: "transparent"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "Mirror",
|
|
51
|
+
value: "mirror"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "Wrap",
|
|
55
|
+
value: "wrap"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
label: "Edges"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
fragmentNode: ({ uniforms, childNode, onCleanup }) => {
|
|
63
|
+
if (!childNode) return vec4(0, 0, 0, 0);
|
|
64
|
+
const childTexture = convertToTexture(childNode);
|
|
65
|
+
onCleanup(() => {
|
|
66
|
+
if (childTexture?.renderTarget?.dispose) childTexture.renderTarget.dispose();
|
|
67
|
+
});
|
|
68
|
+
const aspect = viewportSize.x.div(viewportSize.y);
|
|
69
|
+
const aspectCorrectedUV = vec2(screenUV.x.mul(aspect), screenUV.y);
|
|
70
|
+
const centerPos = vec2(uniforms.center.uniform.x.mul(aspect), uniforms.center.uniform.y.oneMinus());
|
|
71
|
+
const delta = aspectCorrectedUV.sub(centerPos);
|
|
72
|
+
const angleRad = uniforms.angle.uniform.mul(Math.PI / 180);
|
|
73
|
+
const lineDirection = vec2(cos(angleRad), sin(angleRad));
|
|
74
|
+
const lineNormal = vec2(lineDirection.y.negate(), lineDirection.x);
|
|
75
|
+
const signedDistance = delta.dot(lineNormal);
|
|
76
|
+
const reflectedDelta = delta.sub(lineNormal.mul(signedDistance.mul(2)));
|
|
77
|
+
const mirroredUV = centerPos.add(reflectedDelta);
|
|
78
|
+
const finalMirroredUV = vec2(mirroredUV.x.div(aspect), mirroredUV.y);
|
|
79
|
+
const shouldMirror = step(0, signedDistance);
|
|
80
|
+
return mix(childTexture.sample(screenUV), applyEdgeHandling(finalMirroredUV, childTexture.sample(finalMirroredUV), childTexture, uniforms.edges.uniform), shouldMirror);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var Mirror_default = componentDefinition;
|
|
84
|
+
export { componentDefinition as n, Mirror_default as t };
|
package/dist/core/registry.js
CHANGED
|
@@ -22,48 +22,51 @@ import { n as componentDefinition$16 } from "./DotGrid-BZVfqUZO.js";
|
|
|
22
22
|
import { n as componentDefinition$17 } from "./Duotone-sjvdZBlx.js";
|
|
23
23
|
import { n as componentDefinition$18 } from "./FilmGrain-Cr3qP38A.js";
|
|
24
24
|
import { n as componentDefinition$19 } from "./FloatingParticles-CPsVFZJl.js";
|
|
25
|
-
import { n as componentDefinition$20 } from "./
|
|
26
|
-
import { n as componentDefinition$21 } from "./
|
|
27
|
-
import { n as componentDefinition$22 } from "./
|
|
28
|
-
import { n as componentDefinition$23 } from "./
|
|
29
|
-
import { n as componentDefinition$24 } from "./
|
|
30
|
-
import { n as componentDefinition$25 } from "./
|
|
31
|
-
import { n as componentDefinition$26 } from "./
|
|
32
|
-
import { n as componentDefinition$27 } from "./
|
|
33
|
-
import { n as componentDefinition$28 } from "./
|
|
34
|
-
import { n as componentDefinition$29 } from "./
|
|
35
|
-
import { n as componentDefinition$30 } from "./
|
|
36
|
-
import { n as componentDefinition$31 } from "./
|
|
37
|
-
import { n as componentDefinition$32 } from "./
|
|
38
|
-
import { n as componentDefinition$33 } from "./
|
|
39
|
-
import { n as componentDefinition$34 } from "./
|
|
40
|
-
import { n as componentDefinition$35 } from "./
|
|
41
|
-
import { n as componentDefinition$36 } from "./
|
|
42
|
-
import { n as componentDefinition$37 } from "./
|
|
43
|
-
import { n as componentDefinition$38 } from "./
|
|
44
|
-
import { n as componentDefinition$39 } from "./
|
|
45
|
-
import { n as componentDefinition$40 } from "./
|
|
46
|
-
import { n as componentDefinition$41 } from "./
|
|
47
|
-
import { n as componentDefinition$42 } from "./
|
|
48
|
-
import { n as componentDefinition$43 } from "./
|
|
49
|
-
import { n as componentDefinition$44 } from "./
|
|
50
|
-
import { n as componentDefinition$45 } from "./
|
|
51
|
-
import { n as componentDefinition$46 } from "./
|
|
52
|
-
import { n as componentDefinition$47 } from "./
|
|
53
|
-
import { n as componentDefinition$48 } from "./
|
|
54
|
-
import { n as componentDefinition$49 } from "./
|
|
55
|
-
import { n as componentDefinition$50 } from "./
|
|
56
|
-
import { n as componentDefinition$51 } from "./
|
|
57
|
-
import { n as componentDefinition$52 } from "./
|
|
58
|
-
import { n as componentDefinition$53 } from "./
|
|
59
|
-
import { n as componentDefinition$54 } from "./
|
|
60
|
-
import { n as componentDefinition$55 } from "./
|
|
61
|
-
import { n as componentDefinition$56 } from "./
|
|
62
|
-
import { n as componentDefinition$57 } from "./
|
|
63
|
-
import { n as componentDefinition$58 } from "./
|
|
64
|
-
import { n as componentDefinition$59 } from "./
|
|
65
|
-
import { n as componentDefinition$60 } from "./
|
|
66
|
-
import { n as componentDefinition$61 } from "./
|
|
25
|
+
import { n as componentDefinition$20 } from "./FlowField-BJFGOUZL.js";
|
|
26
|
+
import { n as componentDefinition$21 } from "./GlassTiles-DzYvo92U.js";
|
|
27
|
+
import { n as componentDefinition$22 } from "./Glow-C4JrnNxe.js";
|
|
28
|
+
import { n as componentDefinition$23 } from "./Godrays-CPWOcLmc.js";
|
|
29
|
+
import { n as componentDefinition$24 } from "./Grayscale-BFS-Abdh.js";
|
|
30
|
+
import { n as componentDefinition$25 } from "./Grid-CsIIl3LT.js";
|
|
31
|
+
import { n as componentDefinition$26 } from "./GridDistortion-Cq3hRKXK.js";
|
|
32
|
+
import { n as componentDefinition$27 } from "./Group-DHokCeZ1.js";
|
|
33
|
+
import { n as componentDefinition$28 } from "./Halftone-BQsMiTyE.js";
|
|
34
|
+
import { n as componentDefinition$29 } from "./HueShift-BTjEGl3Z.js";
|
|
35
|
+
import { n as componentDefinition$30 } from "./ImageTexture-CY8Q8h_o.js";
|
|
36
|
+
import { n as componentDefinition$31 } from "./Invert-B8vSeK8d.js";
|
|
37
|
+
import { n as componentDefinition$32 } from "./Kaleidoscope-Dr-ja0XH.js";
|
|
38
|
+
import { n as componentDefinition$33 } from "./LinearBlur-DgT4B0nH.js";
|
|
39
|
+
import { n as componentDefinition$34 } from "./LinearGradient-DTifAwSC.js";
|
|
40
|
+
import { n as componentDefinition$35 } from "./Liquify-_eLJRjd7.js";
|
|
41
|
+
import { n as componentDefinition$36 } from "./Mirror-CnCw4TpZ.js";
|
|
42
|
+
import { n as componentDefinition$37 } from "./Perspective-BpgcHA7E.js";
|
|
43
|
+
import { n as componentDefinition$38 } from "./Pixelate-Bt2jxIDd.js";
|
|
44
|
+
import { n as componentDefinition$39 } from "./PolarCoordinates-BJ8-cfC7.js";
|
|
45
|
+
import { n as componentDefinition$40 } from "./Posterize-Bs-iNEVB.js";
|
|
46
|
+
import { n as componentDefinition$41 } from "./ProgressiveBlur-DELpd9wJ.js";
|
|
47
|
+
import { n as componentDefinition$42 } from "./RadialGradient-DQ4JGS5G.js";
|
|
48
|
+
import { n as componentDefinition$43 } from "./RectangularCoordinates-DXSP_gdW.js";
|
|
49
|
+
import { n as componentDefinition$44 } from "./Ripples-DwDKIvtQ.js";
|
|
50
|
+
import { n as componentDefinition$45 } from "./Saturation-ekyl1D9y.js";
|
|
51
|
+
import { n as componentDefinition$46 } from "./Sharpness-DlWZ-yPe.js";
|
|
52
|
+
import { n as componentDefinition$47 } from "./Shatter-BeD72o80.js";
|
|
53
|
+
import { n as componentDefinition$48 } from "./SimplexNoise-DIo9v2-R.js";
|
|
54
|
+
import { n as componentDefinition$49 } from "./SineWave-DFNnXFYQ.js";
|
|
55
|
+
import { n as componentDefinition$50 } from "./SolidColor-B4eYGf_i.js";
|
|
56
|
+
import { n as componentDefinition$51 } from "./Spherize-BIVrRcZG.js";
|
|
57
|
+
import { n as componentDefinition$52 } from "./Spiral-CqjRxq1I.js";
|
|
58
|
+
import { n as componentDefinition$53 } from "./Strands-B-a2SQB2.js";
|
|
59
|
+
import { n as componentDefinition$54 } from "./Stretch-CZv3u-3X.js";
|
|
60
|
+
import { n as componentDefinition$55 } from "./Stripes-CXUFg1Gt.js";
|
|
61
|
+
import { n as componentDefinition$56 } from "./Swirl-BcEmYjJs.js";
|
|
62
|
+
import { n as componentDefinition$57 } from "./TiltShift-679S-uVs.js";
|
|
63
|
+
import { n as componentDefinition$58 } from "./Tint-DS7IJWfS.js";
|
|
64
|
+
import { n as componentDefinition$59 } from "./Tritone-m_0hwkvN.js";
|
|
65
|
+
import { n as componentDefinition$60 } from "./Twirl-DcuGsZAB.js";
|
|
66
|
+
import { n as componentDefinition$61 } from "./Vibrance-BafFCMLv.js";
|
|
67
|
+
import { n as componentDefinition$62 } from "./WaveDistortion-CQkMSDMg.js";
|
|
68
|
+
import { n as componentDefinition$63 } from "./WebcamTexture-C5oIVQlF.js";
|
|
69
|
+
import { n as componentDefinition$64 } from "./ZoomBlur-pFDohu2G.js";
|
|
67
70
|
var createShaderRegistry = () => {
|
|
68
71
|
const registry = {};
|
|
69
72
|
const shaderDefinitions = {
|
|
@@ -87,48 +90,51 @@ var createShaderRegistry = () => {
|
|
|
87
90
|
Duotone: componentDefinition$17,
|
|
88
91
|
FilmGrain: componentDefinition$18,
|
|
89
92
|
FloatingParticles: componentDefinition$19,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
93
|
+
FlowField: componentDefinition$20,
|
|
94
|
+
GlassTiles: componentDefinition$21,
|
|
95
|
+
Glow: componentDefinition$22,
|
|
96
|
+
Godrays: componentDefinition$23,
|
|
97
|
+
Grayscale: componentDefinition$24,
|
|
98
|
+
Grid: componentDefinition$25,
|
|
99
|
+
GridDistortion: componentDefinition$26,
|
|
100
|
+
Group: componentDefinition$27,
|
|
101
|
+
Halftone: componentDefinition$28,
|
|
102
|
+
HueShift: componentDefinition$29,
|
|
103
|
+
ImageTexture: componentDefinition$30,
|
|
104
|
+
Invert: componentDefinition$31,
|
|
105
|
+
Kaleidoscope: componentDefinition$32,
|
|
106
|
+
LinearBlur: componentDefinition$33,
|
|
107
|
+
LinearGradient: componentDefinition$34,
|
|
108
|
+
Liquify: componentDefinition$35,
|
|
109
|
+
Mirror: componentDefinition$36,
|
|
110
|
+
Perspective: componentDefinition$37,
|
|
111
|
+
Pixelate: componentDefinition$38,
|
|
112
|
+
PolarCoordinates: componentDefinition$39,
|
|
113
|
+
Posterize: componentDefinition$40,
|
|
114
|
+
ProgressiveBlur: componentDefinition$41,
|
|
115
|
+
RadialGradient: componentDefinition$42,
|
|
116
|
+
RectangularCoordinates: componentDefinition$43,
|
|
117
|
+
Ripples: componentDefinition$44,
|
|
118
|
+
Saturation: componentDefinition$45,
|
|
119
|
+
Sharpness: componentDefinition$46,
|
|
120
|
+
Shatter: componentDefinition$47,
|
|
121
|
+
SimplexNoise: componentDefinition$48,
|
|
122
|
+
SineWave: componentDefinition$49,
|
|
123
|
+
SolidColor: componentDefinition$50,
|
|
124
|
+
Spherize: componentDefinition$51,
|
|
125
|
+
Spiral: componentDefinition$52,
|
|
126
|
+
Strands: componentDefinition$53,
|
|
127
|
+
Stretch: componentDefinition$54,
|
|
128
|
+
Stripes: componentDefinition$55,
|
|
129
|
+
Swirl: componentDefinition$56,
|
|
130
|
+
TiltShift: componentDefinition$57,
|
|
131
|
+
Tint: componentDefinition$58,
|
|
132
|
+
Tritone: componentDefinition$59,
|
|
133
|
+
Twirl: componentDefinition$60,
|
|
134
|
+
Vibrance: componentDefinition$61,
|
|
135
|
+
WaveDistortion: componentDefinition$62,
|
|
136
|
+
WebcamTexture: componentDefinition$63,
|
|
137
|
+
ZoomBlur: componentDefinition$64
|
|
132
138
|
};
|
|
133
139
|
Object.entries(shaderDefinitions).forEach(([fileName, def]) => {
|
|
134
140
|
const propsMetadata = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shaderRegistry.d.ts","sourceRoot":"","sources":["../src/shaderRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shaderRegistry.d.ts","sourceRoot":"","sources":["../src/shaderRegistry.ts"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAA;IACpC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE;QAC5B,EAAE,CAAC,EAAE,GAAG,CAAA;QACR,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAC,CAAA;CACH;AAqGD,eAAO,MAAM,cAAc,qCAAyB,CAAA;AAGpD,wBAAgB,aAAa,IAAI,mBAAmB,EAAE,CAErD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE7E;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAE5E;AAED,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAG9C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComponentDefinition } from '../../types';
|
|
2
|
+
import { transformEdges } from '../../utilities/transformations';
|
|
3
|
+
|
|
4
|
+
export interface ComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Intensity of the flow distortion
|
|
7
|
+
*
|
|
8
|
+
* Accepts a number between 0 and 0.5.
|
|
9
|
+
* @default 0.15
|
|
10
|
+
*/
|
|
11
|
+
strength: number;
|
|
12
|
+
/**
|
|
13
|
+
* Scale of the flow patterns
|
|
14
|
+
*
|
|
15
|
+
* Accepts a number between 0.5 and 5.
|
|
16
|
+
* @default 2
|
|
17
|
+
*/
|
|
18
|
+
detail: number;
|
|
19
|
+
/**
|
|
20
|
+
* Speed of the flow
|
|
21
|
+
*
|
|
22
|
+
* Accepts a number between 0 and 5.
|
|
23
|
+
* @default 1
|
|
24
|
+
*/
|
|
25
|
+
speed: number;
|
|
26
|
+
/**
|
|
27
|
+
* How to handle edges when distortion pushes content out of bounds
|
|
28
|
+
*
|
|
29
|
+
* Accepts one of: `"stretch"`, `"transparent"`, `"mirror"`, `"wrap"`.
|
|
30
|
+
* @default "mirror"
|
|
31
|
+
*/
|
|
32
|
+
edges: Parameters<typeof transformEdges>[0];
|
|
33
|
+
}
|
|
34
|
+
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
35
|
+
export default componentDefinition;
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/FlowField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAIlE,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA6InE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "../../edges-Bd7GP4s2.js";
|
|
2
|
+
import "../../transformations-YbhRK-rd.js";
|
|
3
|
+
import "../../time-BZqyVJXt.js";
|
|
4
|
+
import { n as componentDefinition, t as FlowField_default } from "../../FlowField-BJFGOUZL.js";
|
|
5
|
+
export { componentDefinition, FlowField_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as GlassTiles_default } from "../../GlassTiles-
|
|
1
|
+
import { n as componentDefinition, t as GlassTiles_default } from "../../GlassTiles-DzYvo92U.js";
|
|
2
2
|
export { componentDefinition, GlassTiles_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Glow_default } from "../../Glow-
|
|
1
|
+
import { n as componentDefinition, t as Glow_default } from "../../Glow-C4JrnNxe.js";
|
|
2
2
|
export { componentDefinition, Glow_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import { n as componentDefinition, t as Godrays_default } from "../../Godrays-
|
|
3
|
+
import { n as componentDefinition, t as Godrays_default } from "../../Godrays-CPWOcLmc.js";
|
|
4
4
|
export { componentDefinition, Godrays_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Grayscale_default } from "../../Grayscale-
|
|
1
|
+
import { n as componentDefinition, t as Grayscale_default } from "../../Grayscale-BFS-Abdh.js";
|
|
2
2
|
export { componentDefinition, Grayscale_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as Grid_default } from "../../Grid-
|
|
2
|
+
import { n as componentDefinition, t as Grid_default } from "../../Grid-CsIIl3LT.js";
|
|
3
3
|
export { componentDefinition, Grid_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as GridDistortion_default } from "../../GridDistortion-
|
|
3
|
+
import { n as componentDefinition, t as GridDistortion_default } from "../../GridDistortion-Cq3hRKXK.js";
|
|
4
4
|
export { componentDefinition, GridDistortion_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Group_default } from "../../Group-
|
|
1
|
+
import { n as componentDefinition, t as Group_default } from "../../Group-DHokCeZ1.js";
|
|
2
2
|
export { componentDefinition, Group_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as Halftone_default } from "../../Halftone-
|
|
2
|
+
import { n as componentDefinition, t as Halftone_default } from "../../Halftone-BQsMiTyE.js";
|
|
3
3
|
export { componentDefinition, Halftone_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as HueShift_default } from "../../HueShift-
|
|
1
|
+
import { n as componentDefinition, t as HueShift_default } from "../../HueShift-BTjEGl3Z.js";
|
|
2
2
|
export { componentDefinition, HueShift_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as ImageTexture_default } from "../../ImageTexture-
|
|
1
|
+
import { n as componentDefinition, t as ImageTexture_default } from "../../ImageTexture-CY8Q8h_o.js";
|
|
2
2
|
export { componentDefinition, ImageTexture_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Invert_default } from "../../Invert-
|
|
1
|
+
import { n as componentDefinition, t as Invert_default } from "../../Invert-B8vSeK8d.js";
|
|
2
2
|
export { componentDefinition, Invert_default as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComponentDefinition } from '../../types';
|
|
2
|
+
import { transformPosition, transformEdges } from '../../utilities/transformations';
|
|
3
|
+
|
|
4
|
+
export interface ComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* The center point of the kaleidoscope effect
|
|
7
|
+
*
|
|
8
|
+
* Accepts `{ x, y }` objects with values from 0 to 1, or CSS positions like `top center`.
|
|
9
|
+
* @default {"x":0.5,"y":0.5}
|
|
10
|
+
*/
|
|
11
|
+
center: Parameters<typeof transformPosition>[0];
|
|
12
|
+
/**
|
|
13
|
+
* Number of radial segments in the kaleidoscope
|
|
14
|
+
*
|
|
15
|
+
* Accepts a number between 2 and 24.
|
|
16
|
+
* @default 6
|
|
17
|
+
*/
|
|
18
|
+
segments: number;
|
|
19
|
+
/**
|
|
20
|
+
* Rotation offset for the entire kaleidoscope pattern
|
|
21
|
+
*
|
|
22
|
+
* Accepts a number between 0 and 360.
|
|
23
|
+
* @default 0
|
|
24
|
+
*/
|
|
25
|
+
angle: number;
|
|
26
|
+
/**
|
|
27
|
+
* How to handle edges when distortion pushes content out of bounds
|
|
28
|
+
*
|
|
29
|
+
* Accepts one of: `"stretch"`, `"transparent"`, `"mirror"`, `"wrap"`.
|
|
30
|
+
* @default "mirror"
|
|
31
|
+
*/
|
|
32
|
+
edges: Parameters<typeof transformEdges>[0];
|
|
33
|
+
}
|
|
34
|
+
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
35
|
+
export default componentDefinition;
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Kaleidoscope/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAGrF,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CAwGnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as LinearBlur_default } from "../../LinearBlur-
|
|
2
|
+
import { n as componentDefinition, t as LinearBlur_default } from "../../LinearBlur-DgT4B0nH.js";
|
|
3
3
|
export { componentDefinition, LinearBlur_default as default };
|