shaders 2.2.23 → 2.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/AngularBlur-Dl2gwk68.js +64 -0
- package/dist/core/Ascii-Dha_QpT3.js +286 -0
- package/dist/core/Beam-CTN9Ni43.js +139 -0
- package/dist/core/Blob-CxFDZovO.js +218 -0
- package/dist/core/Blur-Y2FsmFk_.js +77 -0
- package/dist/core/Bulge-Cb-t0xqI.js +132 -0
- package/dist/core/CRTScreen-CtERsenz.js +112 -0
- package/dist/core/ChannelBlur-CvM6GJgZ.js +118 -0
- package/dist/core/Checkerboard-CgB-egNY.js +83 -0
- package/dist/core/ChromaFlow-vRCwhQpN.js +222 -0
- package/dist/core/ChromaticAberration-FTquTQIL.js +88 -0
- package/dist/core/Circle-Daziv5d7.js +67 -0
- package/dist/core/CursorTrail-Bsz9e6Fn.js +145 -0
- package/dist/core/DiffuseBlur-Cj2PtRNd.js +83 -0
- package/dist/core/Dither-D2Nf4p3w.js +66 -0
- package/dist/core/DotGrid-CzOwquo4.js +75 -0
- package/dist/core/Duotone-XuTN9tI7.js +65 -0
- package/dist/core/FilmGrain-D3-nbi12.js +28 -0
- package/dist/core/FloatingParticles-D9Nnu1qg.js +217 -0
- package/dist/core/GlassTiles-CnjCvajI.js +69 -0
- package/dist/core/Glow-BluFc9be.js +75 -0
- package/dist/core/Godrays-ChLh_vGl.js +144 -0
- package/dist/core/Grayscale-DRny75A9.js +20 -0
- package/dist/core/Grid-DgyDa4H1.js +58 -0
- package/dist/core/GridDistortion-BAspCYvp.js +188 -0
- package/dist/core/Group-Dul7PUBl.js +14 -0
- package/dist/core/Halftone-Ifv5F_FT.js +65 -0
- package/dist/core/HueShift-De8ukMWs.js +31 -0
- package/dist/core/ImageTexture-DvYcQgJB.js +143 -0
- package/dist/core/Invert-Fz0NtIJc.js +21 -0
- package/dist/core/LinearBlur-LmhnQoA4.js +62 -0
- package/dist/core/LinearGradient-xbloQjzt.js +133 -0
- package/dist/core/Liquify-DMe1V5-O.js +175 -0
- package/dist/core/Pixelate-Cv8537Pj.js +37 -0
- package/dist/core/PolarCoordinates-DDvDhBE-.js +112 -0
- package/dist/core/Posterize-3m3xkWOz.js +29 -0
- package/dist/core/ProgressiveBlur-EGkevObV.js +121 -0
- package/dist/core/RadialGradient-B7ZZB_VJ.js +71 -0
- package/dist/core/RectangularCoordinates-muWR8mZS.js +101 -0
- package/dist/core/Ripples-8XaZaXQF.js +117 -0
- package/dist/core/Saturation-CYFI1jzN.js +30 -0
- package/dist/core/SimplexNoise-DJUe0wz_.js +99 -0
- package/dist/core/SineWave-Dl3nFO1W.js +120 -0
- package/dist/core/SolidColor-CWGq_Bjq.js +21 -0
- package/dist/core/Spherize-C-jZEUsN.js +128 -0
- package/dist/core/Spiral-BSB_R39p.js +132 -0
- package/dist/core/Strands-0stO5BMy.js +161 -0
- package/dist/core/Stretch-B645paha.js +133 -0
- package/dist/core/Swirl-CVnbawit.js +173 -0
- package/dist/core/TiltShift-0CxNRI6L.js +134 -0
- package/dist/core/Tritone-Daa-I5UD.js +76 -0
- package/dist/core/Twirl-2CJVZEtk.js +96 -0
- package/dist/core/Vibrance-DRtecEvb.js +30 -0
- package/dist/core/WaveDistortion-BscXN2rs.js +173 -0
- package/dist/core/ZoomBlur-CAqK0Kju.js +62 -0
- package/dist/core/colorMixing-BXiTAqJU.js +69 -0
- package/dist/core/edges-Bn_OIa_h.js +26 -0
- package/dist/core/index.js +2257 -1604
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +3 -7
- package/dist/core/shaders/Ascii/index.js +2 -6
- package/dist/core/shaders/Beam/index.d.ts +71 -0
- package/dist/core/shaders/Beam/index.d.ts.map +1 -0
- package/dist/core/shaders/Beam/index.js +4 -0
- package/dist/core/shaders/Blob/index.js +5 -9
- package/dist/core/shaders/Blur/index.js +2 -6
- package/dist/core/shaders/Bulge/index.js +4 -8
- package/dist/core/shaders/CRTScreen/index.js +2 -6
- package/dist/core/shaders/ChannelBlur/index.js +2 -6
- package/dist/core/shaders/Checkerboard/index.js +4 -8
- package/dist/core/shaders/ChromaFlow/index.js +3 -7
- package/dist/core/shaders/ChromaticAberration/index.js +3 -7
- package/dist/core/shaders/Circle/index.js +3 -7
- package/dist/core/shaders/CursorTrail/index.js +4 -8
- package/dist/core/shaders/DiffuseBlur/index.js +4 -8
- package/dist/core/shaders/Dither/index.js +3 -7
- package/dist/core/shaders/DotGrid/index.js +3 -7
- package/dist/core/shaders/Duotone/index.js +4 -8
- package/dist/core/shaders/FilmGrain/index.js +2 -6
- package/dist/core/shaders/FloatingParticles/index.js +3 -7
- package/dist/core/shaders/GlassTiles/index.js +2 -6
- package/dist/core/shaders/Glow/index.js +2 -6
- package/dist/core/shaders/Godrays/index.js +3 -7
- package/dist/core/shaders/Grayscale/index.js +2 -8
- package/dist/core/shaders/Grid/index.js +3 -7
- package/dist/core/shaders/GridDistortion/index.js +4 -8
- package/dist/core/shaders/Group/index.js +2 -6
- package/dist/core/shaders/Halftone/index.js +3 -7
- package/dist/core/shaders/HueShift/index.js +2 -8
- package/dist/core/shaders/ImageTexture/index.js +2 -6
- package/dist/core/shaders/Invert/index.js +2 -6
- package/dist/core/shaders/LinearBlur/index.js +3 -7
- package/dist/core/shaders/LinearGradient/index.js +4 -8
- package/dist/core/shaders/Liquify/index.js +4 -8
- package/dist/core/shaders/Pixelate/index.js +2 -6
- package/dist/core/shaders/PolarCoordinates/index.js +4 -8
- package/dist/core/shaders/Posterize/index.js +2 -7
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
- package/dist/core/shaders/RadialGradient/index.js +4 -8
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
- package/dist/core/shaders/Ripples/index.js +5 -9
- package/dist/core/shaders/Saturation/index.js +2 -8
- package/dist/core/shaders/SimplexNoise/index.js +5 -9
- package/dist/core/shaders/SineWave/index.js +3 -7
- package/dist/core/shaders/SolidColor/index.js +3 -7
- package/dist/core/shaders/Spherize/index.js +3 -7
- package/dist/core/shaders/Spiral/index.js +4 -8
- package/dist/core/shaders/Strands/index.js +4 -8
- package/dist/core/shaders/Stretch/index.js +4 -8
- package/dist/core/shaders/Swirl/index.js +5 -9
- package/dist/core/shaders/TiltShift/index.js +3 -7
- package/dist/core/shaders/Tritone/index.js +4 -8
- package/dist/core/shaders/Twirl/index.js +4 -8
- package/dist/core/shaders/Vibrance/index.js +2 -8
- package/dist/core/shaders/WaveDistortion/index.js +4 -8
- package/dist/core/shaders/ZoomBlur/index.js +3 -7
- package/dist/core/telemetry/index.js +189 -157
- package/dist/core/time-CTJvRUZ4.js +10 -0
- package/dist/core/transformations-DxfQXZWi.js +4715 -0
- package/dist/react/components/Beam.d.ts +31 -0
- package/dist/react/components/Beam.d.ts.map +1 -0
- package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +7649 -104600
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +2 -5
- package/dist/registry.js +224 -0
- package/dist/solid/components/Beam.d.ts +28 -0
- package/dist/solid/components/Beam.d.ts.map +1 -0
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +6691 -102524
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +586 -537
- package/dist/svelte/components/Beam.svelte.d.ts +19 -0
- package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +6175 -102455
- package/dist/svelte/utils/generatePresetCode.js +2 -5
- package/dist/vue/components/Beam.vue.d.ts +57 -0
- package/dist/vue/components/Beam.vue.d.ts.map +1 -0
- package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +6929 -103492
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +2 -5
- package/package.json +12 -1
- package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
- package/dist/core/Ascii-BT0-K_vw.js +0 -196
- package/dist/core/Blob-BlQ_1T_8.js +0 -169
- package/dist/core/Blur-421AjWLH.js +0 -64
- package/dist/core/Bulge-CZRVoR6C.js +0 -103
- package/dist/core/CRTScreen-C_U9g_IR.js +0 -91
- package/dist/core/ChannelBlur-5pzcB6Zv.js +0 -89
- package/dist/core/Checkerboard-CrQkqXhD.js +0 -75
- package/dist/core/ChromaFlow-CNrQdL8f.js +0 -134
- package/dist/core/ChromaticAberration-D9H7O17Y.js +0 -82
- package/dist/core/Circle-DnLaDn8V.js +0 -62
- package/dist/core/ColorAdjustment-CKwpE_4M.js +0 -14
- package/dist/core/CursorTrail-NY6n97VG.js +0 -105
- package/dist/core/DiffuseBlur-C_n01ABk.js +0 -69
- package/dist/core/Dither-4s-c4zh4.js +0 -61
- package/dist/core/DotGrid-BYl8XdMi.js +0 -61
- package/dist/core/Duotone-DbewOoB4.js +0 -66
- package/dist/core/FilmGrain-zA_-knOw.js +0 -28
- package/dist/core/FloatingParticles-BhVnqMsE.js +0 -160
- package/dist/core/GlassTiles-CFI57glh.js +0 -52
- package/dist/core/Glow-CQgl3IoS.js +0 -66
- package/dist/core/Godrays-BHMix_Bh.js +0 -105
- package/dist/core/Grayscale-CAEFLteL.js +0 -21
- package/dist/core/Grid-DlM-rVbZ.js +0 -50
- package/dist/core/GridDistortion-ZOZphSAT.js +0 -147
- package/dist/core/Group-BQAs3RiH.js +0 -17
- package/dist/core/Halftone-ci4ga-_J.js +0 -55
- package/dist/core/HueShift-CyxzPcJV.js +0 -32
- package/dist/core/ImageTexture-CdAGsPuH.js +0 -105
- package/dist/core/Invert-iPsiIqNZ.js +0 -20
- package/dist/core/LinearBlur-BEaaoIk-.js +0 -56
- package/dist/core/LinearGradient-DR_7RxLX.js +0 -111
- package/dist/core/Liquify-Bi02_ugh.js +0 -139
- package/dist/core/Pixelate-CSsdT1rr.js +0 -38
- package/dist/core/PolarCoordinates-D626ml58.js +0 -103
- package/dist/core/Posterize-DhZkMaC7.js +0 -46
- package/dist/core/ProgressiveBlur-CGtCfLF8.js +0 -102
- package/dist/core/RadialGradient-C0_WzmbH.js +0 -71
- package/dist/core/RectangularCoordinates-DfXw7fhI.js +0 -92
- package/dist/core/Ripples-DkemN3eh.js +0 -106
- package/dist/core/Saturation-Dup81Pnq.js +0 -31
- package/dist/core/SimplexNoise-BYEiCjDj.js +0 -94
- package/dist/core/SineWave-C6MRPtsy.js +0 -107
- package/dist/core/SolidColor-BZHRczgb.js +0 -22
- package/dist/core/Spherize-DOAnDx2l.js +0 -103
- package/dist/core/Spiral-BMjnWXh1.js +0 -115
- package/dist/core/Strands-BOVsuJLe.js +0 -125
- package/dist/core/Stretch-D6bHc6yp.js +0 -103
- package/dist/core/Swirl-BFoc0ImG.js +0 -148
- package/dist/core/TSLBase-BFMvTOak.js +0 -8053
- package/dist/core/TiltShift-BiNvvhzj.js +0 -114
- package/dist/core/Tritone-gdx2AA0m.js +0 -75
- package/dist/core/Twirl-BsV8YbqC.js +0 -82
- package/dist/core/Vibrance-C182fbSw.js +0 -31
- package/dist/core/WaveDistortion-CmaS2zDB.js +0 -132
- package/dist/core/ZoomBlur-DLf5xQ16.js +0 -56
- package/dist/core/colorMixing--dhzx0ch.js +0 -21
- package/dist/core/edges-CDzKsauJ.js +0 -15
- package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
- package/dist/core/time-DbRMw6Jm.js +0 -10
- package/dist/core/transformations-CsrIJXh-.js +0 -3992
- package/dist/react/generatePresetCode-DaS7jkcT.js +0 -626
- package/dist/svelte/generatePresetCode-DaS7jkcT.js +0 -626
- package/dist/vue/generatePresetCode-Cd1B-Y9j.js +0 -632
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { O as k } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { r as T } from "./transformations-CsrIJXh-.js";
|
|
3
|
-
const C = {
|
|
4
|
-
name: "Grid",
|
|
5
|
-
category: "Base Layers",
|
|
6
|
-
description: "Simple grid lines pattern with adjustable thickness",
|
|
7
|
-
acceptsUVContext: !0,
|
|
8
|
-
props: {
|
|
9
|
-
color: {
|
|
10
|
-
default: "#ffffff",
|
|
11
|
-
transform: T,
|
|
12
|
-
description: "The color of the grid lines",
|
|
13
|
-
ui: {
|
|
14
|
-
type: "color",
|
|
15
|
-
label: "Color"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
cells: {
|
|
19
|
-
default: 10,
|
|
20
|
-
description: "Number of cells along the shortest canvas edge (creates square cells)",
|
|
21
|
-
ui: {
|
|
22
|
-
type: "range",
|
|
23
|
-
min: 1,
|
|
24
|
-
max: 50,
|
|
25
|
-
step: 1,
|
|
26
|
-
label: "Cells"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
thickness: {
|
|
30
|
-
default: 1,
|
|
31
|
-
description: "Thickness of grid lines (normalized, 0.0-1.0)",
|
|
32
|
-
ui: {
|
|
33
|
-
type: "range",
|
|
34
|
-
min: 0,
|
|
35
|
-
max: 5,
|
|
36
|
-
step: 0.1,
|
|
37
|
-
label: "Thickness"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
fragmentNode: ({ uniforms: e, uvContext: l }) => {
|
|
42
|
-
const { vec2: a, vec4: d, fract: m, max: p, screenUV: f, viewportSize: o, fwidth: u, smoothstep: n } = k, 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()), v = t.y.min(t.y.oneMinus()), c = u(r), b = p(n(s.add(c.x), s, y), n(s.add(c.y), s, v));
|
|
43
|
-
return d(e.color.uniform.rgb, e.color.uniform.a.mul(b));
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var V = C;
|
|
47
|
-
export {
|
|
48
|
-
C as n,
|
|
49
|
-
V as t
|
|
50
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
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) => {
|
|
6
|
-
let t = f.get(e);
|
|
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,
|
|
12
|
-
data: l,
|
|
13
|
-
tslNode: $(s),
|
|
14
|
-
gridSize: n
|
|
15
|
-
}, f.set(e, t);
|
|
16
|
-
}
|
|
17
|
-
return t;
|
|
18
|
-
};
|
|
19
|
-
const re = {
|
|
20
|
-
name: "GridDistortion",
|
|
21
|
-
category: "Interactive",
|
|
22
|
-
description: "Interactive grid distortion controlled by mouse position",
|
|
23
|
-
requiresRTT: !0,
|
|
24
|
-
requiresChild: !0,
|
|
25
|
-
props: {
|
|
26
|
-
intensity: {
|
|
27
|
-
default: 1,
|
|
28
|
-
description: "Strength of the distortion effect",
|
|
29
|
-
ui: {
|
|
30
|
-
type: "range",
|
|
31
|
-
min: 0,
|
|
32
|
-
max: 5,
|
|
33
|
-
step: 0.1,
|
|
34
|
-
label: "Intensity"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
swirl: {
|
|
38
|
-
default: 0,
|
|
39
|
-
description: "Amount of swirl motion",
|
|
40
|
-
ui: {
|
|
41
|
-
type: "range",
|
|
42
|
-
min: 0,
|
|
43
|
-
max: 2,
|
|
44
|
-
step: 0.1,
|
|
45
|
-
label: "Swirl"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
decay: {
|
|
49
|
-
default: 3,
|
|
50
|
-
description: "Rate of distortion decay (higher = faster)",
|
|
51
|
-
ui: {
|
|
52
|
-
type: "range",
|
|
53
|
-
min: 0,
|
|
54
|
-
max: 10,
|
|
55
|
-
step: 0.1,
|
|
56
|
-
label: "Decay"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
radius: {
|
|
60
|
-
default: 1,
|
|
61
|
-
description: "Radius of the distortion effect",
|
|
62
|
-
ui: {
|
|
63
|
-
type: "range",
|
|
64
|
-
min: 0,
|
|
65
|
-
max: 3,
|
|
66
|
-
step: 0.01,
|
|
67
|
-
label: "Radius"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
gridSize: {
|
|
71
|
-
default: 20,
|
|
72
|
-
description: "Resolution of the distortion grid (higher = more detailed)",
|
|
73
|
-
ui: {
|
|
74
|
-
type: "range",
|
|
75
|
-
min: 8,
|
|
76
|
-
max: 128,
|
|
77
|
-
step: 1,
|
|
78
|
-
label: "Grid Size"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
edges: {
|
|
82
|
-
default: "stretch",
|
|
83
|
-
description: "How to handle edges when distortion pushes content out of bounds",
|
|
84
|
-
transform: K,
|
|
85
|
-
ui: {
|
|
86
|
-
type: "select",
|
|
87
|
-
options: [
|
|
88
|
-
{
|
|
89
|
-
label: "Stretch",
|
|
90
|
-
value: "stretch"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
label: "Transparent",
|
|
94
|
-
value: "transparent"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: "Mirror",
|
|
98
|
-
value: "mirror"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
label: "Wrap",
|
|
102
|
-
value: "wrap"
|
|
103
|
-
}
|
|
104
|
-
],
|
|
105
|
-
label: "Edges"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
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);
|
|
111
|
-
let F = 0.5, I = 0.5, R = Date.now();
|
|
112
|
-
if (t(({ pointer: o }) => {
|
|
113
|
-
const _ = Date.now(), i = Math.min((_ - R) / 1e3, 0.016);
|
|
114
|
-
R = _;
|
|
115
|
-
const V = i > 0 ? (o.x - F) / i : 0, X = i > 0 ? (o.y - I) / i : 0;
|
|
116
|
-
h.value = h.value * 0.85 + V * 0.15, v.value = v.value * 0.85 + X * 0.15;
|
|
117
|
-
const Y = e.decay.uniform.value, q = e.intensity.uniform.value, y = e.radius.uniform.value * 0.05, M = e.swirl.uniform.value;
|
|
118
|
-
for (let u = 0; u < d; u++) for (let m = 0; m < d; m++) {
|
|
119
|
-
const r = (u * d + m) * 2;
|
|
120
|
-
a[r] *= 1 - Y * i, a[r + 1] *= 1 - Y * i;
|
|
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));
|
|
124
|
-
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(D, S) + Math.PI * 0.5;
|
|
126
|
-
a[r] += Math.cos(A) * M * p * i * 2, a[r + 1] += Math.sin(A) * M * p * i * 2;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
a[r] = Math.max(-1, Math.min(1, a[r])), a[r + 1] = Math.max(-1, Math.min(1, a[r + 1]));
|
|
130
|
-
}
|
|
131
|
-
z.needsUpdate = !0, F = o.x, I = o.y;
|
|
132
|
-
}), l(() => {
|
|
133
|
-
z.dispose(), f.delete(e);
|
|
134
|
-
}), !n) return H(0, 0, 0, 0);
|
|
135
|
-
const c = L(n);
|
|
136
|
-
l(() => {
|
|
137
|
-
c?.renderTarget?.dispose && c.renderTarget.dispose();
|
|
138
|
-
});
|
|
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);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
var de = re;
|
|
144
|
-
export {
|
|
145
|
-
re as n,
|
|
146
|
-
de as t
|
|
147
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { O as r } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
const t = {
|
|
3
|
-
name: "Group",
|
|
4
|
-
category: "Utilities",
|
|
5
|
-
description: "Container for organizing and composing child effects",
|
|
6
|
-
requiresChild: !0,
|
|
7
|
-
props: {},
|
|
8
|
-
fragmentNode: ({ childNode: e }) => {
|
|
9
|
-
const { vec4: o } = r;
|
|
10
|
-
return e || o(0);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
var i = t;
|
|
14
|
-
export {
|
|
15
|
-
t as n,
|
|
16
|
-
i as t
|
|
17
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { O as V } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { n as A } from "./transformations-CsrIJXh-.js";
|
|
3
|
-
const D = {
|
|
4
|
-
name: "Halftone",
|
|
5
|
-
category: "Stylize",
|
|
6
|
-
description: "Halftone dot pattern effect for printing aesthetics",
|
|
7
|
-
requiresChild: !0,
|
|
8
|
-
props: {
|
|
9
|
-
frequency: {
|
|
10
|
-
default: 100,
|
|
11
|
-
description: "Frequency of the halftone dots",
|
|
12
|
-
ui: {
|
|
13
|
-
type: "range",
|
|
14
|
-
min: 10,
|
|
15
|
-
max: 300,
|
|
16
|
-
step: 1,
|
|
17
|
-
label: "Frequency"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
angle: {
|
|
21
|
-
default: 45,
|
|
22
|
-
transform: A,
|
|
23
|
-
description: "Rotation angle of the pattern (in degrees)",
|
|
24
|
-
ui: {
|
|
25
|
-
type: "range",
|
|
26
|
-
min: 0,
|
|
27
|
-
max: 360,
|
|
28
|
-
step: 1,
|
|
29
|
-
label: "Angle"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
smoothness: {
|
|
33
|
-
default: 0.1,
|
|
34
|
-
description: "Edge smoothness of the dots",
|
|
35
|
-
ui: {
|
|
36
|
-
type: "range",
|
|
37
|
-
min: 0,
|
|
38
|
-
max: 0.3,
|
|
39
|
-
step: 0.01,
|
|
40
|
-
label: "Smoothness"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
fragmentNode: ({ uniforms: t, childNode: s }) => {
|
|
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;
|
|
46
|
-
if (!s) return r(0);
|
|
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);
|
|
48
|
-
return r(o.rgb.mul(p), o.a.mul(p));
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var E = D;
|
|
52
|
-
export {
|
|
53
|
-
D as n,
|
|
54
|
-
E as t
|
|
55
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { O as n } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { n as s } from "./ColorAdjustment-CKwpE_4M.js";
|
|
3
|
-
const i = {
|
|
4
|
-
name: "HueShift",
|
|
5
|
-
category: "Adjustments",
|
|
6
|
-
description: "Rotate hue around the color wheel",
|
|
7
|
-
requiresChild: !0,
|
|
8
|
-
props: { shift: {
|
|
9
|
-
default: 0,
|
|
10
|
-
description: "The amount to shift the hue by",
|
|
11
|
-
ui: {
|
|
12
|
-
type: "range",
|
|
13
|
-
min: -180,
|
|
14
|
-
max: 180,
|
|
15
|
-
step: 1,
|
|
16
|
-
label: "Shift"
|
|
17
|
-
},
|
|
18
|
-
transform: (t) => t * Math.PI / 180
|
|
19
|
-
} },
|
|
20
|
-
fragmentNode: ({ uniforms: t, childNode: o }) => {
|
|
21
|
-
const { vec4: e } = n;
|
|
22
|
-
if (!o)
|
|
23
|
-
return console.error("You must pass a child component into the Hue Shift shader."), e(0);
|
|
24
|
-
const r = o || e(0, 0, 0, 0);
|
|
25
|
-
return e(s(r.rgb, t.shift.uniform).rgb, r.a);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var h = i;
|
|
29
|
-
export {
|
|
30
|
-
i as n,
|
|
31
|
-
h as t
|
|
32
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
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 = {
|
|
3
|
-
name: "ImageTexture",
|
|
4
|
-
category: "Base Layers",
|
|
5
|
-
description: "Display an image with customizable object-fit modes",
|
|
6
|
-
acceptsUVContext: !0,
|
|
7
|
-
props: {
|
|
8
|
-
url: {
|
|
9
|
-
default: "https://shaders.com/sample.jpg",
|
|
10
|
-
description: "Upload an image or provide a URL",
|
|
11
|
-
ui: {
|
|
12
|
-
type: "image-upload",
|
|
13
|
-
label: "Image"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
objectFit: {
|
|
17
|
-
default: "cover",
|
|
18
|
-
description: "How the image should be sized within the viewport",
|
|
19
|
-
transform: (m) => ({
|
|
20
|
-
cover: 0,
|
|
21
|
-
contain: 1,
|
|
22
|
-
fill: 2,
|
|
23
|
-
"scale-down": 3,
|
|
24
|
-
none: 4
|
|
25
|
-
})[m] ?? 0,
|
|
26
|
-
ui: {
|
|
27
|
-
type: "select",
|
|
28
|
-
options: [
|
|
29
|
-
{
|
|
30
|
-
label: "Cover",
|
|
31
|
-
value: "cover"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: "Contain",
|
|
35
|
-
value: "contain"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: "Fill",
|
|
39
|
-
value: "fill"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
label: "Scale Down",
|
|
43
|
-
value: "scale-down"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
label: "None",
|
|
47
|
-
value: "none"
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
label: "Object Fit"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
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();
|
|
56
|
-
let T = "", r = !1;
|
|
57
|
-
const n = new oe();
|
|
58
|
-
n.colorSpace = S;
|
|
59
|
-
const $ = H(n), s = x(1), f = x(0), U = x(0), V = (e) => {
|
|
60
|
-
if (!(!e || e.trim() === "" || r)) {
|
|
61
|
-
r = !0;
|
|
62
|
-
try {
|
|
63
|
-
let h = e;
|
|
64
|
-
try {
|
|
65
|
-
h = new URL(e, window.location.href).href;
|
|
66
|
-
} catch {
|
|
67
|
-
}
|
|
68
|
-
_.load(e, (d) => {
|
|
69
|
-
d.colorSpace = S;
|
|
70
|
-
const p = d.image, w = p.width || 1, b = p.height || 1, te = w / b;
|
|
71
|
-
d.dispose(), T = e, requestAnimationFrame(() => {
|
|
72
|
-
const g = n.image;
|
|
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;
|
|
74
|
-
}), r = !1;
|
|
75
|
-
}, void 0, (d) => {
|
|
76
|
-
const p = !e.startsWith("http://") && !e.startsWith("https://") && !e.startsWith("data:");
|
|
77
|
-
console.error(`[ImageTexture] Failed to load image
|
|
78
|
-
Requested URL: ${e}
|
|
79
|
-
Resolved URL: ${h}
|
|
80
|
-
Path type: ${p ? "relative" : "absolute"}
|
|
81
|
-
Error:`, d), r = !1;
|
|
82
|
-
});
|
|
83
|
-
} catch (h) {
|
|
84
|
-
console.error("[ImageTexture] Error initiating image load:", h), r = !1;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
const e = m?.url?.uniform?.value ?? "";
|
|
90
|
-
e && e.trim() !== "" && V(e);
|
|
91
|
-
}, 0), W(() => {
|
|
92
|
-
const e = m?.url?.uniform?.value ?? "";
|
|
93
|
-
e !== T && !r && V(e);
|
|
94
|
-
}), D(() => {
|
|
95
|
-
n.dispose();
|
|
96
|
-
});
|
|
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));
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
var le = ie;
|
|
102
|
-
export {
|
|
103
|
-
ie as n,
|
|
104
|
-
le as t
|
|
105
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { O as a } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
const c = {
|
|
3
|
-
name: "Invert",
|
|
4
|
-
category: "Adjustments",
|
|
5
|
-
description: "Invert RGB colors while preserving alpha",
|
|
6
|
-
requiresChild: !0,
|
|
7
|
-
props: {},
|
|
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);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var p = c;
|
|
17
|
-
export {
|
|
18
|
-
c as n,
|
|
19
|
-
p as t
|
|
20
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { O as q } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
-
import { n as w } from "./transformations-CsrIJXh-.js";
|
|
3
|
-
const A = {
|
|
4
|
-
name: "LinearBlur",
|
|
5
|
-
category: "Blurs",
|
|
6
|
-
description: "Directional motion blur in a specific angle",
|
|
7
|
-
requiresRTT: !0,
|
|
8
|
-
requiresChild: !0,
|
|
9
|
-
props: {
|
|
10
|
-
intensity: {
|
|
11
|
-
default: 30,
|
|
12
|
-
description: "Intensity of the linear blur effect",
|
|
13
|
-
ui: {
|
|
14
|
-
type: "range",
|
|
15
|
-
min: 0,
|
|
16
|
-
max: 100,
|
|
17
|
-
step: 1,
|
|
18
|
-
label: "Intensity"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
angle: {
|
|
22
|
-
default: 0,
|
|
23
|
-
transform: w,
|
|
24
|
-
description: "Direction of the linear blur (in degrees)",
|
|
25
|
-
ui: {
|
|
26
|
-
type: "range",
|
|
27
|
-
min: 0,
|
|
28
|
-
max: 360,
|
|
29
|
-
step: 1,
|
|
30
|
-
label: "Angle"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
fragmentNode: ({ uniforms: s, childNode: a, onCleanup: d }) => {
|
|
35
|
-
const { vec2: l, vec4: u, float: e, screenUV: p, viewportSize: f, sin: g, cos: v, radians: b, Fn: x, convertToTexture: y } = q;
|
|
36
|
-
if (!a) return u(0, 0, 0, 0);
|
|
37
|
-
const t = y(a);
|
|
38
|
-
d(() => {
|
|
39
|
-
t?.renderTarget?.dispose && t.renderTarget.dispose();
|
|
40
|
-
});
|
|
41
|
-
const c = b(s.angle.uniform), T = l(v(c), g(c));
|
|
42
|
-
return x(() => {
|
|
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();
|
|
44
|
-
for (let i = 0; i < 32; i++) {
|
|
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));
|
|
47
|
-
}
|
|
48
|
-
return n.div(r);
|
|
49
|
-
})();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var R = A;
|
|
53
|
-
export {
|
|
54
|
-
A as n,
|
|
55
|
-
R as t
|
|
56
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
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 = {
|
|
5
|
-
name: "LinearGradient",
|
|
6
|
-
category: "Base Layers",
|
|
7
|
-
description: "Create smooth linear color gradients",
|
|
8
|
-
acceptsUVContext: !0,
|
|
9
|
-
props: {
|
|
10
|
-
colorA: {
|
|
11
|
-
default: "#1aff00",
|
|
12
|
-
transform: b,
|
|
13
|
-
description: "The starting color of the gradient",
|
|
14
|
-
ui: {
|
|
15
|
-
type: "color",
|
|
16
|
-
label: "Color A"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
colorB: {
|
|
20
|
-
default: "#0000ff",
|
|
21
|
-
transform: b,
|
|
22
|
-
description: "The ending color of the gradient",
|
|
23
|
-
ui: {
|
|
24
|
-
type: "color",
|
|
25
|
-
label: "Color B"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
start: {
|
|
29
|
-
default: {
|
|
30
|
-
x: 0,
|
|
31
|
-
y: 0.5
|
|
32
|
-
},
|
|
33
|
-
transform: h,
|
|
34
|
-
description: "The starting point of the gradient",
|
|
35
|
-
ui: {
|
|
36
|
-
type: "position",
|
|
37
|
-
label: "Start"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
end: {
|
|
41
|
-
default: {
|
|
42
|
-
x: 1,
|
|
43
|
-
y: 0.5
|
|
44
|
-
},
|
|
45
|
-
transform: h,
|
|
46
|
-
description: "The ending point of the gradient",
|
|
47
|
-
ui: {
|
|
48
|
-
type: "position",
|
|
49
|
-
label: "End"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
angle: {
|
|
53
|
-
default: 0,
|
|
54
|
-
transform: j,
|
|
55
|
-
description: "Additional rotation angle of the gradient (in degrees)",
|
|
56
|
-
ui: {
|
|
57
|
-
type: "range",
|
|
58
|
-
min: 0,
|
|
59
|
-
max: 360,
|
|
60
|
-
step: 1,
|
|
61
|
-
label: "Angle"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
edges: {
|
|
65
|
-
default: "stretch",
|
|
66
|
-
transform: X,
|
|
67
|
-
description: "How to handle areas beyond the gradient endpoints",
|
|
68
|
-
ui: {
|
|
69
|
-
type: "select",
|
|
70
|
-
options: [
|
|
71
|
-
{
|
|
72
|
-
label: "Stretch",
|
|
73
|
-
value: "stretch"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "Transparent",
|
|
77
|
-
value: "transparent"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
label: "Mirror",
|
|
81
|
-
value: "mirror"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
label: "Wrap",
|
|
85
|
-
value: "wrap"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
label: "Edges"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
colorSpace: {
|
|
92
|
-
default: "linear",
|
|
93
|
-
transform: Y,
|
|
94
|
-
description: "Color space for color interpolation",
|
|
95
|
-
ui: {
|
|
96
|
-
type: "select",
|
|
97
|
-
options: k,
|
|
98
|
-
label: "Color Space"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
fragmentNode: ({ uniforms: t, uvContext: T }) => {
|
|
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);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
var Z = I;
|
|
108
|
-
export {
|
|
109
|
-
I as n,
|
|
110
|
-
Z as t
|
|
111
|
-
};
|