shaders 2.2.0 → 2.2.1
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/{AngularBlur-BJi-Edw-.js → AngularBlur-BZENxuhv.js} +4 -4
- package/dist/core/{Ascii-B1KHvM1u.js → Ascii-joVW9dAD.js} +11 -11
- package/dist/core/{Blob-CBASKMfO.js → Blob-Ds3jasiC.js} +15 -14
- package/dist/core/{Blur-bz9Ubr0x.js → Blur-sKjcr9_K.js} +1 -1
- package/dist/core/Bulge-CdcB9we6.js +103 -0
- package/dist/core/{CRTScreen-BnfROw0f.js → CRTScreen-BWDSeX_0.js} +6 -6
- package/dist/core/{ChannelBlur-DhWT-55L.js → ChannelBlur-i9M5gbkh.js} +6 -6
- package/dist/core/{Checkerboard-CgWGd9t7.js → Checkerboard-D9-UAs26.js} +17 -16
- package/dist/core/{ChromaFlow-DOVrymVB.js → ChromaFlow-DZAJwEBw.js} +6 -6
- package/dist/core/{ChromaticAberration-CyTSXY7j.js → ChromaticAberration-DLYIcjJx.js} +2 -2
- package/dist/core/{Circle-0WHV1HrM.js → Circle-Ca-LtXkF.js} +13 -12
- package/dist/core/{CursorTrail-3zQ5rtjh.js → CursorTrail-B_VZJBOK.js} +11 -11
- package/dist/core/{DiffuseBlur-DLIKRsnf.js → DiffuseBlur-COpm1qrw.js} +5 -5
- package/dist/core/{Dither-Cnbknfji.js → Dither-MK-9r3tw.js} +2 -2
- package/dist/core/{DotGrid-BkItF2C8.js → DotGrid-DP__DqQj.js} +12 -11
- package/dist/core/{Duotone-BI4tJI3k.js → Duotone-CmkF6eDj.js} +3 -3
- package/dist/core/FilmGrain-ByNyK2gs.js +28 -0
- package/dist/core/FloatingParticles-CxcXDtZg.js +160 -0
- package/dist/core/GlassTiles-CxUl9MxF.js +52 -0
- package/dist/core/{Glow-BD0t9E1L.js → Glow-Cz3ImaBH.js} +5 -5
- package/dist/core/{Godrays-CPIAbymT.js → Godrays-BHfh6URI.js} +18 -17
- package/dist/core/{Grayscale-BtOqK43k.js → Grayscale-FPSUcFGC.js} +1 -1
- package/dist/core/{Grid-Ro0Yi5WY.js → Grid-BvM0M3Hl.js} +12 -11
- package/dist/core/GridDistortion-yjmNv0Q3.js +147 -0
- package/dist/core/{Group-DTXP-whY.js → Group-jZZimqG1.js} +1 -1
- package/dist/core/{Halftone-B_MuXCD8.js → Halftone-DWIVrS2s.js} +4 -4
- package/dist/core/{HueShift-CKG9M-d2.js → HueShift-CBupF7d4.js} +1 -1
- package/dist/core/{ImageTexture-B6zFP2fB.js → ImageTexture-GrTz4Fx7.js} +20 -19
- package/dist/core/{Invert-Cd7GK1vs.js → Invert-CCQ1H_Qr.js} +1 -1
- package/dist/core/{LinearBlur-JFLMQBY4.js → LinearBlur-DHBRP6Yh.js} +4 -4
- package/dist/core/{LinearGradient-Ztg5Lzwj.js → LinearGradient-B4C3CKhf.js} +16 -15
- package/dist/core/Liquify-DNHtcXxv.js +139 -0
- package/dist/core/Pixelate-BKooNVcb.js +38 -0
- package/dist/core/{PolarCoordinates-qzU8gNXR.js → PolarCoordinates-DKhEbQhq.js} +20 -16
- package/dist/core/{Posterize-BkBU8tnN.js → Posterize-D81ZG2A9.js} +1 -1
- package/dist/core/{ProgressiveBlur-HAQf188T.js → ProgressiveBlur-CPdReTnY.js} +7 -7
- package/dist/core/{RadialGradient-DISqJuTZ.js → RadialGradient-XmwfZ91d.js} +15 -14
- package/dist/core/RectangularCoordinates-DWY7ptY1.js +92 -0
- package/dist/core/{Ripples-CX8Qgnog.js → Ripples-CndvRX-N.js} +13 -12
- package/dist/core/{Saturation-DMxPYmIU.js → Saturation-C6u9sNkr.js} +1 -1
- package/dist/core/{SimplexNoise-B5ygfckG.js → SimplexNoise-BH0ZZzP4.js} +12 -11
- package/dist/core/{SineWave-KPFlP3Wk.js → SineWave-DBH8MraQ.js} +13 -12
- package/dist/core/{SolidColor-B8oxlGge.js → SolidColor-DR665qss.js} +6 -5
- package/dist/core/{Spiral-CX22hUJ3.js → Spiral--7KUy0u3.js} +15 -14
- package/dist/core/{Strands-Bv7RvyRC.js → Strands-Bi1Is8_o.js} +19 -18
- package/dist/core/{Swirl-CIXreSgZ.js → Swirl-DuYM23jG.js} +14 -13
- package/dist/core/{TiltShift-J0UUcoh-.js → TiltShift-BUvZWBsh.js} +11 -11
- package/dist/core/{Tritone-E9eHvjJV.js → Tritone-CKifp6Ob.js} +3 -3
- package/dist/core/{Twirl-ClhPpapm.js → Twirl-Ztlb9x_h.js} +21 -17
- package/dist/core/{Vibrance-CqnE9Zco.js → Vibrance-B7EsDw6e.js} +1 -1
- package/dist/core/{WaveDistortion-gecgVpvO.js → WaveDistortion-HCnk54tD.js} +20 -17
- package/dist/core/{ZoomBlur-CaGbSDG3.js → ZoomBlur-Ck6M9A2W.js} +2 -2
- package/dist/core/{colorMixing-C_ESXyqX.js → colorMixing-DPZ-Td4U.js} +3 -3
- package/dist/core/edges-B-tVdqcI.js +16 -0
- package/dist/core/index.js +1315 -945
- package/dist/core/performanceTracker.d.ts +2 -0
- package/dist/core/performanceTracker.d.ts.map +1 -1
- package/dist/core/renderer.d.ts +12 -0
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +3 -3
- package/dist/core/shaders/Ascii/index.js +2 -2
- package/dist/core/shaders/Blob/index.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +5 -5
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +4 -4
- package/dist/core/shaders/CRTScreen/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +4 -4
- package/dist/core/shaders/ChromaFlow/index.js +3 -3
- package/dist/core/shaders/ChromaticAberration/index.js +3 -3
- package/dist/core/shaders/Circle/index.d.ts.map +1 -1
- package/dist/core/shaders/Circle/index.js +3 -3
- package/dist/core/shaders/CursorTrail/index.js +4 -4
- package/dist/core/shaders/DiffuseBlur/index.js +2 -2
- package/dist/core/shaders/Dither/index.js +3 -3
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +3 -3
- package/dist/core/shaders/Duotone/index.js +4 -4
- package/dist/core/shaders/FilmGrain/index.d.ts.map +1 -1
- package/dist/core/shaders/FilmGrain/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +3 -3
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +2 -2
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +3 -3
- package/dist/core/shaders/Grayscale/index.js +2 -2
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +3 -3
- package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/GridDistortion/index.js +4 -4
- package/dist/core/shaders/Group/index.js +2 -2
- package/dist/core/shaders/Halftone/index.js +3 -3
- package/dist/core/shaders/HueShift/index.js +2 -2
- package/dist/core/shaders/ImageTexture/index.d.ts.map +1 -1
- package/dist/core/shaders/ImageTexture/index.js +2 -2
- package/dist/core/shaders/Invert/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.js +3 -3
- package/dist/core/shaders/LinearGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearGradient/index.js +4 -4
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +4 -4
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +4 -4
- package/dist/core/shaders/Posterize/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -3
- package/dist/core/shaders/RadialGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/RadialGradient/index.js +4 -4
- package/dist/core/shaders/RectangularCoordinates/index.d.ts +38 -0
- package/dist/core/shaders/RectangularCoordinates/index.d.ts.map +1 -0
- package/dist/core/shaders/RectangularCoordinates/index.js +8 -0
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +4 -4
- package/dist/core/shaders/Saturation/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +4 -4
- package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
- package/dist/core/shaders/SineWave/index.js +3 -3
- package/dist/core/shaders/SolidColor/index.d.ts.map +1 -1
- package/dist/core/shaders/SolidColor/index.js +3 -3
- package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
- package/dist/core/shaders/Spiral/index.js +4 -4
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +4 -4
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +5 -5
- package/dist/core/shaders/TiltShift/index.js +3 -3
- package/dist/core/shaders/Tritone/index.js +4 -4
- package/dist/core/shaders/Twirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Twirl/index.js +4 -4
- package/dist/core/shaders/Vibrance/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +6 -7
- package/dist/core/shaders/ZoomBlur/index.js +3 -3
- package/dist/core/telemetry/collector.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +19 -19
- package/dist/core/{three.tsl-CgyjOhns.js → three.tsl-BqgDcRt9.js} +21 -20
- package/dist/core/{time-myrFQH-u.js → time-5uQ65blS.js} +1 -1
- package/dist/core/{transformations-Bs66Qh16.js → transformations-DBjTkQ5b.js} +1 -1
- package/dist/core/types.d.ts +81 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utilities/edges.d.ts +13 -2
- package/dist/core/utilities/edges.d.ts.map +1 -1
- package/dist/core/utilities/uvTransform.d.ts +20 -0
- package/dist/core/utilities/uvTransform.d.ts.map +1 -1
- package/dist/react/components/RectangularCoordinates.d.ts +31 -0
- package/dist/react/components/RectangularCoordinates.d.ts.map +1 -0
- package/dist/react/index.cjs +233 -233
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +16300 -15647
- package/dist/react/utils/generatePresetCode.cjs +2 -2
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +12 -0
- package/dist/registry.js +151 -0
- package/dist/svelte/components/RectangularCoordinates.svelte.d.ts +19 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +15134 -14523
- package/dist/svelte/utils/generatePresetCode.js +12 -0
- package/dist/vue/components/RectangularCoordinates.vue.d.ts +57 -0
- package/dist/vue/components/RectangularCoordinates.vue.d.ts.map +1 -0
- package/dist/vue/{generatePresetCode-B6Ks_W3s.js → generatePresetCode-T78GxN5X.js} +12 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +15219 -14598
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +6 -1
- package/dist/core/Bulge-Ceythf-i.js +0 -99
- package/dist/core/FilmGrain-BAZORehh.js +0 -27
- package/dist/core/FloatingParticles-7wvOBUbD.js +0 -158
- package/dist/core/GlassTiles-C0y_PWTa.js +0 -48
- package/dist/core/GridDistortion-CuxRQdzs.js +0 -137
- package/dist/core/Liquify-rmJGJAdt.js +0 -126
- package/dist/core/Pixelate-BIANS3t9.js +0 -34
- package/dist/core/edges-Cj8yVYgz.js +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AA+iBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,UAsD/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaders",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Declarative shader components for Vue, React, and Svelte",
|
|
5
5
|
"author": "Simon Le Marchant<https://github.com/marchantweb>",
|
|
6
6
|
"homepage": "https://shaders.com/",
|
|
@@ -314,6 +314,11 @@
|
|
|
314
314
|
"types": "./dist/core/shaders/ZoomBlur/index.d.ts",
|
|
315
315
|
"import": "./dist/core/shaders/ZoomBlur/index.js",
|
|
316
316
|
"require": "./dist/core/shaders/ZoomBlur/index.js"
|
|
317
|
+
},
|
|
318
|
+
"./core/RectangularCoordinates": {
|
|
319
|
+
"types": "./dist/core/shaders/RectangularCoordinates/index.d.ts",
|
|
320
|
+
"import": "./dist/core/shaders/RectangularCoordinates/index.js",
|
|
321
|
+
"require": "./dist/core/shaders/RectangularCoordinates/index.js"
|
|
317
322
|
}
|
|
318
323
|
},
|
|
319
324
|
"files": [
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { O as U, d as t, h as V, m as E } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
import { t as M } from "./edges-Cj8yVYgz.js";
|
|
3
|
-
import { a as R, o as z } from "./transformations-Bs66Qh16.js";
|
|
4
|
-
E();
|
|
5
|
-
const A = {
|
|
6
|
-
name: "Bulge",
|
|
7
|
-
category: "Distortions",
|
|
8
|
-
requiresRTT: !0,
|
|
9
|
-
requiresChild: !0,
|
|
10
|
-
props: {
|
|
11
|
-
center: {
|
|
12
|
-
default: {
|
|
13
|
-
x: 0.5,
|
|
14
|
-
y: 0.5
|
|
15
|
-
},
|
|
16
|
-
transform: z,
|
|
17
|
-
description: "The center point of the bulge effect",
|
|
18
|
-
ui: {
|
|
19
|
-
type: "position",
|
|
20
|
-
label: "Center"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
strength: {
|
|
24
|
-
default: 1,
|
|
25
|
-
description: "The intensity of the bulge effect (positive = bulge out, negative = pinch in)",
|
|
26
|
-
ui: {
|
|
27
|
-
type: "range",
|
|
28
|
-
min: -1,
|
|
29
|
-
max: 1,
|
|
30
|
-
step: 0.01,
|
|
31
|
-
label: "Strength"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
radius: {
|
|
35
|
-
default: 1,
|
|
36
|
-
description: "The radius of the bulge effect area",
|
|
37
|
-
ui: {
|
|
38
|
-
type: "range",
|
|
39
|
-
min: 0,
|
|
40
|
-
max: 5,
|
|
41
|
-
step: 0.01,
|
|
42
|
-
label: "Radius"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
falloff: {
|
|
46
|
-
default: 0.5,
|
|
47
|
-
description: "Controls the smoothness of the transition (0 = hard edge, 1 = very smooth)",
|
|
48
|
-
ui: {
|
|
49
|
-
type: "range",
|
|
50
|
-
min: 0,
|
|
51
|
-
max: 1,
|
|
52
|
-
step: 0.01,
|
|
53
|
-
label: "Falloff"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
edges: {
|
|
57
|
-
default: "stretch",
|
|
58
|
-
description: "How to handle edges when distortion pushes content out of bounds",
|
|
59
|
-
transform: R,
|
|
60
|
-
ui: {
|
|
61
|
-
type: "select",
|
|
62
|
-
options: [
|
|
63
|
-
{
|
|
64
|
-
label: "Stretch",
|
|
65
|
-
value: "stretch"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: "Transparent",
|
|
69
|
-
value: "transparent"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
label: "Mirror",
|
|
73
|
-
value: "mirror"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "Wrap",
|
|
77
|
-
value: "wrap"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
label: "Edges"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
fragmentNode: ({ uniforms: e, childNode: a, onCleanup: g }) => {
|
|
85
|
-
const { vec2: s, vec4: h, length: b, screenUV: i, viewportSize: l, convertToTexture: v, smoothstep: x } = U;
|
|
86
|
-
if (!a) return h(0, 0, 0, 0);
|
|
87
|
-
const o = v(a);
|
|
88
|
-
g(() => {
|
|
89
|
-
o?.renderTarget?.dispose && o.renderTarget.dispose();
|
|
90
|
-
});
|
|
91
|
-
const n = l.x.div(l.y), y = s(i.x.mul(n), i.y), u = s(e.center.uniform.x.mul(n), e.center.uniform.y.oneMinus()), c = y.sub(u), f = b(c), r = e.radius.uniform.mul(0.5), T = e.falloff.uniform, _ = x(r.mul(t(1).sub(T).sub(t(1e-3)).max(t(0))), r, f).oneMinus(), d = f.div(r), q = d.mul(d), w = V(t(0), t(1).sub(q)), C = _.mul(w), D = e.strength.uniform.negate().mul(C), F = t(1).add(D), S = c.mul(F), m = u.add(S), p = s(m.x.div(n), m.y);
|
|
92
|
-
return M(p, o.sample(p), o, e.edges.uniform);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
var O = A;
|
|
96
|
-
export {
|
|
97
|
-
A as n,
|
|
98
|
-
O as t
|
|
99
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { O as f, m as g } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
g();
|
|
3
|
-
const p = {
|
|
4
|
-
name: "FilmGrain",
|
|
5
|
-
category: "Effects",
|
|
6
|
-
requiresChild: !0,
|
|
7
|
-
props: { strength: {
|
|
8
|
-
default: 0.5,
|
|
9
|
-
description: "Intensity of the film grain noise",
|
|
10
|
-
ui: {
|
|
11
|
-
type: "range",
|
|
12
|
-
min: 0,
|
|
13
|
-
max: 1,
|
|
14
|
-
step: 0.01,
|
|
15
|
-
label: "Strength"
|
|
16
|
-
}
|
|
17
|
-
} },
|
|
18
|
-
fragmentNode: ({ uniforms: r, childNode: s }) => {
|
|
19
|
-
const { vec2: i, vec4: e, float: t, screenUV: o, sin: a, dot: l, fract: m } = f, c = r.strength.uniform, n = s || e(0, 0, 0, 0), u = m(a(l(o, i(t(12.9898), t(78.233)).mul(t(2)))).mul(t(43758.5453))).mul(t(2)).sub(t(1)).mul(c.mul(t(0.1)));
|
|
20
|
-
return e(n.rgb.add(u), n.a);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var h = p;
|
|
24
|
-
export {
|
|
25
|
-
p as n,
|
|
26
|
-
h as t
|
|
27
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { O as Z, m as $ } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
import { r as ee } from "./transformations-Bs66Qh16.js";
|
|
3
|
-
$();
|
|
4
|
-
const te = {
|
|
5
|
-
name: "FloatingParticles",
|
|
6
|
-
category: "Effects",
|
|
7
|
-
requiresRTT: !1,
|
|
8
|
-
props: {
|
|
9
|
-
randomness: {
|
|
10
|
-
default: 0.25,
|
|
11
|
-
description: "Randomness of particle animation",
|
|
12
|
-
ui: {
|
|
13
|
-
type: "range",
|
|
14
|
-
min: 0,
|
|
15
|
-
max: 1,
|
|
16
|
-
step: 0.01,
|
|
17
|
-
label: "Randomness"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
speed: {
|
|
21
|
-
default: 0.25,
|
|
22
|
-
description: "Speed of particle movement",
|
|
23
|
-
ui: {
|
|
24
|
-
type: "range",
|
|
25
|
-
min: 0,
|
|
26
|
-
max: 1,
|
|
27
|
-
step: 0.01,
|
|
28
|
-
label: "Speed"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
angle: {
|
|
32
|
-
default: 90,
|
|
33
|
-
description: "Movement angle in degrees (0=right, 90=down, 180=left, 270=up)",
|
|
34
|
-
ui: {
|
|
35
|
-
type: "range",
|
|
36
|
-
min: 0,
|
|
37
|
-
max: 360,
|
|
38
|
-
step: 1,
|
|
39
|
-
label: "Angle"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
particleSize: {
|
|
43
|
-
default: 1,
|
|
44
|
-
description: "Size of particles",
|
|
45
|
-
ui: {
|
|
46
|
-
type: "range",
|
|
47
|
-
min: 0.1,
|
|
48
|
-
max: 20,
|
|
49
|
-
step: 0.1,
|
|
50
|
-
label: "Particle Size"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
particleSoftness: {
|
|
54
|
-
default: 0,
|
|
55
|
-
description: "Edge softness of particles (0 = sharp, 1 = very soft)",
|
|
56
|
-
ui: {
|
|
57
|
-
type: "range",
|
|
58
|
-
min: 0,
|
|
59
|
-
max: 5,
|
|
60
|
-
step: 0.01,
|
|
61
|
-
label: "Particle Softness"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
twinkle: {
|
|
65
|
-
default: 0.5,
|
|
66
|
-
description: "Intensity of the twinkle effect (0 = off, 1 = full twinkle)",
|
|
67
|
-
ui: {
|
|
68
|
-
type: "range",
|
|
69
|
-
min: 0,
|
|
70
|
-
max: 1,
|
|
71
|
-
step: 0.01,
|
|
72
|
-
label: "Twinkle"
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
count: {
|
|
76
|
-
default: 5,
|
|
77
|
-
description: "Number of particle layers",
|
|
78
|
-
ui: {
|
|
79
|
-
type: "range",
|
|
80
|
-
min: 1,
|
|
81
|
-
max: 5,
|
|
82
|
-
step: 1,
|
|
83
|
-
label: "Count"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
particleColor: {
|
|
87
|
-
default: "#ffffff",
|
|
88
|
-
transform: ee,
|
|
89
|
-
description: "Color of the particles",
|
|
90
|
-
ui: {
|
|
91
|
-
type: "color",
|
|
92
|
-
label: "Particle Color"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
speedVariance: {
|
|
96
|
-
default: 0.3,
|
|
97
|
-
description: "Per-layer speed variance (0 = all layers same speed, 1 = high variance)",
|
|
98
|
-
ui: {
|
|
99
|
-
type: "range",
|
|
100
|
-
min: 0,
|
|
101
|
-
max: 1,
|
|
102
|
-
step: 0.01,
|
|
103
|
-
label: "Speed Variance"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
angleVariance: {
|
|
107
|
-
default: 30,
|
|
108
|
-
description: "Per-layer angle variance in degrees (0 = all layers same angle, 180 = full variance)",
|
|
109
|
-
ui: {
|
|
110
|
-
type: "range",
|
|
111
|
-
min: 0,
|
|
112
|
-
max: 180,
|
|
113
|
-
step: 1,
|
|
114
|
-
label: "Angle Variance"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
particleDensity: {
|
|
118
|
-
default: 3,
|
|
119
|
-
description: "Particle density (lower = more spread out, higher = more dense)",
|
|
120
|
-
ui: {
|
|
121
|
-
type: "range",
|
|
122
|
-
min: 0.5,
|
|
123
|
-
max: 3,
|
|
124
|
-
step: 0.1,
|
|
125
|
-
label: "Particle Density"
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
fragmentNode: ({ uniforms: l, childNode: F }) => {
|
|
130
|
-
const { vec2: n, vec3: I, vec4: U, float: o, sin: u, cos: P, smoothstep: H, mix: B, min: h, floor: O, fract: V, length: E, dot: T, screenUV: j, viewportSize: L, time: b, Fn: d } = Z, G = d(([e]) => V(u(T(e, n(127.1, 311.7))).mul(43758.5453123))), N = d(([e]) => V(u(n(T(e, n(127.1, 311.7)), T(e, n(269.5, 183.3)))).mul(43758.5453))), J = d(([e, a]) => {
|
|
131
|
-
const s = N(e).sub(0.5), t = u(a), r = P(a);
|
|
132
|
-
return n(r.mul(s.x).sub(t.mul(s.y)).mul(0.66), t.mul(s.x).add(r.mul(s.y)).mul(0.66)).add(e).add(0.5);
|
|
133
|
-
}), K = d(([e]) => b.mul(l.randomness.uniform).mul(G(e).sub(0.5)).mul(2)), f = d(([e, a]) => {
|
|
134
|
-
const s = J(a, K(a));
|
|
135
|
-
return E(e.sub(s));
|
|
136
|
-
}), Q = d(([e]) => {
|
|
137
|
-
const a = O(e), s = V(e);
|
|
138
|
-
let t = f(e, a);
|
|
139
|
-
const r = l.particleSoftness.uniform, m = l.particleSize.uniform.mul(0.01), i = m.mul(0.6).add(r.mul(m.mul(2.4))), c = i.greaterThan(0.35), g = s.x.lessThan(0.4), x = s.x.greaterThan(0.6), w = s.y.lessThan(0.4), R = s.y.greaterThan(0.6), z = c.and(g), p = c.and(x), D = c.and(w), y = c.and(R);
|
|
140
|
-
t = z.select(h(t, f(e, a.add(n(-1, 0)))), t), t = p.select(h(t, f(e, a.add(n(1, 0)))), t), t = D.select(h(t, f(e, a.add(n(0, -1)))), t), t = y.select(h(t, f(e, a.add(n(0, 1)))), t);
|
|
141
|
-
const M = H(i, m.mul(0.6), t), _ = l.twinkle.uniform, v = a.x.mul(12.9898).add(a.y.mul(78.233)).sin().mul(43758.5453).fract(), C = u(b.mul(2).add(v.mul(6.28318))).mul(0.5).add(0.5), A = B(o(1), C, _);
|
|
142
|
-
return M.mul(A).mul(l.particleColor.uniform.rgb);
|
|
143
|
-
}), W = d(([e]) => {
|
|
144
|
-
const a = o(1.05), s = o(0.9), t = l.count.uniform, r = I(0).toVar(), m = o(1).toVar(), i = o(1).toVar(), c = n(0).toVar(), g = l.angle.uniform.mul(3.14159).div(180), x = n(P(g), u(g)), w = b.mul(x).mul(l.speed.uniform), R = l.speedVariance.uniform, z = l.angleVariance.uniform.mul(3.14159).div(180);
|
|
145
|
-
for (let p = 0; p < 4; p++) {
|
|
146
|
-
const D = o(p).lessThan(t).and(i.greaterThan(0.02)), y = N(n(i, o(p).mul(7.919))), M = o(1).add(y.x.sub(0.5).mul(R)), _ = y.y.sub(0.5).mul(z).mul(2), v = g.add(_), C = n(P(v), u(v)), A = w.mul(M).add(C.sub(x).mul(b).mul(l.speed.uniform)), Y = Q(e.mul(m).add(A).add(c)).mul(i);
|
|
147
|
-
r.assign(r.add(D.select(Y, I(0)))), c.assign(c.add(y.mul(10))), i.assign(i.mul(s)), m.assign(m.mul(a));
|
|
148
|
-
}
|
|
149
|
-
return r;
|
|
150
|
-
}), q = j.mul(2).sub(1), X = L.x.div(L.y), k = W(n(q.x.mul(X), q.y).mul(l.particleDensity.uniform)), S = E(k);
|
|
151
|
-
return F ? U(B(F.xyz, k, S.greaterThan(0.01).select(S, 0)), 1) : U(k, S);
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
var se = te;
|
|
155
|
-
export {
|
|
156
|
-
te as n,
|
|
157
|
-
se as t
|
|
158
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { O as q, m as G } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
G();
|
|
3
|
-
const V = {
|
|
4
|
-
name: "GlassTiles",
|
|
5
|
-
category: "Distortions",
|
|
6
|
-
requiresRTT: !0,
|
|
7
|
-
requiresChild: !0,
|
|
8
|
-
props: {
|
|
9
|
-
intensity: {
|
|
10
|
-
default: 1,
|
|
11
|
-
description: "The intensity of the glass tiles effect",
|
|
12
|
-
ui: {
|
|
13
|
-
type: "range",
|
|
14
|
-
min: 0,
|
|
15
|
-
max: 5,
|
|
16
|
-
step: 0.1,
|
|
17
|
-
label: "Intensity"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
tileCount: {
|
|
21
|
-
default: 100,
|
|
22
|
-
description: "Number of tiles across the shortest dimension",
|
|
23
|
-
ui: {
|
|
24
|
-
type: "range",
|
|
25
|
-
min: 1,
|
|
26
|
-
max: 200,
|
|
27
|
-
step: 1,
|
|
28
|
-
label: "Tile Count"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
fragmentNode: ({ uniforms: a, childNode: l, dimensions: c, onCleanup: T }) => {
|
|
33
|
-
const { vec2: o, vec4: u, floor: g, mul: e, div: t, sub: d, add: m, screenUV: y, uniform: C, convertToTexture: v } = q;
|
|
34
|
-
if (!l)
|
|
35
|
-
return console.error("You must pass a child component into the Glass Tiles shader."), u(0);
|
|
36
|
-
const i = v(l);
|
|
37
|
-
T(() => {
|
|
38
|
-
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
39
|
-
});
|
|
40
|
-
const s = C(c.width / c.height), p = y, x = a.intensity.uniform, n = a.tileCount.uniform, r = o(s.greaterThanEqual(1).select(e(n, s), n), s.lessThan(1).select(t(n, s), n)), f = t(g(e(p, r)), r), h = d(p, f), b = o(0.5, 0.5), _ = e(x, 0.025), U = m(m(h, e(d(t(h, t(o(1), r)), b), _)), f);
|
|
41
|
-
return u(i.sample(U));
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var N = V;
|
|
45
|
-
export {
|
|
46
|
-
V as n,
|
|
47
|
-
N as t
|
|
48
|
-
};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { O as N, m as Q } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
import { t as $ } from "./edges-Cj8yVYgz.js";
|
|
3
|
-
import { a as ee } from "./transformations-Bs66Qh16.js";
|
|
4
|
-
import { DataTexture as te, FloatType as ae, LinearFilter as q, RGFormat as ie } from "three";
|
|
5
|
-
Q();
|
|
6
|
-
const se = {
|
|
7
|
-
name: "GridDistortion",
|
|
8
|
-
category: "Interactive",
|
|
9
|
-
requiresRTT: !0,
|
|
10
|
-
requiresChild: !0,
|
|
11
|
-
props: {
|
|
12
|
-
intensity: {
|
|
13
|
-
default: 1,
|
|
14
|
-
description: "Strength of the distortion effect",
|
|
15
|
-
ui: {
|
|
16
|
-
type: "range",
|
|
17
|
-
min: 0,
|
|
18
|
-
max: 5,
|
|
19
|
-
step: 0.1,
|
|
20
|
-
label: "Intensity"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
swirl: {
|
|
24
|
-
default: 0,
|
|
25
|
-
description: "Amount of swirl motion",
|
|
26
|
-
ui: {
|
|
27
|
-
type: "range",
|
|
28
|
-
min: 0,
|
|
29
|
-
max: 2,
|
|
30
|
-
step: 0.1,
|
|
31
|
-
label: "Swirl"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
decay: {
|
|
35
|
-
default: 3,
|
|
36
|
-
description: "Rate of distortion decay (higher = faster)",
|
|
37
|
-
ui: {
|
|
38
|
-
type: "range",
|
|
39
|
-
min: 0,
|
|
40
|
-
max: 10,
|
|
41
|
-
step: 0.1,
|
|
42
|
-
label: "Decay"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
radius: {
|
|
46
|
-
default: 1,
|
|
47
|
-
description: "Radius of the distortion effect",
|
|
48
|
-
ui: {
|
|
49
|
-
type: "range",
|
|
50
|
-
min: 0,
|
|
51
|
-
max: 3,
|
|
52
|
-
step: 0.01,
|
|
53
|
-
label: "Radius"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
gridSize: {
|
|
57
|
-
default: 20,
|
|
58
|
-
description: "Resolution of the distortion grid (higher = more detailed)",
|
|
59
|
-
ui: {
|
|
60
|
-
type: "range",
|
|
61
|
-
min: 8,
|
|
62
|
-
max: 128,
|
|
63
|
-
step: 1,
|
|
64
|
-
label: "Grid Size"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
edges: {
|
|
68
|
-
default: "stretch",
|
|
69
|
-
description: "How to handle edges when distortion pushes content out of bounds",
|
|
70
|
-
transform: ee,
|
|
71
|
-
ui: {
|
|
72
|
-
type: "select",
|
|
73
|
-
options: [
|
|
74
|
-
{
|
|
75
|
-
label: "Stretch",
|
|
76
|
-
value: "stretch"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
label: "Transparent",
|
|
80
|
-
value: "transparent"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
label: "Mirror",
|
|
84
|
-
value: "mirror"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
label: "Wrap",
|
|
88
|
-
value: "wrap"
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
label: "Edges"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
fragmentNode: ({ uniforms: n, onBeforeRender: A, childNode: b, onCleanup: T }) => {
|
|
96
|
-
const { vec2: w, vec4: H, float: m, uniform: o, screenUV: D, texture: j, convertToTexture: C } = N;
|
|
97
|
-
if (!b) return H(0, 0, 0, 0);
|
|
98
|
-
const l = C(b);
|
|
99
|
-
T(() => {
|
|
100
|
-
l?.renderTarget?.dispose && l.renderTarget.dispose();
|
|
101
|
-
});
|
|
102
|
-
const i = Math.max(8, Math.min(128, Math.floor(n.gridSize.uniform.value))), e = new Float32Array(i * i * 2), r = new te(e, i, i, ie, ae);
|
|
103
|
-
r.magFilter = q, r.minFilter = q, r.needsUpdate = !0;
|
|
104
|
-
const L = j(r), O = o(0.5), P = o(0.5), p = o(0), f = o(0);
|
|
105
|
-
let S = 0.5, F = 0.5, R = Date.now();
|
|
106
|
-
A(({ pointer: s }) => {
|
|
107
|
-
const G = Date.now(), t = Math.min((G - R) / 1e3, 0.016);
|
|
108
|
-
R = G;
|
|
109
|
-
const I = t > 0 ? (s.x - S) / t : 0, V = t > 0 ? (s.y - F) / t : 0;
|
|
110
|
-
p.value = p.value * 0.85 + I * 0.15, f.value = f.value * 0.85 + V * 0.15, O.value = s.x, P.value = s.y;
|
|
111
|
-
const X = n.decay.uniform.value, Y = n.intensity.uniform.value, g = n.radius.uniform.value * 0.05, v = n.swirl.uniform.value;
|
|
112
|
-
for (let c = 0; c < i; c++) for (let d = 0; d < i; d++) {
|
|
113
|
-
const a = (c * i + d) * 2;
|
|
114
|
-
e[a] *= 1 - X * t, e[a + 1] *= 1 - X * t;
|
|
115
|
-
const J = (d + 0.5) / i, K = (c + 0.5) / i, x = J - s.x, y = K - s.y, M = Math.sqrt(x * x + y * y);
|
|
116
|
-
if (M < g * 2 && Math.abs(I) + Math.abs(V) > 0.01) {
|
|
117
|
-
const u = Math.exp(-M * M / (g * g));
|
|
118
|
-
if (e[a] += p.value * u * Y * t * 0.5, e[a + 1] += f.value * u * Y * t * 0.5, v > 0) {
|
|
119
|
-
const E = Math.atan2(y, x) + Math.PI * 0.5;
|
|
120
|
-
e[a] += Math.cos(E) * v * u * t * 2, e[a + 1] += Math.sin(E) * v * u * t * 2;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
e[a] = Math.max(-1, Math.min(1, e[a])), e[a + 1] = Math.max(-1, Math.min(1, e[a + 1]));
|
|
124
|
-
}
|
|
125
|
-
r.needsUpdate = !0, S = s.x, F = s.y;
|
|
126
|
-
}), T(() => {
|
|
127
|
-
r.dispose();
|
|
128
|
-
});
|
|
129
|
-
const W = n.gridSize.uniform, h = m(1).div(W), Z = D.div(h).floor().mul(h).add(h.mul(0.5)), k = L.sample(Z).xy, U = m(0.1), _ = m(-0.1), B = k.clamp(w(_, _), w(U, U)), z = D.sub(B);
|
|
130
|
-
return $(z, l.sample(z), l, n.edges.uniform);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
var ce = se;
|
|
134
|
-
export {
|
|
135
|
-
se as n,
|
|
136
|
-
ce as t
|
|
137
|
-
};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { O as C, m as J } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
import { t as K } from "./edges-Cj8yVYgz.js";
|
|
3
|
-
import { a as N } from "./transformations-Bs66Qh16.js";
|
|
4
|
-
import { DataTexture as Q, FloatType as $, LinearFilter as L, RGFormat as ee } from "three";
|
|
5
|
-
J();
|
|
6
|
-
const te = {
|
|
7
|
-
name: "Liquify",
|
|
8
|
-
category: "Interactive",
|
|
9
|
-
requiresRTT: !0,
|
|
10
|
-
requiresChild: !0,
|
|
11
|
-
props: {
|
|
12
|
-
intensity: {
|
|
13
|
-
default: 1,
|
|
14
|
-
description: "Strength of the distortion effect",
|
|
15
|
-
ui: {
|
|
16
|
-
type: "range",
|
|
17
|
-
min: 0,
|
|
18
|
-
max: 5,
|
|
19
|
-
step: 0.1,
|
|
20
|
-
label: "Intensity"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
swirl: {
|
|
24
|
-
default: 0,
|
|
25
|
-
description: "Amount of swirl motion (0-1)",
|
|
26
|
-
ui: {
|
|
27
|
-
type: "range",
|
|
28
|
-
min: 0,
|
|
29
|
-
max: 1,
|
|
30
|
-
step: 0.01,
|
|
31
|
-
label: "Swirl"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
decay: {
|
|
35
|
-
default: 3,
|
|
36
|
-
description: "Rate of distortion decay (higher = faster)",
|
|
37
|
-
ui: {
|
|
38
|
-
type: "range",
|
|
39
|
-
min: 0,
|
|
40
|
-
max: 10,
|
|
41
|
-
step: 0.1,
|
|
42
|
-
label: "Decay"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
radius: {
|
|
46
|
-
default: 1,
|
|
47
|
-
description: "Radius of the distortion effect",
|
|
48
|
-
ui: {
|
|
49
|
-
type: "range",
|
|
50
|
-
min: 0,
|
|
51
|
-
max: 3,
|
|
52
|
-
step: 0.01,
|
|
53
|
-
label: "Radius"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
edges: {
|
|
57
|
-
default: "stretch",
|
|
58
|
-
description: "How to handle edges when distortion pushes content out of bounds",
|
|
59
|
-
transform: N,
|
|
60
|
-
ui: {
|
|
61
|
-
type: "select",
|
|
62
|
-
options: [
|
|
63
|
-
{
|
|
64
|
-
label: "Stretch",
|
|
65
|
-
value: "stretch"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: "Transparent",
|
|
69
|
-
value: "transparent"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
label: "Mirror",
|
|
73
|
-
value: "mirror"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "Wrap",
|
|
77
|
-
value: "wrap"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
label: "Edges"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
fragmentNode: ({ uniforms: i, onBeforeRender: A, childNode: g, onCleanup: M }) => {
|
|
85
|
-
const { vec2: b, vec4: G, float: T, uniform: o, screenUV: w, texture: H, convertToTexture: j } = C;
|
|
86
|
-
if (!g) return G(0, 0, 0, 0);
|
|
87
|
-
const l = j(g);
|
|
88
|
-
M(() => {
|
|
89
|
-
l?.renderTarget?.dispose && l.renderTarget.dispose();
|
|
90
|
-
});
|
|
91
|
-
const s = 32, e = new Float32Array(s * s * 2), r = new Q(e, s, s, ee, $);
|
|
92
|
-
r.magFilter = L, r.minFilter = L, r.needsUpdate = !0;
|
|
93
|
-
const O = H(r), P = o(0.5), W = o(0.5), m = o(0), p = o(0);
|
|
94
|
-
let D = 0.5, F = 0.5, R = Date.now();
|
|
95
|
-
A(({ pointer: n }) => {
|
|
96
|
-
const X = Date.now(), t = Math.min((X - R) / 1e3, 0.016);
|
|
97
|
-
R = X;
|
|
98
|
-
const Y = t > 0 ? (n.x - D) / t : 0, E = t > 0 ? (n.y - F) / t : 0;
|
|
99
|
-
m.value = m.value * 0.85 + Y * 0.15, p.value = p.value * 0.85 + E * 0.15, P.value = n.x, W.value = n.y;
|
|
100
|
-
const S = i.decay.uniform.value, U = i.intensity.uniform.value, f = i.radius.uniform.value * 0.05, h = i.swirl.uniform.value;
|
|
101
|
-
for (let c = 0; c < s; c++) for (let u = 0; u < s; u++) {
|
|
102
|
-
const a = (c * s + u) * 2;
|
|
103
|
-
e[a] *= 1 - S * t, e[a + 1] *= 1 - S * t;
|
|
104
|
-
const z = (u + 0.5) / s, B = (c + 0.5) / s, y = z - n.x, v = B - n.y, x = Math.sqrt(y * y + v * v);
|
|
105
|
-
if (x < f * 2 && Math.abs(Y) + Math.abs(E) > 0.01) {
|
|
106
|
-
const d = Math.exp(-x * x / (f * f));
|
|
107
|
-
if (e[a] += m.value * d * U * t * 0.5, e[a + 1] += p.value * d * U * t * 0.5, h > 0) {
|
|
108
|
-
const V = Math.atan2(v, y) + Math.PI * 0.5;
|
|
109
|
-
e[a] += Math.cos(V) * h * d * t * 2, e[a + 1] += Math.sin(V) * h * d * t * 2;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
e[a] = Math.max(-1, Math.min(1, e[a])), e[a + 1] = Math.max(-1, Math.min(1, e[a + 1]));
|
|
113
|
-
}
|
|
114
|
-
r.needsUpdate = !0, D = n.x, F = n.y;
|
|
115
|
-
}), M(() => {
|
|
116
|
-
r.dispose();
|
|
117
|
-
});
|
|
118
|
-
const Z = O.sample(w).xy, _ = T(0.2), q = T(-0.2), k = Z.clamp(b(q, q), b(_, _)), I = w.sub(k);
|
|
119
|
-
return K(I, l.sample(I), l, i.edges.uniform);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
var ie = te;
|
|
123
|
-
export {
|
|
124
|
-
te as n,
|
|
125
|
-
ie as t
|
|
126
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { O as p, m as u } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
u();
|
|
3
|
-
const m = {
|
|
4
|
-
name: "Pixelate",
|
|
5
|
-
category: "Effects",
|
|
6
|
-
requiresRTT: !0,
|
|
7
|
-
requiresChild: !0,
|
|
8
|
-
props: { scale: {
|
|
9
|
-
default: 50,
|
|
10
|
-
description: "Pixel size - higher values create larger, more visible pixels",
|
|
11
|
-
ui: {
|
|
12
|
-
type: "range",
|
|
13
|
-
min: 1,
|
|
14
|
-
max: 200,
|
|
15
|
-
step: 1,
|
|
16
|
-
label: "Scale"
|
|
17
|
-
}
|
|
18
|
-
} },
|
|
19
|
-
fragmentNode: ({ uniforms: i, childNode: r, onCleanup: s }) => {
|
|
20
|
-
const { vec4: a, floor: n, screenUV: o, convertToTexture: l } = p;
|
|
21
|
-
if (!r) return a(0, 0, 0, 0);
|
|
22
|
-
const e = l(r);
|
|
23
|
-
s(() => {
|
|
24
|
-
e?.renderTarget?.dispose && e.renderTarget.dispose();
|
|
25
|
-
});
|
|
26
|
-
const t = i.scale.uniform, c = n(o.mul(t)).div(t);
|
|
27
|
-
return e.sample(c);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var x = m;
|
|
31
|
-
export {
|
|
32
|
-
m as n,
|
|
33
|
-
x as t
|
|
34
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { O as f, m as g } from "./three.tsl-CgyjOhns.js";
|
|
2
|
-
g();
|
|
3
|
-
var { vec2: p, vec4: h, step: s, abs: u, mod: x, fract: y, float: n, select: o } = f;
|
|
4
|
-
const C = (r, a, m, c) => {
|
|
5
|
-
const b = s(n(0), r.x).mul(s(r.x, n(1))), _ = s(n(0), r.y).mul(s(r.y, n(1))), v = b.mul(_), B = h(a.rgb, a.a.mul(v)), t = x(u(r.x), n(2)), l = x(u(r.y), n(2)), w = p(o(s(n(1), t), n(2).sub(t), t), o(s(n(1), l), n(2).sub(l), l)), X = m.sample(w), Y = p(y(r.x), y(r.y)), e = m.sample(Y);
|
|
6
|
-
return o(s(n(0.5), c), o(s(n(1.5), c), o(s(n(2.5), c), e, X), B), a);
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
C as t
|
|
10
|
-
};
|