shaders 2.2.1 → 2.2.3
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-BZENxuhv.js → AngularBlur-BTUdXC0g.js} +5 -4
- package/dist/core/{Ascii-joVW9dAD.js → Ascii-Bu8ii7oo.js} +25 -24
- package/dist/core/{Blob-Ds3jasiC.js → Blob-C0G0efjG.js} +11 -10
- package/dist/core/{Blur-sKjcr9_K.js → Blur-BzUO9yxF.js} +13 -12
- package/dist/core/{Bulge-CdcB9we6.js → Bulge-BCXYAzig.js} +9 -8
- package/dist/core/{CRTScreen-BWDSeX_0.js → CRTScreen-cJ3XHrI9.js} +9 -8
- package/dist/core/{ChannelBlur-i9M5gbkh.js → ChannelBlur-BEK1qzGn.js} +17 -16
- package/dist/core/{Checkerboard-D9-UAs26.js → Checkerboard-BPkiSF5I.js} +15 -14
- package/dist/core/{ChromaFlow-DZAJwEBw.js → ChromaFlow-AHO3C4o3.js} +13 -12
- package/dist/core/{ChromaticAberration-DLYIcjJx.js → ChromaticAberration-nVg3r1FK.js} +11 -10
- package/dist/core/{Circle-Ca-LtXkF.js → Circle-C8ltF4BZ.js} +10 -9
- package/dist/core/{CursorTrail-B_VZJBOK.js → CursorTrail-BeJGeovB.js} +11 -10
- package/dist/core/DiffuseBlur-BdGvOoBw.js +40 -0
- package/dist/core/{Dither-MK-9r3tw.js → Dither-CpN3vGSh.js} +12 -11
- package/dist/core/{DotGrid-DP__DqQj.js → DotGrid-BFUzeSQw.js} +9 -8
- package/dist/core/{Duotone-CmkF6eDj.js → Duotone-_nR_o3-g.js} +6 -5
- package/dist/core/FilmGrain-BAKXXtLg.js +29 -0
- package/dist/core/{FloatingParticles-CxcXDtZg.js → FloatingParticles-Fv8JIzKk.js} +11 -10
- package/dist/core/GlassTiles-5MyBj1ff.js +53 -0
- package/dist/core/{Glow-Cz3ImaBH.js → Glow-DvJj7BB7.js} +13 -12
- package/dist/core/{Godrays-BHfh6URI.js → Godrays-cUzAKVXn.js} +18 -17
- package/dist/core/{Grayscale-FPSUcFGC.js → Grayscale-oWIF3PV5.js} +2 -1
- package/dist/core/{Grid-BvM0M3Hl.js → Grid-Bov7AA9m.js} +10 -9
- package/dist/core/{GridDistortion-yjmNv0Q3.js → GridDistortion-CWYom5Dw.js} +11 -10
- package/dist/core/Group-CPk-7fiA.js +18 -0
- package/dist/core/{Halftone-DWIVrS2s.js → Halftone-F7fsdu7W.js} +11 -10
- package/dist/core/{HueShift-CBupF7d4.js → HueShift-CiS4hdtk.js} +2 -1
- package/dist/core/{ImageTexture-GrTz4Fx7.js → ImageTexture-B3Q29OHX.js} +16 -15
- package/dist/core/Invert-Cyc4JHWc.js +21 -0
- package/dist/core/{LinearBlur-DHBRP6Yh.js → LinearBlur-BTC54qzk.js} +8 -7
- package/dist/core/{LinearGradient-B4C3CKhf.js → LinearGradient-LEMeW0KM.js} +3 -2
- package/dist/core/{Liquify-DNHtcXxv.js → Liquify-D2nzMDzq.js} +15 -14
- package/dist/core/{Pixelate-BKooNVcb.js → Pixelate-irPzmtQm.js} +8 -7
- package/dist/core/{PolarCoordinates-DKhEbQhq.js → PolarCoordinates-Ck5ZWrQO.js} +5 -4
- package/dist/core/{Posterize-D81ZG2A9.js → Posterize-DICq_t96.js} +8 -7
- package/dist/core/{ProgressiveBlur-CPdReTnY.js → ProgressiveBlur-BuORe3VH.js} +10 -9
- package/dist/core/{RadialGradient-XmwfZ91d.js → RadialGradient-D0cN67jm.js} +8 -7
- package/dist/core/{RectangularCoordinates-DWY7ptY1.js → RectangularCoordinates-1LIDaeHR.js} +15 -14
- package/dist/core/{Ripples-CndvRX-N.js → Ripples-DH71sFJc.js} +6 -5
- package/dist/core/{Saturation-C6u9sNkr.js → Saturation-DbSXtSeK.js} +10 -9
- package/dist/core/{SimplexNoise-BH0ZZzP4.js → SimplexNoise-DPGC2OPJ.js} +10 -9
- package/dist/core/{SineWave-DBH8MraQ.js → SineWave-CkWtnzHF.js} +10 -9
- package/dist/core/{SolidColor-DR665qss.js → SolidColor-DaB-FHNX.js} +2 -1
- package/dist/core/{Spiral--7KUy0u3.js → Spiral-CcyI8azF.js} +18 -17
- package/dist/core/{Strands-Bi1Is8_o.js → Strands-Co4fkc05.js} +10 -9
- package/dist/core/{Swirl-DuYM23jG.js → Swirl-BoveqtNV.js} +15 -14
- package/dist/core/{TiltShift-BUvZWBsh.js → TiltShift-D53azmRe.js} +4 -3
- package/dist/core/{Tritone-CKifp6Ob.js → Tritone-Cg1rX-hL.js} +11 -10
- package/dist/core/{Twirl-Ztlb9x_h.js → Twirl-raO5pe5X.js} +10 -9
- package/dist/core/{Vibrance-B7EsDw6e.js → Vibrance-DtekSkcz.js} +8 -7
- package/dist/core/{WaveDistortion-HCnk54tD.js → WaveDistortion-C65qO_cZ.js} +6 -5
- package/dist/core/{ZoomBlur-Ck6M9A2W.js → ZoomBlur-B97ZjhXe.js} +10 -9
- package/dist/core/index.js +771 -754
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +1 -1
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +1 -1
- package/dist/core/shaders/Blob/index.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +1 -1
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +1 -1
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +1 -1
- package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +1 -1
- package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +1 -1
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +1 -1
- package/dist/core/shaders/ChromaFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaFlow/index.js +1 -1
- package/dist/core/shaders/ChromaticAberration/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaticAberration/index.js +1 -1
- package/dist/core/shaders/Circle/index.d.ts.map +1 -1
- package/dist/core/shaders/Circle/index.js +1 -1
- package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
- package/dist/core/shaders/CursorTrail/index.js +1 -1
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +1 -1
- package/dist/core/shaders/Dither/index.d.ts.map +1 -1
- package/dist/core/shaders/Dither/index.js +1 -1
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +1 -1
- package/dist/core/shaders/Duotone/index.d.ts.map +1 -1
- package/dist/core/shaders/Duotone/index.js +1 -1
- package/dist/core/shaders/FilmGrain/index.d.ts.map +1 -1
- package/dist/core/shaders/FilmGrain/index.js +1 -1
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +1 -1
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +1 -1
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/Grayscale/index.d.ts.map +1 -1
- package/dist/core/shaders/Grayscale/index.js +1 -1
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +1 -1
- package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/GridDistortion/index.js +1 -1
- package/dist/core/shaders/Group/index.d.ts.map +1 -1
- package/dist/core/shaders/Group/index.js +1 -1
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +1 -1
- package/dist/core/shaders/HueShift/index.d.ts.map +1 -1
- package/dist/core/shaders/HueShift/index.js +1 -1
- package/dist/core/shaders/ImageTexture/index.d.ts +1 -1
- package/dist/core/shaders/ImageTexture/index.d.ts.map +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/Invert/index.d.ts.map +1 -1
- package/dist/core/shaders/Invert/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Posterize/index.d.ts.map +1 -1
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
- package/dist/core/shaders/RadialGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/RadialGradient/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/Saturation/index.d.ts.map +1 -1
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +1 -1
- package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/SolidColor/index.d.ts.map +1 -1
- package/dist/core/shaders/SolidColor/index.js +1 -1
- package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
- package/dist/core/shaders/Spiral/index.js +1 -1
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/Tritone/index.d.ts.map +1 -1
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.d.ts.map +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/react/index.cjs +63 -63
- package/dist/react/index.js +4776 -4707
- package/dist/react/utils/generatePresetCode.cjs +1 -1
- package/dist/react/utils/generatePresetCode.js +1 -1
- package/dist/registry.d.ts +3 -0
- package/dist/registry.js +226 -88
- package/dist/svelte/index.js +5539 -5470
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/{generatePresetCode-T78GxN5X.js → generatePresetCode-D4V6rBae.js} +1 -1
- package/dist/vue/index.js +4603 -4534
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +1 -1
- package/dist/core/DiffuseBlur-COpm1qrw.js +0 -39
- package/dist/core/FilmGrain-ByNyK2gs.js +0 -28
- package/dist/core/GlassTiles-CxUl9MxF.js +0 -52
- package/dist/core/Group-jZZimqG1.js +0 -17
- package/dist/core/Invert-CCQ1H_Qr.js +0 -20
|
@@ -4,6 +4,7 @@ q();
|
|
|
4
4
|
const P = {
|
|
5
5
|
name: "AngularBlur",
|
|
6
6
|
category: "Blurs",
|
|
7
|
+
description: "Radial motion blur rotating around a center point",
|
|
7
8
|
requiresRTT: !0,
|
|
8
9
|
requiresChild: !0,
|
|
9
10
|
props: {
|
|
@@ -42,15 +43,15 @@ const P = {
|
|
|
42
43
|
return T(() => {
|
|
43
44
|
const e = x.sub(c), s = u(0).toVar(), i = t(0).toVar(), _ = A.div(t(31));
|
|
44
45
|
for (let n = 0; n < 32; n++) {
|
|
45
|
-
const
|
|
46
|
-
s.assign(s.add(C)), i.assign(i.add(
|
|
46
|
+
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 = _.mul(t(n)), f = h(p), g = v(p), B = l(e.x.mul(f).sub(e.y.mul(g)), e.x.mul(g).add(e.y.mul(f))).add(c), C = o.sample(B).mul(m);
|
|
47
|
+
s.assign(s.add(C)), i.assign(i.add(m));
|
|
47
48
|
}
|
|
48
49
|
return s.div(i);
|
|
49
50
|
})();
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
|
-
var
|
|
53
|
+
var w = P;
|
|
53
54
|
export {
|
|
54
55
|
P as n,
|
|
55
|
-
|
|
56
|
+
w as t
|
|
56
57
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { A as x, C as
|
|
1
|
+
import { A as x, C as $e, b as Re, d as Y, k as _e, m as ke, p as Ee, r as De, t as qe } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { DataTexture as Ge, NearestFilter as ee, RGBAFormat as Je, UnsignedByteType as Ve } from "three";
|
|
3
|
-
|
|
3
|
+
ke();
|
|
4
4
|
const d = {
|
|
5
5
|
name: "Ascii",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Stylize",
|
|
7
|
+
description: "Convert imagery to ASCII character art",
|
|
7
8
|
requiresRTT: !0,
|
|
8
9
|
requiresChild: !0,
|
|
9
10
|
props: {
|
|
@@ -77,10 +78,10 @@ const d = {
|
|
|
77
78
|
transform: (a) => 0.1 + a * 1.4
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
|
-
fragmentNode: ({ uniforms: a, childNode:
|
|
81
|
-
const { vec2: v, vec3: _, vec4:
|
|
82
|
-
if (
|
|
83
|
-
const w = se(
|
|
81
|
+
fragmentNode: ({ uniforms: a, childNode: $, onCleanup: R, onBeforeRender: te }) => {
|
|
82
|
+
const { vec2: v, vec3: _, vec4: k, floor: M, fract: ae, dot: E, ceil: oe, sqrt: ne, screenUV: le, texture: re, viewportSize: ce, convertToTexture: se } = _e;
|
|
83
|
+
if (!$) return k(0, 0, 0, 0);
|
|
84
|
+
const w = se($);
|
|
84
85
|
R(() => {
|
|
85
86
|
w?.renderTarget?.dispose && w.renderTarget.dispose();
|
|
86
87
|
});
|
|
@@ -121,13 +122,13 @@ const d = {
|
|
|
121
122
|
}
|
|
122
123
|
const q = async (e, n, t, r) => {
|
|
123
124
|
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))),
|
|
125
|
+
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
126
|
p.width = l, p.height = l;
|
|
126
127
|
const c = p.getContext("2d");
|
|
127
128
|
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
129
|
for (let C = 0; C < u; C++) {
|
|
129
|
-
const
|
|
130
|
-
c.fillText(
|
|
130
|
+
const Ae = e[C], Be = Math.floor(C / i), Pe = C % i * h + h / 2, Ie = Be * h + h / 2;
|
|
131
|
+
c.fillText(Ae, Pe, Ie);
|
|
131
132
|
}
|
|
132
133
|
const Ue = c.getImageData(0, 0, p.width, p.height);
|
|
133
134
|
return {
|
|
@@ -141,30 +142,30 @@ const d = {
|
|
|
141
142
|
fontFamily: t,
|
|
142
143
|
uvScale: i * h / l
|
|
143
144
|
};
|
|
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,
|
|
145
|
+
}, 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, y = a?.characters?.uniform?.value ?? ue, G = a?.cellSize?.uniform?.value ?? de, F = a?.fontFamily?.uniform?.value ?? pe, J = a?.spacing?.uniform?.value ?? he;
|
|
145
146
|
let o = {
|
|
146
147
|
data: new Uint8Array(l * l * 4),
|
|
147
148
|
width: l,
|
|
148
149
|
height: l,
|
|
149
150
|
atlasSize: 3,
|
|
150
151
|
cellSize: G,
|
|
151
|
-
charCount:
|
|
152
|
-
characters:
|
|
153
|
-
fontFamily:
|
|
152
|
+
charCount: y.length,
|
|
153
|
+
characters: y,
|
|
154
|
+
fontFamily: F,
|
|
154
155
|
uvScale: 1
|
|
155
156
|
};
|
|
156
157
|
const s = new Ge(o.data, l, l, Je, Ve);
|
|
157
158
|
s.minFilter = ee, s.magFilter = ee, s.generateMipmaps = !1, s.needsUpdate = !0;
|
|
158
|
-
const
|
|
159
|
-
let
|
|
159
|
+
const me = re(s), T = x(o.charCount), U = x(o.cellSize), A = x(o.uvScale);
|
|
160
|
+
let m = y, f = G, S = F, g = J;
|
|
160
161
|
const V = async () => {
|
|
161
|
-
const e = a?.characters?.uniform?.value ??
|
|
162
|
-
o = await q(e, n, t, r), s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize,
|
|
162
|
+
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;
|
|
163
|
+
o = await q(e, n, t, r), s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, A.value = o.uvScale, m = e, f = n, S = t, g = r;
|
|
163
164
|
};
|
|
164
165
|
setTimeout(() => {
|
|
165
166
|
V().catch((e) => {
|
|
166
167
|
console.error("Failed to initialize atlas:", e);
|
|
167
|
-
}), ie(a?.fontFamily?.uniform?.value ??
|
|
168
|
+
}), ie(a?.fontFamily?.uniform?.value ?? F).then(() => {
|
|
168
169
|
V().catch((e) => {
|
|
169
170
|
console.error("Failed to update atlas with custom font:", e);
|
|
170
171
|
});
|
|
@@ -176,17 +177,17 @@ const d = {
|
|
|
176
177
|
te(() => {
|
|
177
178
|
const e = Date.now();
|
|
178
179
|
if (e - O < 16 || z) return;
|
|
179
|
-
const n = a.characters?.uniform?.value ??
|
|
180
|
-
!n || n.length === 0 || (n !==
|
|
181
|
-
o = i, s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize,
|
|
180
|
+
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;
|
|
181
|
+
!n || n.length === 0 || (n !== m || t !== f || r !== S || u !== g) && (O = e, z = !0, q(n, t, r, u).then((i) => {
|
|
182
|
+
o = i, s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, A.value = o.uvScale, m = n, f = t, S = r, g = u, z = !1;
|
|
182
183
|
}).catch((i) => {
|
|
183
184
|
console.error("Failed to update atlas:", i), z = !1;
|
|
184
185
|
}));
|
|
185
186
|
}), R(() => {
|
|
186
187
|
s.dispose();
|
|
187
188
|
});
|
|
188
|
-
const
|
|
189
|
-
return
|
|
189
|
+
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 = De(Ee(qe(j), v(X.mul(0.5)))), ze = Se.add(v(0.5)).div(N), B = w.sample(ze), xe = E(B.rgb, _(0.299, 0.587, 0.114)), P = T, H = M(xe.mul(0.8).add(0.1).mul(P).min(P.sub(1e-4))), I = oe(ne(P)), Me = H.mod(I), we = M(H.div(I)), K = Y(1).div(I).mul(A), be = v(Me, we).mul(K).add(Ce.mul(K)), Q = me.sample(be), ye = E(Q.rgb, _(0.299, 0.587, 0.114)).lessThan(0.1);
|
|
190
|
+
return k(Q.rgb.mul(B.rgb), $e(Re(ye, ve), Y(0), B.a));
|
|
190
191
|
}
|
|
191
192
|
};
|
|
192
193
|
var Le = d;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { k as fo, m as bo } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { t as yo } from "./time-5uQ65blS.js";
|
|
3
|
-
import { i as xo, o as Co, r as
|
|
3
|
+
import { i as xo, o as Co, r as g, t as vo } from "./transformations-DBjTkQ5b.js";
|
|
4
4
|
import { t as So } from "./colorMixing-DPZ-Td4U.js";
|
|
5
5
|
bo();
|
|
6
6
|
const Ao = {
|
|
7
7
|
name: "Blob",
|
|
8
|
-
category: "
|
|
8
|
+
category: "Base Layers",
|
|
9
|
+
description: "Organic animated blob with 3D lighting and gradients",
|
|
9
10
|
acceptsUVContext: !0,
|
|
10
11
|
props: {
|
|
11
12
|
colorA: {
|
|
12
13
|
default: "#ff6b35",
|
|
13
|
-
transform:
|
|
14
|
+
transform: g,
|
|
14
15
|
description: "Primary color of the blob",
|
|
15
16
|
ui: {
|
|
16
17
|
type: "color",
|
|
@@ -19,7 +20,7 @@ const Ao = {
|
|
|
19
20
|
},
|
|
20
21
|
colorB: {
|
|
21
22
|
default: "#e91e63",
|
|
22
|
-
transform:
|
|
23
|
+
transform: g,
|
|
23
24
|
description: "Secondary color of the blob",
|
|
24
25
|
ui: {
|
|
25
26
|
type: "color",
|
|
@@ -105,7 +106,7 @@ const Ao = {
|
|
|
105
106
|
},
|
|
106
107
|
highlightColor: {
|
|
107
108
|
default: "#ffe11a",
|
|
108
|
-
transform:
|
|
109
|
+
transform: g,
|
|
109
110
|
description: "Color of the specular highlight",
|
|
110
111
|
ui: {
|
|
111
112
|
type: "color",
|
|
@@ -157,13 +158,13 @@ const Ao = {
|
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
},
|
|
160
|
-
fragmentNode: (
|
|
161
|
-
const { uniforms: i, uvContext:
|
|
162
|
-
return
|
|
161
|
+
fragmentNode: (p) => {
|
|
162
|
+
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 = yo(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, _ = i.highlightIntensity.uniform, L = i.highlightX.uniform, R = i.highlightY.uniform, T = i.highlightZ.uniform, U = i.highlightColor.uniform, w = B.mul(o(0.3)), V = B.mul(o(2)).add(o(0.5)), m = o(0.5), z = y.x.div(y.y), k = f(v.x.mul(z), v.y), M = f(i.center.uniform.x.mul(z), i.center.uniform.y.oneMinus()), t = k.sub(M), O = 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), O), V), 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(L, R, T)), 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(_).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 = So(S, A, s(o(0.1), o(0.9), co), i.colorSpace.uniform).rgb, go = S.a.add(A.a).div(o(2)), po = U.rgb.mul(mo);
|
|
163
|
+
return X(ho.add(po), go.mul(H));
|
|
163
164
|
}
|
|
164
165
|
};
|
|
165
|
-
var
|
|
166
|
+
var Do = Ao;
|
|
166
167
|
export {
|
|
167
168
|
Ao as n,
|
|
168
|
-
|
|
169
|
+
Do as t
|
|
169
170
|
};
|
|
@@ -3,6 +3,7 @@ S();
|
|
|
3
3
|
const B = {
|
|
4
4
|
name: "Blur",
|
|
5
5
|
category: "Blurs",
|
|
6
|
+
description: "A simple Gaussian blur effect",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: { intensity: {
|
|
@@ -16,7 +17,7 @@ const B = {
|
|
|
16
17
|
label: "Intensity"
|
|
17
18
|
}
|
|
18
19
|
} },
|
|
19
|
-
fragmentNode: ({ uniforms:
|
|
20
|
+
fragmentNode: ({ uniforms: _, childNode: f, onCleanup: g }) => {
|
|
20
21
|
const { vec2: r, vec4: n, float: s, screenUV: T, convertToTexture: h, viewportSize: v, Fn: x } = z;
|
|
21
22
|
if (!f) return n(0, 0, 0, 0);
|
|
22
23
|
const o = h(f);
|
|
@@ -37,23 +38,23 @@ const B = {
|
|
|
37
38
|
0.278,
|
|
38
39
|
0.135,
|
|
39
40
|
0.056
|
|
40
|
-
],
|
|
41
|
-
const a = T, l =
|
|
42
|
-
for (let
|
|
43
|
-
const u = s(y[
|
|
44
|
-
|
|
41
|
+
], b = 6.214, w = _.intensity.uniform.mul(0.06), i = h(x(() => {
|
|
42
|
+
const a = T, l = w, c = r(1).div(v), t = n(0).toVar();
|
|
43
|
+
for (let e = -6; e <= 6; e++) {
|
|
44
|
+
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);
|
|
45
|
+
t.assign(t.add(p));
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
+
return t;
|
|
47
48
|
})());
|
|
48
49
|
return g(() => {
|
|
49
50
|
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
50
51
|
}), x(() => {
|
|
51
|
-
const a = T, l =
|
|
52
|
-
for (let
|
|
53
|
-
const u = s(y[
|
|
54
|
-
|
|
52
|
+
const a = T, l = w, c = r(1).div(v), t = n(0).toVar();
|
|
53
|
+
for (let e = -6; e <= 6; e++) {
|
|
54
|
+
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);
|
|
55
|
+
t.assign(t.add(p));
|
|
55
56
|
}
|
|
56
|
-
return
|
|
57
|
+
return t;
|
|
57
58
|
})();
|
|
58
59
|
}
|
|
59
60
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { d as i, h as A, k as
|
|
1
|
+
import { d as i, h as A, k as V, m as R } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { t as S } from "./edges-B-tVdqcI.js";
|
|
3
3
|
import { a as w, o as E } from "./transformations-DBjTkQ5b.js";
|
|
4
4
|
R();
|
|
5
5
|
const P = {
|
|
6
6
|
name: "Bulge",
|
|
7
7
|
category: "Distortions",
|
|
8
|
+
description: "Magnify or pinch content around a center point",
|
|
8
9
|
requiresRTT: !0,
|
|
9
10
|
requiresChild: !0,
|
|
10
11
|
props: {
|
|
@@ -82,18 +83,18 @@ const P = {
|
|
|
82
83
|
}
|
|
83
84
|
},
|
|
84
85
|
uvTransformNode: ({ uv: e, uniforms: o, viewportSize: u }) => {
|
|
85
|
-
const { vec2:
|
|
86
|
-
return
|
|
86
|
+
const { vec2: n, length: b, smoothstep: x, float: t, max: d } = V, c = u.x.div(u.y), y = n(e.x.mul(c), e.y), s = n(o.center.uniform.x.mul(c), o.center.uniform.y.oneMinus()), a = y.sub(s), f = b(a), r = o.radius.uniform.mul(0.5), m = o.falloff.uniform, p = x(r.mul(t(1).sub(m).sub(t(1e-3)).max(t(0))), r, f).oneMinus(), l = f.div(r), v = l.mul(l), T = d(t(0), t(1).sub(v)), g = p.mul(T), F = o.strength.uniform.negate().mul(g), q = t(1).add(F), D = a.mul(q), h = s.add(D);
|
|
87
|
+
return n(h.x.div(c), h.y);
|
|
87
88
|
},
|
|
88
89
|
fragmentNode: ({ uniforms: e, childNode: o, onCleanup: u }) => {
|
|
89
|
-
const { vec2:
|
|
90
|
+
const { vec2: n, vec4: b, length: x, screenUV: t, viewportSize: d, convertToTexture: c, smoothstep: y } = V;
|
|
90
91
|
if (!o) return b(0, 0, 0, 0);
|
|
91
|
-
const
|
|
92
|
+
const s = c(o);
|
|
92
93
|
u(() => {
|
|
93
|
-
|
|
94
|
+
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
94
95
|
});
|
|
95
|
-
const a =
|
|
96
|
-
return S(
|
|
96
|
+
const a = d.x.div(d.y), f = n(t.x.mul(a), t.y), r = n(e.center.uniform.x.mul(a), e.center.uniform.y.oneMinus()), m = f.sub(r), p = x(m), l = e.radius.uniform.mul(0.5), v = e.falloff.uniform, T = y(l.mul(i(1).sub(v).sub(i(1e-3)).max(i(0))), l, p).oneMinus(), g = p.div(l), F = g.mul(g), q = A(i(0), i(1).sub(F)), D = T.mul(q), h = e.strength.uniform.negate().mul(D), C = i(1).add(h), _ = m.mul(C), M = r.add(_), U = n(M.x.div(a), M.y);
|
|
97
|
+
return S(U, s.sample(U), s, e.edges.uniform);
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
var $ = P;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { k as
|
|
1
|
+
import { k as E, m as N } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
N();
|
|
3
3
|
const W = {
|
|
4
4
|
name: "CRTScreen",
|
|
5
|
-
category: "
|
|
5
|
+
category: "Stylize",
|
|
6
|
+
description: "Retro CRT monitor simulation with scanlines",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
@@ -73,15 +74,15 @@ const W = {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
|
-
fragmentNode: ({ uniforms: n, childNode:
|
|
77
|
-
const { vec2: o, vec3: c, vec4: u, float: e, screenUV: t, sin:
|
|
78
|
-
if (!
|
|
79
|
-
const s =
|
|
77
|
+
fragmentNode: ({ uniforms: n, childNode: a, onCleanup: d }) => {
|
|
78
|
+
const { vec2: o, vec3: c, vec4: u, float: e, screenUV: t, sin: i, fract: p, smoothstep: f, length: h, convertToTexture: g } = E;
|
|
79
|
+
if (!a) return u(0, 0, 0, 0);
|
|
80
|
+
const s = g(a);
|
|
80
81
|
d(() => {
|
|
81
82
|
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
82
83
|
});
|
|
83
|
-
const b = n.pixelSize.uniform, S = n.colorShift.uniform, x = n.scanlineIntensity.uniform, y = n.scanlineFrequency.uniform, C = n.brightness.uniform, T = n.contrast.uniform, m = S.mul(e(2e-3)), v = t.add(o(m, e(0))),
|
|
84
|
-
return u(P.mul(
|
|
84
|
+
const b = n.pixelSize.uniform, S = n.colorShift.uniform, x = n.scanlineIntensity.uniform, y = n.scanlineFrequency.uniform, C = n.brightness.uniform, T = n.contrast.uniform, m = S.mul(e(2e-3)), v = t.add(o(m, e(0))), z = t, q = t.sub(o(m, e(0))), R = s.sample(v).r, V = s.sample(z).g, _ = s.sample(q).b, k = c(R, V, _).sub(e(0.5)).mul(T).add(e(0.5)).mul(C), F = i(t.y.mul(y).mul(e(3.14159 * 2))), I = e(1).sub(x.mul(F.mul(e(0.5)).add(e(0.5)))), r = k.mul(I), U = b.mul(e(0.5)), l = p(t.mul(U)), M = i(l.x.mul(e(6.28318))).mul(e(0.1)).add(e(0.95)), w = i(l.x.mul(e(6.28318)).add(e(2.09))).mul(e(0.1)).add(e(0.95)), D = i(l.x.mul(e(6.28318)).add(e(4.18))).mul(e(0.1)).add(e(0.95)), P = c(r.r.mul(M), r.g.mul(w), r.b.mul(D)), j = h(t.sub(o(0.5, 0.5))), B = f(e(0.8), e(0.3), j);
|
|
85
|
+
return u(P.mul(B), e(1));
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
var G = W;
|
|
@@ -3,6 +3,7 @@ k();
|
|
|
3
3
|
const A = {
|
|
4
4
|
name: "ChannelBlur",
|
|
5
5
|
category: "Blurs",
|
|
6
|
+
description: "Independent blur for red, green, and blue channels",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
@@ -40,11 +41,11 @@ const A = {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
|
-
fragmentNode: ({ uniforms: m, childNode: x, onCleanup:
|
|
44
|
-
const { vec2: t, vec4: p, float: e, screenUV:
|
|
44
|
+
fragmentNode: ({ uniforms: m, childNode: x, onCleanup: I }) => {
|
|
45
|
+
const { vec2: t, vec4: p, float: e, screenUV: S, convertToTexture: v, viewportSize: O, Fn: B } = C;
|
|
45
46
|
if (!x) return p(0, 0, 0, 0);
|
|
46
|
-
const i =
|
|
47
|
-
|
|
47
|
+
const i = v(x);
|
|
48
|
+
I(() => {
|
|
48
49
|
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
49
50
|
});
|
|
50
51
|
const V = [
|
|
@@ -61,24 +62,24 @@ const A = {
|
|
|
61
62
|
0.278,
|
|
62
63
|
0.135,
|
|
63
64
|
0.056
|
|
64
|
-
], w = 6.214, R = m.redIntensity.uniform.mul(0.1), _ = m.greenIntensity.uniform.mul(0.1), z = m.blueIntensity.uniform.mul(0.1),
|
|
65
|
-
const n =
|
|
66
|
-
for (let
|
|
67
|
-
const s = e(V[
|
|
68
|
-
r.assign(r.add(
|
|
65
|
+
], w = 6.214, R = m.redIntensity.uniform.mul(0.1), _ = m.greenIntensity.uniform.mul(0.1), z = m.blueIntensity.uniform.mul(0.1), u = v(B(() => {
|
|
66
|
+
const n = S, f = t(1).div(O), r = e(0).toVar(), a = e(0).toVar(), l = e(0).toVar();
|
|
67
|
+
for (let d = -6; d <= 6; d++) {
|
|
68
|
+
const s = e(V[d + 6] / w), o = e(d).mul(f.x), c = t(o.mul(R), e(0)), g = t(o.mul(_), e(0)), y = t(o.mul(z), e(0)), b = i.sample(n.add(c)).r.mul(s), T = i.sample(n.add(g)).g.mul(s), h = i.sample(n.add(y)).b.mul(s);
|
|
69
|
+
r.assign(r.add(b)), a.assign(a.add(T)), l.assign(l.add(h));
|
|
69
70
|
}
|
|
70
71
|
return p(r, a, l, e(1));
|
|
71
72
|
})());
|
|
72
|
-
return
|
|
73
|
-
|
|
73
|
+
return I(() => {
|
|
74
|
+
u?.renderTarget?.dispose && u.renderTarget.dispose();
|
|
74
75
|
}), B(() => {
|
|
75
|
-
const n =
|
|
76
|
+
const n = S, f = t(1).div(O), r = e(0).toVar(), a = e(0).toVar(), l = e(0).toVar();
|
|
76
77
|
for (let s = -6; s <= 6; s++) {
|
|
77
|
-
const o = e(V[s + 6] / w), c = e(s).mul(f.y), g = t(e(0), c.mul(R)), y = t(e(0), c.mul(_)),
|
|
78
|
-
r.assign(r.add(
|
|
78
|
+
const o = e(V[s + 6] / w), c = e(s).mul(f.y), g = t(e(0), c.mul(R)), y = t(e(0), c.mul(_)), b = t(e(0), c.mul(z)), T = u.sample(n.add(g)).r.mul(o), h = u.sample(n.add(y)).g.mul(o), q = u.sample(n.add(b)).b.mul(o);
|
|
79
|
+
r.assign(r.add(T)), a.assign(a.add(h)), l.assign(l.add(q));
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
-
return p(r, a, l,
|
|
81
|
+
const d = i.sample(n).a;
|
|
82
|
+
return p(r, a, l, d);
|
|
82
83
|
})();
|
|
83
84
|
}
|
|
84
85
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import { i as
|
|
3
|
-
import { t as
|
|
4
|
-
|
|
1
|
+
import { k as B, m as U } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { i as _, r as f, t as w } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
import { t as A } from "./colorMixing-DPZ-Td4U.js";
|
|
4
|
+
U();
|
|
5
5
|
const F = {
|
|
6
6
|
name: "Checkerboard",
|
|
7
|
-
category: "
|
|
7
|
+
category: "Base Layers",
|
|
8
|
+
description: "Classic checkerboard pattern with two alternating colors",
|
|
8
9
|
acceptsUVContext: !0,
|
|
9
10
|
props: {
|
|
10
11
|
colorA: {
|
|
@@ -49,27 +50,27 @@ const F = {
|
|
|
49
50
|
},
|
|
50
51
|
colorSpace: {
|
|
51
52
|
default: "linear",
|
|
52
|
-
transform:
|
|
53
|
+
transform: _,
|
|
53
54
|
description: "Color space for color interpolation",
|
|
54
55
|
ui: {
|
|
55
56
|
type: "select",
|
|
56
|
-
options:
|
|
57
|
+
options: w,
|
|
57
58
|
label: "Color Space"
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
fragmentNode: ({ uniforms: o, uvContext: m }) => {
|
|
62
|
-
const { vec2: u, float: e, floor: h, mod: b, fract: g, smoothstep: y, min: r, screenUV: C, viewportSize: s } =
|
|
63
|
-
let
|
|
63
|
+
const { vec2: u, float: e, floor: h, mod: b, fract: g, smoothstep: y, min: r, screenUV: C, viewportSize: s } = B, c = m ?? C, x = s.x.div(s.y), S = u(c.x.mul(x), c.y.oneMinus()), k = o.cells.uniform, l = o.softness.uniform, a = S.mul(k), n = h(a), i = b(n.x.add(n.y), 2);
|
|
64
|
+
let d = i;
|
|
64
65
|
if (l) {
|
|
65
|
-
const t = g(a), v = r(r(t.x, e(1).sub(t.x)), r(t.y, e(1).sub(t.y))), V = l.mul(0.5),
|
|
66
|
-
|
|
66
|
+
const t = g(a), v = r(r(t.x, e(1).sub(t.x)), r(t.y, e(1).sub(t.y))), V = l.mul(0.5), p = y(e(0), V, v);
|
|
67
|
+
d = i.mul(p).add(e(0.5).mul(e(1).sub(p)));
|
|
67
68
|
}
|
|
68
|
-
return
|
|
69
|
+
return A(o.colorA.uniform, o.colorB.uniform, d, o.colorSpace.uniform);
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
|
-
var
|
|
72
|
+
var D = F;
|
|
72
73
|
export {
|
|
73
74
|
F as n,
|
|
74
|
-
|
|
75
|
+
D as t
|
|
75
76
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { k as Vt, m as Wt } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { r as X } from "./transformations-DBjTkQ5b.js";
|
|
3
|
-
import { DataTexture as at, FloatType as
|
|
3
|
+
import { DataTexture as at, FloatType as lt, LinearFilter as _, RGFormat as nt } from "three";
|
|
4
4
|
Wt();
|
|
5
5
|
const jt = {
|
|
6
6
|
name: "ChromaFlow",
|
|
7
7
|
category: "Interactive",
|
|
8
|
+
description: "Interactive liquid flow effect that follows your cursor",
|
|
8
9
|
props: {
|
|
9
10
|
baseColor: {
|
|
10
11
|
default: "#0066ff",
|
|
@@ -86,10 +87,10 @@ const jt = {
|
|
|
86
87
|
}
|
|
87
88
|
},
|
|
88
89
|
fragmentNode: ({ uniforms: u, onBeforeRender: st, onCleanup: rt }) => {
|
|
89
|
-
const { vec2:
|
|
90
|
-
w.magFilter =
|
|
91
|
-
const C = new at(r, o, o,
|
|
92
|
-
C.magFilter =
|
|
90
|
+
const { vec2: l, vec4: it, float: t, uniform: Y, screenUV: n, texture: W, smoothstep: v, mix: dt } = Vt, o = 128, f = new Float32Array(o * o * 2), r = new Float32Array(o * o * 2), w = new at(f, o, o, nt, lt);
|
|
91
|
+
w.magFilter = _, w.minFilter = _, w.needsUpdate = !0;
|
|
92
|
+
const C = new at(r, o, o, nt, lt);
|
|
93
|
+
C.magFilter = _, C.minFilter = _, C.needsUpdate = !0;
|
|
93
94
|
const F = W(w), b = W(C), ct = Y(0.5), mt = Y(0.5), q = Y(0), D = Y(0);
|
|
94
95
|
let j = 0.5, B = 0.5, G = Date.now();
|
|
95
96
|
st(({ pointer: p }) => {
|
|
@@ -97,20 +98,20 @@ const jt = {
|
|
|
97
98
|
G = tt;
|
|
98
99
|
const ot = s > 0 ? (p.x - j) / s : 0, et = s > 0 ? (p.y - B) / s : 0;
|
|
99
100
|
q.value = q.value * 0.85 + ot * 0.15, D.value = D.value * 0.85 + et * 0.15, ct.value = p.x, mt.value = p.y;
|
|
100
|
-
const V = u.intensity.uniform.value, Yt = u.radius.uniform.value * 0.05, zt = u.momentum.uniform.value, x = new Float32Array(f), i = new Float32Array(r),
|
|
101
|
-
for (let a = 0; a < o * o * 2; a++) x[a] = f[a] *
|
|
101
|
+
const V = u.intensity.uniform.value, Yt = u.radius.uniform.value * 0.05, zt = u.momentum.uniform.value, x = new Float32Array(f), i = new Float32Array(r), It = 1 - s / Math.max(0.1, 1);
|
|
102
|
+
for (let a = 0; a < o * o * 2; a++) x[a] = f[a] * It;
|
|
102
103
|
for (let a = 0; a < o; a++) for (let d = 0; d < o; d++) {
|
|
103
104
|
const e = (a * o + d) * 2, S = 1 - s / Math.max(0.4, 1);
|
|
104
105
|
if (i[e] = r[e] * S, i[e + 1] = r[e + 1] * S, Math.abs(f[e]) > 1e-3 || Math.abs(f[e + 1]) > 1e-3) {
|
|
105
|
-
const
|
|
106
|
+
const T = zt * 50 * s, A = d - f[e] * T, R = a - f[e + 1] * T, c = Math.floor(A), m = Math.floor(R), h = c + 1, y = m + 1;
|
|
106
107
|
if (c >= 0 && m >= 0 && h < o && y < o) {
|
|
107
|
-
const M = A - c,
|
|
108
|
-
i[e] = (r[
|
|
108
|
+
const M = A - c, U = R - m, Tt = (m * o + c) * 2, Ut = (m * o + h) * 2, _t = (y * o + c) * 2, Lt = (y * o + h) * 2;
|
|
109
|
+
i[e] = (r[Tt] * (1 - M) * (1 - U) + r[Ut] * M * (1 - U) + r[_t] * (1 - M) * U + r[Lt] * M * U) * S;
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
for (let a = 0; a < o; a++) for (let d = 0; d < o; d++) {
|
|
113
|
-
const e = (a * o + d) * 2, S = (d + 0.5) / o,
|
|
114
|
+
const e = (a * o + d) * 2, S = (d + 0.5) / o, T = (a + 0.5) / o, A = S - p.x, R = T - p.y, c = Math.sqrt(A * A + R * R), m = Math.sqrt(q.value * q.value + D.value * D.value), h = Yt * Math.min(m * m * 20, 1);
|
|
114
115
|
if (c < h * 2 && Math.abs(ot) + Math.abs(et) > 0.01) {
|
|
115
116
|
const y = Math.exp(-c * c / (h * h));
|
|
116
117
|
x[e] += q.value * y * (V * 100) * s * 0.01, x[e + 1] += D.value * y * (V * 100) * s * 0.01;
|
|
@@ -123,7 +124,7 @@ const jt = {
|
|
|
123
124
|
}), rt(() => {
|
|
124
125
|
w.dispose(), C.dispose();
|
|
125
126
|
});
|
|
126
|
-
const ut = b.sample(
|
|
127
|
+
const ut = b.sample(n).x, z = l(t(1 / 128), t(1 / 128)), ft = b.sample(n.add(l(z.x, t(0)))).x, pt = b.sample(n.add(l(t(0), z.y))).x, xt = b.sample(n.add(l(z.x.negate(), t(0)))).x, ht = b.sample(n.add(l(t(0), z.y.negate()))).x, yt = ut.add(ft).add(pt).add(xt).add(ht).mul(t(0.2)), k = v(t(0), t(0.1), yt), I = l(t(1 / 128), t(1 / 128)), vt = F.sample(n).xy, wt = F.sample(n.add(l(I.x, t(0)))).xy, Ct = F.sample(n.add(l(t(0), I.y))).xy, gt = F.sample(n.add(l(I.x.negate(), t(0)))).xy, Mt = F.sample(n.add(l(t(0), I.y.negate()))).xy, g = vt.add(wt).add(Ct).add(gt).add(Mt).mul(t(0.2)), Ft = u.baseColor.uniform, bt = u.upColor.uniform, qt = u.downColor.uniform, Dt = u.leftColor.uniform, St = u.rightColor.uniform, L = g.x.mul(g.x).add(g.y.mul(g.y)).sqrt(), At = v(t(0.01), t(0.1), L), E = g.x.div(L.add(t(1e-3))), H = g.y.div(L.add(t(1e-3))), N = v(t(0), t(0.7), E.max(t(0))), P = v(t(0), t(0.7), E.negate().max(t(0))), Z = v(t(0), t(0.7), H.max(t(0))), J = v(t(0), t(0.7), H.negate().max(t(0))), Rt = Dt.mul(P).add(St.mul(N)), Xt = qt.mul(J).add(bt.mul(Z)), K = P.add(N), O = Z.add(J), Q = K.add(O).add(t(1e-3)), $ = dt(Ft, Rt.mul(K.div(Q)).add(Xt.mul(O.div(Q))), At);
|
|
127
128
|
return it($.rgb.mul(k), $.a.mul(k));
|
|
128
129
|
}
|
|
129
130
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { k as
|
|
1
|
+
import { k as T, m as C } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { n as v } from "./transformations-DBjTkQ5b.js";
|
|
3
3
|
C();
|
|
4
|
-
const
|
|
4
|
+
const R = {
|
|
5
5
|
name: "ChromaticAberration",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Stylize",
|
|
7
|
+
description: "Separate RGB channels for a prismatic distortion effect",
|
|
7
8
|
requiresRTT: !0,
|
|
8
9
|
requiresChild: !0,
|
|
9
10
|
props: {
|
|
@@ -65,18 +66,18 @@ const _ = {
|
|
|
65
66
|
}
|
|
66
67
|
},
|
|
67
68
|
fragmentNode: ({ uniforms: t, childNode: s, onCleanup: o }) => {
|
|
68
|
-
const { vec2: f, vec4:
|
|
69
|
-
if (!s) return
|
|
69
|
+
const { vec2: f, vec4: i, cos: c, sin: m, radians: u, screenUV: r, convertToTexture: d } = T;
|
|
70
|
+
if (!s) return i(0, 0, 0, 0);
|
|
70
71
|
const e = d(s);
|
|
71
72
|
o(() => {
|
|
72
73
|
e?.renderTarget?.dispose && e.renderTarget.dispose();
|
|
73
74
|
});
|
|
74
|
-
const
|
|
75
|
-
return
|
|
75
|
+
const l = u(t.angle.uniform), n = f(c(l), m(l)), a = t.strength.uniform.mul(0.1), p = r.add(n.mul(a).mul(t.redOffset.uniform)), g = r.add(n.mul(a).mul(t.greenOffset.uniform)), h = r.add(n.mul(a).mul(t.blueOffset.uniform)), b = e.sample(p).r, O = e.sample(g).g, x = e.sample(h).b, y = e.sample(r).a;
|
|
76
|
+
return i(b, O, x, y);
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
|
-
var
|
|
79
|
+
var S = R;
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
R as n,
|
|
82
|
+
S as t
|
|
82
83
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { k as g, m as v } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
-
import { o as
|
|
2
|
+
import { o as y, r as x } from "./transformations-DBjTkQ5b.js";
|
|
3
3
|
v();
|
|
4
|
-
const
|
|
4
|
+
const b = {
|
|
5
5
|
name: "Circle",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Base Layers",
|
|
7
|
+
description: "Generate a circle with adjustable size and softness",
|
|
7
8
|
acceptsUVContext: !0,
|
|
8
9
|
props: {
|
|
9
10
|
color: {
|
|
10
11
|
default: "#ffffff",
|
|
11
|
-
transform:
|
|
12
|
+
transform: x,
|
|
12
13
|
description: "The color of the circle",
|
|
13
14
|
ui: {
|
|
14
15
|
type: "color",
|
|
@@ -42,7 +43,7 @@ const C = {
|
|
|
42
43
|
x: 0.5,
|
|
43
44
|
y: 0.5
|
|
44
45
|
},
|
|
45
|
-
transform:
|
|
46
|
+
transform: y,
|
|
46
47
|
description: "The center point of the circle",
|
|
47
48
|
ui: {
|
|
48
49
|
type: "position",
|
|
@@ -51,12 +52,12 @@ const C = {
|
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
54
|
fragmentNode: ({ uniforms: e, uvContext: i }) => {
|
|
54
|
-
const { vec2: t, vec4: c, length: a, smoothstep: l, screenUV: f, viewportSize: o } = g, r = i ?? f, s = o.x.div(o.y), u = t(r.x.mul(s), r.y), p = t(e.center.uniform.x.mul(s), e.center.uniform.y.oneMinus()),
|
|
55
|
+
const { vec2: t, vec4: c, length: a, smoothstep: l, screenUV: f, viewportSize: o } = g, r = i ?? f, s = o.x.div(o.y), u = t(r.x.mul(s), r.y), p = t(e.center.uniform.x.mul(s), e.center.uniform.y.oneMinus()), d = a(u.sub(p)), m = e.softness.uniform, n = e.radius.uniform.mul(0.5), h = l(n, n.sub(m), d);
|
|
55
56
|
return c(e.color.uniform.rgb, e.color.uniform.a.mul(h));
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
|
-
var
|
|
59
|
+
var k = b;
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
b as n,
|
|
62
|
+
k as t
|
|
62
63
|
};
|