shaders 2.2.1 → 2.2.2
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 +773 -758
- 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 +71 -71
- package/dist/react/index.js +4831 -4764
- 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 +5632 -5565
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/{generatePresetCode-T78GxN5X.js → generatePresetCode-D4V6rBae.js} +1 -1
- package/dist/vue/index.js +5169 -5102
- 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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { j as p, k as at, m as et } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
-
import { i as ot, r as _, t as
|
|
3
|
-
import { t as
|
|
2
|
+
import { i as ot, r as _, t as rt } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
import { t as lt } from "./colorMixing-DPZ-Td4U.js";
|
|
4
4
|
import { DataTexture as st, FloatType as nt, LinearFilter as B, RGBAFormat as it } from "three";
|
|
5
5
|
et();
|
|
6
6
|
const ct = {
|
|
7
7
|
name: "CursorTrail",
|
|
8
8
|
category: "Interactive",
|
|
9
|
+
description: "Animated trail effect that tracks cursor movement",
|
|
9
10
|
props: {
|
|
10
11
|
colorA: {
|
|
11
12
|
default: "#00aaff",
|
|
@@ -64,37 +65,37 @@ const ct = {
|
|
|
64
65
|
description: "Color space for color interpolation",
|
|
65
66
|
ui: {
|
|
66
67
|
type: "select",
|
|
67
|
-
options:
|
|
68
|
+
options: rt,
|
|
68
69
|
label: "Color Space"
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
|
-
fragmentNode: ({ uniforms:
|
|
73
|
+
fragmentNode: ({ uniforms: l, onBeforeRender: U, onCleanup: j }) => {
|
|
73
74
|
const { vec4: q, float: t, texture: E, step: G, screenUV: n } = at, a = 128, o = new Float32Array(a * a * 4), s = new st(o, a, a, it, nt);
|
|
74
75
|
s.magFilter = B, s.minFilter = B, s.needsUpdate = !0;
|
|
75
76
|
const i = E(s);
|
|
76
77
|
let y = 0.5, M = 0.5, g = Date.now();
|
|
77
|
-
U(({ pointer:
|
|
78
|
+
U(({ pointer: r }) => {
|
|
78
79
|
const T = Date.now(), f = Math.min((T - g) / 1e3, 0.016);
|
|
79
80
|
g = T;
|
|
80
|
-
const h =
|
|
81
|
+
const h = l.radius.uniform.value * 0.1, b = l.length.uniform.value, N = l.shrink.uniform.value, F = r.x - y, w = r.y - M, z = Math.sqrt(F * F + w * w), O = 1 - f / Math.max(0.1, b), V = f / Math.max(0.1, b);
|
|
81
82
|
for (let e = 0; e < a * a * 4; e += 4)
|
|
82
83
|
o[e] *= O, o[e + 1] = 1 - (1 - o[e]) * N, o[e + 2] = Math.min(1, o[e + 2] + V);
|
|
83
84
|
if (z > 1e-3) {
|
|
84
|
-
const e = h * 3, Z = Math.max(0, Math.floor((
|
|
85
|
+
const e = h * 3, Z = Math.max(0, Math.floor((r.x - e) * a)), K = Math.min(a - 1, Math.ceil((r.x + e) * a)), P = Math.max(0, Math.floor((r.y - e) * a)), Q = Math.min(a - 1, Math.ceil((r.y + e) * a));
|
|
85
86
|
for (let m = P; m <= Q; m++) for (let d = Z; d <= K; d++) {
|
|
86
|
-
const u = (m * a + d) * 4, W = (d + 0.5) / a, $ = (m + 0.5) / a, I = W -
|
|
87
|
+
const u = (m * a + d) * 4, W = (d + 0.5) / a, $ = (m + 0.5) / a, I = W - r.x, R = $ - r.y, x = Math.sqrt(I * I + R * R);
|
|
87
88
|
if (x < e) {
|
|
88
89
|
const tt = Math.exp(-x * x / (h * h)) * z * 50 * f;
|
|
89
90
|
o[u] = Math.min(1, o[u] + tt), o[u + 1] = 1, o[u + 2] = 0;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
s.needsUpdate = !0, y =
|
|
94
|
+
s.needsUpdate = !0, y = r.x, M = r.y;
|
|
94
95
|
}), j(() => {
|
|
95
96
|
s.dispose();
|
|
96
97
|
});
|
|
97
|
-
const c = t(1 / a), C = i.sample(n),
|
|
98
|
+
const c = t(1 / a), C = i.sample(n), k = i.sample(n.add(p(c, t(0)))), v = i.sample(n.add(p(t(0), c))), S = i.sample(n.add(p(c.negate(), t(0)))), A = i.sample(n.add(p(t(0), c.negate()))), H = C.x.mul(t(0.5)).add(k.x.mul(t(0.125))).add(v.x.mul(t(0.125))).add(S.x.mul(t(0.125))).add(A.x.mul(t(0.125))), J = C.z.mul(t(0.5)).add(k.z.mul(t(0.125))).add(v.z.mul(t(0.125))).add(S.z.mul(t(0.125))).add(A.z.mul(t(0.125))), L = G(t(0.01), H), X = l.colorA.uniform, Y = l.colorB.uniform, D = lt(X, Y, J, l.colorSpace.uniform);
|
|
98
99
|
return q(D.rgb, D.a.mul(L));
|
|
99
100
|
}
|
|
100
101
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { k as R, m as V } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
V();
|
|
3
|
+
const k = {
|
|
4
|
+
name: "DiffuseBlur",
|
|
5
|
+
category: "Blurs",
|
|
6
|
+
description: "Soft focus blur using stochastic sampling",
|
|
7
|
+
requiresRTT: !0,
|
|
8
|
+
requiresChild: !0,
|
|
9
|
+
props: { intensity: {
|
|
10
|
+
default: 30,
|
|
11
|
+
description: "Intensity of the diffuse blur effect",
|
|
12
|
+
ui: {
|
|
13
|
+
type: "range",
|
|
14
|
+
min: 0,
|
|
15
|
+
max: 100,
|
|
16
|
+
step: 1,
|
|
17
|
+
label: "Intensity"
|
|
18
|
+
}
|
|
19
|
+
} },
|
|
20
|
+
fragmentNode: ({ uniforms: p, childNode: o, onCleanup: g }) => {
|
|
21
|
+
const { vec2: e, vec4: i, float: s, screenUV: v, convertToTexture: x, viewportSize: h, fract: T, sin: u, cos: y, dot: _, Fn: b } = R;
|
|
22
|
+
if (!o) return i(0, 0, 0, 0);
|
|
23
|
+
const n = x(o);
|
|
24
|
+
return g(() => {
|
|
25
|
+
n?.renderTarget?.dispose && n.renderTarget.dispose();
|
|
26
|
+
}), b(() => {
|
|
27
|
+
const a = v, S = p.intensity.uniform.mul(1), q = e(1).div(h), l = (t) => T(u(_(t, e(12.9898, 78.233).mul(2))).mul(43758.5453)), r = i(0).toVar(), c = 16;
|
|
28
|
+
for (let t = 0; t < c; t++) {
|
|
29
|
+
const d = a.mul(1e3).add(e(s(t * 11.7), s(t * 5.3))), B = l(d), C = l(d.add(e(73.2, 41.9))), f = B.mul(6.28318530718), m = C.sqrt().mul(S), D = e(y(f).mul(m), u(f).mul(m)).mul(q.x), z = a.add(D), I = n.sample(z);
|
|
30
|
+
r.assign(r.add(I));
|
|
31
|
+
}
|
|
32
|
+
return r.div(s(c));
|
|
33
|
+
})();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var F = k;
|
|
37
|
+
export {
|
|
38
|
+
k as n,
|
|
39
|
+
F as t
|
|
40
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { k as
|
|
1
|
+
import { k as z, m as S } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { r as n } from "./transformations-DBjTkQ5b.js";
|
|
3
|
-
|
|
4
|
-
const
|
|
3
|
+
S();
|
|
4
|
+
const v = {
|
|
5
5
|
name: "Dither",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Stylize",
|
|
7
|
+
description: "Bayer matrix dithering to reduce colors",
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
9
10
|
pixelSize: {
|
|
@@ -47,15 +48,15 @@ const S = {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
|
-
fragmentNode: ({ uniforms: t, childNode:
|
|
51
|
-
const { vec2: u, vec3:
|
|
52
|
-
if (!
|
|
53
|
-
const a =
|
|
54
|
-
return
|
|
51
|
+
fragmentNode: ({ uniforms: t, childNode: o }) => {
|
|
52
|
+
const { vec2: u, vec3: d, vec4: l, floor: f, screenUV: p, viewportSize: m, dot: h, step: q, mix: i } = z;
|
|
53
|
+
if (!o) return l(0, 0, 0, 0);
|
|
54
|
+
const a = o, g = h(a.rgb, d(0.299, 0.587, 0.114)).mul(a.a), x = t.pixelSize.uniform, s = f(p.mul(m).div(x)).mod(u(4)), e = s.x, r = s.y, y = r.equal(0).select(e.equal(0).select(0 / 16, e.equal(1).select(8 / 16, e.equal(2).select(2 / 16, 10 / 16))), r.equal(1).select(e.equal(0).select(12 / 16, e.equal(1).select(4 / 16, e.equal(2).select(14 / 16, 6 / 16))), r.equal(2).select(e.equal(0).select(3 / 16, e.equal(1).select(11 / 16, e.equal(2).select(1 / 16, 9 / 16))), e.equal(0).select(15 / 16, e.equal(1).select(7 / 16, e.equal(2).select(13 / 16, 5 / 16)))))), b = t.threshold.uniform, c = q(y, g.add(b.sub(0.5)));
|
|
55
|
+
return l(i(t.colorA.uniform.rgb, t.colorB.uniform.rgb, c), i(t.colorA.uniform.a, t.colorB.uniform.a, c));
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
|
-
var _ =
|
|
58
|
+
var _ = v;
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
v as n,
|
|
60
61
|
_ as t
|
|
61
62
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { f as U, k as
|
|
2
|
-
import { r as
|
|
3
|
-
|
|
1
|
+
import { f as U, k as G, m as I } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { r as M } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
I();
|
|
4
4
|
const P = {
|
|
5
5
|
name: "DotGrid",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Base Layers",
|
|
7
|
+
description: "Grid of dots with optional twinkling animation",
|
|
7
8
|
acceptsUVContext: !0,
|
|
8
9
|
props: {
|
|
9
10
|
color: {
|
|
10
11
|
default: "#ffffff",
|
|
11
12
|
description: "The color of the dot",
|
|
12
|
-
transform:
|
|
13
|
+
transform: M,
|
|
13
14
|
ui: {
|
|
14
15
|
type: "color",
|
|
15
16
|
label: "Color"
|
|
@@ -50,12 +51,12 @@ const P = {
|
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
fragmentNode: ({ uniforms: t, uvContext: f }) => {
|
|
53
|
-
const { screenUV: m, vec4: u, vec2: p, smoothstep: h, length: o, floor: n, float: i, viewportSize: g, time: y, sin: w, mix: b } =
|
|
54
|
+
const { screenUV: m, vec4: u, vec2: p, smoothstep: h, length: o, floor: n, float: i, viewportSize: g, time: y, sin: w, mix: b } = G, s = f ?? m, l = t.density.uniform, r = t.dotSize.uniform, k = t.color.uniform, x = t.twinkle.uniform, a = g, v = a.x.div(a.y), d = p(s.x.mul(v), s.y.oneMinus()), e = d.mul(l), z = o(e.sub(n(e)).sub(0.5)), D = o(U(d.mul(l))), S = i(1).sub(h(r.mul(0.5), r.mul(0.5).add(D.mul(0.5)), z)), c = n(e), C = c.x.mul(12.9898).add(c.y.mul(78.233)).sin().mul(43758.5453).fract(), V = w(y.mul(2).add(C.mul(6.28318))).mul(0.5).add(0.5), _ = b(i(1), V, x), T = S.mul(_);
|
|
54
55
|
return u(k.rgb, T);
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
|
-
var
|
|
58
|
+
var L = P;
|
|
58
59
|
export {
|
|
59
60
|
P as n,
|
|
60
|
-
|
|
61
|
+
L as t
|
|
61
62
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { k as
|
|
1
|
+
import { k as f, m as b } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { i as C, r as a, t as g } from "./transformations-DBjTkQ5b.js";
|
|
3
3
|
import { t as T } from "./colorMixing-DPZ-Td4U.js";
|
|
4
4
|
b();
|
|
5
5
|
const h = {
|
|
6
6
|
name: "Duotone",
|
|
7
|
-
category: "
|
|
7
|
+
category: "Adjustments",
|
|
8
|
+
description: "Map colors to two tones based on luminance",
|
|
8
9
|
requiresRTT: !0,
|
|
9
10
|
requiresChild: !0,
|
|
10
11
|
props: {
|
|
@@ -49,14 +50,14 @@ const h = {
|
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
fragmentNode: ({ uniforms: o, childNode: r, onCleanup: s }) => {
|
|
52
|
-
const { vec3: l, vec4: t, dot: i, smoothstep: c, screenUV: p, convertToTexture: d } =
|
|
53
|
+
const { vec3: l, vec4: t, dot: i, smoothstep: c, screenUV: p, convertToTexture: d } = f;
|
|
53
54
|
if (!r) return t(0, 0, 0, 0);
|
|
54
55
|
const e = d(r);
|
|
55
56
|
s(() => {
|
|
56
57
|
e?.renderTarget?.dispose && e.renderTarget.dispose();
|
|
57
58
|
});
|
|
58
|
-
const n = e.sample(p), u = i(n.rgb, l(0.299, 0.587, 0.114)),
|
|
59
|
-
return t(T(o.colorA.uniform, o.colorB.uniform,
|
|
59
|
+
const n = e.sample(p), u = i(n.rgb, l(0.299, 0.587, 0.114)), m = c(o.blend.uniform.sub(0.5), o.blend.uniform.add(0.5), u);
|
|
60
|
+
return t(T(o.colorA.uniform, o.colorB.uniform, m, o.colorSpace.uniform).rgb, n.a);
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
63
|
var B = h;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { k as f, m as p } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
p();
|
|
3
|
+
const d = {
|
|
4
|
+
name: "FilmGrain",
|
|
5
|
+
category: "Stylize",
|
|
6
|
+
description: "Analog film grain texture overlay",
|
|
7
|
+
requiresChild: !0,
|
|
8
|
+
acceptsUVContext: !0,
|
|
9
|
+
props: { strength: {
|
|
10
|
+
default: 0.5,
|
|
11
|
+
description: "Intensity of the film grain noise",
|
|
12
|
+
ui: {
|
|
13
|
+
type: "range",
|
|
14
|
+
min: 0,
|
|
15
|
+
max: 1,
|
|
16
|
+
step: 0.01,
|
|
17
|
+
label: "Strength"
|
|
18
|
+
}
|
|
19
|
+
} },
|
|
20
|
+
fragmentNode: ({ uniforms: r, childNode: i, uvContext: o }) => {
|
|
21
|
+
const { vec2: s, vec4: e, float: t, screenUV: a, sin: l, dot: m, fract: c } = f, u = r.strength.uniform, n = i || e(0, 0, 0, 0), g = c(l(m(o ?? a, s(t(12.9898), t(78.233)).mul(t(2)))).mul(t(43758.5453))).mul(t(2)).sub(t(1)).mul(u.mul(t(0.1)));
|
|
22
|
+
return e(n.rgb.add(g), n.a);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var y = d;
|
|
26
|
+
export {
|
|
27
|
+
d as n,
|
|
28
|
+
y as t
|
|
29
|
+
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { k as Q, m as W } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { r as X } from "./transformations-DBjTkQ5b.js";
|
|
3
3
|
W();
|
|
4
|
-
var { vec2: a, vec3:
|
|
4
|
+
var { vec2: a, vec3: q, vec4: E, float: c, sin: g, cos: U, smoothstep: Y, mix: H, min: k, floor: Z, fract: I, length: j, dot: B, screenUV: $, viewportSize: N, time: w, Fn: m } = Q, ee = m(([e]) => I(g(B(e, a(127.1, 311.7))).mul(43758.5453123))), G = m(([e]) => I(g(a(B(e, a(127.1, 311.7)), B(e, a(269.5, 183.3)))).mul(43758.5453))), te = m(([e, n]) => {
|
|
5
5
|
const l = G(e).sub(0.5), u = g(n), x = U(n);
|
|
6
6
|
return a(x.mul(l.x).sub(u.mul(l.y)).mul(0.66), u.mul(l.x).add(x.mul(l.y)).mul(0.66)).add(e).add(0.5);
|
|
7
|
-
}), ae = m(([e, n]) =>
|
|
7
|
+
}), ae = m(([e, n]) => w.mul(n).mul(ee(e).sub(0.5)).mul(2)), v = m(([e, n, l]) => {
|
|
8
8
|
const u = te(n, ae(n, l));
|
|
9
9
|
return j(e.sub(u));
|
|
10
10
|
});
|
|
11
11
|
const ne = {
|
|
12
12
|
name: "FloatingParticles",
|
|
13
|
-
category: "
|
|
13
|
+
category: "Base Layers",
|
|
14
|
+
description: "Animated floating particles with twinkle effects",
|
|
14
15
|
requiresRTT: !1,
|
|
15
16
|
acceptsUVContext: !0,
|
|
16
17
|
props: {
|
|
@@ -136,21 +137,21 @@ const ne = {
|
|
|
136
137
|
},
|
|
137
138
|
fragmentNode: ({ uniforms: e, childNode: n, uvContext: l }) => {
|
|
138
139
|
const u = l ?? $, x = m(([s]) => {
|
|
139
|
-
const r = Z(s), p =
|
|
140
|
+
const r = Z(s), p = I(s);
|
|
140
141
|
let t = v(s, r, e.randomness.uniform);
|
|
141
142
|
const y = e.particleSoftness.uniform, d = e.particleSize.uniform.mul(0.01), o = d.mul(0.6).add(y.mul(d.mul(2.4))), i = o.greaterThan(0.35), h = p.x.lessThan(0.4), V = p.x.greaterThan(0.6), R = p.y.lessThan(0.4), z = p.y.greaterThan(0.6), D = i.and(h), f = i.and(V), C = i.and(R), b = i.and(z);
|
|
142
143
|
t = D.select(k(t, v(s, r.add(a(-1, 0)), e.randomness.uniform)), t), t = f.select(k(t, v(s, r.add(a(1, 0)), e.randomness.uniform)), t), t = C.select(k(t, v(s, r.add(a(0, -1)), e.randomness.uniform)), t), t = b.select(k(t, v(s, r.add(a(0, 1)), e.randomness.uniform)), t);
|
|
143
|
-
const M = Y(o, d.mul(0.6), t), _ = e.twinkle.uniform, P = r.x.mul(12.9898).add(r.y.mul(78.233)).sin().mul(43758.5453).fract(), A = g(
|
|
144
|
+
const M = Y(o, d.mul(0.6), t), _ = e.twinkle.uniform, P = r.x.mul(12.9898).add(r.y.mul(78.233)).sin().mul(43758.5453).fract(), A = g(w.mul(2).add(P.mul(6.28318))).mul(0.5).add(0.5), F = H(c(1), A, _);
|
|
144
145
|
return M.mul(F).mul(e.particleColor.uniform.rgb);
|
|
145
146
|
}), J = m(([s]) => {
|
|
146
|
-
const r = c(1.05), p = c(0.9), t = e.count.uniform, y =
|
|
147
|
+
const r = c(1.05), p = c(0.9), t = e.count.uniform, y = q(0).toVar(), d = c(1).toVar(), o = c(1).toVar(), i = a(0).toVar(), h = e.angle.uniform.mul(3.14159).div(180), V = a(U(h), g(h)), R = w.mul(V).mul(e.speed.uniform), z = e.speedVariance.uniform, D = e.angleVariance.uniform.mul(3.14159).div(180);
|
|
147
148
|
for (let f = 0; f < 4; f++) {
|
|
148
|
-
const C = c(f).lessThan(t).and(o.greaterThan(0.02)), b = G(a(o, c(f).mul(7.919))), M = c(1).add(b.x.sub(0.5).mul(z)), _ = b.y.sub(0.5).mul(D).mul(2), P = h.add(_), A = a(U(P), g(P)), F = R.mul(M).add(A.sub(V).mul(
|
|
149
|
-
y.assign(y.add(C.select(O,
|
|
149
|
+
const C = c(f).lessThan(t).and(o.greaterThan(0.02)), b = G(a(o, c(f).mul(7.919))), M = c(1).add(b.x.sub(0.5).mul(z)), _ = b.y.sub(0.5).mul(D).mul(2), P = h.add(_), A = a(U(P), g(P)), F = R.mul(M).add(A.sub(V).mul(w).mul(e.speed.uniform)), O = x(s.mul(d).add(F).add(i)).mul(o);
|
|
150
|
+
y.assign(y.add(C.select(O, q(0)))), i.assign(i.add(b.mul(10))), o.assign(o.mul(p)), d.assign(d.mul(r));
|
|
150
151
|
}
|
|
151
152
|
return y;
|
|
152
|
-
}),
|
|
153
|
-
return n ?
|
|
153
|
+
}), L = u.mul(2).sub(1), K = N.x.div(N.y), T = J(a(L.x.mul(K), L.y).mul(e.particleDensity.uniform)), S = j(T);
|
|
154
|
+
return n ? E(H(n.xyz, T, S.greaterThan(0.01).select(S, 0)), n.w) : E(T, S);
|
|
154
155
|
}
|
|
155
156
|
};
|
|
156
157
|
var le = ne;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { k as b, m as R } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
R();
|
|
3
|
+
const V = {
|
|
4
|
+
name: "GlassTiles",
|
|
5
|
+
category: "Distortions",
|
|
6
|
+
description: "Refraction-like distortion in a tile grid pattern",
|
|
7
|
+
requiresRTT: !0,
|
|
8
|
+
requiresChild: !0,
|
|
9
|
+
props: {
|
|
10
|
+
intensity: {
|
|
11
|
+
default: 1,
|
|
12
|
+
description: "The intensity of the glass tiles effect",
|
|
13
|
+
ui: {
|
|
14
|
+
type: "range",
|
|
15
|
+
min: 0,
|
|
16
|
+
max: 5,
|
|
17
|
+
step: 0.1,
|
|
18
|
+
label: "Intensity"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
tileCount: {
|
|
22
|
+
default: 100,
|
|
23
|
+
description: "Number of tiles across the shortest dimension",
|
|
24
|
+
ui: {
|
|
25
|
+
type: "range",
|
|
26
|
+
min: 1,
|
|
27
|
+
max: 200,
|
|
28
|
+
step: 1,
|
|
29
|
+
label: "Tile Count"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
uvTransformNode: ({ uv: o, uniforms: s, viewportSize: i }) => {
|
|
34
|
+
const { vec2: r, floor: a, select: l } = b, p = s.intensity.uniform, t = s.tileCount.uniform, e = i.x.div(i.y), n = r(l(e.greaterThanEqual(1), t.mul(e), t), l(e.lessThan(1), t.div(e), t)), c = a(o.mul(n)).div(n), d = o.sub(c), T = r(0.5, 0.5), h = p.mul(0.025), u = d.div(r(1, 1).div(n)).sub(T).mul(h);
|
|
35
|
+
return d.add(u).add(c);
|
|
36
|
+
},
|
|
37
|
+
fragmentNode: ({ uniforms: o, childNode: s, dimensions: i, onCleanup: r }) => {
|
|
38
|
+
const { vec2: a, vec4: l, floor: p, mul: t, div: e, sub: n, add: c, screenUV: d, uniform: T, convertToTexture: h } = b;
|
|
39
|
+
if (!s)
|
|
40
|
+
return console.error("You must pass a child component into the Glass Tiles shader."), l(0);
|
|
41
|
+
const u = h(s);
|
|
42
|
+
r(() => {
|
|
43
|
+
u?.renderTarget?.dispose && u.renderTarget.dispose();
|
|
44
|
+
});
|
|
45
|
+
const m = T(i.width / i.height), g = d, x = o.intensity.uniform, f = o.tileCount.uniform, C = a(m.greaterThanEqual(1).select(t(f, m), f), m.lessThan(1).select(e(f, m), f)), v = e(p(t(g, C)), C), y = n(g, v), U = a(0.5, 0.5), _ = t(x, 0.025), q = c(c(y, t(n(e(y, e(a(1), C)), U), _)), v);
|
|
46
|
+
return l(u.sample(q));
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var N = V;
|
|
50
|
+
export {
|
|
51
|
+
V as n,
|
|
52
|
+
N as t
|
|
53
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
|
|
1
|
+
import { k as U, m as j } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
j();
|
|
3
3
|
const B = {
|
|
4
4
|
name: "Glow",
|
|
5
|
-
category: "
|
|
5
|
+
category: "Stylize",
|
|
6
|
+
description: "Soft glow effect with adjustable intensity",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
@@ -41,26 +42,26 @@ const B = {
|
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
fragmentNode: ({ uniforms: s, childNode: a, onCleanup: g }) => {
|
|
44
|
-
const { vec2: c, vec3: h, vec4: r, float: t, max: d, dot: w, screenUV: f, convertToTexture: b, viewportSize:
|
|
45
|
+
const { vec2: c, vec3: h, vec4: r, float: t, max: d, dot: w, screenUV: f, convertToTexture: b, viewportSize: y, Fn: x } = U;
|
|
45
46
|
if (!a) return r(0, 0, 0, 0);
|
|
46
47
|
const o = b(a);
|
|
47
48
|
g(() => {
|
|
48
49
|
o?.renderTarget?.dispose && o.renderTarget.dispose();
|
|
49
50
|
});
|
|
50
|
-
const u = o.sample(f), v =
|
|
51
|
-
const z = s.size.uniform,
|
|
51
|
+
const u = o.sample(f), v = x(() => {
|
|
52
|
+
const z = s.size.uniform, S = s.threshold.uniform, G = c(1).div(y), n = r(0, 0, 0, 0).toVar(), e = 5;
|
|
52
53
|
for (let i = -e; i <= e; i++) for (let l = -e; l <= e; l++) {
|
|
53
|
-
const C = c(t(i), t(l)).mul(
|
|
54
|
-
n.assign(n.add(
|
|
54
|
+
const C = c(t(i), t(l)).mul(G).mul(z), V = f.add(C), m = o.sample(V), k = w(m.rgb, h(0.299, 0.587, 0.114)), q = d(t(0), k.sub(S)), R = m.mul(q);
|
|
55
|
+
n.assign(n.add(R));
|
|
55
56
|
}
|
|
56
57
|
const _ = t((e * 2 + 1) * (e * 2 + 1));
|
|
57
58
|
return n.div(_);
|
|
58
|
-
})(), T = s.intensity.uniform,
|
|
59
|
-
return r(u.rgb.add(
|
|
59
|
+
})(), T = s.intensity.uniform, p = v.mul(T);
|
|
60
|
+
return r(u.rgb.add(p.rgb), d(u.a, p.a));
|
|
60
61
|
}
|
|
61
62
|
};
|
|
62
|
-
var
|
|
63
|
+
var E = B;
|
|
63
64
|
export {
|
|
64
65
|
B as n,
|
|
65
|
-
|
|
66
|
+
E as t
|
|
66
67
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { k as A, m as
|
|
1
|
+
import { k as A, m as E, t as M } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
import { o as j, r as _ } from "./transformations-DBjTkQ5b.js";
|
|
3
|
-
|
|
3
|
+
E();
|
|
4
4
|
const z = {
|
|
5
5
|
name: "Godrays",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Base Layers",
|
|
7
|
+
description: "Volumetric light rays emanating from a point",
|
|
7
8
|
requiresRTT: !1,
|
|
8
9
|
acceptsUVContext: !0,
|
|
9
10
|
props: {
|
|
@@ -82,20 +83,20 @@ const z = {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
},
|
|
85
|
-
fragmentNode: ({ uniforms:
|
|
86
|
-
const { vec2:
|
|
87
|
-
const t = n.floor(),
|
|
88
|
-
return m(m(l, r,
|
|
89
|
-
}), f =
|
|
90
|
-
const l =
|
|
91
|
-
return m(h(C(y), o), p,
|
|
92
|
-
}), k =
|
|
93
|
-
const n =
|
|
94
|
-
u.assign(u.mul(f(d, p,
|
|
95
|
-
const N = t.mul(1.4).sub(n.mul(2.5)), q = t.mul(0.7).mul(a(1).add(
|
|
96
|
-
return
|
|
97
|
-
})(),
|
|
98
|
-
return R(m(
|
|
86
|
+
fragmentNode: ({ uniforms: e, uvContext: v }) => {
|
|
87
|
+
const { vec2: i, vec4: R, float: a, sin: T, atan2: B, length: D, pow: h, smoothstep: P, mix: m, clamp: x, screenUV: S, time: U, PI: w, Fn: g } = A, F = v ?? S, G = i(e.center.uniform.x, e.center.uniform.y.oneMinus()), d = F.sub(G), C = g(([n]) => {
|
|
88
|
+
const t = n.floor(), s = n.fract(), o = (u) => T(u.x.mul(127.1).add(u.y.mul(311.7))).mul(43758.5453).fract(), l = o(t), r = o(t.add(i(1, 0))), y = o(t.add(i(0, 1))), p = o(t.add(i(1, 1))), c = s.mul(s).mul(s.mul(-2).add(3));
|
|
89
|
+
return m(m(l, r, c.x), m(y, p, c.x), c.y);
|
|
90
|
+
}), f = g(([n, t, s, o]) => {
|
|
91
|
+
const l = B(n.y, n.x), r = i(l.mul(s), t), y = i(l.mod(w.mul(2)).mul(s), t), p = h(C(r), o);
|
|
92
|
+
return m(h(C(y), o), p, P(-0.15, 0.15, n.x));
|
|
93
|
+
}), k = g(() => {
|
|
94
|
+
const n = U.mul(e.speed.uniform).mul(0.2), t = D(d), s = a(6.5).mul(M(e.spotty.uniform)), o = a(4).sub(a(3).mul(x(e.intensity.uniform, 0, 1))), l = a(6).mul(e.density.uniform), r = a(0).toVar(), y = t.mul(1).sub(n.mul(3)), p = t.mul(0.5).mul(a(1).add(s)).sub(n.mul(2)), c = l.mul(5), u = f(d, y, c, o).toVar();
|
|
95
|
+
u.assign(u.mul(f(d, p, c.mul(4), o))), r.assign(r.add(u));
|
|
96
|
+
const N = t.mul(1.4).sub(n.mul(2.5)), q = t.mul(0.7).mul(a(1).add(s)).sub(n.mul(1.8)), V = l.mul(4.5), b = f(d, N, V, o).toVar();
|
|
97
|
+
return b.assign(b.mul(f(d, q, V.mul(3.5), o))), r.assign(r.add(b.mul(0.7))), x(r, 0, 1);
|
|
98
|
+
})(), I = e.rayColor.uniform.rgb, L = e.backgroundColor.uniform.rgb;
|
|
99
|
+
return R(m(L, I, k), e.backgroundColor.uniform.a.add(k.mul(e.rayColor.uniform.a)));
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
var K = z;
|
|
@@ -3,7 +3,8 @@ import { t as a } from "./ColorAdjustment-CKwpE_4M.js";
|
|
|
3
3
|
s();
|
|
4
4
|
const n = {
|
|
5
5
|
name: "Grayscale",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Adjustments",
|
|
7
|
+
description: "Convert colors to black and white",
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {},
|
|
9
10
|
fragmentNode: ({ childNode: e }) => {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { k as b, m as
|
|
2
|
-
import { r as
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { k as b, m as T } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { r as _ } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
T();
|
|
4
|
+
const C = {
|
|
5
5
|
name: "Grid",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Base Layers",
|
|
7
|
+
description: "Simple grid lines pattern with adjustable thickness",
|
|
7
8
|
acceptsUVContext: !0,
|
|
8
9
|
props: {
|
|
9
10
|
color: {
|
|
10
11
|
default: "#ffffff",
|
|
11
|
-
transform:
|
|
12
|
+
transform: _,
|
|
12
13
|
description: "The color of the grid lines",
|
|
13
14
|
ui: {
|
|
14
15
|
type: "color",
|
|
@@ -39,12 +40,12 @@ const _ = {
|
|
|
39
40
|
}
|
|
40
41
|
},
|
|
41
42
|
fragmentNode: ({ uniforms: e, uvContext: l }) => {
|
|
42
|
-
const { vec2: a, vec4: d, fract: m, max:
|
|
43
|
+
const { vec2: a, vec4: d, fract: m, max: p, screenUV: f, viewportSize: o, fwidth: u, smoothstep: n } = b, i = l ?? f, h = o.x.div(o.y), g = a(i.x.mul(h), i.y.oneMinus()), x = e.cells.uniform, r = g.mul(x), t = m(r), s = e.thickness.uniform.mul(0.01), y = t.x.min(t.x.oneMinus()), k = t.y.min(t.y.oneMinus()), c = u(r), v = p(n(s.add(c.x), s, y), n(s.add(c.y), s, k));
|
|
43
44
|
return d(e.color.uniform.rgb, e.color.uniform.a.mul(v));
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
|
-
var V =
|
|
47
|
+
var V = C;
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
C as n,
|
|
49
50
|
V as t
|
|
50
51
|
};
|
|
@@ -20,6 +20,7 @@ var ie = 20, f = /* @__PURE__ */ new WeakMap(), re = (e) => {
|
|
|
20
20
|
const se = {
|
|
21
21
|
name: "GridDistortion",
|
|
22
22
|
category: "Interactive",
|
|
23
|
+
description: "Interactive grid distortion controlled by mouse position",
|
|
23
24
|
requiresRTT: !0,
|
|
24
25
|
requiresChild: !0,
|
|
25
26
|
props: {
|
|
@@ -108,27 +109,27 @@ const se = {
|
|
|
108
109
|
},
|
|
109
110
|
fragmentNode: ({ uniforms: e, onBeforeRender: t, childNode: s, onCleanup: l }) => {
|
|
110
111
|
const { vec2: n, vec4: k, float: g, uniform: T, screenUV: w, convertToTexture: H } = B, { texture: z, data: a, tslNode: L, gridSize: d } = re(e), h = T(0), v = T(0);
|
|
111
|
-
let F = 0.5,
|
|
112
|
+
let F = 0.5, I = 0.5, R = Date.now();
|
|
112
113
|
if (t(({ pointer: o }) => {
|
|
113
|
-
const G = Date.now(), i = Math.min((G -
|
|
114
|
-
|
|
115
|
-
const V = i > 0 ? (o.x - F) / i : 0, X = i > 0 ? (o.y -
|
|
114
|
+
const G = Date.now(), i = Math.min((G - R) / 1e3, 0.016);
|
|
115
|
+
R = G;
|
|
116
|
+
const V = i > 0 ? (o.x - F) / i : 0, X = i > 0 ? (o.y - I) / i : 0;
|
|
116
117
|
h.value = h.value * 0.85 + V * 0.15, v.value = v.value * 0.85 + X * 0.15;
|
|
117
118
|
const Y = e.decay.uniform.value, q = e.intensity.uniform.value, y = e.radius.uniform.value * 0.05, M = e.swirl.uniform.value;
|
|
118
119
|
for (let u = 0; u < d; u++) for (let m = 0; m < d; m++) {
|
|
119
120
|
const r = (u * d + m) * 2;
|
|
120
121
|
a[r] *= 1 - Y * i, a[r + 1] *= 1 - Y * i;
|
|
121
|
-
const j = (m + 0.5) / d, P = (u + 0.5) / d, S = j - o.x,
|
|
122
|
-
if (
|
|
123
|
-
const p = Math.exp(-
|
|
122
|
+
const j = (m + 0.5) / d, P = (u + 0.5) / d, S = j - o.x, b = P - o.y, D = Math.sqrt(S * S + b * b);
|
|
123
|
+
if (D < y * 2 && Math.abs(V) + Math.abs(X) > 0.01) {
|
|
124
|
+
const p = Math.exp(-D * D / (y * y));
|
|
124
125
|
if (a[r] += h.value * p * q * i * 0.5, a[r + 1] += v.value * p * q * i * 0.5, M > 0) {
|
|
125
|
-
const A = Math.atan2(
|
|
126
|
+
const A = Math.atan2(b, S) + Math.PI * 0.5;
|
|
126
127
|
a[r] += Math.cos(A) * M * p * i * 2, a[r + 1] += Math.sin(A) * M * p * i * 2;
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
a[r] = Math.max(-1, Math.min(1, a[r])), a[r + 1] = Math.max(-1, Math.min(1, a[r + 1]));
|
|
130
131
|
}
|
|
131
|
-
z.needsUpdate = !0, F = o.x,
|
|
132
|
+
z.needsUpdate = !0, F = o.x, I = o.y;
|
|
132
133
|
}), l(() => {
|
|
133
134
|
z.dispose(), f.delete(e);
|
|
134
135
|
}), !s) return k(0, 0, 0, 0);
|
|
@@ -136,7 +137,7 @@ const se = {
|
|
|
136
137
|
l(() => {
|
|
137
138
|
c?.renderTarget?.dispose && c.renderTarget.dispose();
|
|
138
139
|
});
|
|
139
|
-
const N = e.gridSize.uniform, x = g(1).div(N), O = w.div(x).floor().mul(x).add(x.mul(0.5)), W = L.sample(O).xy,
|
|
140
|
+
const N = e.gridSize.uniform, x = g(1).div(N), O = w.div(x).floor().mul(x).add(x.mul(0.5)), W = L.sample(O).xy, _ = g(0.1), U = g(-0.1), Z = W.clamp(n(U, U), n(_, _)), E = w.sub(Z);
|
|
140
141
|
return K(E, c.sample(E), c, e.edges.uniform);
|
|
141
142
|
}
|
|
142
143
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { k as r, m as o } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
o();
|
|
3
|
+
const i = {
|
|
4
|
+
name: "Group",
|
|
5
|
+
category: "Utilities",
|
|
6
|
+
description: "Container for organizing and composing child effects",
|
|
7
|
+
requiresChild: !0,
|
|
8
|
+
props: {},
|
|
9
|
+
fragmentNode: ({ childNode: e }) => {
|
|
10
|
+
const { vec4: t } = r;
|
|
11
|
+
return e || t(0);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var s = i;
|
|
15
|
+
export {
|
|
16
|
+
i as n,
|
|
17
|
+
s as t
|
|
18
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { k as
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
1
|
+
import { k as V, m as A } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { n as D } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
A();
|
|
4
4
|
const F = {
|
|
5
5
|
name: "Halftone",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Stylize",
|
|
7
|
+
description: "Halftone dot pattern effect for printing aesthetics",
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
9
10
|
frequency: {
|
|
@@ -19,7 +20,7 @@ const F = {
|
|
|
19
20
|
},
|
|
20
21
|
angle: {
|
|
21
22
|
default: 45,
|
|
22
|
-
transform:
|
|
23
|
+
transform: D,
|
|
23
24
|
description: "Rotation angle of the pattern (in degrees)",
|
|
24
25
|
ui: {
|
|
25
26
|
type: "range",
|
|
@@ -42,14 +43,14 @@ const F = {
|
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
45
|
fragmentNode: ({ uniforms: t, childNode: s }) => {
|
|
45
|
-
const { vec2: e, vec3:
|
|
46
|
+
const { vec2: e, vec3: g, vec4: r, sin: h, cos: y, fract: b, length: v, smoothstep: x, dot: n, screenUV: q, viewportSize: a, radians: _ } = V;
|
|
46
47
|
if (!s) return r(0);
|
|
47
|
-
const
|
|
48
|
-
return r(o.rgb.mul(
|
|
48
|
+
const i = q, S = t.frequency.uniform, z = t.angle.uniform, c = t.smoothness.uniform, l = _(z), C = a.x.div(a.y), m = e(i.x.mul(C), i.y), f = y(l), d = h(l), H = b(e(n(m, e(f, d.negate())), n(m, e(d, f))).mul(S)).sub(0.5), o = s, u = n(o.rgb, g(0.299, 0.587, 0.114)).mul(0.7).add(0.15), U = v(H), p = x(u.add(c), u.sub(c), U);
|
|
49
|
+
return r(o.rgb.mul(p), o.a.mul(p));
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
|
-
var
|
|
52
|
+
var E = F;
|
|
52
53
|
export {
|
|
53
54
|
F as n,
|
|
54
|
-
|
|
55
|
+
E as t
|
|
55
56
|
};
|