shaders 2.2.24 → 2.2.25
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-Dl2gwk68.js +64 -0
- package/dist/core/Ascii-Dha_QpT3.js +286 -0
- package/dist/core/Beam-CTN9Ni43.js +139 -0
- package/dist/core/Blob-CxFDZovO.js +218 -0
- package/dist/core/Blur-Y2FsmFk_.js +77 -0
- package/dist/core/Bulge-Cb-t0xqI.js +132 -0
- package/dist/core/CRTScreen-CtERsenz.js +112 -0
- package/dist/core/ChannelBlur-CvM6GJgZ.js +118 -0
- package/dist/core/Checkerboard-CgB-egNY.js +83 -0
- package/dist/core/ChromaFlow-vRCwhQpN.js +222 -0
- package/dist/core/ChromaticAberration-FTquTQIL.js +88 -0
- package/dist/core/Circle-Daziv5d7.js +67 -0
- package/dist/core/CursorTrail-Bsz9e6Fn.js +145 -0
- package/dist/core/DiffuseBlur-Cj2PtRNd.js +83 -0
- package/dist/core/Dither-D2Nf4p3w.js +66 -0
- package/dist/core/DotGrid-CzOwquo4.js +75 -0
- package/dist/core/Duotone-XuTN9tI7.js +65 -0
- package/dist/core/FilmGrain-D3-nbi12.js +28 -0
- package/dist/core/FloatingParticles-D9Nnu1qg.js +217 -0
- package/dist/core/GlassTiles-CnjCvajI.js +69 -0
- package/dist/core/Glow-BluFc9be.js +75 -0
- package/dist/core/Godrays-ChLh_vGl.js +144 -0
- package/dist/core/Grayscale-DRny75A9.js +20 -0
- package/dist/core/Grid-DgyDa4H1.js +58 -0
- package/dist/core/GridDistortion-BAspCYvp.js +188 -0
- package/dist/core/Group-Dul7PUBl.js +14 -0
- package/dist/core/Halftone-Ifv5F_FT.js +65 -0
- package/dist/core/HueShift-De8ukMWs.js +31 -0
- package/dist/core/ImageTexture-DvYcQgJB.js +143 -0
- package/dist/core/Invert-Fz0NtIJc.js +21 -0
- package/dist/core/LinearBlur-LmhnQoA4.js +62 -0
- package/dist/core/LinearGradient-xbloQjzt.js +133 -0
- package/dist/core/Liquify-DMe1V5-O.js +175 -0
- package/dist/core/Pixelate-Cv8537Pj.js +37 -0
- package/dist/core/PolarCoordinates-DDvDhBE-.js +112 -0
- package/dist/core/Posterize-3m3xkWOz.js +29 -0
- package/dist/core/ProgressiveBlur-EGkevObV.js +121 -0
- package/dist/core/RadialGradient-B7ZZB_VJ.js +71 -0
- package/dist/core/RectangularCoordinates-muWR8mZS.js +101 -0
- package/dist/core/Ripples-8XaZaXQF.js +117 -0
- package/dist/core/Saturation-CYFI1jzN.js +30 -0
- package/dist/core/SimplexNoise-DJUe0wz_.js +99 -0
- package/dist/core/SineWave-Dl3nFO1W.js +120 -0
- package/dist/core/SolidColor-CWGq_Bjq.js +21 -0
- package/dist/core/Spherize-C-jZEUsN.js +128 -0
- package/dist/core/Spiral-BSB_R39p.js +132 -0
- package/dist/core/Strands-0stO5BMy.js +161 -0
- package/dist/core/Stretch-B645paha.js +133 -0
- package/dist/core/Swirl-CVnbawit.js +173 -0
- package/dist/core/TiltShift-0CxNRI6L.js +134 -0
- package/dist/core/Tritone-Daa-I5UD.js +76 -0
- package/dist/core/Twirl-2CJVZEtk.js +96 -0
- package/dist/core/Vibrance-DRtecEvb.js +30 -0
- package/dist/core/WaveDistortion-BscXN2rs.js +173 -0
- package/dist/core/ZoomBlur-CAqK0Kju.js +62 -0
- package/dist/core/colorMixing-BXiTAqJU.js +69 -0
- package/dist/core/edges-Bn_OIa_h.js +26 -0
- package/dist/core/index.js +2257 -1606
- package/dist/core/shaders/AngularBlur/index.js +3 -7
- package/dist/core/shaders/Ascii/index.js +2 -6
- package/dist/core/shaders/Beam/index.js +4 -8
- package/dist/core/shaders/Blob/index.js +5 -9
- package/dist/core/shaders/Blur/index.js +2 -6
- package/dist/core/shaders/Bulge/index.js +4 -8
- package/dist/core/shaders/CRTScreen/index.js +2 -6
- package/dist/core/shaders/ChannelBlur/index.js +2 -6
- package/dist/core/shaders/Checkerboard/index.js +4 -8
- package/dist/core/shaders/ChromaFlow/index.js +3 -7
- package/dist/core/shaders/ChromaticAberration/index.js +3 -7
- package/dist/core/shaders/Circle/index.js +3 -7
- package/dist/core/shaders/CursorTrail/index.js +4 -8
- package/dist/core/shaders/DiffuseBlur/index.js +4 -8
- package/dist/core/shaders/Dither/index.js +3 -7
- package/dist/core/shaders/DotGrid/index.js +3 -7
- package/dist/core/shaders/Duotone/index.js +4 -8
- package/dist/core/shaders/FilmGrain/index.js +2 -6
- package/dist/core/shaders/FloatingParticles/index.js +3 -7
- package/dist/core/shaders/GlassTiles/index.js +2 -6
- package/dist/core/shaders/Glow/index.js +2 -6
- package/dist/core/shaders/Godrays/index.js +3 -7
- package/dist/core/shaders/Grayscale/index.js +2 -8
- package/dist/core/shaders/Grid/index.js +3 -7
- package/dist/core/shaders/GridDistortion/index.js +4 -8
- package/dist/core/shaders/Group/index.js +2 -6
- package/dist/core/shaders/Halftone/index.js +3 -7
- package/dist/core/shaders/HueShift/index.js +2 -8
- package/dist/core/shaders/ImageTexture/index.js +2 -6
- package/dist/core/shaders/Invert/index.js +2 -6
- package/dist/core/shaders/LinearBlur/index.js +3 -7
- package/dist/core/shaders/LinearGradient/index.js +4 -8
- package/dist/core/shaders/Liquify/index.js +4 -8
- package/dist/core/shaders/Pixelate/index.js +2 -6
- package/dist/core/shaders/PolarCoordinates/index.js +4 -8
- package/dist/core/shaders/Posterize/index.js +2 -7
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
- package/dist/core/shaders/RadialGradient/index.js +4 -8
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
- package/dist/core/shaders/Ripples/index.js +5 -9
- package/dist/core/shaders/Saturation/index.js +2 -8
- package/dist/core/shaders/SimplexNoise/index.js +5 -9
- package/dist/core/shaders/SineWave/index.js +3 -7
- package/dist/core/shaders/SolidColor/index.js +3 -7
- package/dist/core/shaders/Spherize/index.js +3 -7
- package/dist/core/shaders/Spiral/index.js +4 -8
- package/dist/core/shaders/Strands/index.js +4 -8
- package/dist/core/shaders/Stretch/index.js +4 -8
- package/dist/core/shaders/Swirl/index.js +5 -9
- package/dist/core/shaders/TiltShift/index.js +3 -7
- package/dist/core/shaders/Tritone/index.js +4 -8
- package/dist/core/shaders/Twirl/index.js +4 -8
- package/dist/core/shaders/Vibrance/index.js +2 -8
- package/dist/core/shaders/WaveDistortion/index.js +4 -8
- package/dist/core/shaders/ZoomBlur/index.js +3 -7
- package/dist/core/telemetry/index.js +189 -157
- package/dist/core/time-CTJvRUZ4.js +10 -0
- package/dist/core/transformations-DxfQXZWi.js +4715 -0
- package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
- package/dist/react/index.js +7645 -104827
- package/dist/react/utils/generatePresetCode.js +2 -5
- package/dist/solid/index.js +6670 -102727
- package/dist/solid/utils/generatePresetCode.js +583 -554
- package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
- package/dist/svelte/index.js +6175 -102645
- package/dist/svelte/utils/generatePresetCode.js +2 -5
- package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
- package/dist/vue/index.js +6929 -103706
- package/dist/vue/utils/generatePresetCode.js +2 -5
- package/package.json +4 -1
- package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
- package/dist/core/Ascii-BT0-K_vw.js +0 -196
- package/dist/core/Beam-BAKql1AP.js +0 -116
- package/dist/core/Blob-CVSxhHJG.js +0 -169
- package/dist/core/Blur-C1TTBHCX.js +0 -64
- package/dist/core/Bulge-DV8tX-cw.js +0 -103
- package/dist/core/CRTScreen-VTJQoOeq.js +0 -91
- package/dist/core/ChannelBlur-BLZ9kBNA.js +0 -89
- package/dist/core/Checkerboard-DQ4Df3vm.js +0 -75
- package/dist/core/ChromaFlow-BggN1_Av.js +0 -134
- package/dist/core/ChromaticAberration-DlTaHNcp.js +0 -82
- package/dist/core/Circle-B9ObWlq5.js +0 -62
- package/dist/core/ColorAdjustment-FeXXpypd.js +0 -14
- package/dist/core/CursorTrail-C7QdUj8O.js +0 -105
- package/dist/core/DiffuseBlur-Mx6LBsqz.js +0 -69
- package/dist/core/Dither-CeIdV_9C.js +0 -61
- package/dist/core/DotGrid-D6xUvYrt.js +0 -61
- package/dist/core/Duotone-C2Pqt2gR.js +0 -66
- package/dist/core/FilmGrain-CJ9n_fgk.js +0 -28
- package/dist/core/FloatingParticles-iGtMs44K.js +0 -160
- package/dist/core/GlassTiles-D_lVyag2.js +0 -52
- package/dist/core/Glow-B0jj-6OC.js +0 -66
- package/dist/core/Godrays-DjLVuZa4.js +0 -105
- package/dist/core/Grayscale-BbsdDa_X.js +0 -21
- package/dist/core/Grid-ByjU-_ua.js +0 -50
- package/dist/core/GridDistortion-C_eIlhkW.js +0 -147
- package/dist/core/Group-CyaDLGpI.js +0 -17
- package/dist/core/Halftone-BvuAe_k-.js +0 -55
- package/dist/core/HueShift-B_qE9c08.js +0 -32
- package/dist/core/ImageTexture-h00TFC1l.js +0 -105
- package/dist/core/Invert-BEDDB0sm.js +0 -20
- package/dist/core/LinearBlur-CLKxuyeT.js +0 -56
- package/dist/core/LinearGradient-BPo8TX_M.js +0 -111
- package/dist/core/Liquify-DGkfeixZ.js +0 -139
- package/dist/core/Pixelate-Bzy_7LnJ.js +0 -38
- package/dist/core/PolarCoordinates-BUumPeTv.js +0 -103
- package/dist/core/Posterize-ggKIJlmm.js +0 -46
- package/dist/core/ProgressiveBlur-D6_6T7SS.js +0 -102
- package/dist/core/RadialGradient-DEY9fRqa.js +0 -71
- package/dist/core/RectangularCoordinates-CZ-cFrCh.js +0 -92
- package/dist/core/Ripples-BwNlcsnV.js +0 -106
- package/dist/core/Saturation-Dl3gCWuZ.js +0 -31
- package/dist/core/SimplexNoise-BhE_WyGt.js +0 -94
- package/dist/core/SineWave-Db_Y0Mcv.js +0 -107
- package/dist/core/SolidColor-CerOp4EQ.js +0 -22
- package/dist/core/Spherize-Dh8E5XwG.js +0 -103
- package/dist/core/Spiral-BvygQEfP.js +0 -115
- package/dist/core/Strands-maaPn4On.js +0 -125
- package/dist/core/Stretch-CnA0-nSz.js +0 -103
- package/dist/core/Swirl-CQBUahTB.js +0 -148
- package/dist/core/TSLBase-Bt7Z4hv_.js +0 -8053
- package/dist/core/TiltShift-qFj0oFzN.js +0 -114
- package/dist/core/Tritone-AiixmTg8.js +0 -75
- package/dist/core/Twirl-ooHQcV89.js +0 -82
- package/dist/core/Vibrance-C2FRlLkK.js +0 -31
- package/dist/core/WaveDistortion-CN8MjKlm.js +0 -132
- package/dist/core/ZoomBlur-CxWGx8PH.js +0 -56
- package/dist/core/colorMixing--dhzx0ch.js +0 -21
- package/dist/core/edges-CDzKsauJ.js +0 -15
- package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
- package/dist/core/time-DbRMw6Jm.js +0 -10
- package/dist/core/transformations-CsrIJXh-.js +0 -3992
- package/dist/react/generatePresetCode-CVj6IV8Y.js +0 -646
- package/dist/svelte/generatePresetCode-CVj6IV8Y.js +0 -646
- package/dist/vue/generatePresetCode-DCaIsDhE.js +0 -652
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
export {
|
|
3
|
-
o as availableComponents,
|
|
4
|
-
a as generatePresetCode
|
|
5
|
-
};
|
|
1
|
+
import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-CRJmU8iF.js";
|
|
2
|
+
export { availableComponents, generatePresetCode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaders",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.25",
|
|
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/",
|
|
@@ -552,6 +552,9 @@
|
|
|
552
552
|
"dev": "tsx scripts/build.ts --watch",
|
|
553
553
|
"typecheck": "tsc --noEmit"
|
|
554
554
|
},
|
|
555
|
+
"dependencies": {
|
|
556
|
+
"three": "^0.181.0"
|
|
557
|
+
},
|
|
555
558
|
"devDependencies": {
|
|
556
559
|
"@types/fs-extra": "^11.0.4",
|
|
557
560
|
"@types/node": "^20.17.11",
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { O as _ } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { o as q } from "./transformations-CsrIJXh-.js";
|
|
3
|
-
const I = {
|
|
4
|
-
name: "AngularBlur",
|
|
5
|
-
category: "Blurs",
|
|
6
|
-
description: "Radial motion blur rotating around a center point",
|
|
7
|
-
requiresRTT: !0,
|
|
8
|
-
requiresChild: !0,
|
|
9
|
-
props: {
|
|
10
|
-
intensity: {
|
|
11
|
-
default: 20,
|
|
12
|
-
description: "Intensity of the angular blur effect",
|
|
13
|
-
ui: {
|
|
14
|
-
type: "range",
|
|
15
|
-
min: 0,
|
|
16
|
-
max: 100,
|
|
17
|
-
step: 1,
|
|
18
|
-
label: "Blur Intensity"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
center: {
|
|
22
|
-
default: {
|
|
23
|
-
x: 0.5,
|
|
24
|
-
y: 0.5
|
|
25
|
-
},
|
|
26
|
-
transform: q,
|
|
27
|
-
description: "The center point of the rotation",
|
|
28
|
-
ui: {
|
|
29
|
-
type: "position",
|
|
30
|
-
label: "Center Position"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
fragmentNode: ({ uniforms: r, childNode: a, onCleanup: y }) => {
|
|
35
|
-
const { vec2: l, vec4: u, float: t, screenUV: x, sin: v, cos: T, Fn: b, convertToTexture: h } = _;
|
|
36
|
-
if (!a) return u(0, 0, 0, 0);
|
|
37
|
-
const o = h(a);
|
|
38
|
-
y(() => {
|
|
39
|
-
o?.renderTarget?.dispose && o.renderTarget.dispose();
|
|
40
|
-
});
|
|
41
|
-
const c = l(r.center.uniform.x, r.center.uniform.y.oneMinus()), A = r.intensity.uniform.mul(5e-3);
|
|
42
|
-
return b(() => {
|
|
43
|
-
const e = x.sub(c), s = u(0).toVar(), i = t(0).toVar(), B = A.div(t(31));
|
|
44
|
-
for (let n = 0; n < 32; n++) {
|
|
45
|
-
const d = t(n).div(t(31)).sub(0.5).mul(2), m = t(1).div(t(2.506628)).mul(t(-0.5).mul(d).mul(d).div(t(0.64)).exp()), p = B.mul(t(n)), f = T(p), g = v(p), C = l(e.x.mul(f).sub(e.y.mul(g)), e.x.mul(g).add(e.y.mul(f))).add(c), V = o.sample(C).mul(m);
|
|
46
|
-
s.assign(s.add(V)), i.assign(i.add(m));
|
|
47
|
-
}
|
|
48
|
-
return s.div(i);
|
|
49
|
-
})();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var w = I;
|
|
53
|
-
export {
|
|
54
|
-
I as n,
|
|
55
|
-
w as t
|
|
56
|
-
};
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { O as $e, S as Re, d as Y, k as x, p as ke, r as Ee, t as _e, y as De } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { DataTexture as qe, NearestFilter as ee, RGBAFormat as Ge, UnsignedByteType as Je } from "three";
|
|
3
|
-
const d = {
|
|
4
|
-
name: "Ascii",
|
|
5
|
-
category: "Stylize",
|
|
6
|
-
description: "Convert imagery to ASCII character art",
|
|
7
|
-
requiresRTT: !0,
|
|
8
|
-
requiresChild: !0,
|
|
9
|
-
props: {
|
|
10
|
-
characters: {
|
|
11
|
-
default: "@%#*+=-:.",
|
|
12
|
-
description: "Characters to use for ASCII effect (light to dark)",
|
|
13
|
-
ui: {
|
|
14
|
-
type: "text",
|
|
15
|
-
label: "Characters"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
cellSize: {
|
|
19
|
-
default: 30,
|
|
20
|
-
description: "Size of each ASCII character cell in pixels",
|
|
21
|
-
ui: {
|
|
22
|
-
type: "range",
|
|
23
|
-
min: 8,
|
|
24
|
-
max: 100,
|
|
25
|
-
step: 1,
|
|
26
|
-
label: "Cell Size"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
fontFamily: {
|
|
30
|
-
default: "JetBrains Mono",
|
|
31
|
-
description: "Font family for characters",
|
|
32
|
-
ui: {
|
|
33
|
-
type: "select",
|
|
34
|
-
options: [
|
|
35
|
-
{
|
|
36
|
-
label: "JetBrains Mono",
|
|
37
|
-
value: "JetBrains Mono"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: "Fira Code",
|
|
41
|
-
value: "Fira Code"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "Source Code Pro",
|
|
45
|
-
value: "Source Code Pro"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: "IBM Plex Mono",
|
|
49
|
-
value: "IBM Plex Mono"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: "Space Mono",
|
|
53
|
-
value: "Space Mono"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
label: "Roboto Mono",
|
|
57
|
-
value: "Roboto Mono"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
label: "Courier Prime",
|
|
61
|
-
value: "Courier Prime"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
label: "Font Family"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
spacing: {
|
|
68
|
-
default: 1,
|
|
69
|
-
description: "Character size within each cell (1.0 = optimal size, 0.0 = smallest)",
|
|
70
|
-
ui: {
|
|
71
|
-
type: "range",
|
|
72
|
-
min: 0,
|
|
73
|
-
max: 1,
|
|
74
|
-
step: 0.05,
|
|
75
|
-
label: "Character Size"
|
|
76
|
-
},
|
|
77
|
-
transform: (a) => 0.1 + a * 1.4
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
fragmentNode: ({ uniforms: a, childNode: $, onCleanup: R, onBeforeRender: te }) => {
|
|
81
|
-
const { vec2: v, vec3: k, vec4: E, floor: M, fract: ae, dot: _, ceil: oe, sqrt: ne, screenUV: le, texture: re, viewportSize: ce, convertToTexture: se } = $e;
|
|
82
|
-
if (!$) return E(0, 0, 0, 0);
|
|
83
|
-
const w = se($);
|
|
84
|
-
R(() => {
|
|
85
|
-
w?.renderTarget?.dispose && w.renderTarget.dispose();
|
|
86
|
-
});
|
|
87
|
-
const l = 2048, D = {
|
|
88
|
-
"JetBrains Mono": "JetBrains+Mono",
|
|
89
|
-
"Fira Code": "Fira+Code",
|
|
90
|
-
"Source Code Pro": "Source+Code+Pro",
|
|
91
|
-
"IBM Plex Mono": "IBM+Plex+Mono",
|
|
92
|
-
"Space Mono": "Space+Mono",
|
|
93
|
-
"Roboto Mono": "Roboto+Mono",
|
|
94
|
-
"Courier Prime": "Courier+Prime"
|
|
95
|
-
}, y = /* @__PURE__ */ new Set();
|
|
96
|
-
async function ie(e) {
|
|
97
|
-
if (y.has(e) || !D[e]) return;
|
|
98
|
-
const n = D[e];
|
|
99
|
-
if (!document.querySelector(`link[href*="${n}"]`)) {
|
|
100
|
-
const t = document.createElement("link");
|
|
101
|
-
t.rel = "stylesheet", t.href = `https://fonts.googleapis.com/css2?family=${n}:wght@400&display=swap`, document.head.appendChild(t);
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
104
|
-
if (document.fonts && document.fonts.load) {
|
|
105
|
-
const t = [
|
|
106
|
-
`400 12px "${e}"`,
|
|
107
|
-
`12px "${e}"`,
|
|
108
|
-
`400 12px ${e}`,
|
|
109
|
-
`12px ${e}`
|
|
110
|
-
];
|
|
111
|
-
for (const r of t) try {
|
|
112
|
-
await document.fonts.load(r);
|
|
113
|
-
break;
|
|
114
|
-
} catch {
|
|
115
|
-
}
|
|
116
|
-
await new Promise((r) => setTimeout(r, 500)), y.add(e);
|
|
117
|
-
} else
|
|
118
|
-
await new Promise((t) => setTimeout(t, 1e3)), y.add(e);
|
|
119
|
-
} catch {
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
const q = async (e, n, t, r) => {
|
|
123
|
-
if (!e || e.length === 0) throw new Error("Characters string cannot be empty");
|
|
124
|
-
const u = e.length, i = Math.max(2, Math.ceil(Math.sqrt(u))), Fe = 128, Te = Math.max(1, 2 / r), h = Math.min(Fe * Te, l / i), W = h * 0.75, p = document.createElement("canvas");
|
|
125
|
-
p.width = l, p.height = l;
|
|
126
|
-
const c = p.getContext("2d");
|
|
127
|
-
c.clearRect(0, 0, p.width, p.height), c.fillStyle = "#ffffff", c.font = `${W}px "${t}", ${t}, monospace`, !c.font.includes(t) && !c.font.includes("IBM") && !c.font.includes("Plex") && (c.font = `${W}px ${t}, monospace`), c.textAlign = "center", c.textBaseline = "middle";
|
|
128
|
-
for (let C = 0; C < u; C++) {
|
|
129
|
-
const Be = e[C], Pe = Math.floor(C / i), Ae = C % i * h + h / 2, Ie = Pe * h + h / 2;
|
|
130
|
-
c.fillText(Be, Ae, Ie);
|
|
131
|
-
}
|
|
132
|
-
const Ue = c.getImageData(0, 0, p.width, p.height);
|
|
133
|
-
return {
|
|
134
|
-
data: new Uint8Array(Ue.data),
|
|
135
|
-
width: l,
|
|
136
|
-
height: l,
|
|
137
|
-
atlasSize: i,
|
|
138
|
-
cellSize: n,
|
|
139
|
-
charCount: u,
|
|
140
|
-
characters: e,
|
|
141
|
-
fontFamily: t,
|
|
142
|
-
uvScale: i * h / l
|
|
143
|
-
};
|
|
144
|
-
}, ue = d.props.characters.default, de = d.props.cellSize.default, pe = d.props.fontFamily.default, he = d.props.spacing.transform ? d.props.spacing.transform(d.props.spacing.default) : d.props.spacing.default, b = a?.characters?.uniform?.value ?? ue, G = a?.cellSize?.uniform?.value ?? de, F = a?.fontFamily?.uniform?.value ?? pe, J = a?.spacing?.uniform?.value ?? he;
|
|
145
|
-
let o = {
|
|
146
|
-
data: new Uint8Array(l * l * 4),
|
|
147
|
-
width: l,
|
|
148
|
-
height: l,
|
|
149
|
-
atlasSize: 3,
|
|
150
|
-
cellSize: G,
|
|
151
|
-
charCount: b.length,
|
|
152
|
-
characters: b,
|
|
153
|
-
fontFamily: F,
|
|
154
|
-
uvScale: 1
|
|
155
|
-
};
|
|
156
|
-
const s = new qe(o.data, l, l, Ge, Je);
|
|
157
|
-
s.minFilter = ee, s.magFilter = ee, s.generateMipmaps = !1, s.needsUpdate = !0;
|
|
158
|
-
const me = re(s), T = x(o.charCount), U = x(o.cellSize), B = x(o.uvScale);
|
|
159
|
-
let m = b, f = G, S = F, g = J;
|
|
160
|
-
const O = async () => {
|
|
161
|
-
const e = a?.characters?.uniform?.value ?? m, n = a?.cellSize?.uniform?.value ?? f, t = a?.fontFamily?.uniform?.value ?? S, r = a?.spacing?.uniform?.value ?? g;
|
|
162
|
-
o = await q(e, n, t, r), s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, B.value = o.uvScale, m = e, f = n, S = t, g = r;
|
|
163
|
-
};
|
|
164
|
-
setTimeout(() => {
|
|
165
|
-
O().catch((e) => {
|
|
166
|
-
console.error("Failed to initialize atlas:", e);
|
|
167
|
-
}), ie(a?.fontFamily?.uniform?.value ?? F).then(() => {
|
|
168
|
-
O().catch((e) => {
|
|
169
|
-
console.error("Failed to update atlas with custom font:", e);
|
|
170
|
-
});
|
|
171
|
-
}).catch((e) => {
|
|
172
|
-
console.error("Failed to load font:", e);
|
|
173
|
-
});
|
|
174
|
-
}, 0);
|
|
175
|
-
let V = 0, z = !1;
|
|
176
|
-
te(() => {
|
|
177
|
-
const e = Date.now();
|
|
178
|
-
if (e - V < 16 || z) return;
|
|
179
|
-
const n = a.characters?.uniform?.value ?? m, t = a.cellSize?.uniform?.value ?? f, r = a.fontFamily?.uniform?.value ?? S, u = a.spacing?.uniform?.value ?? g;
|
|
180
|
-
!n || n.length === 0 || (n !== m || t !== f || r !== S || u !== g) && (V = e, z = !0, q(n, t, r, u).then((i) => {
|
|
181
|
-
o = i, s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, B.value = o.uvScale, m = n, f = t, S = r, g = u, z = !1;
|
|
182
|
-
}).catch((i) => {
|
|
183
|
-
console.error("Failed to update atlas:", i), z = !1;
|
|
184
|
-
}));
|
|
185
|
-
}), R(() => {
|
|
186
|
-
s.dispose();
|
|
187
|
-
});
|
|
188
|
-
const fe = U.mul(1.5), N = ce.div(fe), L = le.mul(N), Se = M(L), ge = ae(L), X = a.spacing?.uniform ?? x(J), Z = v(0.5), j = ge.sub(Z), Ce = j.div(X).add(Z), ve = Ee(ke(_e(j), v(X.mul(0.5)))), ze = Se.add(v(0.5)).div(N), P = w.sample(ze), xe = _(P.rgb, k(0.299, 0.587, 0.114)), A = T, H = M(xe.mul(0.8).add(0.1).mul(A).min(A.sub(1e-4))), I = oe(ne(A)), Me = H.mod(I), we = M(H.div(I)), K = Y(1).div(I).mul(B), ye = v(Me, we).mul(K).add(Ce.mul(K)), Q = me.sample(ye), be = _(Q.rgb, k(0.299, 0.587, 0.114)).lessThan(0.1);
|
|
189
|
-
return E(Q.rgb.mul(P.rgb), Re(De(be, ve), Y(0), P.a));
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
var Ne = d;
|
|
193
|
-
export {
|
|
194
|
-
d as n,
|
|
195
|
-
Ne as t
|
|
196
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { O as I } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { i as N, o as k, r as T, t as R } from "./transformations-CsrIJXh-.js";
|
|
3
|
-
import { t as j } from "./colorMixing--dhzx0ch.js";
|
|
4
|
-
const H = {
|
|
5
|
-
name: "Beam",
|
|
6
|
-
category: "Base Layers",
|
|
7
|
-
description: "A beam of light from one point to another.",
|
|
8
|
-
acceptsUVContext: !0,
|
|
9
|
-
props: {
|
|
10
|
-
startPosition: {
|
|
11
|
-
default: {
|
|
12
|
-
x: 0.2,
|
|
13
|
-
y: 0.5
|
|
14
|
-
},
|
|
15
|
-
transform: k,
|
|
16
|
-
description: "Starting point of the beam",
|
|
17
|
-
ui: {
|
|
18
|
-
type: "position",
|
|
19
|
-
label: "Start Position"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
endPosition: {
|
|
23
|
-
default: {
|
|
24
|
-
x: 0.8,
|
|
25
|
-
y: 0.5
|
|
26
|
-
},
|
|
27
|
-
transform: k,
|
|
28
|
-
description: "Ending point of the beam",
|
|
29
|
-
ui: {
|
|
30
|
-
type: "position",
|
|
31
|
-
label: "End Position"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
startThickness: {
|
|
35
|
-
default: 0.2,
|
|
36
|
-
description: "Thickness at the start of the beam",
|
|
37
|
-
ui: {
|
|
38
|
-
type: "range",
|
|
39
|
-
min: 0,
|
|
40
|
-
max: 2,
|
|
41
|
-
step: 0.01,
|
|
42
|
-
label: "Start Thickness"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
endThickness: {
|
|
46
|
-
default: 0.2,
|
|
47
|
-
description: "Thickness at the end of the beam",
|
|
48
|
-
ui: {
|
|
49
|
-
type: "range",
|
|
50
|
-
min: 0,
|
|
51
|
-
max: 2,
|
|
52
|
-
step: 0.01,
|
|
53
|
-
label: "End Thickness"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
startSoftness: {
|
|
57
|
-
default: 0.5,
|
|
58
|
-
description: "Edge softness at the start of the beam",
|
|
59
|
-
ui: {
|
|
60
|
-
type: "range",
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 50,
|
|
63
|
-
step: 0.01,
|
|
64
|
-
label: "Start Softness"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
endSoftness: {
|
|
68
|
-
default: 0.5,
|
|
69
|
-
description: "Edge softness at the end of the beam",
|
|
70
|
-
ui: {
|
|
71
|
-
type: "range",
|
|
72
|
-
min: 0,
|
|
73
|
-
max: 20,
|
|
74
|
-
step: 0.01,
|
|
75
|
-
label: "End Softness"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
insideColor: {
|
|
79
|
-
default: "#FF0000",
|
|
80
|
-
transform: T,
|
|
81
|
-
description: "Color at the center of the beam",
|
|
82
|
-
ui: {
|
|
83
|
-
type: "color",
|
|
84
|
-
label: "Inside Color"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
outsideColor: {
|
|
88
|
-
default: "#0000FF",
|
|
89
|
-
transform: T,
|
|
90
|
-
description: "Color at the edges of the beam",
|
|
91
|
-
ui: {
|
|
92
|
-
type: "color",
|
|
93
|
-
label: "Outside Color"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
colorSpace: {
|
|
97
|
-
default: "linear",
|
|
98
|
-
transform: N,
|
|
99
|
-
description: "Color space for color interpolation",
|
|
100
|
-
ui: {
|
|
101
|
-
type: "select",
|
|
102
|
-
options: R,
|
|
103
|
-
label: "Color Space"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
fragmentNode: ({ uniforms: t, uvContext: v }) => {
|
|
108
|
-
const { vec2: e, vec4: E, float: o, screenUV: V, viewportSize: l, sqrt: B, max: m, smoothstep: p, mix: u, clamp: F, pow: U } = I, f = v ?? V, d = l.x.div(l.y), y = e(t.startPosition.uniform.x, t.startPosition.uniform.y.oneMinus()), x = e(t.endPosition.uniform.x, t.endPosition.uniform.y.oneMinus()), n = e(y.x.mul(d), y.y), b = e(x.x.mul(d), x.y), a = e(f.x.mul(d), f.y), s = e(b.x.sub(n.x), b.y.sub(n.y)), h = e(a.x.sub(n.x), a.y.sub(n.y)), O = h.x.mul(s.x).add(h.y.mul(s.y)), _ = s.x.mul(s.x).add(s.y.mul(s.y)), i = F(O.div(m(_, o(1e-4))), o(0), o(1)), C = e(n.x.add(s.x.mul(i)), n.y.add(s.y.mul(i))), r = e(a.x.sub(C.x), a.y.sub(C.y)), q = B(r.x.mul(r.x).add(r.y.mul(r.y))), w = u(t.startThickness.uniform.mul(0.25), t.endThickness.uniform.mul(0.25), i), z = t.startSoftness.uniform, D = t.endSoftness.uniform, c = u(z, D, i), S = q.div(m(w, o(1e-4))), L = o(1).add(c), M = U(o(1).sub(p(o(1), L, S)), o(1).add(c.mul(1.5))), A = p(o(1).sub(c), o(1).add(c), S), g = t.insideColor.uniform, P = t.outsideColor.uniform, G = j(g, P, A, t.colorSpace.uniform).rgb;
|
|
109
|
-
return E(G, g.a.add(P.a).div(o(2)).mul(M));
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
var W = H;
|
|
113
|
-
export {
|
|
114
|
-
H as n,
|
|
115
|
-
W as t
|
|
116
|
-
};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { O as fo } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { t as bo } from "./time-DbRMw6Jm.js";
|
|
3
|
-
import { i as yo, o as xo, r as g, t as Co } from "./transformations-CsrIJXh-.js";
|
|
4
|
-
import { t as vo } from "./colorMixing--dhzx0ch.js";
|
|
5
|
-
const So = {
|
|
6
|
-
name: "Blob",
|
|
7
|
-
category: "Base Layers",
|
|
8
|
-
description: "Organic animated blob with 3D lighting and gradients",
|
|
9
|
-
acceptsUVContext: !0,
|
|
10
|
-
props: {
|
|
11
|
-
colorA: {
|
|
12
|
-
default: "#ff6b35",
|
|
13
|
-
transform: g,
|
|
14
|
-
description: "Primary color of the blob",
|
|
15
|
-
ui: {
|
|
16
|
-
type: "color",
|
|
17
|
-
label: "Color A"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
colorB: {
|
|
21
|
-
default: "#e91e63",
|
|
22
|
-
transform: g,
|
|
23
|
-
description: "Secondary color of the blob",
|
|
24
|
-
ui: {
|
|
25
|
-
type: "color",
|
|
26
|
-
label: "Color B"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
size: {
|
|
30
|
-
default: 0.5,
|
|
31
|
-
description: "Size of the blob",
|
|
32
|
-
ui: {
|
|
33
|
-
type: "range",
|
|
34
|
-
min: 0,
|
|
35
|
-
max: 1,
|
|
36
|
-
step: 0.01,
|
|
37
|
-
label: "Size"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
deformation: {
|
|
41
|
-
default: 0.5,
|
|
42
|
-
description: "How organic and blobby the shape is (0 = circle, 1 = very blobby)",
|
|
43
|
-
ui: {
|
|
44
|
-
type: "range",
|
|
45
|
-
min: 0,
|
|
46
|
-
max: 1,
|
|
47
|
-
step: 0.01,
|
|
48
|
-
label: "Deformation"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
softness: {
|
|
52
|
-
default: 0.5,
|
|
53
|
-
description: "Softness of the blob edges (combines edge width and transition curve)",
|
|
54
|
-
ui: {
|
|
55
|
-
type: "range",
|
|
56
|
-
min: 0,
|
|
57
|
-
max: 1,
|
|
58
|
-
step: 0.01,
|
|
59
|
-
label: "Softness"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
highlightIntensity: {
|
|
63
|
-
default: 0.5,
|
|
64
|
-
description: "Intensity of specular highlight effect",
|
|
65
|
-
ui: {
|
|
66
|
-
type: "range",
|
|
67
|
-
min: 0,
|
|
68
|
-
max: 1,
|
|
69
|
-
step: 0.01,
|
|
70
|
-
label: "Highlight Intensity"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
highlightX: {
|
|
74
|
-
default: 0.3,
|
|
75
|
-
description: "Light direction X component",
|
|
76
|
-
ui: {
|
|
77
|
-
type: "range",
|
|
78
|
-
min: -1,
|
|
79
|
-
max: 1,
|
|
80
|
-
step: 0.01,
|
|
81
|
-
label: "Highlight X"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
highlightY: {
|
|
85
|
-
default: -0.3,
|
|
86
|
-
description: "Light direction Y component",
|
|
87
|
-
ui: {
|
|
88
|
-
type: "range",
|
|
89
|
-
min: -1,
|
|
90
|
-
max: 1,
|
|
91
|
-
step: 0.01,
|
|
92
|
-
label: "Highlight Y"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
highlightZ: {
|
|
96
|
-
default: 0.4,
|
|
97
|
-
description: "Light direction Z component",
|
|
98
|
-
ui: {
|
|
99
|
-
type: "range",
|
|
100
|
-
min: -1,
|
|
101
|
-
max: 1,
|
|
102
|
-
step: 0.01,
|
|
103
|
-
label: "Highlight Z"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
highlightColor: {
|
|
107
|
-
default: "#ffe11a",
|
|
108
|
-
transform: g,
|
|
109
|
-
description: "Color of the specular highlight",
|
|
110
|
-
ui: {
|
|
111
|
-
type: "color",
|
|
112
|
-
label: "Highlight Color"
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
speed: {
|
|
116
|
-
default: 0.5,
|
|
117
|
-
description: "Animation speed",
|
|
118
|
-
ui: {
|
|
119
|
-
type: "range",
|
|
120
|
-
min: 0,
|
|
121
|
-
max: 2,
|
|
122
|
-
step: 0.1,
|
|
123
|
-
label: "Speed"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
seed: {
|
|
127
|
-
default: 1,
|
|
128
|
-
description: "Adjusts the starting state, useful for variation",
|
|
129
|
-
ui: {
|
|
130
|
-
type: "range",
|
|
131
|
-
min: 0,
|
|
132
|
-
max: 100,
|
|
133
|
-
step: 1,
|
|
134
|
-
label: "Seed"
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
center: {
|
|
138
|
-
default: {
|
|
139
|
-
x: 0.5,
|
|
140
|
-
y: 0.5
|
|
141
|
-
},
|
|
142
|
-
transform: xo,
|
|
143
|
-
description: "The center point of the blob",
|
|
144
|
-
ui: {
|
|
145
|
-
type: "position",
|
|
146
|
-
label: "Center Position"
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
colorSpace: {
|
|
150
|
-
default: "linear",
|
|
151
|
-
transform: yo,
|
|
152
|
-
description: "Color space for color interpolation",
|
|
153
|
-
ui: {
|
|
154
|
-
type: "select",
|
|
155
|
-
options: Co,
|
|
156
|
-
label: "Color Space"
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
fragmentNode: (p) => {
|
|
161
|
-
const { uniforms: i, uvContext: D } = p, { vec2: f, vec3: c, vec4: X, float: o, screenUV: Y, smoothstep: s, sin: e, length: b, viewportSize: y, pow: x, max: Z, normalize: C, dot: I, reflect: N } = fo, v = D ?? Y, l = bo(p, i.speed, i.seed), S = i.colorA.uniform, A = i.colorB.uniform, P = i.size.uniform, u = i.deformation.uniform, B = i.softness.uniform, L = i.highlightIntensity.uniform, R = i.highlightX.uniform, T = i.highlightY.uniform, U = i.highlightZ.uniform, V = i.highlightColor.uniform, w = B.mul(o(0.3)), O = B.mul(o(2)).add(o(0.5)), m = o(0.5), z = y.x.div(y.y), _ = f(v.x.mul(z), v.y), k = f(i.center.uniform.x.mul(z), i.center.uniform.y.oneMinus()), t = _.sub(k), M = b(t), j = P, n = o(4), F = e(t.x.mul(n.mul(o(0.8))).add(l.mul(o(0.8)))).mul(e(t.y.mul(n.mul(o(0.7))).add(l.mul(o(0.6))))).add(e(t.x.mul(n.mul(o(1.2))).sub(t.y.mul(n.mul(o(0.9))).add(l.mul(o(0.4)))))).mul(o(0.15)).mul(u), G = e(t.x.mul(n.mul(o(1.4))).sub(l.mul(o(0.5)))).mul(e(t.y.mul(n.mul(o(1.1))).add(l.mul(o(0.7))))).mul(o(0.12)).mul(u).mul(s(o(0.15), o(0.25), m)), W = e(t.x.mul(n.mul(o(1.8))).add(t.y.mul(n.mul(o(1.6))).add(l.mul(o(0.3))))).add(e(t.x.mul(n.mul(o(0.6))).sub(l.mul(o(0.9))))).mul(o(0.1)).mul(u).mul(s(o(0.3), o(0.4), m)), q = e(t.x.mul(n.mul(o(2.2))).add(l.mul(o(0.2)))).mul(e(t.y.mul(n.mul(o(1.9))).sub(l.mul(o(0.8))))).mul(o(0.08)).mul(u).mul(s(o(0.45), o(0.55), m)), E = e(t.x.mul(n.mul(o(2.8))).sub(t.y.mul(n.mul(o(2.4))).add(l.mul(o(0.6))))).mul(o(0.06)).mul(u).mul(s(o(0.6), o(0.7), m)), J = e(t.x.mul(n.mul(o(3.2))).add(l.mul(o(1.1)))).add(e(t.y.mul(n.mul(o(3.5))).sub(l.mul(o(0.4))))).mul(o(0.04)).mul(u).mul(s(o(0.75), o(0.85), m)), K = F.add(G).add(W).add(q).add(E).add(J), h = j.add(K), H = x(s(h.add(w), h.sub(w), M), O), Q = b(t), $ = h, a = s(o(0), $, Q), oo = o(1).sub(a.mul(o(0.1))), to = C(c(t.x.mul(a.add(o(0.2))), t.y.mul(a.add(o(0.2))), oo)), eo = C(c(R, T, U)), lo = c(o(0), o(0), o(1)), io = N(eo.negate(), to), no = o(32), so = x(Z(o(0), I(io, lo)), no), uo = a.mul(o(0.5)).add(o(0.5)), mo = so.mul(uo).mul(L).mul(H), r = t.x.mul(o(3)), d = t.y.mul(o(3)), ao = e(r.add(l.mul(o(0.4)))).mul(e(d.add(l.mul(o(0.3))))).add(e(r.mul(o(0.7)).add(d.mul(o(0.8))).add(l.mul(o(0.2))))).mul(o(0.5)).add(o(0.5)), ro = e(r.mul(o(1.3)).sub(l.mul(o(0.5)))).mul(e(d.mul(o(1.1)).add(l.mul(o(0.6))))).add(e(r.mul(o(0.5)).sub(d.mul(o(0.6)).sub(l.mul(o(0.3)))))).mul(o(0.5)).add(o(0.5)), co = ao.mul(o(0.6)).add(ro.mul(o(0.4))), ho = vo(S, A, s(o(0.1), o(0.9), co), i.colorSpace.uniform).rgb, go = S.a.add(A.a).div(o(2)), po = V.rgb.mul(mo);
|
|
162
|
-
return X(ho.add(po), go.mul(H));
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
var Ho = So;
|
|
166
|
-
export {
|
|
167
|
-
So as n,
|
|
168
|
-
Ho as t
|
|
169
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { O as S } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
const B = {
|
|
3
|
-
name: "Blur",
|
|
4
|
-
category: "Blurs",
|
|
5
|
-
description: "A simple Gaussian blur effect",
|
|
6
|
-
requiresRTT: !0,
|
|
7
|
-
requiresChild: !0,
|
|
8
|
-
props: { intensity: {
|
|
9
|
-
default: 50,
|
|
10
|
-
description: "Intensity of the blur effect",
|
|
11
|
-
ui: {
|
|
12
|
-
type: "range",
|
|
13
|
-
min: 0,
|
|
14
|
-
max: 100,
|
|
15
|
-
step: 1,
|
|
16
|
-
label: "Intensity"
|
|
17
|
-
}
|
|
18
|
-
} },
|
|
19
|
-
fragmentNode: ({ uniforms: z, childNode: f, onCleanup: g }) => {
|
|
20
|
-
const { vec2: r, vec4: n, float: s, screenUV: T, convertToTexture: v, viewportSize: x, Fn: h } = S;
|
|
21
|
-
if (!f) return n(0, 0, 0, 0);
|
|
22
|
-
const o = v(f);
|
|
23
|
-
g(() => {
|
|
24
|
-
o?.renderTarget?.dispose && o.renderTarget.dispose();
|
|
25
|
-
});
|
|
26
|
-
const y = [
|
|
27
|
-
0.056,
|
|
28
|
-
0.135,
|
|
29
|
-
0.278,
|
|
30
|
-
0.487,
|
|
31
|
-
0.726,
|
|
32
|
-
0.923,
|
|
33
|
-
1,
|
|
34
|
-
0.923,
|
|
35
|
-
0.726,
|
|
36
|
-
0.487,
|
|
37
|
-
0.278,
|
|
38
|
-
0.135,
|
|
39
|
-
0.056
|
|
40
|
-
], b = 6.214, w = z.intensity.uniform.mul(0.06), i = v(h(() => {
|
|
41
|
-
const a = T, l = w, c = r(1).div(x), t = n(0).toVar();
|
|
42
|
-
for (let e = -6; e <= 6; e++) {
|
|
43
|
-
const u = s(y[e + 6] / b), d = r(s(e), s(0)).mul(l).mul(c), m = a.add(d), p = o.sample(m).mul(u);
|
|
44
|
-
t.assign(t.add(p));
|
|
45
|
-
}
|
|
46
|
-
return t;
|
|
47
|
-
})());
|
|
48
|
-
return g(() => {
|
|
49
|
-
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
50
|
-
}), h(() => {
|
|
51
|
-
const a = T, l = w, c = r(1).div(x), t = n(0).toVar();
|
|
52
|
-
for (let e = -6; e <= 6; e++) {
|
|
53
|
-
const u = s(y[e + 6] / b), d = r(s(0), s(e)).mul(l).mul(c), m = a.add(d), p = i.sample(m).mul(u);
|
|
54
|
-
t.assign(t.add(p));
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
})();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var R = B;
|
|
61
|
-
export {
|
|
62
|
-
B as n,
|
|
63
|
-
R as t
|
|
64
|
-
};
|