shaders 2.2.14 → 2.2.16
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-BTUdXC0g.js → AngularBlur-ClvtyURQ.js} +12 -13
- package/dist/core/{Ascii-Bu8ii7oo.js → Ascii-BT0-K_vw.js} +28 -29
- package/dist/core/{Blob-CzWSpVTR.js → Blob-BlQ_1T_8.js} +12 -13
- package/dist/core/{Blur-BzUO9yxF.js → Blur-421AjWLH.js} +8 -9
- package/dist/core/{Bulge-BCXYAzig.js → Bulge-CZRVoR6C.js} +6 -7
- package/dist/core/{CRTScreen-cJ3XHrI9.js → CRTScreen-C_U9g_IR.js} +8 -9
- package/dist/core/{ChannelBlur-BEK1qzGn.js → ChannelBlur-5pzcB6Zv.js} +4 -5
- package/dist/core/{Checkerboard-B8CnUlbi.js → Checkerboard-CrQkqXhD.js} +10 -11
- package/dist/core/{ChromaFlow-AHO3C4o3.js → ChromaFlow-CNrQdL8f.js} +16 -17
- package/dist/core/{ChromaticAberration-nVg3r1FK.js → ChromaticAberration-D9H7O17Y.js} +6 -7
- package/dist/core/{Circle-C8ltF4BZ.js → Circle-DnLaDn8V.js} +7 -8
- package/dist/core/{CursorTrail-BcaRHjU5.js → CursorTrail-NY6n97VG.js} +19 -20
- package/dist/core/{DiffuseBlur-Dq_vFrB1.js → DiffuseBlur-C_n01ABk.js} +11 -12
- package/dist/core/{Dither-CpN3vGSh.js → Dither-4s-c4zh4.js} +6 -7
- package/dist/core/{DotGrid-BFUzeSQw.js → DotGrid-BYl8XdMi.js} +9 -10
- package/dist/core/{Duotone-DGNEAlye.js → Duotone-DbewOoB4.js} +12 -13
- package/dist/core/{FilmGrain-BAKXXtLg.js → FilmGrain-zA_-knOw.js} +7 -8
- package/dist/core/{FloatingParticles-Fv8JIzKk.js → FloatingParticles-BhVnqMsE.js} +22 -23
- package/dist/core/{GlassTiles-5MyBj1ff.js → GlassTiles-CFI57glh.js} +7 -8
- package/dist/core/{Glow-DvJj7BB7.js → Glow-CQgl3IoS.js} +10 -11
- package/dist/core/{Godrays-D3VnYrAm.js → Godrays-BBCtZxbv.js} +18 -19
- package/dist/core/{Grayscale-oWIF3PV5.js → Grayscale-CAEFLteL.js} +9 -10
- package/dist/core/{Grid-Bov7AA9m.js → Grid-DlM-rVbZ.js} +5 -6
- package/dist/core/{GridDistortion-CWYom5Dw.js → GridDistortion-ZOZphSAT.js} +29 -30
- package/dist/core/{Group-CPk-7fiA.js → Group-BQAs3RiH.js} +7 -8
- package/dist/core/{Halftone-F7fsdu7W.js → Halftone-ci4ga-_J.js} +8 -9
- package/dist/core/{HueShift-CiS4hdtk.js → HueShift-CyxzPcJV.js} +11 -12
- package/dist/core/{ImageTexture-B3Q29OHX.js → ImageTexture-CdAGsPuH.js} +18 -20
- package/dist/core/{Invert-Cyc4JHWc.js → Invert-iPsiIqNZ.js} +7 -8
- package/dist/core/{LinearBlur-BTC54qzk.js → LinearBlur-BEaaoIk-.js} +13 -14
- package/dist/core/{LinearGradient-DPe-Z-lw.js → LinearGradient-DR_7RxLX.js} +10 -11
- package/dist/core/{Liquify-D2nzMDzq.js → Liquify-Bi02_ugh.js} +33 -34
- package/dist/core/{Pixelate-irPzmtQm.js → Pixelate-CSsdT1rr.js} +4 -5
- package/dist/core/{PolarCoordinates-Ck5ZWrQO.js → PolarCoordinates-D626ml58.js} +10 -11
- package/dist/core/{Posterize-DICq_t96.js → Posterize-DhZkMaC7.js} +8 -10
- package/dist/core/{ProgressiveBlur-BuORe3VH.js → ProgressiveBlur-CGtCfLF8.js} +16 -17
- package/dist/core/{RadialGradient-CbaCbOJj.js → RadialGradient-C0_WzmbH.js} +13 -14
- package/dist/core/{RectangularCoordinates-1LIDaeHR.js → RectangularCoordinates-DfXw7fhI.js} +6 -7
- package/dist/core/{Ripples-0Ufm3-fY.js → Ripples-DkemN3eh.js} +9 -10
- package/dist/core/{Saturation-DbSXtSeK.js → Saturation-Dup81Pnq.js} +7 -8
- package/dist/core/{SimplexNoise-BKB94dhx.js → SimplexNoise-BYEiCjDj.js} +9 -10
- package/dist/core/{SineWave-CkWtnzHF.js → SineWave-C6MRPtsy.js} +9 -10
- package/dist/core/{SolidColor-DaB-FHNX.js → SolidColor-BZHRczgb.js} +1 -1
- package/dist/core/{Spherize-CqjZj4yV.js → Spherize-DOAnDx2l.js} +13 -14
- package/dist/core/{Spiral-BkzSmPUL.js → Spiral-BMjnWXh1.js} +11 -12
- package/dist/core/{Strands-DyrV6zDO.js → Strands-BOVsuJLe.js} +14 -15
- package/dist/core/{Stretch-DeBlJ-NH.js → Stretch-D6bHc6yp.js} +13 -14
- package/dist/core/{Swirl-BHn9Ji7_.js → Swirl-BFoc0ImG.js} +14 -15
- package/dist/core/{TiltShift-DiArippe.js → TiltShift-BiNvvhzj.js} +14 -15
- package/dist/core/{Tritone-DrzxJUaq.js → Tritone-gdx2AA0m.js} +9 -10
- package/dist/core/{Twirl-C6xj1p52.js → Twirl-BsV8YbqC.js} +8 -9
- package/dist/core/{Vibrance-C6lNgpWH.js → Vibrance-C182fbSw.js} +5 -6
- package/dist/core/{WaveDistortion-DcXxPZ2w.js → WaveDistortion-CmaS2zDB.js} +12 -13
- package/dist/core/{ZoomBlur-_feIVJs6.js → ZoomBlur-DLf5xQ16.js} +10 -11
- package/dist/core/{colorMixing-C-FChLp0.js → colorMixing--dhzx0ch.js} +10 -11
- package/dist/core/edges-CDzKsauJ.js +15 -0
- package/dist/core/index.js +636 -684
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +3 -3
- package/dist/core/shaders/Ascii/index.js +2 -2
- package/dist/core/shaders/Blob/index.js +5 -5
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/Bulge/index.js +4 -4
- package/dist/core/shaders/CRTScreen/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +4 -4
- package/dist/core/shaders/ChromaFlow/index.js +3 -3
- package/dist/core/shaders/ChromaticAberration/index.js +3 -3
- package/dist/core/shaders/Circle/index.js +3 -3
- package/dist/core/shaders/CursorTrail/index.js +4 -4
- package/dist/core/shaders/DiffuseBlur/index.js +4 -4
- package/dist/core/shaders/Dither/index.js +3 -3
- package/dist/core/shaders/DotGrid/index.js +3 -3
- package/dist/core/shaders/Duotone/index.js +4 -4
- package/dist/core/shaders/FilmGrain/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.js +3 -3
- package/dist/core/shaders/GlassTiles/index.js +2 -2
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +3 -3
- package/dist/core/shaders/Grayscale/index.js +2 -2
- package/dist/core/shaders/Grid/index.js +3 -3
- package/dist/core/shaders/GridDistortion/index.js +4 -4
- package/dist/core/shaders/Group/index.js +2 -2
- package/dist/core/shaders/Halftone/index.js +3 -3
- package/dist/core/shaders/HueShift/index.js +2 -2
- package/dist/core/shaders/ImageTexture/index.js +2 -2
- package/dist/core/shaders/Invert/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.js +3 -3
- package/dist/core/shaders/LinearGradient/index.js +4 -4
- package/dist/core/shaders/Liquify/index.js +4 -4
- package/dist/core/shaders/Pixelate/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.js +4 -4
- package/dist/core/shaders/Posterize/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -3
- package/dist/core/shaders/RadialGradient/index.js +4 -4
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -4
- package/dist/core/shaders/Ripples/index.js +5 -5
- package/dist/core/shaders/Saturation/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.js +5 -5
- package/dist/core/shaders/SineWave/index.js +3 -3
- package/dist/core/shaders/SolidColor/index.js +3 -3
- package/dist/core/shaders/Spherize/index.js +3 -3
- package/dist/core/shaders/Spiral/index.js +4 -4
- package/dist/core/shaders/Strands/index.js +4 -4
- package/dist/core/shaders/Stretch/index.js +4 -4
- package/dist/core/shaders/Swirl/index.js +5 -5
- package/dist/core/shaders/TiltShift/index.js +3 -3
- package/dist/core/shaders/Tritone/index.js +4 -4
- package/dist/core/shaders/Twirl/index.js +4 -4
- package/dist/core/shaders/Vibrance/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +4 -4
- package/dist/core/shaders/ZoomBlur/index.js +3 -3
- package/dist/core/three.tsl-Btj1hLsf.js +43845 -0
- package/dist/core/{time-5uQ65blS.js → time-DbRMw6Jm.js} +4 -5
- package/dist/core/{transformations-DBjTkQ5b.js → transformations-CsrIJXh-.js} +176 -177
- package/dist/react/engine/component.template.d.ts +2 -2
- package/dist/react/index.cjs +83 -79
- package/dist/react/index.js +50779 -50512
- package/dist/svelte/components/AngularBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/Ascii.svelte.d.ts +2 -2
- package/dist/svelte/components/Blob.svelte.d.ts +2 -2
- package/dist/svelte/components/Blur.svelte.d.ts +2 -2
- package/dist/svelte/components/Bulge.svelte.d.ts +2 -2
- package/dist/svelte/components/CRTScreen.svelte.d.ts +2 -2
- package/dist/svelte/components/ChannelBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/Checkerboard.svelte.d.ts +2 -2
- package/dist/svelte/components/ChromaFlow.svelte.d.ts +2 -2
- package/dist/svelte/components/ChromaticAberration.svelte.d.ts +2 -2
- package/dist/svelte/components/Circle.svelte.d.ts +2 -2
- package/dist/svelte/components/CursorTrail.svelte.d.ts +2 -2
- package/dist/svelte/components/DiffuseBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/Dither.svelte.d.ts +2 -2
- package/dist/svelte/components/DotGrid.svelte.d.ts +2 -2
- package/dist/svelte/components/Duotone.svelte.d.ts +2 -2
- package/dist/svelte/components/FilmGrain.svelte.d.ts +2 -2
- package/dist/svelte/components/FloatingParticles.svelte.d.ts +2 -2
- package/dist/svelte/components/GlassTiles.svelte.d.ts +2 -2
- package/dist/svelte/components/Glow.svelte.d.ts +2 -2
- package/dist/svelte/components/Godrays.svelte.d.ts +2 -2
- package/dist/svelte/components/Grayscale.svelte.d.ts +2 -2
- package/dist/svelte/components/Grid.svelte.d.ts +2 -2
- package/dist/svelte/components/GridDistortion.svelte.d.ts +2 -2
- package/dist/svelte/components/Group.svelte.d.ts +2 -2
- package/dist/svelte/components/Halftone.svelte.d.ts +2 -2
- package/dist/svelte/components/HueShift.svelte.d.ts +2 -2
- package/dist/svelte/components/ImageTexture.svelte.d.ts +2 -2
- package/dist/svelte/components/Invert.svelte.d.ts +2 -2
- package/dist/svelte/components/LinearBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/LinearGradient.svelte.d.ts +2 -2
- package/dist/svelte/components/Liquify.svelte.d.ts +2 -2
- package/dist/svelte/components/Pixelate.svelte.d.ts +2 -2
- package/dist/svelte/components/PolarCoordinates.svelte.d.ts +2 -2
- package/dist/svelte/components/Posterize.svelte.d.ts +2 -2
- package/dist/svelte/components/ProgressiveBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/RadialGradient.svelte.d.ts +2 -2
- package/dist/svelte/components/RectangularCoordinates.svelte.d.ts +2 -2
- package/dist/svelte/components/Ripples.svelte.d.ts +2 -2
- package/dist/svelte/components/Saturation.svelte.d.ts +2 -2
- package/dist/svelte/components/SimplexNoise.svelte.d.ts +2 -2
- package/dist/svelte/components/SineWave.svelte.d.ts +2 -2
- package/dist/svelte/components/SolidColor.svelte.d.ts +2 -2
- package/dist/svelte/components/Spherize.svelte.d.ts +2 -2
- package/dist/svelte/components/Spiral.svelte.d.ts +2 -2
- package/dist/svelte/components/Strands.svelte.d.ts +2 -2
- package/dist/svelte/components/Stretch.svelte.d.ts +2 -2
- package/dist/svelte/components/Swirl.svelte.d.ts +2 -2
- package/dist/svelte/components/TiltShift.svelte.d.ts +2 -2
- package/dist/svelte/components/Tritone.svelte.d.ts +2 -2
- package/dist/svelte/components/Twirl.svelte.d.ts +2 -2
- package/dist/svelte/components/Vibrance.svelte.d.ts +2 -2
- package/dist/svelte/components/WaveDistortion.svelte.d.ts +2 -2
- package/dist/svelte/components/ZoomBlur.svelte.d.ts +2 -2
- package/dist/svelte/engine/component.template.svelte.d.ts +2 -2
- package/dist/svelte/index.js +50786 -50519
- package/dist/vue/engine/Shader.vue.d.ts +1 -1
- package/dist/vue/index.js +50430 -50163
- package/package.json +1 -1
- package/dist/core/edges-B-tVdqcI.js +0 -16
- package/dist/core/three.tsl-BqgDcRt9.js +0 -43424
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { a as
|
|
4
|
-
import { DataTexture as
|
|
5
|
-
|
|
6
|
-
var ie = 20, f = /* @__PURE__ */ new WeakMap(), re = (e) => {
|
|
1
|
+
import { D as $, O as B } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { t as J } from "./edges-CDzKsauJ.js";
|
|
3
|
+
import { a as K } from "./transformations-CsrIJXh-.js";
|
|
4
|
+
import { DataTexture as Q, FloatType as ee, LinearFilter as C, RGFormat as te } from "three";
|
|
5
|
+
var ae = 20, f = /* @__PURE__ */ new WeakMap(), ie = (e) => {
|
|
7
6
|
let t = f.get(e);
|
|
8
|
-
const
|
|
9
|
-
if (t && t.gridSize !==
|
|
10
|
-
const l = new Float32Array(
|
|
11
|
-
|
|
12
|
-
texture:
|
|
7
|
+
const n = e?.gridSize?.uniform?.value ? Math.max(8, Math.min(128, Math.floor(e.gridSize.uniform.value))) : ae;
|
|
8
|
+
if (t && t.gridSize !== n && (t.texture.dispose(), t = void 0, f.delete(e)), !t) {
|
|
9
|
+
const l = new Float32Array(n * n * 2), s = new Q(l, n, n, te, ee);
|
|
10
|
+
s.magFilter = C, s.minFilter = C, s.needsUpdate = !0, t = {
|
|
11
|
+
texture: s,
|
|
13
12
|
data: l,
|
|
14
|
-
tslNode: $(
|
|
15
|
-
gridSize:
|
|
13
|
+
tslNode: $(s),
|
|
14
|
+
gridSize: n
|
|
16
15
|
}, f.set(e, t);
|
|
17
16
|
}
|
|
18
17
|
return t;
|
|
19
18
|
};
|
|
20
|
-
const
|
|
19
|
+
const re = {
|
|
21
20
|
name: "GridDistortion",
|
|
22
21
|
category: "Interactive",
|
|
23
22
|
description: "Interactive grid distortion controlled by mouse position",
|
|
@@ -82,7 +81,7 @@ const se = {
|
|
|
82
81
|
edges: {
|
|
83
82
|
default: "stretch",
|
|
84
83
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
85
|
-
transform:
|
|
84
|
+
transform: K,
|
|
86
85
|
ui: {
|
|
87
86
|
type: "select",
|
|
88
87
|
options: [
|
|
@@ -107,23 +106,23 @@ const se = {
|
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
108
|
},
|
|
110
|
-
fragmentNode: ({ uniforms: e, onBeforeRender: t, childNode:
|
|
111
|
-
const { vec2:
|
|
109
|
+
fragmentNode: ({ uniforms: e, onBeforeRender: t, childNode: n, onCleanup: l }) => {
|
|
110
|
+
const { vec2: s, vec4: H, float: g, uniform: T, screenUV: w, convertToTexture: L } = B, { texture: z, data: a, tslNode: N, gridSize: d } = ie(e), h = T(0), v = T(0);
|
|
112
111
|
let F = 0.5, I = 0.5, R = Date.now();
|
|
113
112
|
if (t(({ pointer: o }) => {
|
|
114
|
-
const
|
|
115
|
-
R =
|
|
113
|
+
const _ = Date.now(), i = Math.min((_ - R) / 1e3, 0.016);
|
|
114
|
+
R = _;
|
|
116
115
|
const V = i > 0 ? (o.x - F) / i : 0, X = i > 0 ? (o.y - I) / i : 0;
|
|
117
116
|
h.value = h.value * 0.85 + V * 0.15, v.value = v.value * 0.85 + X * 0.15;
|
|
118
117
|
const Y = e.decay.uniform.value, q = e.intensity.uniform.value, y = e.radius.uniform.value * 0.05, M = e.swirl.uniform.value;
|
|
119
118
|
for (let u = 0; u < d; u++) for (let m = 0; m < d; m++) {
|
|
120
119
|
const r = (u * d + m) * 2;
|
|
121
120
|
a[r] *= 1 - Y * i, a[r + 1] *= 1 - Y * i;
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
const p = Math.exp(-
|
|
121
|
+
const k = (m + 0.5) / d, P = (u + 0.5) / d, S = k - o.x, D = P - o.y, b = Math.sqrt(S * S + D * D);
|
|
122
|
+
if (b < y * 2 && Math.abs(V) + Math.abs(X) > 0.01) {
|
|
123
|
+
const p = Math.exp(-b * b / (y * y));
|
|
125
124
|
if (a[r] += h.value * p * q * i * 0.5, a[r + 1] += v.value * p * q * i * 0.5, M > 0) {
|
|
126
|
-
const A = Math.atan2(
|
|
125
|
+
const A = Math.atan2(D, S) + Math.PI * 0.5;
|
|
127
126
|
a[r] += Math.cos(A) * M * p * i * 2, a[r + 1] += Math.sin(A) * M * p * i * 2;
|
|
128
127
|
}
|
|
129
128
|
}
|
|
@@ -132,17 +131,17 @@ const se = {
|
|
|
132
131
|
z.needsUpdate = !0, F = o.x, I = o.y;
|
|
133
132
|
}), l(() => {
|
|
134
133
|
z.dispose(), f.delete(e);
|
|
135
|
-
}), !
|
|
136
|
-
const c =
|
|
134
|
+
}), !n) return H(0, 0, 0, 0);
|
|
135
|
+
const c = L(n);
|
|
137
136
|
l(() => {
|
|
138
137
|
c?.renderTarget?.dispose && c.renderTarget.dispose();
|
|
139
138
|
});
|
|
140
|
-
const
|
|
141
|
-
return
|
|
139
|
+
const O = e.gridSize.uniform, x = g(1).div(O), W = w.div(x).floor().mul(x).add(x.mul(0.5)), Z = N.sample(W).xy, U = g(0.1), E = g(-0.1), j = Z.clamp(s(E, E), s(U, U)), G = w.sub(j);
|
|
140
|
+
return J(G, c.sample(G), c, e.edges.uniform);
|
|
142
141
|
}
|
|
143
142
|
};
|
|
144
|
-
var
|
|
143
|
+
var de = re;
|
|
145
144
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
re as n,
|
|
146
|
+
de as t
|
|
148
147
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const i = {
|
|
1
|
+
import { O as r } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
const t = {
|
|
4
3
|
name: "Group",
|
|
5
4
|
category: "Utilities",
|
|
6
5
|
description: "Container for organizing and composing child effects",
|
|
7
6
|
requiresChild: !0,
|
|
8
7
|
props: {},
|
|
9
8
|
fragmentNode: ({ childNode: e }) => {
|
|
10
|
-
const { vec4:
|
|
11
|
-
return e ||
|
|
9
|
+
const { vec4: o } = r;
|
|
10
|
+
return e || o(0);
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
|
-
var
|
|
13
|
+
var i = t;
|
|
15
14
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
t as n,
|
|
16
|
+
i as t
|
|
18
17
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
4
|
-
const F = {
|
|
1
|
+
import { O as V } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { n as A } from "./transformations-CsrIJXh-.js";
|
|
3
|
+
const D = {
|
|
5
4
|
name: "Halftone",
|
|
6
5
|
category: "Stylize",
|
|
7
6
|
description: "Halftone dot pattern effect for printing aesthetics",
|
|
@@ -20,7 +19,7 @@ const F = {
|
|
|
20
19
|
},
|
|
21
20
|
angle: {
|
|
22
21
|
default: 45,
|
|
23
|
-
transform:
|
|
22
|
+
transform: A,
|
|
24
23
|
description: "Rotation angle of the pattern (in degrees)",
|
|
25
24
|
ui: {
|
|
26
25
|
type: "range",
|
|
@@ -43,14 +42,14 @@ const F = {
|
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
fragmentNode: ({ uniforms: t, childNode: s }) => {
|
|
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:
|
|
45
|
+
const { vec2: e, vec3: g, vec4: r, sin: h, cos: y, fract: b, length: v, smoothstep: x, dot: n, screenUV: q, viewportSize: a, radians: S } = V;
|
|
47
46
|
if (!s) return r(0);
|
|
48
|
-
const
|
|
47
|
+
const c = q, _ = t.frequency.uniform, z = t.angle.uniform, i = t.smoothness.uniform, l = S(z), C = a.x.div(a.y), m = e(c.x.mul(C), c.y), f = y(l), d = h(l), H = b(e(n(m, e(f, d.negate())), n(m, e(d, f))).mul(_)).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(i), u.sub(i), U);
|
|
49
48
|
return r(o.rgb.mul(p), o.a.mul(p));
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
|
-
var E =
|
|
51
|
+
var E = D;
|
|
53
52
|
export {
|
|
54
|
-
|
|
53
|
+
D as n,
|
|
55
54
|
E as t
|
|
56
55
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
4
|
-
const a = {
|
|
1
|
+
import { O as n } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { n as s } from "./ColorAdjustment-CKwpE_4M.js";
|
|
3
|
+
const i = {
|
|
5
4
|
name: "HueShift",
|
|
6
5
|
category: "Adjustments",
|
|
7
6
|
description: "Rotate hue around the color wheel",
|
|
@@ -18,16 +17,16 @@ const a = {
|
|
|
18
17
|
},
|
|
19
18
|
transform: (t) => t * Math.PI / 180
|
|
20
19
|
} },
|
|
21
|
-
fragmentNode: ({ uniforms: t, childNode:
|
|
22
|
-
const { vec4: e } =
|
|
23
|
-
if (!
|
|
20
|
+
fragmentNode: ({ uniforms: t, childNode: o }) => {
|
|
21
|
+
const { vec4: e } = n;
|
|
22
|
+
if (!o)
|
|
24
23
|
return console.error("You must pass a child component into the Hue Shift shader."), e(0);
|
|
25
|
-
const
|
|
26
|
-
return e(
|
|
24
|
+
const r = o || e(0, 0, 0, 0);
|
|
25
|
+
return e(s(r.rgb, t.shift.uniform).rgb, r.a);
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
|
-
var
|
|
28
|
+
var h = i;
|
|
30
29
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
i as n,
|
|
31
|
+
h as t
|
|
33
32
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
ne();
|
|
4
|
-
const ce = {
|
|
1
|
+
import { B as S, H as oe, O as ae, S as ne, U as se, k as x, y } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
const ie = {
|
|
5
3
|
name: "ImageTexture",
|
|
6
4
|
category: "Base Layers",
|
|
7
5
|
description: "Display an image with customizable object-fit modes",
|
|
@@ -53,12 +51,12 @@ const ce = {
|
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
},
|
|
56
|
-
fragmentNode: ({ uniforms: m, onCleanup:
|
|
57
|
-
const { vec2: o, vec4:
|
|
54
|
+
fragmentNode: ({ uniforms: m, onCleanup: D, onBeforeRender: W, uvContext: A }) => {
|
|
55
|
+
const { vec2: o, vec4: B, float: t, texture: H, screenUV: N, viewportSize: l, step: a, min: u, max: O } = ae, z = A ?? N, _ = new se();
|
|
58
56
|
let T = "", r = !1;
|
|
59
|
-
const n = new
|
|
60
|
-
n.colorSpace =
|
|
61
|
-
const $ = H(n), s =
|
|
57
|
+
const n = new oe();
|
|
58
|
+
n.colorSpace = S;
|
|
59
|
+
const $ = H(n), s = x(1), f = x(0), U = x(0), V = (e) => {
|
|
62
60
|
if (!(!e || e.trim() === "" || r)) {
|
|
63
61
|
r = !0;
|
|
64
62
|
try {
|
|
@@ -67,12 +65,12 @@ const ce = {
|
|
|
67
65
|
h = new URL(e, window.location.href).href;
|
|
68
66
|
} catch {
|
|
69
67
|
}
|
|
70
|
-
|
|
71
|
-
d.colorSpace =
|
|
72
|
-
const p = d.image,
|
|
68
|
+
_.load(e, (d) => {
|
|
69
|
+
d.colorSpace = S;
|
|
70
|
+
const p = d.image, w = p.width || 1, b = p.height || 1, te = w / b;
|
|
73
71
|
d.dispose(), T = e, requestAnimationFrame(() => {
|
|
74
72
|
const g = n.image;
|
|
75
|
-
g && typeof g == "object" && (g.width !==
|
|
73
|
+
g && typeof g == "object" && (g.width !== w || g.height !== b) && n.dispose(), s.value = te, f.value = w, U.value = b, n.image = p, n.colorSpace = S, n.needsUpdate = !0;
|
|
76
74
|
}), r = !1;
|
|
77
75
|
}, void 0, (d) => {
|
|
78
76
|
const p = !e.startsWith("http://") && !e.startsWith("https://") && !e.startsWith("data:");
|
|
@@ -90,18 +88,18 @@ const ce = {
|
|
|
90
88
|
setTimeout(() => {
|
|
91
89
|
const e = m?.url?.uniform?.value ?? "";
|
|
92
90
|
e && e.trim() !== "" && V(e);
|
|
93
|
-
}, 0),
|
|
91
|
+
}, 0), W(() => {
|
|
94
92
|
const e = m?.url?.uniform?.value ?? "";
|
|
95
93
|
e !== T && !r && V(e);
|
|
96
|
-
}),
|
|
94
|
+
}), D(() => {
|
|
97
95
|
n.dispose();
|
|
98
96
|
});
|
|
99
|
-
const q =
|
|
100
|
-
return
|
|
97
|
+
const q = z, c = l.x.div(l.y), i = m.objectFit.uniform, j = O(c.div(s), t(1)), E = o(s.div(c).mul(j), j), F = u(c.div(s), t(1)), k = o(s.div(c).mul(F), F), G = o(1, 1), R = u(u(c.div(s), t(1)), u(l.x.div(f), l.y.div(U))), M = o(s.div(c).mul(R), R), C = u(l.x.div(f), l.y.div(U)), P = o(s.div(c).mul(C), C), J = a(i, t(0.5)), K = a(t(0.5), i).mul(a(i, t(1.5))), Q = a(t(1.5), i).mul(a(i, t(2.5))), X = a(t(2.5), i).mul(a(i, t(3.5))), Y = a(t(3.5), i), Z = o(0).add(E.mul(J)).add(k.mul(K)).add(G.mul(Q)).add(M.mul(X)).add(P.mul(Y)), I = q.sub(o(0.5)).div(Z).add(o(0.5)), v = o(I.x, t(1).sub(I.y)), L = $.sample(v), ee = y(y(v.x.lessThan(0), v.x.greaterThan(1)), y(v.y.lessThan(0), v.y.greaterThan(1)));
|
|
98
|
+
return B(L.rgb, ne(ee, t(0), L.a));
|
|
101
99
|
}
|
|
102
100
|
};
|
|
103
|
-
var
|
|
101
|
+
var le = ie;
|
|
104
102
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
ie as n,
|
|
104
|
+
le as t
|
|
107
105
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
i();
|
|
1
|
+
import { O as a } from "./three.tsl-Btj1hLsf.js";
|
|
3
2
|
const c = {
|
|
4
3
|
name: "Invert",
|
|
5
4
|
category: "Adjustments",
|
|
6
5
|
description: "Invert RGB colors while preserving alpha",
|
|
7
6
|
requiresChild: !0,
|
|
8
7
|
props: {},
|
|
9
|
-
fragmentNode: ({ childNode:
|
|
10
|
-
const { vec4:
|
|
11
|
-
if (!
|
|
12
|
-
return console.error("You must pass a child component into the Invert shader."),
|
|
13
|
-
const o =
|
|
14
|
-
return
|
|
8
|
+
fragmentNode: ({ childNode: t }) => {
|
|
9
|
+
const { vec4: r, vec3: n } = a;
|
|
10
|
+
if (!t)
|
|
11
|
+
return console.error("You must pass a child component into the Invert shader."), r(0);
|
|
12
|
+
const o = t || r(0, 0, 0, 0), e = o.a, s = e.greaterThan(0).select(o.rgb.div(e), n(0, 0, 0));
|
|
13
|
+
return r(n(1, 1, 1).sub(s).mul(e), e);
|
|
15
14
|
}
|
|
16
15
|
};
|
|
17
16
|
var p = c;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
4
|
-
const I = {
|
|
1
|
+
import { O as q } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { n as w } from "./transformations-CsrIJXh-.js";
|
|
3
|
+
const A = {
|
|
5
4
|
name: "LinearBlur",
|
|
6
5
|
category: "Blurs",
|
|
7
6
|
description: "Directional motion blur in a specific angle",
|
|
@@ -21,7 +20,7 @@ const I = {
|
|
|
21
20
|
},
|
|
22
21
|
angle: {
|
|
23
22
|
default: 0,
|
|
24
|
-
transform:
|
|
23
|
+
transform: w,
|
|
25
24
|
description: "Direction of the linear blur (in degrees)",
|
|
26
25
|
ui: {
|
|
27
26
|
type: "range",
|
|
@@ -33,25 +32,25 @@ const I = {
|
|
|
33
32
|
}
|
|
34
33
|
},
|
|
35
34
|
fragmentNode: ({ uniforms: s, childNode: a, onCleanup: d }) => {
|
|
36
|
-
const { vec2: l, vec4: u, float: e, screenUV: p, viewportSize: f, sin: g, cos: v, radians: b, Fn: x, convertToTexture:
|
|
35
|
+
const { vec2: l, vec4: u, float: e, screenUV: p, viewportSize: f, sin: g, cos: v, radians: b, Fn: x, convertToTexture: y } = q;
|
|
37
36
|
if (!a) return u(0, 0, 0, 0);
|
|
38
|
-
const t =
|
|
37
|
+
const t = y(a);
|
|
39
38
|
d(() => {
|
|
40
39
|
t?.renderTarget?.dispose && t.renderTarget.dispose();
|
|
41
40
|
});
|
|
42
|
-
const c = b(s.angle.uniform),
|
|
41
|
+
const c = b(s.angle.uniform), T = l(v(c), g(c));
|
|
43
42
|
return x(() => {
|
|
44
|
-
const
|
|
43
|
+
const h = p, D = l(1).div(f), V = T.mul(s.intensity.uniform).mul(D).mul(2), n = u(0).toVar(), r = e(0).toVar();
|
|
45
44
|
for (let i = 0; i < 32; i++) {
|
|
46
|
-
const o = e(i).div(e(31)).sub(0.5).mul(2), m = e(1).div(e(2.506628)).mul(e(-0.5).mul(o).mul(o).div(e(0.64)).exp()),
|
|
47
|
-
n.assign(n.add(
|
|
45
|
+
const o = e(i).div(e(31)).sub(0.5).mul(2), m = e(1).div(e(2.506628)).mul(e(-0.5).mul(o).mul(o).div(e(0.64)).exp()), B = h.add(V.mul(o.mul(0.5))), _ = t.sample(B).mul(m);
|
|
46
|
+
n.assign(n.add(_)), r.assign(r.add(m));
|
|
48
47
|
}
|
|
49
48
|
return n.div(r);
|
|
50
49
|
})();
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
|
-
var
|
|
52
|
+
var R = A;
|
|
54
53
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
A as n,
|
|
55
|
+
R as t
|
|
57
56
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as X, i as Y, n as j, o as h, r as b, t as
|
|
3
|
-
import { t as
|
|
4
|
-
|
|
5
|
-
const J = {
|
|
1
|
+
import { O as W } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { a as X, i as Y, n as j, o as h, r as b, t as k } from "./transformations-CsrIJXh-.js";
|
|
3
|
+
import { t as F } from "./colorMixing--dhzx0ch.js";
|
|
4
|
+
const I = {
|
|
6
5
|
name: "LinearGradient",
|
|
7
6
|
category: "Base Layers",
|
|
8
7
|
description: "Create smooth linear color gradients",
|
|
@@ -95,18 +94,18 @@ const J = {
|
|
|
95
94
|
description: "Color space for color interpolation",
|
|
96
95
|
ui: {
|
|
97
96
|
type: "select",
|
|
98
|
-
options:
|
|
97
|
+
options: k,
|
|
99
98
|
label: "Color Space"
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
},
|
|
103
102
|
fragmentNode: ({ uniforms: t, uvContext: T }) => {
|
|
104
|
-
const { vec2: s, vec4: y, float: e, cos: x, sin: C, dot: v, radians: A, screenUV: E, length: B, normalize: M, abs: S, mod: q, fract: w } =
|
|
105
|
-
return y(n.x, n.y, n.z,
|
|
103
|
+
const { vec2: s, vec4: y, float: e, cos: x, sin: C, dot: v, radians: A, screenUV: E, length: B, normalize: M, abs: S, mod: q, fract: w } = W, L = T ?? E, l = s(t.start.uniform[0], t.start.uniform[1].oneMinus()), c = s(t.end.uniform[0], t.end.uniform[1].oneMinus()), d = c.sub(l), O = B(d), V = M(d), p = A(t.angle.uniform).negate(), u = x(p), m = C(p), f = l.add(c).mul(0.5), r = L.sub(f), o = v(s(r.x.mul(u).sub(r.y.mul(m)), r.x.mul(m).add(r.y.mul(u))).add(f).sub(l), V).div(O.max(1e-6)), a = t.edges.uniform, H = o.clamp(e(0), e(1)), P = o.greaterThanEqual(e(0)).select(e(1), e(0)), U = o.lessThanEqual(e(1)).select(e(1), e(0)), _ = P.mul(U), i = q(S(o), e(2)), z = i.greaterThan(e(1)).select(e(2).sub(i), i), D = w(o), g = a.greaterThanEqual(e(0.5)), G = a.greaterThanEqual(e(1.5)), N = a.greaterThanEqual(e(2.5)).select(D, G.select(z, g.select(o, H))), n = F(t.colorA.uniform, t.colorB.uniform, N.clamp(e(0), e(1)), t.colorSpace.uniform), R = g.and(a.lessThan(e(1.5))).select(n.w.mul(_), n.w);
|
|
104
|
+
return y(n.x, n.y, n.z, R);
|
|
106
105
|
}
|
|
107
106
|
};
|
|
108
|
-
var
|
|
107
|
+
var Z = I;
|
|
109
108
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
I as n,
|
|
110
|
+
Z as t
|
|
112
111
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { a as
|
|
4
|
-
import { DataTexture as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let i = w.get(e);
|
|
1
|
+
import { D as Z, O as A } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { t as $ } from "./edges-CDzKsauJ.js";
|
|
3
|
+
import { a as B } from "./transformations-CsrIJXh-.js";
|
|
4
|
+
import { DataTexture as J, FloatType as K, LinearFilter as C, RGFormat as Q } from "three";
|
|
5
|
+
var r = 32, T = /* @__PURE__ */ new WeakMap(), G = (e) => {
|
|
6
|
+
let i = T.get(e);
|
|
8
7
|
if (!i) {
|
|
9
|
-
const l = new Float32Array(r * r * 2), t = new
|
|
8
|
+
const l = new Float32Array(r * r * 2), t = new J(l, r, r, Q, K);
|
|
10
9
|
t.magFilter = C, t.minFilter = C, t.needsUpdate = !0, i = {
|
|
11
10
|
texture: t,
|
|
12
11
|
data: l,
|
|
13
12
|
tslNode: Z(t),
|
|
14
13
|
initialized: !1
|
|
15
|
-
},
|
|
14
|
+
}, T.set(e, i);
|
|
16
15
|
}
|
|
17
16
|
return i;
|
|
18
17
|
};
|
|
19
|
-
const
|
|
18
|
+
const ee = {
|
|
20
19
|
name: "Liquify",
|
|
21
20
|
category: "Interactive",
|
|
22
21
|
description: "Liquid-like interactive deformation effect",
|
|
@@ -70,7 +69,7 @@ const te = {
|
|
|
70
69
|
edges: {
|
|
71
70
|
default: "stretch",
|
|
72
71
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
73
|
-
transform:
|
|
72
|
+
transform: B,
|
|
74
73
|
ui: {
|
|
75
74
|
type: "select",
|
|
76
75
|
options: [
|
|
@@ -96,45 +95,45 @@ const te = {
|
|
|
96
95
|
}
|
|
97
96
|
},
|
|
98
97
|
uvTransformNode: ({ uv: e, uniforms: i }) => {
|
|
99
|
-
const { vec2: l, float: t } = A, d = G(i).tslNode.sample(e).xy, o = t(0.2),
|
|
100
|
-
return e.sub(
|
|
98
|
+
const { vec2: l, float: t } = A, d = G(i).tslNode.sample(e).xy, o = t(0.2), u = d.clamp(l(o.negate(), o.negate()), l(o, o));
|
|
99
|
+
return e.sub(u);
|
|
101
100
|
},
|
|
102
101
|
fragmentNode: ({ uniforms: e, onBeforeRender: i, childNode: l, onCleanup: t }) => {
|
|
103
|
-
const { vec2: d, vec4: o, float:
|
|
104
|
-
let R = 0.5, S = 0.5,
|
|
102
|
+
const { vec2: d, vec4: o, float: u, uniform: w, screenUV: F, convertToTexture: H } = A, { texture: q, data: a, tslNode: O } = G(e), h = w(0), x = w(0);
|
|
103
|
+
let R = 0.5, S = 0.5, I = Date.now();
|
|
105
104
|
if (i(({ pointer: c }) => {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
105
|
+
const U = Date.now(), s = Math.min((U - I) / 1e3, 0.016);
|
|
106
|
+
I = U;
|
|
107
|
+
const V = s > 0 ? (c.x - R) / s : 0, X = s > 0 ? (c.y - S) / s : 0;
|
|
108
|
+
h.value = h.value * 0.85 + V * 0.15, x.value = x.value * 0.85 + X * 0.15;
|
|
109
|
+
const Y = e.decay.uniform.value, _ = e.intensity.uniform.value, y = e.radius.uniform.value * 0.05, g = e.swirl.uniform.value;
|
|
111
110
|
for (let p = 0; p < r; p++) for (let f = 0; f < r; f++) {
|
|
112
111
|
const n = (p * r + f) * 2;
|
|
113
|
-
a[n] *= 1 -
|
|
114
|
-
const z = (f + 0.5) / r, P = (p + 0.5) / r, M = z - c.x, b = P - c.y,
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
if (a[n] +=
|
|
112
|
+
a[n] *= 1 - Y * s, a[n + 1] *= 1 - Y * s;
|
|
113
|
+
const z = (f + 0.5) / r, P = (p + 0.5) / r, M = z - c.x, b = P - c.y, D = Math.sqrt(M * M + b * b);
|
|
114
|
+
if (D < y * 2 && Math.abs(V) + Math.abs(X) > 0.01) {
|
|
115
|
+
const v = Math.exp(-D * D / (y * y));
|
|
116
|
+
if (a[n] += h.value * v * _ * s * 0.5, a[n + 1] += x.value * v * _ * s * 0.5, g > 0) {
|
|
118
117
|
const k = Math.atan2(b, M) + Math.PI * 0.5;
|
|
119
|
-
a[n] += Math.cos(k) * g *
|
|
118
|
+
a[n] += Math.cos(k) * g * v * s * 2, a[n + 1] += Math.sin(k) * g * v * s * 2;
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
a[n] = Math.max(-1, Math.min(1, a[n])), a[n + 1] = Math.max(-1, Math.min(1, a[n + 1]));
|
|
123
122
|
}
|
|
124
123
|
q.needsUpdate = !0, R = c.x, S = c.y;
|
|
125
124
|
}), t(() => {
|
|
126
|
-
q.dispose(),
|
|
125
|
+
q.dispose(), T.delete(e);
|
|
127
126
|
}), !l) return o(0, 0, 0, 0);
|
|
128
|
-
const
|
|
127
|
+
const m = H(l);
|
|
129
128
|
t(() => {
|
|
130
|
-
|
|
129
|
+
m?.renderTarget?.dispose && m.renderTarget.dispose();
|
|
131
130
|
});
|
|
132
|
-
const W = O.sample(F).xy,
|
|
133
|
-
return
|
|
131
|
+
const W = O.sample(F).xy, E = u(0.2), L = u(-0.2), j = W.clamp(d(L, L), d(E, E)), N = F.sub(j);
|
|
132
|
+
return $(N, m.sample(N), m, e.edges.uniform);
|
|
134
133
|
}
|
|
135
134
|
};
|
|
136
|
-
var
|
|
135
|
+
var re = ee;
|
|
137
136
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
ee as n,
|
|
138
|
+
re as t
|
|
140
139
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
p
|
|
3
|
-
const m = {
|
|
1
|
+
import { O as l } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
const p = {
|
|
4
3
|
name: "Pixelate",
|
|
5
4
|
category: "Stylize",
|
|
6
5
|
description: "Pixelation effect with adjustable cell size",
|
|
@@ -32,8 +31,8 @@ const m = {
|
|
|
32
31
|
return s.sample(u);
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
|
-
var f =
|
|
34
|
+
var f = p;
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
p as n,
|
|
38
37
|
f as t
|
|
39
38
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { a as
|
|
4
|
-
|
|
5
|
-
const U = {
|
|
1
|
+
import { O as y } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { t as T } from "./edges-CDzKsauJ.js";
|
|
3
|
+
import { a as w, o as C } from "./transformations-CsrIJXh-.js";
|
|
4
|
+
const P = {
|
|
6
5
|
name: "PolarCoordinates",
|
|
7
6
|
category: "Distortions",
|
|
8
7
|
description: "Convert rectangular coordinates to polar space",
|
|
@@ -14,7 +13,7 @@ const U = {
|
|
|
14
13
|
x: 0.5,
|
|
15
14
|
y: 0.5
|
|
16
15
|
},
|
|
17
|
-
transform:
|
|
16
|
+
transform: C,
|
|
18
17
|
description: "The center point for polar coordinate conversion",
|
|
19
18
|
ui: {
|
|
20
19
|
type: "position",
|
|
@@ -57,7 +56,7 @@ const U = {
|
|
|
57
56
|
edges: {
|
|
58
57
|
default: "transparent",
|
|
59
58
|
description: "How to handle edges when distortion pushes content out of bounds",
|
|
60
|
-
transform:
|
|
59
|
+
transform: w,
|
|
61
60
|
ui: {
|
|
62
61
|
type: "select",
|
|
63
62
|
options: [
|
|
@@ -93,12 +92,12 @@ const U = {
|
|
|
93
92
|
i(() => {
|
|
94
93
|
n?.renderTarget?.dispose && n.renderTarget.dispose();
|
|
95
94
|
});
|
|
96
|
-
const d = a.x.div(a.y),
|
|
97
|
-
return
|
|
95
|
+
const d = a.x.div(a.y), x = r(o.x.mul(d), o.y), h = r(e.center.uniform.x.mul(d), e.center.uniform.y.oneMinus()), f = x.sub(h), b = l(f.y, f.x).add(c).div(c.mul(2)), v = p(f), g = s(o, r(b.mul(e.wrap.uniform), v.mul(e.radius.uniform)), e.intensity.uniform);
|
|
96
|
+
return T(g, n.sample(g), n, e.edges.uniform);
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
|
-
var I =
|
|
99
|
+
var I = P;
|
|
101
100
|
export {
|
|
102
|
-
|
|
101
|
+
P as n,
|
|
103
102
|
I as t
|
|
104
103
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
var
|
|
1
|
+
import { O as r } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { c as i, o as n } from "./TSLBase-BFMvTOak.js";
|
|
3
|
+
var a = class extends i {
|
|
4
4
|
static get type() {
|
|
5
5
|
return "PosterizeNode";
|
|
6
6
|
}
|
|
@@ -18,9 +18,7 @@ var p = class extends n {
|
|
|
18
18
|
return t.mul(e).floor().div(e);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
const
|
|
22
|
-
i();
|
|
23
|
-
const d = {
|
|
21
|
+
const p = /* @__PURE__ */ n(a).setParameterLength(2), c = {
|
|
24
22
|
name: "Posterize",
|
|
25
23
|
category: "Adjustments",
|
|
26
24
|
description: "Reduce color depth to create a poster effect",
|
|
@@ -38,11 +36,11 @@ const d = {
|
|
|
38
36
|
} },
|
|
39
37
|
fragmentNode: ({ uniforms: t, childNode: e }) => {
|
|
40
38
|
const { vec4: o, int: s } = r;
|
|
41
|
-
return e ?
|
|
39
|
+
return e ? p(e || o(0, 0, 0, 0), s(t.intensity.uniform)) : (console.error("You must pass a child component into the Posterize shader."), o(0));
|
|
42
40
|
}
|
|
43
41
|
};
|
|
44
|
-
var
|
|
42
|
+
var m = c;
|
|
45
43
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
c as n,
|
|
45
|
+
m as t
|
|
48
46
|
};
|