shaders 2.2.0 → 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-BJi-Edw-.js → AngularBlur-BTUdXC0g.js} +7 -6
- package/dist/core/{Ascii-B1KHvM1u.js → Ascii-Bu8ii7oo.js} +32 -31
- package/dist/core/Blob-C0G0efjG.js +170 -0
- package/dist/core/{Blur-bz9Ubr0x.js → Blur-BzUO9yxF.js} +14 -13
- package/dist/core/Bulge-BCXYAzig.js +104 -0
- package/dist/core/{CRTScreen-BnfROw0f.js → CRTScreen-cJ3XHrI9.js} +13 -12
- package/dist/core/{ChannelBlur-DhWT-55L.js → ChannelBlur-BEK1qzGn.js} +23 -22
- package/dist/core/{Checkerboard-CgWGd9t7.js → Checkerboard-BPkiSF5I.js} +16 -14
- package/dist/core/{ChromaFlow-DOVrymVB.js → ChromaFlow-AHO3C4o3.js} +18 -17
- package/dist/core/{ChromaticAberration-CyTSXY7j.js → ChromaticAberration-nVg3r1FK.js} +12 -11
- package/dist/core/{Circle-0WHV1HrM.js → Circle-C8ltF4BZ.js} +15 -13
- package/dist/core/{CursorTrail-3zQ5rtjh.js → CursorTrail-BeJGeovB.js} +17 -16
- package/dist/core/DiffuseBlur-BdGvOoBw.js +40 -0
- package/dist/core/{Dither-Cnbknfji.js → Dither-CpN3vGSh.js} +13 -12
- package/dist/core/DotGrid-BFUzeSQw.js +62 -0
- package/dist/core/{Duotone-BI4tJI3k.js → Duotone-_nR_o3-g.js} +8 -7
- package/dist/core/FilmGrain-BAKXXtLg.js +29 -0
- package/dist/core/FloatingParticles-Fv8JIzKk.js +161 -0
- package/dist/core/GlassTiles-5MyBj1ff.js +53 -0
- package/dist/core/{Glow-BD0t9E1L.js → Glow-DvJj7BB7.js} +12 -11
- package/dist/core/{Godrays-CPIAbymT.js → Godrays-cUzAKVXn.js} +24 -22
- package/dist/core/{Grayscale-BtOqK43k.js → Grayscale-oWIF3PV5.js} +3 -2
- package/dist/core/Grid-Bov7AA9m.js +51 -0
- package/dist/core/GridDistortion-CWYom5Dw.js +148 -0
- package/dist/core/Group-CPk-7fiA.js +18 -0
- package/dist/core/{Halftone-B_MuXCD8.js → Halftone-F7fsdu7W.js} +11 -10
- package/dist/core/{HueShift-CKG9M-d2.js → HueShift-CiS4hdtk.js} +3 -2
- package/dist/core/{ImageTexture-B6zFP2fB.js → ImageTexture-B3Q29OHX.js} +24 -22
- package/dist/core/Invert-Cyc4JHWc.js +21 -0
- package/dist/core/{LinearBlur-JFLMQBY4.js → LinearBlur-BTC54qzk.js} +12 -11
- package/dist/core/{LinearGradient-Ztg5Lzwj.js → LinearGradient-LEMeW0KM.js} +18 -16
- package/dist/core/Liquify-D2nzMDzq.js +140 -0
- package/dist/core/Pixelate-irPzmtQm.js +39 -0
- package/dist/core/{PolarCoordinates-qzU8gNXR.js → PolarCoordinates-Ck5ZWrQO.js} +21 -16
- package/dist/core/{Posterize-BkBU8tnN.js → Posterize-DICq_t96.js} +9 -8
- package/dist/core/{ProgressiveBlur-HAQf188T.js → ProgressiveBlur-BuORe3VH.js} +17 -16
- package/dist/core/{RadialGradient-DISqJuTZ.js → RadialGradient-D0cN67jm.js} +17 -15
- package/dist/core/RectangularCoordinates-1LIDaeHR.js +93 -0
- package/dist/core/{Ripples-CX8Qgnog.js → Ripples-DH71sFJc.js} +14 -12
- package/dist/core/{Saturation-DMxPYmIU.js → Saturation-DbSXtSeK.js} +10 -9
- package/dist/core/{SimplexNoise-B5ygfckG.js → SimplexNoise-DPGC2OPJ.js} +14 -12
- package/dist/core/{SineWave-KPFlP3Wk.js → SineWave-CkWtnzHF.js} +16 -14
- package/dist/core/{SolidColor-B8oxlGge.js → SolidColor-DaB-FHNX.js} +8 -6
- package/dist/core/{Spiral-CX22hUJ3.js → Spiral-CcyI8azF.js} +19 -17
- package/dist/core/Strands-Co4fkc05.js +126 -0
- package/dist/core/{Swirl-CIXreSgZ.js → Swirl-BoveqtNV.js} +18 -16
- package/dist/core/{TiltShift-J0UUcoh-.js → TiltShift-D53azmRe.js} +14 -13
- package/dist/core/{Tritone-E9eHvjJV.js → Tritone-Cg1rX-hL.js} +13 -12
- package/dist/core/{Twirl-ClhPpapm.js → Twirl-raO5pe5X.js} +20 -15
- package/dist/core/{Vibrance-CqnE9Zco.js → Vibrance-DtekSkcz.js} +8 -7
- package/dist/core/WaveDistortion-C65qO_cZ.js +133 -0
- package/dist/core/{ZoomBlur-CaGbSDG3.js → ZoomBlur-B97ZjhXe.js} +11 -10
- package/dist/core/{colorMixing-C_ESXyqX.js → colorMixing-DPZ-Td4U.js} +3 -3
- package/dist/core/edges-B-tVdqcI.js +16 -0
- package/dist/core/index.js +1333 -948
- package/dist/core/performanceTracker.d.ts +2 -0
- package/dist/core/performanceTracker.d.ts.map +1 -1
- package/dist/core/renderer.d.ts +12 -0
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +3 -3
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +2 -2
- package/dist/core/shaders/Blob/index.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +5 -5
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +4 -4
- package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +4 -4
- package/dist/core/shaders/ChromaFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaFlow/index.js +3 -3
- package/dist/core/shaders/ChromaticAberration/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaticAberration/index.js +3 -3
- package/dist/core/shaders/Circle/index.d.ts.map +1 -1
- package/dist/core/shaders/Circle/index.js +3 -3
- package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
- package/dist/core/shaders/CursorTrail/index.js +4 -4
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +2 -2
- package/dist/core/shaders/Dither/index.d.ts.map +1 -1
- package/dist/core/shaders/Dither/index.js +3 -3
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +3 -3
- package/dist/core/shaders/Duotone/index.d.ts.map +1 -1
- package/dist/core/shaders/Duotone/index.js +4 -4
- package/dist/core/shaders/FilmGrain/index.d.ts.map +1 -1
- package/dist/core/shaders/FilmGrain/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +3 -3
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +2 -2
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +3 -3
- package/dist/core/shaders/Grayscale/index.d.ts.map +1 -1
- package/dist/core/shaders/Grayscale/index.js +2 -2
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +3 -3
- package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/GridDistortion/index.js +4 -4
- package/dist/core/shaders/Group/index.d.ts.map +1 -1
- package/dist/core/shaders/Group/index.js +2 -2
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +3 -3
- package/dist/core/shaders/HueShift/index.d.ts.map +1 -1
- package/dist/core/shaders/HueShift/index.js +2 -2
- 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 +2 -2
- package/dist/core/shaders/Invert/index.d.ts.map +1 -1
- package/dist/core/shaders/Invert/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearBlur/index.js +3 -3
- package/dist/core/shaders/LinearGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearGradient/index.js +4 -4
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +4 -4
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +4 -4
- package/dist/core/shaders/Posterize/index.d.ts.map +1 -1
- package/dist/core/shaders/Posterize/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -3
- package/dist/core/shaders/RadialGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/RadialGradient/index.js +4 -4
- package/dist/core/shaders/RectangularCoordinates/index.d.ts +38 -0
- package/dist/core/shaders/RectangularCoordinates/index.d.ts.map +1 -0
- package/dist/core/shaders/RectangularCoordinates/index.js +8 -0
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +4 -4
- package/dist/core/shaders/Saturation/index.d.ts.map +1 -1
- package/dist/core/shaders/Saturation/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +4 -4
- package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
- package/dist/core/shaders/SineWave/index.js +3 -3
- package/dist/core/shaders/SolidColor/index.d.ts.map +1 -1
- package/dist/core/shaders/SolidColor/index.js +3 -3
- package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
- package/dist/core/shaders/Spiral/index.js +4 -4
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +4 -4
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +5 -5
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +3 -3
- package/dist/core/shaders/Tritone/index.d.ts.map +1 -1
- package/dist/core/shaders/Tritone/index.js +4 -4
- package/dist/core/shaders/Twirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Twirl/index.js +4 -4
- package/dist/core/shaders/Vibrance/index.d.ts.map +1 -1
- package/dist/core/shaders/Vibrance/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +6 -7
- package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +3 -3
- package/dist/core/telemetry/collector.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +19 -19
- package/dist/core/{three.tsl-CgyjOhns.js → three.tsl-BqgDcRt9.js} +21 -20
- package/dist/core/{time-myrFQH-u.js → time-5uQ65blS.js} +1 -1
- package/dist/core/{transformations-Bs66Qh16.js → transformations-DBjTkQ5b.js} +1 -1
- package/dist/core/types.d.ts +85 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/utilities/edges.d.ts +13 -2
- package/dist/core/utilities/edges.d.ts.map +1 -1
- package/dist/core/utilities/uvTransform.d.ts +20 -0
- package/dist/core/utilities/uvTransform.d.ts.map +1 -1
- package/dist/react/components/RectangularCoordinates.d.ts +31 -0
- package/dist/react/components/RectangularCoordinates.d.ts.map +1 -0
- package/dist/react/index.cjs +233 -233
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +16218 -15498
- package/dist/react/utils/generatePresetCode.cjs +2 -2
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +13 -1
- package/dist/registry.d.ts +3 -0
- package/dist/registry.js +376 -87
- package/dist/svelte/components/RectangularCoordinates.svelte.d.ts +19 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +15766 -15088
- package/dist/svelte/utils/generatePresetCode.js +13 -1
- package/dist/vue/components/RectangularCoordinates.vue.d.ts +57 -0
- package/dist/vue/components/RectangularCoordinates.vue.d.ts.map +1 -0
- package/dist/vue/{generatePresetCode-B6Ks_W3s.js → generatePresetCode-D4V6rBae.js} +13 -1
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +15240 -14552
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +6 -1
- package/dist/core/Blob-CBASKMfO.js +0 -168
- package/dist/core/Bulge-Ceythf-i.js +0 -99
- package/dist/core/DiffuseBlur-DLIKRsnf.js +0 -39
- package/dist/core/DotGrid-BkItF2C8.js +0 -60
- package/dist/core/FilmGrain-BAZORehh.js +0 -27
- package/dist/core/FloatingParticles-7wvOBUbD.js +0 -158
- package/dist/core/GlassTiles-C0y_PWTa.js +0 -48
- package/dist/core/Grid-Ro0Yi5WY.js +0 -49
- package/dist/core/GridDistortion-CuxRQdzs.js +0 -137
- package/dist/core/Group-DTXP-whY.js +0 -17
- package/dist/core/Invert-Cd7GK1vs.js +0 -20
- package/dist/core/Liquify-rmJGJAdt.js +0 -126
- package/dist/core/Pixelate-BIANS3t9.js +0 -34
- package/dist/core/Strands-Bv7RvyRC.js +0 -124
- package/dist/core/WaveDistortion-gecgVpvO.js +0 -129
- package/dist/core/edges-Cj8yVYgz.js +0 -10
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as I } from "./transformations-
|
|
1
|
+
import { k as V, m as q } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { o as I } from "./transformations-DBjTkQ5b.js";
|
|
3
3
|
q();
|
|
4
4
|
const P = {
|
|
5
5
|
name: "AngularBlur",
|
|
6
6
|
category: "Blurs",
|
|
7
|
+
description: "Radial motion blur rotating around a center point",
|
|
7
8
|
requiresRTT: !0,
|
|
8
9
|
requiresChild: !0,
|
|
9
10
|
props: {
|
|
@@ -42,15 +43,15 @@ const P = {
|
|
|
42
43
|
return T(() => {
|
|
43
44
|
const e = x.sub(c), s = u(0).toVar(), i = t(0).toVar(), _ = A.div(t(31));
|
|
44
45
|
for (let n = 0; n < 32; n++) {
|
|
45
|
-
const
|
|
46
|
-
s.assign(s.add(C)), i.assign(i.add(
|
|
46
|
+
const d = t(n).div(t(31)).sub(0.5).mul(2), m = t(1).div(t(2.506628)).mul(t(-0.5).mul(d).mul(d).div(t(0.64)).exp()), p = _.mul(t(n)), f = h(p), g = v(p), B = l(e.x.mul(f).sub(e.y.mul(g)), e.x.mul(g).add(e.y.mul(f))).add(c), C = o.sample(B).mul(m);
|
|
47
|
+
s.assign(s.add(C)), i.assign(i.add(m));
|
|
47
48
|
}
|
|
48
49
|
return s.div(i);
|
|
49
50
|
})();
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
|
-
var
|
|
53
|
+
var w = P;
|
|
53
54
|
export {
|
|
54
55
|
P as n,
|
|
55
|
-
|
|
56
|
+
w as t
|
|
56
57
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DataTexture as Ge, NearestFilter as ee, RGBAFormat as Je, UnsignedByteType as
|
|
3
|
-
|
|
1
|
+
import { A as x, C as $e, b as Re, d as Y, k as _e, m as ke, p as Ee, r as De, t as qe } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { DataTexture as Ge, NearestFilter as ee, RGBAFormat as Je, UnsignedByteType as Ve } from "three";
|
|
3
|
+
ke();
|
|
4
4
|
const d = {
|
|
5
5
|
name: "Ascii",
|
|
6
|
-
category: "
|
|
6
|
+
category: "Stylize",
|
|
7
|
+
description: "Convert imagery to ASCII character art",
|
|
7
8
|
requiresRTT: !0,
|
|
8
9
|
requiresChild: !0,
|
|
9
10
|
props: {
|
|
@@ -77,10 +78,10 @@ const d = {
|
|
|
77
78
|
transform: (a) => 0.1 + a * 1.4
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
|
-
fragmentNode: ({ uniforms: a, childNode:
|
|
81
|
-
const { vec2: v, vec3: _, vec4:
|
|
82
|
-
if (
|
|
83
|
-
const w = se(
|
|
81
|
+
fragmentNode: ({ uniforms: a, childNode: $, onCleanup: R, onBeforeRender: te }) => {
|
|
82
|
+
const { vec2: v, vec3: _, vec4: k, floor: M, fract: ae, dot: E, ceil: oe, sqrt: ne, screenUV: le, texture: re, viewportSize: ce, convertToTexture: se } = _e;
|
|
83
|
+
if (!$) return k(0, 0, 0, 0);
|
|
84
|
+
const w = se($);
|
|
84
85
|
R(() => {
|
|
85
86
|
w?.renderTarget?.dispose && w.renderTarget.dispose();
|
|
86
87
|
});
|
|
@@ -121,13 +122,13 @@ const d = {
|
|
|
121
122
|
}
|
|
122
123
|
const q = async (e, n, t, r) => {
|
|
123
124
|
if (!e || e.length === 0) throw new Error("Characters string cannot be empty");
|
|
124
|
-
const u = e.length, i = Math.max(2, Math.ceil(Math.sqrt(u))),
|
|
125
|
+
const u = e.length, i = Math.max(2, Math.ceil(Math.sqrt(u))), Fe = 128, Te = Math.max(1, 2 / r), h = Math.min(Fe * Te, l / i), W = h * 0.75, p = document.createElement("canvas");
|
|
125
126
|
p.width = l, p.height = l;
|
|
126
127
|
const c = p.getContext("2d");
|
|
127
128
|
c.clearRect(0, 0, p.width, p.height), c.fillStyle = "#ffffff", c.font = `${W}px "${t}", ${t}, monospace`, !c.font.includes(t) && !c.font.includes("IBM") && !c.font.includes("Plex") && (c.font = `${W}px ${t}, monospace`), c.textAlign = "center", c.textBaseline = "middle";
|
|
128
129
|
for (let C = 0; C < u; C++) {
|
|
129
|
-
const
|
|
130
|
-
c.fillText(
|
|
130
|
+
const Ae = e[C], Be = Math.floor(C / i), Pe = C % i * h + h / 2, Ie = Be * h + h / 2;
|
|
131
|
+
c.fillText(Ae, Pe, Ie);
|
|
131
132
|
}
|
|
132
133
|
const Ue = c.getImageData(0, 0, p.width, p.height);
|
|
133
134
|
return {
|
|
@@ -141,52 +142,52 @@ const d = {
|
|
|
141
142
|
fontFamily: t,
|
|
142
143
|
uvScale: i * h / l
|
|
143
144
|
};
|
|
144
|
-
}, ue = d.props.characters.default, de = d.props.cellSize.default, pe = d.props.fontFamily.default, he = d.props.spacing.transform ? d.props.spacing.transform(d.props.spacing.default) : d.props.spacing.default,
|
|
145
|
+
}, ue = d.props.characters.default, de = d.props.cellSize.default, pe = d.props.fontFamily.default, he = d.props.spacing.transform ? d.props.spacing.transform(d.props.spacing.default) : d.props.spacing.default, y = a?.characters?.uniform?.value ?? ue, G = a?.cellSize?.uniform?.value ?? de, F = a?.fontFamily?.uniform?.value ?? pe, J = a?.spacing?.uniform?.value ?? he;
|
|
145
146
|
let o = {
|
|
146
147
|
data: new Uint8Array(l * l * 4),
|
|
147
148
|
width: l,
|
|
148
149
|
height: l,
|
|
149
150
|
atlasSize: 3,
|
|
150
151
|
cellSize: G,
|
|
151
|
-
charCount:
|
|
152
|
-
characters:
|
|
153
|
-
fontFamily:
|
|
152
|
+
charCount: y.length,
|
|
153
|
+
characters: y,
|
|
154
|
+
fontFamily: F,
|
|
154
155
|
uvScale: 1
|
|
155
156
|
};
|
|
156
|
-
const s = new Ge(o.data, l, l, Je,
|
|
157
|
+
const s = new Ge(o.data, l, l, Je, Ve);
|
|
157
158
|
s.minFilter = ee, s.magFilter = ee, s.generateMipmaps = !1, s.needsUpdate = !0;
|
|
158
|
-
const
|
|
159
|
-
let
|
|
160
|
-
const
|
|
161
|
-
const e = a?.characters?.uniform?.value ??
|
|
162
|
-
o = await q(e, n, t, r), s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize,
|
|
159
|
+
const me = re(s), T = x(o.charCount), U = x(o.cellSize), A = x(o.uvScale);
|
|
160
|
+
let m = y, f = G, S = F, g = J;
|
|
161
|
+
const V = async () => {
|
|
162
|
+
const e = a?.characters?.uniform?.value ?? m, n = a?.cellSize?.uniform?.value ?? f, t = a?.fontFamily?.uniform?.value ?? S, r = a?.spacing?.uniform?.value ?? g;
|
|
163
|
+
o = await q(e, n, t, r), s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, A.value = o.uvScale, m = e, f = n, S = t, g = r;
|
|
163
164
|
};
|
|
164
165
|
setTimeout(() => {
|
|
165
|
-
|
|
166
|
+
V().catch((e) => {
|
|
166
167
|
console.error("Failed to initialize atlas:", e);
|
|
167
|
-
}), ie(a?.fontFamily?.uniform?.value ??
|
|
168
|
-
|
|
168
|
+
}), ie(a?.fontFamily?.uniform?.value ?? F).then(() => {
|
|
169
|
+
V().catch((e) => {
|
|
169
170
|
console.error("Failed to update atlas with custom font:", e);
|
|
170
171
|
});
|
|
171
172
|
}).catch((e) => {
|
|
172
173
|
console.error("Failed to load font:", e);
|
|
173
174
|
});
|
|
174
175
|
}, 0);
|
|
175
|
-
let
|
|
176
|
+
let O = 0, z = !1;
|
|
176
177
|
te(() => {
|
|
177
178
|
const e = Date.now();
|
|
178
|
-
if (e -
|
|
179
|
-
const n = a.characters?.uniform?.value ??
|
|
180
|
-
!n || n.length === 0 || (n !==
|
|
181
|
-
o = i, s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize,
|
|
179
|
+
if (e - O < 16 || z) return;
|
|
180
|
+
const n = a.characters?.uniform?.value ?? m, t = a.cellSize?.uniform?.value ?? f, r = a.fontFamily?.uniform?.value ?? S, u = a.spacing?.uniform?.value ?? g;
|
|
181
|
+
!n || n.length === 0 || (n !== m || t !== f || r !== S || u !== g) && (O = e, z = !0, q(n, t, r, u).then((i) => {
|
|
182
|
+
o = i, s.image.data = o.data, s.needsUpdate = !0, T.value = o.charCount, U.value = o.cellSize, A.value = o.uvScale, m = n, f = t, S = r, g = u, z = !1;
|
|
182
183
|
}).catch((i) => {
|
|
183
184
|
console.error("Failed to update atlas:", i), z = !1;
|
|
184
185
|
}));
|
|
185
186
|
}), R(() => {
|
|
186
187
|
s.dispose();
|
|
187
188
|
});
|
|
188
|
-
const
|
|
189
|
-
return
|
|
189
|
+
const fe = U.mul(1.5), N = ce.div(fe), L = le.mul(N), Se = M(L), ge = ae(L), X = a.spacing?.uniform ?? x(J), Z = v(0.5), j = ge.sub(Z), Ce = j.div(X).add(Z), ve = De(Ee(qe(j), v(X.mul(0.5)))), ze = Se.add(v(0.5)).div(N), B = w.sample(ze), xe = E(B.rgb, _(0.299, 0.587, 0.114)), P = T, H = M(xe.mul(0.8).add(0.1).mul(P).min(P.sub(1e-4))), I = oe(ne(P)), Me = H.mod(I), we = M(H.div(I)), K = Y(1).div(I).mul(A), be = v(Me, we).mul(K).add(Ce.mul(K)), Q = me.sample(be), ye = E(Q.rgb, _(0.299, 0.587, 0.114)).lessThan(0.1);
|
|
190
|
+
return k(Q.rgb.mul(B.rgb), $e(Re(ye, ve), Y(0), B.a));
|
|
190
191
|
}
|
|
191
192
|
};
|
|
192
193
|
var Le = d;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { k as fo, m as bo } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { t as yo } from "./time-5uQ65blS.js";
|
|
3
|
+
import { i as xo, o as Co, r as g, t as vo } from "./transformations-DBjTkQ5b.js";
|
|
4
|
+
import { t as So } from "./colorMixing-DPZ-Td4U.js";
|
|
5
|
+
bo();
|
|
6
|
+
const Ao = {
|
|
7
|
+
name: "Blob",
|
|
8
|
+
category: "Base Layers",
|
|
9
|
+
description: "Organic animated blob with 3D lighting and gradients",
|
|
10
|
+
acceptsUVContext: !0,
|
|
11
|
+
props: {
|
|
12
|
+
colorA: {
|
|
13
|
+
default: "#ff6b35",
|
|
14
|
+
transform: g,
|
|
15
|
+
description: "Primary color of the blob",
|
|
16
|
+
ui: {
|
|
17
|
+
type: "color",
|
|
18
|
+
label: "Color A"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
colorB: {
|
|
22
|
+
default: "#e91e63",
|
|
23
|
+
transform: g,
|
|
24
|
+
description: "Secondary color of the blob",
|
|
25
|
+
ui: {
|
|
26
|
+
type: "color",
|
|
27
|
+
label: "Color B"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
default: 0.5,
|
|
32
|
+
description: "Size of the blob",
|
|
33
|
+
ui: {
|
|
34
|
+
type: "range",
|
|
35
|
+
min: 0,
|
|
36
|
+
max: 1,
|
|
37
|
+
step: 0.01,
|
|
38
|
+
label: "Size"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
deformation: {
|
|
42
|
+
default: 0.5,
|
|
43
|
+
description: "How organic and blobby the shape is (0 = circle, 1 = very blobby)",
|
|
44
|
+
ui: {
|
|
45
|
+
type: "range",
|
|
46
|
+
min: 0,
|
|
47
|
+
max: 1,
|
|
48
|
+
step: 0.01,
|
|
49
|
+
label: "Deformation"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
softness: {
|
|
53
|
+
default: 0.5,
|
|
54
|
+
description: "Softness of the blob edges (combines edge width and transition curve)",
|
|
55
|
+
ui: {
|
|
56
|
+
type: "range",
|
|
57
|
+
min: 0,
|
|
58
|
+
max: 1,
|
|
59
|
+
step: 0.01,
|
|
60
|
+
label: "Softness"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
highlightIntensity: {
|
|
64
|
+
default: 0.5,
|
|
65
|
+
description: "Intensity of specular highlight effect",
|
|
66
|
+
ui: {
|
|
67
|
+
type: "range",
|
|
68
|
+
min: 0,
|
|
69
|
+
max: 1,
|
|
70
|
+
step: 0.01,
|
|
71
|
+
label: "Highlight Intensity"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
highlightX: {
|
|
75
|
+
default: 0.3,
|
|
76
|
+
description: "Light direction X component",
|
|
77
|
+
ui: {
|
|
78
|
+
type: "range",
|
|
79
|
+
min: -1,
|
|
80
|
+
max: 1,
|
|
81
|
+
step: 0.01,
|
|
82
|
+
label: "Highlight X"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
highlightY: {
|
|
86
|
+
default: -0.3,
|
|
87
|
+
description: "Light direction Y component",
|
|
88
|
+
ui: {
|
|
89
|
+
type: "range",
|
|
90
|
+
min: -1,
|
|
91
|
+
max: 1,
|
|
92
|
+
step: 0.01,
|
|
93
|
+
label: "Highlight Y"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
highlightZ: {
|
|
97
|
+
default: 0.4,
|
|
98
|
+
description: "Light direction Z component",
|
|
99
|
+
ui: {
|
|
100
|
+
type: "range",
|
|
101
|
+
min: -1,
|
|
102
|
+
max: 1,
|
|
103
|
+
step: 0.01,
|
|
104
|
+
label: "Highlight Z"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
highlightColor: {
|
|
108
|
+
default: "#ffe11a",
|
|
109
|
+
transform: g,
|
|
110
|
+
description: "Color of the specular highlight",
|
|
111
|
+
ui: {
|
|
112
|
+
type: "color",
|
|
113
|
+
label: "Highlight Color"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
speed: {
|
|
117
|
+
default: 0.5,
|
|
118
|
+
description: "Animation speed",
|
|
119
|
+
ui: {
|
|
120
|
+
type: "range",
|
|
121
|
+
min: 0,
|
|
122
|
+
max: 2,
|
|
123
|
+
step: 0.1,
|
|
124
|
+
label: "Speed"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
seed: {
|
|
128
|
+
default: 1,
|
|
129
|
+
description: "Adjusts the starting state, useful for variation",
|
|
130
|
+
ui: {
|
|
131
|
+
type: "range",
|
|
132
|
+
min: 0,
|
|
133
|
+
max: 100,
|
|
134
|
+
step: 1,
|
|
135
|
+
label: "Seed"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
center: {
|
|
139
|
+
default: {
|
|
140
|
+
x: 0.5,
|
|
141
|
+
y: 0.5
|
|
142
|
+
},
|
|
143
|
+
transform: Co,
|
|
144
|
+
description: "The center point of the blob",
|
|
145
|
+
ui: {
|
|
146
|
+
type: "position",
|
|
147
|
+
label: "Center Position"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
colorSpace: {
|
|
151
|
+
default: "linear",
|
|
152
|
+
transform: xo,
|
|
153
|
+
description: "Color space for color interpolation",
|
|
154
|
+
ui: {
|
|
155
|
+
type: "select",
|
|
156
|
+
options: vo,
|
|
157
|
+
label: "Color Space"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
fragmentNode: (p) => {
|
|
162
|
+
const { uniforms: i, uvContext: D } = p, { vec2: f, vec3: c, vec4: X, float: o, screenUV: Y, smoothstep: s, sin: e, length: b, viewportSize: y, pow: x, max: Z, normalize: C, dot: I, reflect: N } = fo, v = D ?? Y, l = yo(p, i.speed, i.seed), S = i.colorA.uniform, A = i.colorB.uniform, P = i.size.uniform, u = i.deformation.uniform, B = i.softness.uniform, _ = i.highlightIntensity.uniform, L = i.highlightX.uniform, R = i.highlightY.uniform, T = i.highlightZ.uniform, U = i.highlightColor.uniform, w = B.mul(o(0.3)), V = B.mul(o(2)).add(o(0.5)), m = o(0.5), z = y.x.div(y.y), k = f(v.x.mul(z), v.y), M = f(i.center.uniform.x.mul(z), i.center.uniform.y.oneMinus()), t = k.sub(M), O = b(t), j = P, n = o(4), F = e(t.x.mul(n.mul(o(0.8))).add(l.mul(o(0.8)))).mul(e(t.y.mul(n.mul(o(0.7))).add(l.mul(o(0.6))))).add(e(t.x.mul(n.mul(o(1.2))).sub(t.y.mul(n.mul(o(0.9))).add(l.mul(o(0.4)))))).mul(o(0.15)).mul(u), G = e(t.x.mul(n.mul(o(1.4))).sub(l.mul(o(0.5)))).mul(e(t.y.mul(n.mul(o(1.1))).add(l.mul(o(0.7))))).mul(o(0.12)).mul(u).mul(s(o(0.15), o(0.25), m)), W = e(t.x.mul(n.mul(o(1.8))).add(t.y.mul(n.mul(o(1.6))).add(l.mul(o(0.3))))).add(e(t.x.mul(n.mul(o(0.6))).sub(l.mul(o(0.9))))).mul(o(0.1)).mul(u).mul(s(o(0.3), o(0.4), m)), q = e(t.x.mul(n.mul(o(2.2))).add(l.mul(o(0.2)))).mul(e(t.y.mul(n.mul(o(1.9))).sub(l.mul(o(0.8))))).mul(o(0.08)).mul(u).mul(s(o(0.45), o(0.55), m)), E = e(t.x.mul(n.mul(o(2.8))).sub(t.y.mul(n.mul(o(2.4))).add(l.mul(o(0.6))))).mul(o(0.06)).mul(u).mul(s(o(0.6), o(0.7), m)), J = e(t.x.mul(n.mul(o(3.2))).add(l.mul(o(1.1)))).add(e(t.y.mul(n.mul(o(3.5))).sub(l.mul(o(0.4))))).mul(o(0.04)).mul(u).mul(s(o(0.75), o(0.85), m)), K = F.add(G).add(W).add(q).add(E).add(J), h = j.add(K), H = x(s(h.add(w), h.sub(w), O), V), Q = b(t), $ = h, a = s(o(0), $, Q), oo = o(1).sub(a.mul(o(0.1))), to = C(c(t.x.mul(a.add(o(0.2))), t.y.mul(a.add(o(0.2))), oo)), eo = C(c(L, R, T)), lo = c(o(0), o(0), o(1)), io = N(eo.negate(), to), no = o(32), so = x(Z(o(0), I(io, lo)), no), uo = a.mul(o(0.5)).add(o(0.5)), mo = so.mul(uo).mul(_).mul(H), r = t.x.mul(o(3)), d = t.y.mul(o(3)), ao = e(r.add(l.mul(o(0.4)))).mul(e(d.add(l.mul(o(0.3))))).add(e(r.mul(o(0.7)).add(d.mul(o(0.8))).add(l.mul(o(0.2))))).mul(o(0.5)).add(o(0.5)), ro = e(r.mul(o(1.3)).sub(l.mul(o(0.5)))).mul(e(d.mul(o(1.1)).add(l.mul(o(0.6))))).add(e(r.mul(o(0.5)).sub(d.mul(o(0.6)).sub(l.mul(o(0.3)))))).mul(o(0.5)).add(o(0.5)), co = ao.mul(o(0.6)).add(ro.mul(o(0.4))), ho = So(S, A, s(o(0.1), o(0.9), co), i.colorSpace.uniform).rgb, go = S.a.add(A.a).div(o(2)), po = U.rgb.mul(mo);
|
|
163
|
+
return X(ho.add(po), go.mul(H));
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
var Do = Ao;
|
|
167
|
+
export {
|
|
168
|
+
Ao as n,
|
|
169
|
+
Do as t
|
|
170
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as z, m as S } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
S();
|
|
3
3
|
const B = {
|
|
4
4
|
name: "Blur",
|
|
5
5
|
category: "Blurs",
|
|
6
|
+
description: "A simple Gaussian blur effect",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: { intensity: {
|
|
@@ -16,7 +17,7 @@ const B = {
|
|
|
16
17
|
label: "Intensity"
|
|
17
18
|
}
|
|
18
19
|
} },
|
|
19
|
-
fragmentNode: ({ uniforms:
|
|
20
|
+
fragmentNode: ({ uniforms: _, childNode: f, onCleanup: g }) => {
|
|
20
21
|
const { vec2: r, vec4: n, float: s, screenUV: T, convertToTexture: h, viewportSize: v, Fn: x } = z;
|
|
21
22
|
if (!f) return n(0, 0, 0, 0);
|
|
22
23
|
const o = h(f);
|
|
@@ -37,23 +38,23 @@ const B = {
|
|
|
37
38
|
0.278,
|
|
38
39
|
0.135,
|
|
39
40
|
0.056
|
|
40
|
-
],
|
|
41
|
-
const a = T, l =
|
|
42
|
-
for (let
|
|
43
|
-
const u = s(y[
|
|
44
|
-
|
|
41
|
+
], b = 6.214, w = _.intensity.uniform.mul(0.06), i = h(x(() => {
|
|
42
|
+
const a = T, l = w, c = r(1).div(v), t = n(0).toVar();
|
|
43
|
+
for (let e = -6; e <= 6; e++) {
|
|
44
|
+
const u = s(y[e + 6] / b), d = r(s(e), s(0)).mul(l).mul(c), m = a.add(d), p = o.sample(m).mul(u);
|
|
45
|
+
t.assign(t.add(p));
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
+
return t;
|
|
47
48
|
})());
|
|
48
49
|
return g(() => {
|
|
49
50
|
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
50
51
|
}), x(() => {
|
|
51
|
-
const a = T, l =
|
|
52
|
-
for (let
|
|
53
|
-
const u = s(y[
|
|
54
|
-
|
|
52
|
+
const a = T, l = w, c = r(1).div(v), t = n(0).toVar();
|
|
53
|
+
for (let e = -6; e <= 6; e++) {
|
|
54
|
+
const u = s(y[e + 6] / b), d = r(s(0), s(e)).mul(l).mul(c), m = a.add(d), p = i.sample(m).mul(u);
|
|
55
|
+
t.assign(t.add(p));
|
|
55
56
|
}
|
|
56
|
-
return
|
|
57
|
+
return t;
|
|
57
58
|
})();
|
|
58
59
|
}
|
|
59
60
|
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { d as i, h as A, k as V, m as R } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { t as S } from "./edges-B-tVdqcI.js";
|
|
3
|
+
import { a as w, o as E } from "./transformations-DBjTkQ5b.js";
|
|
4
|
+
R();
|
|
5
|
+
const P = {
|
|
6
|
+
name: "Bulge",
|
|
7
|
+
category: "Distortions",
|
|
8
|
+
description: "Magnify or pinch content around a center point",
|
|
9
|
+
requiresRTT: !0,
|
|
10
|
+
requiresChild: !0,
|
|
11
|
+
props: {
|
|
12
|
+
center: {
|
|
13
|
+
default: {
|
|
14
|
+
x: 0.5,
|
|
15
|
+
y: 0.5
|
|
16
|
+
},
|
|
17
|
+
transform: E,
|
|
18
|
+
description: "The center point of the bulge effect",
|
|
19
|
+
ui: {
|
|
20
|
+
type: "position",
|
|
21
|
+
label: "Center"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
strength: {
|
|
25
|
+
default: 1,
|
|
26
|
+
description: "The intensity of the bulge effect (positive = bulge out, negative = pinch in)",
|
|
27
|
+
ui: {
|
|
28
|
+
type: "range",
|
|
29
|
+
min: -1,
|
|
30
|
+
max: 1,
|
|
31
|
+
step: 0.01,
|
|
32
|
+
label: "Strength"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
radius: {
|
|
36
|
+
default: 1,
|
|
37
|
+
description: "The radius of the bulge effect area",
|
|
38
|
+
ui: {
|
|
39
|
+
type: "range",
|
|
40
|
+
min: 0,
|
|
41
|
+
max: 5,
|
|
42
|
+
step: 0.01,
|
|
43
|
+
label: "Radius"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
falloff: {
|
|
47
|
+
default: 0.5,
|
|
48
|
+
description: "Controls the smoothness of the transition (0 = hard edge, 1 = very smooth)",
|
|
49
|
+
ui: {
|
|
50
|
+
type: "range",
|
|
51
|
+
min: 0,
|
|
52
|
+
max: 1,
|
|
53
|
+
step: 0.01,
|
|
54
|
+
label: "Falloff"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
edges: {
|
|
58
|
+
default: "stretch",
|
|
59
|
+
description: "How to handle edges when distortion pushes content out of bounds",
|
|
60
|
+
transform: w,
|
|
61
|
+
ui: {
|
|
62
|
+
type: "select",
|
|
63
|
+
options: [
|
|
64
|
+
{
|
|
65
|
+
label: "Stretch",
|
|
66
|
+
value: "stretch"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "Transparent",
|
|
70
|
+
value: "transparent"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: "Mirror",
|
|
74
|
+
value: "mirror"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "Wrap",
|
|
78
|
+
value: "wrap"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
label: "Edges"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
uvTransformNode: ({ uv: e, uniforms: o, viewportSize: u }) => {
|
|
86
|
+
const { vec2: n, length: b, smoothstep: x, float: t, max: d } = V, c = u.x.div(u.y), y = n(e.x.mul(c), e.y), s = n(o.center.uniform.x.mul(c), o.center.uniform.y.oneMinus()), a = y.sub(s), f = b(a), r = o.radius.uniform.mul(0.5), m = o.falloff.uniform, p = x(r.mul(t(1).sub(m).sub(t(1e-3)).max(t(0))), r, f).oneMinus(), l = f.div(r), v = l.mul(l), T = d(t(0), t(1).sub(v)), g = p.mul(T), F = o.strength.uniform.negate().mul(g), q = t(1).add(F), D = a.mul(q), h = s.add(D);
|
|
87
|
+
return n(h.x.div(c), h.y);
|
|
88
|
+
},
|
|
89
|
+
fragmentNode: ({ uniforms: e, childNode: o, onCleanup: u }) => {
|
|
90
|
+
const { vec2: n, vec4: b, length: x, screenUV: t, viewportSize: d, convertToTexture: c, smoothstep: y } = V;
|
|
91
|
+
if (!o) return b(0, 0, 0, 0);
|
|
92
|
+
const s = c(o);
|
|
93
|
+
u(() => {
|
|
94
|
+
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
95
|
+
});
|
|
96
|
+
const a = d.x.div(d.y), f = n(t.x.mul(a), t.y), r = n(e.center.uniform.x.mul(a), e.center.uniform.y.oneMinus()), m = f.sub(r), p = x(m), l = e.radius.uniform.mul(0.5), v = e.falloff.uniform, T = y(l.mul(i(1).sub(v).sub(i(1e-3)).max(i(0))), l, p).oneMinus(), g = p.div(l), F = g.mul(g), q = A(i(0), i(1).sub(F)), D = T.mul(q), h = e.strength.uniform.negate().mul(D), C = i(1).add(h), _ = m.mul(C), M = r.add(_), U = n(M.x.div(a), M.y);
|
|
97
|
+
return S(U, s.sample(U), s, e.edges.uniform);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var $ = P;
|
|
101
|
+
export {
|
|
102
|
+
P as n,
|
|
103
|
+
$ as t
|
|
104
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as E, m as N } from "./three.tsl-BqgDcRt9.js";
|
|
2
2
|
N();
|
|
3
|
-
const
|
|
3
|
+
const W = {
|
|
4
4
|
name: "CRTScreen",
|
|
5
|
-
category: "
|
|
5
|
+
category: "Stylize",
|
|
6
|
+
description: "Retro CRT monitor simulation with scanlines",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
@@ -73,19 +74,19 @@ const O = {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
|
-
fragmentNode: ({ uniforms: n, childNode:
|
|
77
|
-
const { vec2: o, vec3: c, vec4: u, float: e, screenUV: t, sin:
|
|
78
|
-
if (!
|
|
79
|
-
const s =
|
|
77
|
+
fragmentNode: ({ uniforms: n, childNode: a, onCleanup: d }) => {
|
|
78
|
+
const { vec2: o, vec3: c, vec4: u, float: e, screenUV: t, sin: i, fract: p, smoothstep: f, length: h, convertToTexture: g } = E;
|
|
79
|
+
if (!a) return u(0, 0, 0, 0);
|
|
80
|
+
const s = g(a);
|
|
80
81
|
d(() => {
|
|
81
82
|
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
82
83
|
});
|
|
83
|
-
const b = n.pixelSize.uniform, S = n.colorShift.uniform, x = n.scanlineIntensity.uniform, y = n.scanlineFrequency.uniform, C = n.brightness.uniform, T = n.contrast.uniform, m = S.mul(e(2e-3)), v = t.add(o(m, e(0))),
|
|
84
|
-
return u(P.mul(
|
|
84
|
+
const b = n.pixelSize.uniform, S = n.colorShift.uniform, x = n.scanlineIntensity.uniform, y = n.scanlineFrequency.uniform, C = n.brightness.uniform, T = n.contrast.uniform, m = S.mul(e(2e-3)), v = t.add(o(m, e(0))), z = t, q = t.sub(o(m, e(0))), R = s.sample(v).r, V = s.sample(z).g, _ = s.sample(q).b, k = c(R, V, _).sub(e(0.5)).mul(T).add(e(0.5)).mul(C), F = i(t.y.mul(y).mul(e(3.14159 * 2))), I = e(1).sub(x.mul(F.mul(e(0.5)).add(e(0.5)))), r = k.mul(I), U = b.mul(e(0.5)), l = p(t.mul(U)), M = i(l.x.mul(e(6.28318))).mul(e(0.1)).add(e(0.95)), w = i(l.x.mul(e(6.28318)).add(e(2.09))).mul(e(0.1)).add(e(0.95)), D = i(l.x.mul(e(6.28318)).add(e(4.18))).mul(e(0.1)).add(e(0.95)), P = c(r.r.mul(M), r.g.mul(w), r.b.mul(D)), j = h(t.sub(o(0.5, 0.5))), B = f(e(0.8), e(0.3), j);
|
|
85
|
+
return u(P.mul(B), e(1));
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
var
|
|
88
|
+
var G = W;
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
W as n,
|
|
91
|
+
G as t
|
|
91
92
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
1
|
+
import { k as C, m as k } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
k();
|
|
3
|
+
const A = {
|
|
4
4
|
name: "ChannelBlur",
|
|
5
5
|
category: "Blurs",
|
|
6
|
+
description: "Independent blur for red, green, and blue channels",
|
|
6
7
|
requiresRTT: !0,
|
|
7
8
|
requiresChild: !0,
|
|
8
9
|
props: {
|
|
@@ -40,11 +41,11 @@ const D = {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
|
-
fragmentNode: ({ uniforms: m, childNode: x, onCleanup:
|
|
44
|
-
const { vec2: t, vec4: p, float: e, screenUV:
|
|
44
|
+
fragmentNode: ({ uniforms: m, childNode: x, onCleanup: I }) => {
|
|
45
|
+
const { vec2: t, vec4: p, float: e, screenUV: S, convertToTexture: v, viewportSize: O, Fn: B } = C;
|
|
45
46
|
if (!x) return p(0, 0, 0, 0);
|
|
46
|
-
const i =
|
|
47
|
-
|
|
47
|
+
const i = v(x);
|
|
48
|
+
I(() => {
|
|
48
49
|
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
49
50
|
});
|
|
50
51
|
const V = [
|
|
@@ -61,29 +62,29 @@ const D = {
|
|
|
61
62
|
0.278,
|
|
62
63
|
0.135,
|
|
63
64
|
0.056
|
|
64
|
-
], w = 6.214, R = m.redIntensity.uniform.mul(0.1), _ = m.greenIntensity.uniform.mul(0.1), z = m.blueIntensity.uniform.mul(0.1),
|
|
65
|
-
const n =
|
|
66
|
-
for (let
|
|
67
|
-
const s = e(V[
|
|
68
|
-
r.assign(r.add(
|
|
65
|
+
], w = 6.214, R = m.redIntensity.uniform.mul(0.1), _ = m.greenIntensity.uniform.mul(0.1), z = m.blueIntensity.uniform.mul(0.1), u = v(B(() => {
|
|
66
|
+
const n = S, f = t(1).div(O), r = e(0).toVar(), a = e(0).toVar(), l = e(0).toVar();
|
|
67
|
+
for (let d = -6; d <= 6; d++) {
|
|
68
|
+
const s = e(V[d + 6] / w), o = e(d).mul(f.x), c = t(o.mul(R), e(0)), g = t(o.mul(_), e(0)), y = t(o.mul(z), e(0)), b = i.sample(n.add(c)).r.mul(s), T = i.sample(n.add(g)).g.mul(s), h = i.sample(n.add(y)).b.mul(s);
|
|
69
|
+
r.assign(r.add(b)), a.assign(a.add(T)), l.assign(l.add(h));
|
|
69
70
|
}
|
|
70
71
|
return p(r, a, l, e(1));
|
|
71
72
|
})());
|
|
72
|
-
return
|
|
73
|
-
|
|
73
|
+
return I(() => {
|
|
74
|
+
u?.renderTarget?.dispose && u.renderTarget.dispose();
|
|
74
75
|
}), B(() => {
|
|
75
|
-
const n =
|
|
76
|
+
const n = S, f = t(1).div(O), r = e(0).toVar(), a = e(0).toVar(), l = e(0).toVar();
|
|
76
77
|
for (let s = -6; s <= 6; s++) {
|
|
77
|
-
const o = e(V[s + 6] / w), c = e(s).mul(f.y), g = t(e(0), c.mul(R)), y = t(e(0), c.mul(_)),
|
|
78
|
-
r.assign(r.add(
|
|
78
|
+
const o = e(V[s + 6] / w), c = e(s).mul(f.y), g = t(e(0), c.mul(R)), y = t(e(0), c.mul(_)), b = t(e(0), c.mul(z)), T = u.sample(n.add(g)).r.mul(o), h = u.sample(n.add(y)).g.mul(o), q = u.sample(n.add(b)).b.mul(o);
|
|
79
|
+
r.assign(r.add(T)), a.assign(a.add(h)), l.assign(l.add(q));
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
-
return p(r, a, l,
|
|
81
|
+
const d = i.sample(n).a;
|
|
82
|
+
return p(r, a, l, d);
|
|
82
83
|
})();
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
|
-
var
|
|
86
|
+
var F = A;
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
A as n,
|
|
89
|
+
F as t
|
|
89
90
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as _, r as f, t as
|
|
3
|
-
import { t as
|
|
4
|
-
|
|
5
|
-
const
|
|
1
|
+
import { k as B, m as U } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { i as _, r as f, t as w } from "./transformations-DBjTkQ5b.js";
|
|
3
|
+
import { t as A } from "./colorMixing-DPZ-Td4U.js";
|
|
4
|
+
U();
|
|
5
|
+
const F = {
|
|
6
6
|
name: "Checkerboard",
|
|
7
|
-
category: "
|
|
7
|
+
category: "Base Layers",
|
|
8
|
+
description: "Classic checkerboard pattern with two alternating colors",
|
|
9
|
+
acceptsUVContext: !0,
|
|
8
10
|
props: {
|
|
9
11
|
colorA: {
|
|
10
12
|
default: "#cccccc",
|
|
@@ -52,23 +54,23 @@ const A = {
|
|
|
52
54
|
description: "Color space for color interpolation",
|
|
53
55
|
ui: {
|
|
54
56
|
type: "select",
|
|
55
|
-
options:
|
|
57
|
+
options: w,
|
|
56
58
|
label: "Color Space"
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
},
|
|
60
|
-
fragmentNode: ({ uniforms: o }) => {
|
|
61
|
-
const { vec2:
|
|
62
|
+
fragmentNode: ({ uniforms: o, uvContext: m }) => {
|
|
63
|
+
const { vec2: u, float: e, floor: h, mod: b, fract: g, smoothstep: y, min: r, screenUV: C, viewportSize: s } = B, c = m ?? C, x = s.x.div(s.y), S = u(c.x.mul(x), c.y.oneMinus()), k = o.cells.uniform, l = o.softness.uniform, a = S.mul(k), n = h(a), i = b(n.x.add(n.y), 2);
|
|
62
64
|
let d = i;
|
|
63
65
|
if (l) {
|
|
64
|
-
const t =
|
|
66
|
+
const t = g(a), v = r(r(t.x, e(1).sub(t.x)), r(t.y, e(1).sub(t.y))), V = l.mul(0.5), p = y(e(0), V, v);
|
|
65
67
|
d = i.mul(p).add(e(0.5).mul(e(1).sub(p)));
|
|
66
68
|
}
|
|
67
|
-
return
|
|
69
|
+
return A(o.colorA.uniform, o.colorB.uniform, d, o.colorSpace.uniform);
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
|
-
var
|
|
72
|
+
var D = F;
|
|
71
73
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
F as n,
|
|
75
|
+
D as t
|
|
74
76
|
};
|