shaders 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/{AngularBlur-BZENxuhv.js → AngularBlur-BTUdXC0g.js} +5 -4
- package/dist/core/{Ascii-joVW9dAD.js → Ascii-Bu8ii7oo.js} +25 -24
- package/dist/core/{Blob-Ds3jasiC.js → Blob-C0G0efjG.js} +11 -10
- package/dist/core/{Blur-sKjcr9_K.js → Blur-BzUO9yxF.js} +13 -12
- package/dist/core/{Bulge-CdcB9we6.js → Bulge-BCXYAzig.js} +9 -8
- package/dist/core/{CRTScreen-BWDSeX_0.js → CRTScreen-cJ3XHrI9.js} +9 -8
- package/dist/core/{ChannelBlur-i9M5gbkh.js → ChannelBlur-BEK1qzGn.js} +17 -16
- package/dist/core/{Checkerboard-D9-UAs26.js → Checkerboard-BPkiSF5I.js} +15 -14
- package/dist/core/{ChromaFlow-DZAJwEBw.js → ChromaFlow-AHO3C4o3.js} +13 -12
- package/dist/core/{ChromaticAberration-DLYIcjJx.js → ChromaticAberration-nVg3r1FK.js} +11 -10
- package/dist/core/{Circle-Ca-LtXkF.js → Circle-C8ltF4BZ.js} +10 -9
- package/dist/core/{CursorTrail-B_VZJBOK.js → CursorTrail-BeJGeovB.js} +11 -10
- package/dist/core/DiffuseBlur-BdGvOoBw.js +40 -0
- package/dist/core/{Dither-MK-9r3tw.js → Dither-CpN3vGSh.js} +12 -11
- package/dist/core/{DotGrid-DP__DqQj.js → DotGrid-BFUzeSQw.js} +9 -8
- package/dist/core/{Duotone-CmkF6eDj.js → Duotone-_nR_o3-g.js} +6 -5
- package/dist/core/FilmGrain-BAKXXtLg.js +29 -0
- package/dist/core/{FloatingParticles-CxcXDtZg.js → FloatingParticles-Fv8JIzKk.js} +11 -10
- package/dist/core/GlassTiles-5MyBj1ff.js +53 -0
- package/dist/core/{Glow-Cz3ImaBH.js → Glow-DvJj7BB7.js} +13 -12
- package/dist/core/{Godrays-BHfh6URI.js → Godrays-cUzAKVXn.js} +18 -17
- package/dist/core/{Grayscale-FPSUcFGC.js → Grayscale-oWIF3PV5.js} +2 -1
- package/dist/core/{Grid-BvM0M3Hl.js → Grid-Bov7AA9m.js} +10 -9
- package/dist/core/{GridDistortion-yjmNv0Q3.js → GridDistortion-CWYom5Dw.js} +11 -10
- package/dist/core/Group-CPk-7fiA.js +18 -0
- package/dist/core/{Halftone-DWIVrS2s.js → Halftone-F7fsdu7W.js} +11 -10
- package/dist/core/{HueShift-CBupF7d4.js → HueShift-CiS4hdtk.js} +2 -1
- package/dist/core/{ImageTexture-GrTz4Fx7.js → ImageTexture-B3Q29OHX.js} +16 -15
- package/dist/core/Invert-Cyc4JHWc.js +21 -0
- package/dist/core/{LinearBlur-DHBRP6Yh.js → LinearBlur-BTC54qzk.js} +8 -7
- package/dist/core/{LinearGradient-B4C3CKhf.js → LinearGradient-LEMeW0KM.js} +3 -2
- package/dist/core/{Liquify-DNHtcXxv.js → Liquify-D2nzMDzq.js} +15 -14
- package/dist/core/{Pixelate-BKooNVcb.js → Pixelate-irPzmtQm.js} +8 -7
- package/dist/core/{PolarCoordinates-DKhEbQhq.js → PolarCoordinates-Ck5ZWrQO.js} +5 -4
- package/dist/core/{Posterize-D81ZG2A9.js → Posterize-DICq_t96.js} +8 -7
- package/dist/core/{ProgressiveBlur-CPdReTnY.js → ProgressiveBlur-BuORe3VH.js} +10 -9
- package/dist/core/{RadialGradient-XmwfZ91d.js → RadialGradient-D0cN67jm.js} +8 -7
- package/dist/core/{RectangularCoordinates-DWY7ptY1.js → RectangularCoordinates-1LIDaeHR.js} +15 -14
- package/dist/core/{Ripples-CndvRX-N.js → Ripples-DH71sFJc.js} +6 -5
- package/dist/core/{Saturation-C6u9sNkr.js → Saturation-DbSXtSeK.js} +10 -9
- package/dist/core/{SimplexNoise-BH0ZZzP4.js → SimplexNoise-DPGC2OPJ.js} +10 -9
- package/dist/core/{SineWave-DBH8MraQ.js → SineWave-CkWtnzHF.js} +10 -9
- package/dist/core/{SolidColor-DR665qss.js → SolidColor-DaB-FHNX.js} +2 -1
- package/dist/core/{Spiral--7KUy0u3.js → Spiral-CcyI8azF.js} +18 -17
- package/dist/core/{Strands-Bi1Is8_o.js → Strands-Co4fkc05.js} +10 -9
- package/dist/core/{Swirl-DuYM23jG.js → Swirl-BoveqtNV.js} +15 -14
- package/dist/core/{TiltShift-BUvZWBsh.js → TiltShift-D53azmRe.js} +4 -3
- package/dist/core/{Tritone-CKifp6Ob.js → Tritone-Cg1rX-hL.js} +11 -10
- package/dist/core/{Twirl-Ztlb9x_h.js → Twirl-raO5pe5X.js} +10 -9
- package/dist/core/{Vibrance-B7EsDw6e.js → Vibrance-DtekSkcz.js} +8 -7
- package/dist/core/{WaveDistortion-HCnk54tD.js → WaveDistortion-C65qO_cZ.js} +6 -5
- package/dist/core/{ZoomBlur-Ck6M9A2W.js → ZoomBlur-B97ZjhXe.js} +10 -9
- package/dist/core/index.js +771 -754
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +1 -1
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +1 -1
- package/dist/core/shaders/Blob/index.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +1 -1
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +1 -1
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +1 -1
- package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +1 -1
- package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +1 -1
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +1 -1
- package/dist/core/shaders/ChromaFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaFlow/index.js +1 -1
- package/dist/core/shaders/ChromaticAberration/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaticAberration/index.js +1 -1
- package/dist/core/shaders/Circle/index.d.ts.map +1 -1
- package/dist/core/shaders/Circle/index.js +1 -1
- package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
- package/dist/core/shaders/CursorTrail/index.js +1 -1
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +1 -1
- package/dist/core/shaders/Dither/index.d.ts.map +1 -1
- package/dist/core/shaders/Dither/index.js +1 -1
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +1 -1
- package/dist/core/shaders/Duotone/index.d.ts.map +1 -1
- package/dist/core/shaders/Duotone/index.js +1 -1
- package/dist/core/shaders/FilmGrain/index.d.ts.map +1 -1
- package/dist/core/shaders/FilmGrain/index.js +1 -1
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +1 -1
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +1 -1
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/Grayscale/index.d.ts.map +1 -1
- package/dist/core/shaders/Grayscale/index.js +1 -1
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +1 -1
- package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/GridDistortion/index.js +1 -1
- package/dist/core/shaders/Group/index.d.ts.map +1 -1
- package/dist/core/shaders/Group/index.js +1 -1
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +1 -1
- package/dist/core/shaders/HueShift/index.d.ts.map +1 -1
- package/dist/core/shaders/HueShift/index.js +1 -1
- package/dist/core/shaders/ImageTexture/index.d.ts +1 -1
- package/dist/core/shaders/ImageTexture/index.d.ts.map +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/Invert/index.d.ts.map +1 -1
- package/dist/core/shaders/Invert/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Posterize/index.d.ts.map +1 -1
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
- package/dist/core/shaders/RadialGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/RadialGradient/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/Saturation/index.d.ts.map +1 -1
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +1 -1
- package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/SolidColor/index.d.ts.map +1 -1
- package/dist/core/shaders/SolidColor/index.js +1 -1
- package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
- package/dist/core/shaders/Spiral/index.js +1 -1
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/Tritone/index.d.ts.map +1 -1
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.d.ts.map +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/react/index.cjs +63 -63
- package/dist/react/index.js +4776 -4707
- package/dist/react/utils/generatePresetCode.cjs +1 -1
- package/dist/react/utils/generatePresetCode.js +1 -1
- package/dist/registry.d.ts +3 -0
- package/dist/registry.js +226 -88
- package/dist/svelte/index.js +5539 -5470
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/{generatePresetCode-T78GxN5X.js → generatePresetCode-D4V6rBae.js} +1 -1
- package/dist/vue/index.js +4603 -4534
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +1 -1
- package/dist/core/DiffuseBlur-COpm1qrw.js +0 -39
- package/dist/core/FilmGrain-ByNyK2gs.js +0 -28
- package/dist/core/GlassTiles-CxUl9MxF.js +0 -52
- package/dist/core/Group-jZZimqG1.js +0 -17
- package/dist/core/Invert-CCQ1H_Qr.js +0 -20
package/dist/core/index.js
CHANGED
|
@@ -1,190 +1,190 @@
|
|
|
1
|
-
import { A as G, B as
|
|
2
|
-
import { n as
|
|
1
|
+
import { A as G, B as Yn, D as C, E as xe, F as dn, H as In, I as Je, J as Hn, K as Wn, L as jn, M as X, N as x, P as ye, R as Qn, S as Ce, T as kn, U as Jn, V as Kn, _ as Me, c as Zn, d as Z, g as Ke, h as Ze, i as er, k as pe, l as wn, m as D, n as k, o as nr, q as rr, s as tr, t as or, v as i, w as sr, x as ee, z as ar } from "./three.tsl-BqgDcRt9.js";
|
|
2
|
+
import { n as ce, t as Re } from "./edges-B-tVdqcI.js";
|
|
3
3
|
import { t as oo } from "./time-5uQ65blS.js";
|
|
4
4
|
import "./transformations-DBjTkQ5b.js";
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as lr } from "./Ascii-
|
|
5
|
+
import { n as ir } from "./AngularBlur-BTUdXC0g.js";
|
|
6
|
+
import { n as lr } from "./Ascii-Bu8ii7oo.js";
|
|
7
7
|
import "./colorMixing-DPZ-Td4U.js";
|
|
8
|
-
import { n as cr } from "./Blob-
|
|
9
|
-
import { n as fr } from "./Blur-
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as dr } from "./Checkerboard-
|
|
13
|
-
import { n as hr } from "./ChromaFlow-
|
|
14
|
-
import { n as pr } from "./ChromaticAberration-
|
|
15
|
-
import { n as gr } from "./Circle-
|
|
16
|
-
import { n as br } from "./CRTScreen-
|
|
17
|
-
import { n as vr } from "./CursorTrail-
|
|
18
|
-
import { n as Cr } from "./DiffuseBlur-
|
|
19
|
-
import { n as Rr } from "./Dither-
|
|
20
|
-
import { n as Tr } from "./DotGrid-
|
|
21
|
-
import { n as kr } from "./Duotone-
|
|
22
|
-
import { n as wr } from "./FilmGrain-
|
|
23
|
-
import { n as yr } from "./FloatingParticles-
|
|
24
|
-
import { n as Sr } from "./GlassTiles-
|
|
25
|
-
import { n as Ur } from "./Glow-
|
|
26
|
-
import { n as xr } from "./Godrays-
|
|
8
|
+
import { n as cr } from "./Blob-C0G0efjG.js";
|
|
9
|
+
import { n as fr } from "./Blur-BzUO9yxF.js";
|
|
10
|
+
import { n as mr } from "./Bulge-BCXYAzig.js";
|
|
11
|
+
import { n as ur } from "./ChannelBlur-BEK1qzGn.js";
|
|
12
|
+
import { n as dr } from "./Checkerboard-BPkiSF5I.js";
|
|
13
|
+
import { n as hr } from "./ChromaFlow-AHO3C4o3.js";
|
|
14
|
+
import { n as pr } from "./ChromaticAberration-nVg3r1FK.js";
|
|
15
|
+
import { n as gr } from "./Circle-C8ltF4BZ.js";
|
|
16
|
+
import { n as br } from "./CRTScreen-cJ3XHrI9.js";
|
|
17
|
+
import { n as vr } from "./CursorTrail-BeJGeovB.js";
|
|
18
|
+
import { n as Cr } from "./DiffuseBlur-BdGvOoBw.js";
|
|
19
|
+
import { n as Rr } from "./Dither-CpN3vGSh.js";
|
|
20
|
+
import { n as Tr } from "./DotGrid-BFUzeSQw.js";
|
|
21
|
+
import { n as kr } from "./Duotone-_nR_o3-g.js";
|
|
22
|
+
import { n as wr } from "./FilmGrain-BAKXXtLg.js";
|
|
23
|
+
import { n as yr } from "./FloatingParticles-Fv8JIzKk.js";
|
|
24
|
+
import { n as Sr } from "./GlassTiles-5MyBj1ff.js";
|
|
25
|
+
import { n as Ur } from "./Glow-DvJj7BB7.js";
|
|
26
|
+
import { n as xr } from "./Godrays-cUzAKVXn.js";
|
|
27
27
|
import "./TSLBase-BFMvTOak.js";
|
|
28
28
|
import "./ColorAdjustment-CKwpE_4M.js";
|
|
29
|
-
import { n as Mr } from "./Grayscale-
|
|
30
|
-
import { n as Ar } from "./Grid-
|
|
31
|
-
import { n as $r } from "./GridDistortion-
|
|
32
|
-
import { n as
|
|
33
|
-
import { n as
|
|
34
|
-
import { n as Fr } from "./HueShift-
|
|
35
|
-
import { n as Er } from "./ImageTexture-
|
|
36
|
-
import { n as Or } from "./Invert-
|
|
37
|
-
import { n as Br } from "./LinearBlur-
|
|
38
|
-
import { n as Pr } from "./LinearGradient-
|
|
39
|
-
import { n as _r } from "./Liquify-
|
|
40
|
-
import { n as Vr } from "./Pixelate-
|
|
41
|
-
import { n as Lr } from "./PolarCoordinates-
|
|
42
|
-
import { n as qr } from "./Posterize-
|
|
43
|
-
import { n as Gr } from "./ProgressiveBlur-
|
|
44
|
-
import { n as Nr } from "./RadialGradient-
|
|
45
|
-
import { n as
|
|
46
|
-
import { n as
|
|
47
|
-
import { n as
|
|
48
|
-
import { n as Hr } from "./SimplexNoise-
|
|
49
|
-
import { n as Wr } from "./SineWave-
|
|
50
|
-
import { n as jr } from "./SolidColor-
|
|
51
|
-
import { n as Qr } from "./Spiral
|
|
52
|
-
import { n as Jr } from "./Strands-
|
|
53
|
-
import { n as Kr } from "./Swirl-
|
|
54
|
-
import { n as Zr } from "./TiltShift-
|
|
55
|
-
import { n as et } from "./Tritone-
|
|
56
|
-
import { n as nt } from "./Twirl-
|
|
57
|
-
import { n as rt } from "./Vibrance-
|
|
58
|
-
import { n as tt } from "./WaveDistortion-
|
|
59
|
-
import { n as ot } from "./ZoomBlur-
|
|
60
|
-
import { WebGLRenderer as
|
|
29
|
+
import { n as Mr } from "./Grayscale-oWIF3PV5.js";
|
|
30
|
+
import { n as Ar } from "./Grid-Bov7AA9m.js";
|
|
31
|
+
import { n as $r } from "./GridDistortion-CWYom5Dw.js";
|
|
32
|
+
import { n as Dr } from "./Group-CPk-7fiA.js";
|
|
33
|
+
import { n as zr } from "./Halftone-F7fsdu7W.js";
|
|
34
|
+
import { n as Fr } from "./HueShift-CiS4hdtk.js";
|
|
35
|
+
import { n as Er } from "./ImageTexture-B3Q29OHX.js";
|
|
36
|
+
import { n as Or } from "./Invert-Cyc4JHWc.js";
|
|
37
|
+
import { n as Br } from "./LinearBlur-BTC54qzk.js";
|
|
38
|
+
import { n as Pr } from "./LinearGradient-LEMeW0KM.js";
|
|
39
|
+
import { n as _r } from "./Liquify-D2nzMDzq.js";
|
|
40
|
+
import { n as Vr } from "./Pixelate-irPzmtQm.js";
|
|
41
|
+
import { n as Lr } from "./PolarCoordinates-Ck5ZWrQO.js";
|
|
42
|
+
import { n as qr } from "./Posterize-DICq_t96.js";
|
|
43
|
+
import { n as Gr } from "./ProgressiveBlur-BuORe3VH.js";
|
|
44
|
+
import { n as Nr } from "./RadialGradient-D0cN67jm.js";
|
|
45
|
+
import { n as Xr } from "./RectangularCoordinates-1LIDaeHR.js";
|
|
46
|
+
import { n as Yr } from "./Ripples-DH71sFJc.js";
|
|
47
|
+
import { n as Ir } from "./Saturation-DbSXtSeK.js";
|
|
48
|
+
import { n as Hr } from "./SimplexNoise-DPGC2OPJ.js";
|
|
49
|
+
import { n as Wr } from "./SineWave-CkWtnzHF.js";
|
|
50
|
+
import { n as jr } from "./SolidColor-DaB-FHNX.js";
|
|
51
|
+
import { n as Qr } from "./Spiral-CcyI8azF.js";
|
|
52
|
+
import { n as Jr } from "./Strands-Co4fkc05.js";
|
|
53
|
+
import { n as Kr } from "./Swirl-BoveqtNV.js";
|
|
54
|
+
import { n as Zr } from "./TiltShift-D53azmRe.js";
|
|
55
|
+
import { n as et } from "./Tritone-Cg1rX-hL.js";
|
|
56
|
+
import { n as nt } from "./Twirl-raO5pe5X.js";
|
|
57
|
+
import { n as rt } from "./Vibrance-DtekSkcz.js";
|
|
58
|
+
import { n as tt } from "./WaveDistortion-C65qO_cZ.js";
|
|
59
|
+
import { n as ot } from "./ZoomBlur-B97ZjhXe.js";
|
|
60
|
+
import { WebGLRenderer as st } from "three";
|
|
61
61
|
jn();
|
|
62
|
-
|
|
63
|
-
function
|
|
64
|
-
const r =
|
|
65
|
-
return
|
|
62
|
+
D();
|
|
63
|
+
function at(e, n, a = 1) {
|
|
64
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
65
|
+
return x(k(i(n.rgb, r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
var hn = (e) =>
|
|
69
|
-
const n = e.x,
|
|
70
|
-
return
|
|
67
|
+
D();
|
|
68
|
+
var hn = (e) => X(e.x.mul(1.2249401).sub(e.y.mul(0.2249404)).sub(e.z.mul(0)), e.x.mul(-0.0420569).add(e.y.mul(1.0420571)).add(e.z.mul(0)), e.x.mul(-0.0196376).sub(e.y.mul(0.0786361)).add(e.z.mul(1.0982735))), it = (e) => X(e.x.mul(0.8224621).add(e.y.mul(0.177538)).add(e.z.mul(0)), e.x.mul(0.0331941).add(e.y.mul(0.9668058)).add(e.z.mul(0)), e.x.mul(0.0170826).add(e.y.mul(0.0723974)).add(e.z.mul(0.9105199))), pn = (e) => {
|
|
69
|
+
const n = e.x, a = e.y, r = e.z, m = n.mul(0.4122214708).add(a.mul(0.5363325363)).add(r.mul(0.0514459929)), p = n.mul(0.2119034982).add(a.mul(0.6806995451).add(r.mul(0.1073969566))), h = n.mul(0.0883024619).add(a.mul(0.2817188376)).add(r.mul(0.6299787005)), d = ee(m, Z(1 / 3)), R = ee(p, Z(1 / 3)), U = ee(h, Z(1 / 3));
|
|
70
|
+
return X(d.mul(0.2104542553).add(R.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(R.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(R.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
71
71
|
}, lt = (e) => {
|
|
72
|
-
const n = e.x,
|
|
73
|
-
return
|
|
72
|
+
const n = e.x, a = e.y, r = e.z, m = n.add(a.mul(0.3963377774)).add(r.mul(0.2158037573)), p = n.sub(a.mul(0.1055613458)).sub(r.mul(0.0638541728)), h = n.sub(a.mul(0.0894841775)).sub(r.mul(1.291485548)), d = ee(m, Z(3)), R = ee(p, Z(3)), U = ee(h, Z(3));
|
|
73
|
+
return X(d.mul(4.0767416621).sub(R.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(R.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(R.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
74
74
|
}, gn = (e) => {
|
|
75
|
-
const n = e.x,
|
|
76
|
-
return
|
|
75
|
+
const n = e.x, a = e.y, r = e.z;
|
|
76
|
+
return X(n, kn(a.mul(a).add(r.mul(r))), er(r, a));
|
|
77
77
|
}, ct = (e) => {
|
|
78
|
-
const n = e.x,
|
|
79
|
-
return
|
|
78
|
+
const n = e.x, a = e.y, r = e.z;
|
|
79
|
+
return X(n, a.mul(tr(r)), a.mul(sr(r)));
|
|
80
80
|
};
|
|
81
|
-
function ft(e, n,
|
|
82
|
-
const r =
|
|
83
|
-
return
|
|
81
|
+
function ft(e, n, a = 1) {
|
|
82
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = hn(X(e.r, e.g, e.b)), h = hn(X(n.r, n.g, n.b)), d = pn(p), R = pn(h), U = gn(d);
|
|
83
|
+
return x(it(lt(ct(k(i(gn(R), r), i(U, i(e.a, C(1, r))))))), m);
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
var bn = (e) =>
|
|
87
|
-
const n = e.x,
|
|
88
|
-
return
|
|
89
|
-
},
|
|
90
|
-
const n = e.x,
|
|
91
|
-
return
|
|
85
|
+
D();
|
|
86
|
+
var bn = (e) => X(e.x.mul(1.2249401).sub(e.y.mul(0.2249404)).sub(e.z.mul(0)), e.x.mul(-0.0420569).add(e.y.mul(1.0420571)).add(e.z.mul(0)), e.x.mul(-0.0196376).sub(e.y.mul(0.0786361)).add(e.z.mul(1.0982735))), mt = (e) => X(e.x.mul(0.8224621).add(e.y.mul(0.177538)).add(e.z.mul(0)), e.x.mul(0.0331941).add(e.y.mul(0.9668058)).add(e.z.mul(0)), e.x.mul(0.0170826).add(e.y.mul(0.0723974)).add(e.z.mul(0.9105199))), vn = (e) => {
|
|
87
|
+
const n = e.x, a = e.y, r = e.z, m = n.mul(0.4122214708).add(a.mul(0.5363325363)).add(r.mul(0.0514459929)), p = n.mul(0.2119034982).add(a.mul(0.6806995451).add(r.mul(0.1073969566))), h = n.mul(0.0883024619).add(a.mul(0.2817188376)).add(r.mul(0.6299787005)), d = ee(m, Z(1 / 3)), R = ee(p, Z(1 / 3)), U = ee(h, Z(1 / 3));
|
|
88
|
+
return X(d.mul(0.2104542553).add(R.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(R.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(R.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
89
|
+
}, ut = (e) => {
|
|
90
|
+
const n = e.x, a = e.y, r = e.z, m = n.add(a.mul(0.3963377774)).add(r.mul(0.2158037573)), p = n.sub(a.mul(0.1055613458)).sub(r.mul(0.0638541728)), h = n.sub(a.mul(0.0894841775)).sub(r.mul(1.291485548)), d = ee(m, Z(3)), R = ee(p, Z(3)), U = ee(h, Z(3));
|
|
91
|
+
return X(d.mul(4.0767416621).sub(R.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(R.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(R.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
92
92
|
};
|
|
93
|
-
function dt(e, n,
|
|
94
|
-
const r =
|
|
95
|
-
return
|
|
93
|
+
function dt(e, n, a = 1) {
|
|
94
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = bn(X(e.r, e.g, e.b)), h = bn(X(n.r, n.g, n.b)), d = vn(p);
|
|
95
|
+
return x(mt(ut(k(i(vn(h), r), i(d, i(e.a, C(1, r)))))), m);
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
function ht(e, n,
|
|
99
|
-
const r =
|
|
100
|
-
return
|
|
97
|
+
D();
|
|
98
|
+
function ht(e, n, a = 1) {
|
|
99
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
100
|
+
return x(k(i(i(e.rgb, n.rgb), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
function pt(e, n,
|
|
104
|
-
const r =
|
|
105
|
-
return
|
|
102
|
+
D();
|
|
103
|
+
function pt(e, n, a = 1) {
|
|
104
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
105
|
+
return x(k(i(C(1, i(C(1, e.rgb), C(1, n.rgb))), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
function gt(e, n,
|
|
109
|
-
const r =
|
|
110
|
-
return
|
|
107
|
+
D();
|
|
108
|
+
function gt(e, n, a = 1) {
|
|
109
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
110
|
+
return x(k(i(Ke(k(e.rgb, n.rgb), 1), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
function bt(e, n,
|
|
114
|
-
const r =
|
|
115
|
-
return
|
|
112
|
+
D();
|
|
113
|
+
function bt(e, n, a = 1) {
|
|
114
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
115
|
+
return x(k(i(Me(i(2, i(e.rgb, n.rgb)), C(1, i(2, i(C(1, e.rgb), C(1, n.rgb)))), xe(0.5, e.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
function vt(e, n,
|
|
119
|
-
const r =
|
|
120
|
-
return
|
|
117
|
+
D();
|
|
118
|
+
function vt(e, n, a = 1) {
|
|
119
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
120
|
+
return x(k(i(or(C(e.rgb, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
121
121
|
}
|
|
122
|
-
|
|
123
|
-
function Ct(e, n,
|
|
124
|
-
const r =
|
|
125
|
-
return
|
|
122
|
+
D();
|
|
123
|
+
function Ct(e, n, a = 1) {
|
|
124
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
125
|
+
return x(k(i(Me(e.rgb, Ke(Zn(e.rgb, C(1, n.rgb)), 1), xe(1e-3, C(1, n.rgb))), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
function Rt(e, n,
|
|
129
|
-
const r =
|
|
130
|
-
return
|
|
127
|
+
D();
|
|
128
|
+
function Rt(e, n, a = 1) {
|
|
129
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
130
|
+
return x(k(i(C(k(e.rgb, n.rgb), i(2, i(e.rgb, n.rgb))), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
function
|
|
134
|
-
return k(k(
|
|
132
|
+
D();
|
|
133
|
+
function me(e) {
|
|
134
|
+
return k(k(i(e.r, 0.2126), i(e.g, 0.7152)), i(e.b, 0.0722));
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
function Tt(e, n,
|
|
138
|
-
const r =
|
|
139
|
-
return
|
|
136
|
+
D();
|
|
137
|
+
function Tt(e, n, a = 1) {
|
|
138
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = C(me(e.rgb), me(n.rgb));
|
|
139
|
+
return x(k(i(k(n.rgb, p), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
function kt(e, n,
|
|
143
|
-
const r =
|
|
144
|
-
return
|
|
141
|
+
D();
|
|
142
|
+
function kt(e, n, a = 1) {
|
|
143
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = me(e.rgb), h = me(n.rgb).div(k(p, 1e-4));
|
|
144
|
+
return x(k(i(i(e.rgb, h), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
function wt(e, n,
|
|
148
|
-
const r =
|
|
149
|
-
return
|
|
146
|
+
D();
|
|
147
|
+
function wt(e, n, a = 1) {
|
|
148
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
149
|
+
return x(k(i(Ke(e.rgb, n.rgb), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
function yt(e, n,
|
|
153
|
-
const r =
|
|
154
|
-
return
|
|
151
|
+
D();
|
|
152
|
+
function yt(e, n, a = 1) {
|
|
153
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
154
|
+
return x(k(i(Ze(e.rgb, n.rgb), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
function St(e, n,
|
|
158
|
-
const r =
|
|
159
|
-
return
|
|
156
|
+
D();
|
|
157
|
+
function St(e, n, a = 1) {
|
|
158
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
159
|
+
return x(k(i(Me(x(0, 0, 0, 1).rgb, Ze(C(1, C(1, e.rgb).div(k(n.rgb, 1e-4))), 0), xe(1e-4, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
function Ut(e, n,
|
|
163
|
-
const r =
|
|
164
|
-
return
|
|
161
|
+
D();
|
|
162
|
+
function Ut(e, n, a = 1) {
|
|
163
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
164
|
+
return x(k(i(Ze(k(k(e.rgb, n.rgb), -1), 0), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
function xt(e, n,
|
|
168
|
-
const r =
|
|
169
|
-
return
|
|
166
|
+
D();
|
|
167
|
+
function xt(e, n, a = 1) {
|
|
168
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = k(i(2, i(e.rgb, n.rgb)), i(i(e.rgb, e.rgb), C(1, i(2, n.rgb)))), h = kn(e.rgb);
|
|
169
|
+
return x(k(i(Me(p, k(i(2, i(e.rgb, C(1, n.rgb))), i(h, C(i(2, n.rgb), 1))), xe(0.5, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
function Mt(e, n,
|
|
173
|
-
const r =
|
|
174
|
-
return
|
|
171
|
+
D();
|
|
172
|
+
function Mt(e, n, a = 1) {
|
|
173
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r)));
|
|
174
|
+
return x(k(i(Me(i(2, i(e.rgb, n.rgb)), C(1, i(2, i(C(1, e.rgb), C(1, n.rgb)))), xe(0.5, n.rgb)), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
175
175
|
}
|
|
176
|
-
|
|
177
|
-
function At(e, n,
|
|
178
|
-
const r =
|
|
179
|
-
return
|
|
176
|
+
D();
|
|
177
|
+
function At(e, n, a = 1) {
|
|
178
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = me(e.rgb), h = me(n.rgb), d = e.rgb.sub(p), R = n.rgb.sub(h), U = d.length();
|
|
179
|
+
return x(k(i(k(i(R.normalize(), U), p), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
180
180
|
}
|
|
181
|
-
|
|
182
|
-
function $t(e, n,
|
|
183
|
-
const r =
|
|
184
|
-
return
|
|
181
|
+
D();
|
|
182
|
+
function $t(e, n, a = 1) {
|
|
183
|
+
const r = i(n.a, a), m = k(r, i(e.a, C(1, r))), p = me(e.rgb), h = me(n.rgb), d = e.rgb.sub(p), R = n.rgb.sub(h);
|
|
184
|
+
return x(k(i(k(i(d.normalize(), R.length()), p), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
185
185
|
}
|
|
186
186
|
var Cn = {
|
|
187
|
-
normal:
|
|
187
|
+
normal: at,
|
|
188
188
|
"normal-oklch": ft,
|
|
189
189
|
"normal-oklab": dt,
|
|
190
190
|
multiply: ht,
|
|
@@ -205,37 +205,37 @@ var Cn = {
|
|
|
205
205
|
hue: At,
|
|
206
206
|
saturation: $t
|
|
207
207
|
};
|
|
208
|
-
function
|
|
209
|
-
return (Cn[
|
|
208
|
+
function K(e, n, a = "normal", r = 1) {
|
|
209
|
+
return (Cn[a] || Cn.normal)(e, n, r);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
function zt(e, n) {
|
|
213
|
-
const i = s(e.a, n.a);
|
|
214
|
-
return U(e.rgb, i);
|
|
215
|
-
}
|
|
216
|
-
A();
|
|
211
|
+
D();
|
|
217
212
|
function Dt(e, n) {
|
|
218
|
-
const
|
|
219
|
-
return
|
|
213
|
+
const a = i(e.a, n.a);
|
|
214
|
+
return x(e.rgb, a);
|
|
215
|
+
}
|
|
216
|
+
D();
|
|
217
|
+
function zt(e, n) {
|
|
218
|
+
const a = C(1, n.a), r = i(e.a, a);
|
|
219
|
+
return x(e.rgb, r);
|
|
220
220
|
}
|
|
221
|
-
|
|
221
|
+
D();
|
|
222
222
|
function Ft(e, n) {
|
|
223
|
-
const
|
|
224
|
-
return
|
|
223
|
+
const a = X(0.2126, 0.7152, 0.0722), r = wn(n.rgb, a), m = i(e.a, r);
|
|
224
|
+
return x(e.rgb, m);
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
D();
|
|
227
227
|
function Et(e, n) {
|
|
228
|
-
const
|
|
229
|
-
return
|
|
228
|
+
const a = X(0.2126, 0.7152, 0.0722), r = C(1, wn(n.rgb, a)), m = i(e.a, r);
|
|
229
|
+
return x(e.rgb, m);
|
|
230
230
|
}
|
|
231
231
|
var Rn = {
|
|
232
|
-
alpha:
|
|
233
|
-
alphaInverted:
|
|
232
|
+
alpha: Dt,
|
|
233
|
+
alphaInverted: zt,
|
|
234
234
|
luminance: Ft,
|
|
235
235
|
luminanceInverted: Et
|
|
236
236
|
};
|
|
237
|
-
function Ot(e, n,
|
|
238
|
-
return (Rn[
|
|
237
|
+
function Ot(e, n, a = "alpha") {
|
|
238
|
+
return (Rn[a] || Rn.alpha)(e, n);
|
|
239
239
|
}
|
|
240
240
|
var Bt = class {
|
|
241
241
|
frameTimesMs = [];
|
|
@@ -259,8 +259,8 @@ var Bt = class {
|
|
|
259
259
|
this.frameTimesMs.push(e), this.frameTimesMs.length > this.maxSamples && this.frameTimesMs.shift(), this.totalFrameCount++, e > this.targetFrameTime && this.jankFrameCount++;
|
|
260
260
|
const n = performance.now();
|
|
261
261
|
if (this.lastFrameTimestamp > 0) {
|
|
262
|
-
const
|
|
263
|
-
this.frameIntervals.push(
|
|
262
|
+
const a = n - this.lastFrameTimestamp;
|
|
263
|
+
this.frameIntervals.push(a), this.frameIntervals.length > this.maxSamples && this.frameIntervals.shift();
|
|
264
264
|
}
|
|
265
265
|
this.lastFrameTimestamp = n, this.recordMemorySnapshot();
|
|
266
266
|
}
|
|
@@ -298,32 +298,32 @@ var Bt = class {
|
|
|
298
298
|
time: e,
|
|
299
299
|
bytes: n
|
|
300
300
|
});
|
|
301
|
-
const
|
|
302
|
-
this.memorySnapshots = this.memorySnapshots.filter((r) => r.time >
|
|
301
|
+
const a = e - this.memoryWindowMs;
|
|
302
|
+
this.memorySnapshots = this.memorySnapshots.filter((r) => r.time > a);
|
|
303
303
|
}
|
|
304
304
|
/**
|
|
305
305
|
* Calculates memory growth rate in MB/sec
|
|
306
306
|
*/
|
|
307
307
|
calculateMemoryGrowthRate() {
|
|
308
308
|
if (this.memorySnapshots.length < 2) return null;
|
|
309
|
-
const e = this.memorySnapshots[0], n = this.memorySnapshots[this.memorySnapshots.length - 1],
|
|
310
|
-
return (n.bytes - e.bytes) / (1024 * 1024) /
|
|
309
|
+
const e = this.memorySnapshots[0], n = this.memorySnapshots[this.memorySnapshots.length - 1], a = (n.time - e.time) / 1e3;
|
|
310
|
+
return (n.bytes - e.bytes) / (1024 * 1024) / a;
|
|
311
311
|
}
|
|
312
312
|
/**
|
|
313
313
|
* Calculates standard deviation of frame times
|
|
314
314
|
*/
|
|
315
315
|
calculateStdDev(e) {
|
|
316
316
|
if (e.length === 0) return 0;
|
|
317
|
-
const n = e.reduce((r,
|
|
318
|
-
return Math.sqrt(
|
|
317
|
+
const n = e.reduce((r, m) => r + m, 0) / e.length, a = e.map((r) => Math.pow(r - n, 2)).reduce((r, m) => r + m, 0) / e.length;
|
|
318
|
+
return Math.sqrt(a);
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
321
|
* Calculates 99th percentile frame time
|
|
322
322
|
*/
|
|
323
323
|
calculateP99(e) {
|
|
324
324
|
if (e.length === 0) return 0;
|
|
325
|
-
const n = [...e].sort((r,
|
|
326
|
-
return n[Math.min(
|
|
325
|
+
const n = [...e].sort((r, m) => r - m), a = Math.floor(n.length * 0.99);
|
|
326
|
+
return n[Math.min(a, n.length - 1)];
|
|
327
327
|
}
|
|
328
328
|
/**
|
|
329
329
|
* Calculates complexity score based on node structure
|
|
@@ -349,7 +349,7 @@ var Bt = class {
|
|
|
349
349
|
score: 0,
|
|
350
350
|
label: "N/A"
|
|
351
351
|
};
|
|
352
|
-
const n = this.frameTimesMs.reduce((
|
|
352
|
+
const n = this.frameTimesMs.reduce((U, V) => U + V, 0) / e, a = Math.min(n / 16.67 * 100, 100), r = this.calculateComplexityScore(), m = Math.min(r / 100 * 100, 100);
|
|
353
353
|
let p = 0;
|
|
354
354
|
this.lastGpuTime !== null && (p = Math.min(this.lastGpuTime / 16.67 * 100, 100));
|
|
355
355
|
const h = this.lastGpuTime !== null ? {
|
|
@@ -360,7 +360,7 @@ var Bt = class {
|
|
|
360
360
|
frame: 0.7,
|
|
361
361
|
gpu: 0,
|
|
362
362
|
complexity: 0.3
|
|
363
|
-
}, d = Math.round(
|
|
363
|
+
}, d = Math.round(a * h.frame + p * h.gpu + m * h.complexity);
|
|
364
364
|
let R;
|
|
365
365
|
return d <= 20 ? R = "Very Light" : d <= 40 ? R = "Light" : d <= 60 ? R = "Medium" : d <= 80 ? R = "Heavy" : R = "Very Heavy", {
|
|
366
366
|
score: Math.min(d, 100),
|
|
@@ -371,11 +371,11 @@ var Bt = class {
|
|
|
371
371
|
* Gets current performance statistics
|
|
372
372
|
*/
|
|
373
373
|
getStats(e) {
|
|
374
|
-
const n = this.frameTimesMs.length,
|
|
374
|
+
const n = this.frameTimesMs.length, a = this.frameIntervals.length > 0 ? 1e3 / (this.frameIntervals.reduce((z, F) => z + F, 0) / this.frameIntervals.length) : 0, r = n > 0 ? this.frameTimesMs.reduce((z, F) => z + F, 0) / n : 0, m = n > 0 ? Math.min(...this.frameTimesMs) : 0, p = n > 0 ? Math.max(...this.frameTimesMs) : 0, h = this.calculateP99(this.frameTimesMs), d = this.calculateStdDev(this.frameTimesMs), R = this.totalFrameCount > 0 ? this.jankFrameCount / this.totalFrameCount * 100 : 0, U = performance.memory, V = U ? U.usedJSHeapSize / (1024 * 1024) : null, B = this.calculateMemoryGrowthRate(), ne = r > 0 ? r / this.targetFrameTime * 100 : 0, Y = e?.render?.calls ?? null, I = e?.programs?.length ?? null, N = e?.memory?.textures ?? null, ae = this.calculateIntensityScore();
|
|
375
375
|
return {
|
|
376
|
-
fps: Math.round(
|
|
376
|
+
fps: Math.round(a),
|
|
377
377
|
avgFrameTime: Math.round(r * 100) / 100,
|
|
378
|
-
minFrameTime: Math.round(
|
|
378
|
+
minFrameTime: Math.round(m * 100) / 100,
|
|
379
379
|
maxFrameTime: Math.round(p * 100) / 100,
|
|
380
380
|
p99FrameTime: Math.round(h * 100) / 100,
|
|
381
381
|
stdDevFrameTime: Math.round(d * 100) / 100,
|
|
@@ -384,13 +384,13 @@ var Bt = class {
|
|
|
384
384
|
nodeCount: this.nodeCount,
|
|
385
385
|
rttNodeCount: this.rttNodeCount,
|
|
386
386
|
complexityScore: this.calculateComplexityScore(),
|
|
387
|
-
memoryUsedMB:
|
|
388
|
-
memoryGrowthRate:
|
|
387
|
+
memoryUsedMB: V !== null ? Math.round(V * 100) / 100 : null,
|
|
388
|
+
memoryGrowthRate: B !== null ? Math.round(B * 1e3) / 1e3 : null,
|
|
389
389
|
cpuTime: this.lastCpuTime !== null ? Math.round(this.lastCpuTime * 100) / 100 : null,
|
|
390
390
|
gpuTime: this.lastGpuTime !== null ? Math.round(this.lastGpuTime * 100) / 100 : null,
|
|
391
|
-
budgetUsed: Math.round(
|
|
392
|
-
drawCalls:
|
|
393
|
-
shaderPrograms:
|
|
391
|
+
budgetUsed: Math.round(ne * 10) / 10,
|
|
392
|
+
drawCalls: Y,
|
|
393
|
+
shaderPrograms: I,
|
|
394
394
|
textureCount: N,
|
|
395
395
|
intensityScore: ae.score,
|
|
396
396
|
intensityLabel: ae.label,
|
|
@@ -404,37 +404,37 @@ var Bt = class {
|
|
|
404
404
|
this.frameTimesMs = [], this.frameIntervals = [], this.lastFrameTimestamp = 0, this.jankFrameCount = 0, this.totalFrameCount = 0, this.memorySnapshots = [], this.lastCpuTime = null, this.lastGpuTime = null;
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
|
-
|
|
408
|
-
var { vec2:
|
|
409
|
-
const
|
|
410
|
-
const R = r.mul(Lt).div(Vt(180)),
|
|
411
|
-
return
|
|
407
|
+
D();
|
|
408
|
+
var { vec2: Se, cos: Pt, sin: _t, float: Vt, PI: Lt } = pe;
|
|
409
|
+
const fe = (e) => e.offsetX !== 0 || e.offsetY !== 0 || e.rotation !== 0 || e.scale !== 1 || e.anchorX !== 0.5 || e.anchorY !== 0.5, Ue = (e, n, a, r, m, p, h, d) => {
|
|
410
|
+
const R = r.mul(Lt).div(Vt(180)), U = Pt(R), V = _t(R), B = Se(p, h), ne = e.sub(B).div(m), Y = Se(ne.x.mul(d), ne.y), I = Se(Y.x.mul(U).sub(Y.y.mul(V)), Y.x.mul(V).add(Y.y.mul(U)));
|
|
411
|
+
return Se(I.x.div(d), I.y).sub(Se(n, a)).add(B);
|
|
412
412
|
};
|
|
413
413
|
var qt = /* @__PURE__ */ rr({
|
|
414
414
|
createUniformsMap: () => Gt,
|
|
415
415
|
updateUniformValue: () => Nt
|
|
416
416
|
});
|
|
417
|
-
function Gt(e, n,
|
|
417
|
+
function Gt(e, n, a) {
|
|
418
418
|
const r = {};
|
|
419
|
-
return Object.entries(e.props).forEach(([
|
|
420
|
-
const h = n[
|
|
419
|
+
return Object.entries(e.props).forEach(([m, p]) => {
|
|
420
|
+
const h = n[m];
|
|
421
421
|
let d = h;
|
|
422
422
|
if (p.transform) {
|
|
423
|
-
const
|
|
424
|
-
d =
|
|
423
|
+
const U = p.transform(h);
|
|
424
|
+
d = U?.node ?? U;
|
|
425
425
|
}
|
|
426
426
|
if (d == null && (d = p.default, p.transform && d !== null && d !== void 0)) {
|
|
427
|
-
const
|
|
428
|
-
d =
|
|
427
|
+
const U = p.transform(d);
|
|
428
|
+
d = U?.node ?? U;
|
|
429
429
|
}
|
|
430
|
-
d == null && (console.error(`[Shaders] Uniform "${
|
|
431
|
-
propName:
|
|
430
|
+
d == null && (console.error(`[Shaders] Uniform "${m}" is null/undefined after fallback. PropConfig:`, {
|
|
431
|
+
propName: m,
|
|
432
432
|
initialValue: h,
|
|
433
433
|
default: p.default,
|
|
434
434
|
hasTransform: !!p.transform
|
|
435
435
|
}), d = 0);
|
|
436
|
-
const R = yn(d).setName(`${
|
|
437
|
-
typeof d == "string" && R.value === null && (R.value = d), r[
|
|
436
|
+
const R = yn(d).setName(`${m}_${a}`);
|
|
437
|
+
typeof d == "string" && R.value === null && (R.value = d), r[m] = {
|
|
438
438
|
uniform: R,
|
|
439
439
|
transform: p.transform || void 0
|
|
440
440
|
};
|
|
@@ -442,17 +442,17 @@ function Gt(e, n, i) {
|
|
|
442
442
|
}
|
|
443
443
|
function Nt(e, n) {
|
|
444
444
|
if (e?.transform) {
|
|
445
|
-
const
|
|
445
|
+
const a = e.transform(n), r = a?.data ?? a;
|
|
446
446
|
e.uniform.value = r;
|
|
447
447
|
} else e.uniform.value = n;
|
|
448
448
|
}
|
|
449
449
|
var yn, Sn = Wn({ "src/utilities/uniforms.ts": (() => {
|
|
450
|
-
|
|
450
|
+
D(), { uniform: yn } = pe;
|
|
451
451
|
}) });
|
|
452
|
-
|
|
453
|
-
var Tn = !1,
|
|
452
|
+
D();
|
|
453
|
+
var Tn = !1, Xt = /* @__PURE__ */ (() => {
|
|
454
454
|
let e = 0;
|
|
455
|
-
const n = /* @__PURE__ */ new Set(),
|
|
455
|
+
const n = /* @__PURE__ */ new Set(), a = (h) => {
|
|
456
456
|
n.forEach((d) => {
|
|
457
457
|
try {
|
|
458
458
|
d.onMouseMove(h);
|
|
@@ -468,7 +468,7 @@ var Tn = !1, It = /* @__PURE__ */ (() => {
|
|
|
468
468
|
console.error("[Shaders] Error in touch move handler:", R);
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
|
-
},
|
|
471
|
+
}, m = () => {
|
|
472
472
|
n.forEach((h) => {
|
|
473
473
|
try {
|
|
474
474
|
h.onMouseUp();
|
|
@@ -486,11 +486,11 @@ var Tn = !1, It = /* @__PURE__ */ (() => {
|
|
|
486
486
|
});
|
|
487
487
|
};
|
|
488
488
|
return { register(h) {
|
|
489
|
-
return n.add(h), e++, e === 1 && (window.addEventListener("mousemove",
|
|
490
|
-
n.delete(h), e--, e === 0 && (window.removeEventListener("mousemove",
|
|
489
|
+
return n.add(h), e++, e === 1 && (window.addEventListener("mousemove", a), window.addEventListener("touchmove", r), window.addEventListener("mouseup", m), window.addEventListener("touchend", p)), () => {
|
|
490
|
+
n.delete(h), e--, e === 0 && (window.removeEventListener("mousemove", a), window.removeEventListener("touchmove", r), window.removeEventListener("mouseup", m), window.removeEventListener("touchend", p));
|
|
491
491
|
};
|
|
492
492
|
} };
|
|
493
|
-
})(),
|
|
493
|
+
})(), Yt = () => {
|
|
494
494
|
try {
|
|
495
495
|
{
|
|
496
496
|
const { MODE: e, DEV: n } = {
|
|
@@ -508,41 +508,41 @@ var Tn = !1, It = /* @__PURE__ */ (() => {
|
|
|
508
508
|
return !1;
|
|
509
509
|
}
|
|
510
510
|
};
|
|
511
|
-
function
|
|
512
|
-
let e = null, n,
|
|
511
|
+
function cs() {
|
|
512
|
+
let e = null, n, a, r, m, p;
|
|
513
513
|
const h = {
|
|
514
514
|
nodes: /* @__PURE__ */ new Map(),
|
|
515
515
|
rootId: null,
|
|
516
516
|
idToNodeId: /* @__PURE__ */ new Map()
|
|
517
517
|
}, d = /* @__PURE__ */ new Map();
|
|
518
|
-
let R = null,
|
|
518
|
+
let R = null, U = null, V = null, B = !1, ne = !1, Y = !1, I = null, N = !1, ae = !0, z = 0, F = 0, te = !1, qe = 0, Ae = !1, $e = 0.5, De = 0.5, ue = !1, ze = !1, Fe = null, Te = null, de = !1;
|
|
519
519
|
const ie = new Bt();
|
|
520
|
-
let
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
width:
|
|
520
|
+
let oe = [], Ge = !1, Ee = [], ge = null, Oe = [], be = null, en = /* @__PURE__ */ new Set(), nn = /* @__PURE__ */ new Set(), Be = 0, ke = /* @__PURE__ */ new Set(), Ne = /* @__PURE__ */ new Set(), we = null, Pe = !1;
|
|
521
|
+
const Xe = (s, t) => {
|
|
522
|
+
s <= 0 || t <= 0 || s === z && t === F || (we = {
|
|
523
|
+
width: s,
|
|
524
524
|
height: t
|
|
525
|
-
},
|
|
526
|
-
if (
|
|
527
|
-
const { width: o, height: l } =
|
|
528
|
-
|
|
525
|
+
}, Pe || (Pe = !0, requestAnimationFrame(() => {
|
|
526
|
+
if (Pe = !1, !we) return;
|
|
527
|
+
const { width: o, height: l } = we;
|
|
528
|
+
we = null, z = o, F = l, Y || (Y = !0), n.setSize(o, l, !1);
|
|
529
529
|
const f = o / l, b = 2, g = b * f;
|
|
530
|
-
|
|
531
|
-
w.transformUniforms?.aspectRatio && (w.transformUniforms.aspectRatio.value = f), w.resizeCallbacks.forEach((
|
|
530
|
+
a.left = -g / 2, a.right = g / 2, a.top = b / 2, a.bottom = -b / 2, a.updateProjectionMatrix(), m.scale.set(g, b, 1), h.nodes.forEach((w) => {
|
|
531
|
+
w.transformUniforms?.aspectRatio && (w.transformUniforms.aspectRatio.value = f), w.resizeCallbacks.forEach((M) => {
|
|
532
532
|
try {
|
|
533
|
-
|
|
533
|
+
M({
|
|
534
534
|
width: o,
|
|
535
535
|
height: l
|
|
536
536
|
});
|
|
537
|
-
} catch (
|
|
538
|
-
console.error("Error in resize callback:",
|
|
537
|
+
} catch (E) {
|
|
538
|
+
console.error("Error in resize callback:", E);
|
|
539
539
|
}
|
|
540
540
|
});
|
|
541
|
-
}),
|
|
541
|
+
}), re().catch(console.warn);
|
|
542
542
|
})));
|
|
543
|
-
}, Un = () =>
|
|
544
|
-
if (!n || !
|
|
545
|
-
const t =
|
|
543
|
+
}, Un = () => B && !!n && !!r && !!a && !!p && z > 0 && F > 0 && N, xn = (s) => {
|
|
544
|
+
if (!n || !a || !m) return;
|
|
545
|
+
const t = s[0];
|
|
546
546
|
if (!t) return;
|
|
547
547
|
let o, l;
|
|
548
548
|
if (t.contentBoxSize) {
|
|
@@ -550,81 +550,81 @@ function ca() {
|
|
|
550
550
|
f ? (o = Math.round(f.inlineSize), l = Math.round(f.blockSize)) : (o = Math.round(t.contentRect.width), l = Math.round(t.contentRect.height));
|
|
551
551
|
} else
|
|
552
552
|
o = Math.round(t.contentRect.width), l = Math.round(t.contentRect.height);
|
|
553
|
-
o === 0 || l === 0 ||
|
|
554
|
-
}, Mn = (
|
|
555
|
-
const t =
|
|
553
|
+
o === 0 || l === 0 || Xe(o, l);
|
|
554
|
+
}, Mn = (s) => {
|
|
555
|
+
const t = s[0];
|
|
556
556
|
if (!t) return;
|
|
557
557
|
const o = N;
|
|
558
558
|
N = t.isIntersecting;
|
|
559
|
-
const l = e?.getBoundingClientRect(), f =
|
|
560
|
-
if (
|
|
561
|
-
if (
|
|
562
|
-
const { width: b, height: g } = e.getBoundingClientRect(), w = Math.round(b),
|
|
563
|
-
w > 0 &&
|
|
559
|
+
const l = e?.getBoundingClientRect(), f = te;
|
|
560
|
+
if (te = N && !!l && l.width > 0 && l.height > 0, N && !o) {
|
|
561
|
+
if (Ae = !0, e) {
|
|
562
|
+
const { width: b, height: g } = e.getBoundingClientRect(), w = Math.round(b), M = Math.round(g);
|
|
563
|
+
w > 0 && M > 0 && (z === 0 || F === 0 || w !== z || M !== F ? (Xe(w, M), !f && te && he()) : p && B && h.rootId && (p.needsUpdate = !0, he(), re().catch(console.warn)));
|
|
564
564
|
}
|
|
565
565
|
ae && je();
|
|
566
566
|
} else !N && o && Qe();
|
|
567
|
-
}, An = (
|
|
568
|
-
if (
|
|
569
|
-
for (const o of
|
|
567
|
+
}, An = (s, t) => {
|
|
568
|
+
if (s.size !== t.size) return !1;
|
|
569
|
+
for (const o of s) if (!t.has(o)) return !1;
|
|
570
570
|
return !0;
|
|
571
|
-
},
|
|
572
|
-
|
|
573
|
-
const t = nr(
|
|
574
|
-
return
|
|
571
|
+
}, _e = (s) => {
|
|
572
|
+
Be++;
|
|
573
|
+
const t = nr(s);
|
|
574
|
+
return ke.add(t), t;
|
|
575
575
|
}, rn = () => {
|
|
576
|
-
|
|
576
|
+
Ne.forEach((s) => {
|
|
577
577
|
try {
|
|
578
|
-
|
|
578
|
+
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
579
579
|
} catch {
|
|
580
580
|
}
|
|
581
|
-
}),
|
|
581
|
+
}), Ne.clear();
|
|
582
582
|
};
|
|
583
|
-
let
|
|
584
|
-
const
|
|
585
|
-
if (!h.rootId || !p ||
|
|
586
|
-
if (
|
|
587
|
-
|
|
588
|
-
|
|
583
|
+
let ve = !1;
|
|
584
|
+
const he = () => {
|
|
585
|
+
if (!h.rootId || !p || ze || !h.nodes.get(h.rootId)) return;
|
|
586
|
+
if (z === 0 || F === 0) {
|
|
587
|
+
ve || (ve = !0, requestAnimationFrame(() => {
|
|
588
|
+
ve = !1, z > 0 && F > 0 && he();
|
|
589
589
|
}));
|
|
590
590
|
return;
|
|
591
591
|
}
|
|
592
|
-
|
|
593
|
-
const
|
|
592
|
+
ze = !0;
|
|
593
|
+
const s = performance.now();
|
|
594
594
|
console.log("[Shaders Perf] Starting updateMaterial()");
|
|
595
595
|
try {
|
|
596
596
|
const t = performance.now();
|
|
597
|
-
|
|
597
|
+
Ne = new Set(ke), ke.clear(), console.log(`[Shaders Perf] Texture management: ${(performance.now() - t).toFixed(2)}ms`);
|
|
598
598
|
const o = /* @__PURE__ */ new Set(), l = performance.now();
|
|
599
599
|
nn.clear(), h.nodes.forEach((g, w) => {
|
|
600
600
|
(g.requiresRTT || g.transformRTTActive) && nn.add(w);
|
|
601
|
-
}), console.log(`[Shaders Perf] RTT tracking rebuild: ${(performance.now() - l).toFixed(2)}ms (${h.nodes.size} nodes)`),
|
|
601
|
+
}), console.log(`[Shaders Perf] RTT tracking rebuild: ${(performance.now() - l).toFixed(2)}ms (${h.nodes.size} nodes)`), Be = 0;
|
|
602
602
|
const f = performance.now(), b = j(h.rootId, /* @__PURE__ */ new Set(), o);
|
|
603
|
-
if (console.log(`[Shaders Perf] composeNodeTree: ${(performance.now() - f).toFixed(2)}ms (RTT ops: ${
|
|
603
|
+
if (console.log(`[Shaders Perf] composeNodeTree: ${(performance.now() - f).toFixed(2)}ms (RTT ops: ${Be})`), b && p) {
|
|
604
604
|
const g = !An(en, o), w = p.fragmentNode !== b;
|
|
605
|
-
if (g ||
|
|
606
|
-
console.log(`[Shaders Perf] Recompilation needed: compositionChanged=${g}, nodeChanged=${w}, needsRefresh=${
|
|
607
|
-
const
|
|
608
|
-
rn(), console.log(`[Shaders Perf] Texture disposal: ${(performance.now() -
|
|
609
|
-
const
|
|
605
|
+
if (g || Ae || w) {
|
|
606
|
+
console.log(`[Shaders Perf] Recompilation needed: compositionChanged=${g}, nodeChanged=${w}, needsRefresh=${Ae}`);
|
|
607
|
+
const M = performance.now();
|
|
608
|
+
rn(), console.log(`[Shaders Perf] Texture disposal: ${(performance.now() - M).toFixed(2)}ms`);
|
|
609
|
+
const E = performance.now();
|
|
610
610
|
try {
|
|
611
611
|
p.dispose(), n.renderTarget && n.renderTarget.dispose();
|
|
612
612
|
} catch {
|
|
613
613
|
}
|
|
614
|
-
console.log(`[Shaders Perf] Material disposal: ${(performance.now() -
|
|
615
|
-
const y = performance.now(),
|
|
616
|
-
|
|
614
|
+
console.log(`[Shaders Perf] Material disposal: ${(performance.now() - E).toFixed(2)}ms`);
|
|
615
|
+
const y = performance.now(), u = new dn({ transparent: !0 });
|
|
616
|
+
u.fragmentNode = b, u.needsUpdate = !0, console.log(`[Shaders Perf] Material creation: ${(performance.now() - y).toFixed(2)}ms`), m.material = u, p = u, Ae = !1, en = o;
|
|
617
617
|
} else console.log("[Shaders Perf] No recompilation needed (composition unchanged)");
|
|
618
618
|
}
|
|
619
|
-
console.log(`[Shaders Perf] TOTAL updateMaterial: ${(performance.now() -
|
|
619
|
+
console.log(`[Shaders Perf] TOTAL updateMaterial: ${(performance.now() - s).toFixed(2)}ms`), console.log("========================================");
|
|
620
620
|
} catch (t) {
|
|
621
|
-
console.error("Error composing shader tree:", t), console.log(`[Shaders Perf] FAILED after ${(performance.now() -
|
|
621
|
+
console.error("Error composing shader tree:", t), console.log(`[Shaders Perf] FAILED after ${(performance.now() - s).toFixed(2)}ms`);
|
|
622
622
|
} finally {
|
|
623
|
-
|
|
623
|
+
ze = !1;
|
|
624
624
|
}
|
|
625
|
-
N &&
|
|
626
|
-
}, W = (
|
|
627
|
-
const t = d.get(
|
|
625
|
+
N && re().catch(console.warn);
|
|
626
|
+
}, W = (s) => {
|
|
627
|
+
const t = d.get(s);
|
|
628
628
|
if (!t) return [];
|
|
629
629
|
const o = [];
|
|
630
630
|
for (const l of t) {
|
|
@@ -632,24 +632,24 @@ function ca() {
|
|
|
632
632
|
f && o.push(f);
|
|
633
633
|
}
|
|
634
634
|
return o;
|
|
635
|
-
}, $n = (
|
|
636
|
-
for (const [t, o] of h.nodes.entries()) if (o.metadata.id ===
|
|
635
|
+
}, $n = (s) => {
|
|
636
|
+
for (const [t, o] of h.nodes.entries()) if (o.metadata.id === s) return t;
|
|
637
637
|
return null;
|
|
638
|
-
},
|
|
639
|
-
if (!t.metadata.mask?.source) return
|
|
638
|
+
}, se = (s, t, o, l) => {
|
|
639
|
+
if (!t.metadata.mask?.source) return s;
|
|
640
640
|
const f = t.metadata.mask.source, b = $n(f);
|
|
641
|
-
if (!b) return
|
|
641
|
+
if (!b) return s;
|
|
642
642
|
if (l.has(b))
|
|
643
|
-
return console.error("Uh oh, looks like you've got a circular dependency in your shader masks."),
|
|
643
|
+
return console.error("Uh oh, looks like you've got a circular dependency in your shader masks."), s;
|
|
644
644
|
const g = new Set(l);
|
|
645
|
-
return g.add(o), Ot(
|
|
646
|
-
},
|
|
647
|
-
if (!t.metadata.transform || !t.transformUniforms || !
|
|
648
|
-
const o =
|
|
649
|
-
return
|
|
650
|
-
}, H = (
|
|
645
|
+
return g.add(o), Ot(s, j(b, g), t.metadata.mask.type || "alpha");
|
|
646
|
+
}, le = (s, t) => {
|
|
647
|
+
if (!t.metadata.transform || !t.transformUniforms || !fe(t.metadata.transform) && !t.transformRTTActive) return s;
|
|
648
|
+
const o = _e(s), l = Ue(Ce, t.transformUniforms.offsetX, t.transformUniforms.offsetY, t.transformUniforms.rotation, t.transformUniforms.scale, t.transformUniforms.anchorX, t.transformUniforms.anchorY, t.transformUniforms.aspectRatio);
|
|
649
|
+
return Re(l, o.sample(l), o, t.transformUniforms.edges);
|
|
650
|
+
}, H = (s) => !!s.uvTransformFunc && s.requiresChild && s.metadata.blendMode === "normal" && (s.metadata.opacity === void 0 || s.metadata.opacity === 1) && s.metadata.visible !== !1 && !s.metadata.mask?.source && !(s.transformUniforms && s.metadata.transform && fe(s.metadata.transform)), Ye = (s) => {
|
|
651
651
|
const t = [];
|
|
652
|
-
let o =
|
|
652
|
+
let o = s;
|
|
653
653
|
for (; o; ) {
|
|
654
654
|
const l = h.nodes.get(o);
|
|
655
655
|
if (!l || !H(l)) break;
|
|
@@ -661,79 +661,79 @@ function ca() {
|
|
|
661
661
|
else break;
|
|
662
662
|
}
|
|
663
663
|
return t;
|
|
664
|
-
},
|
|
665
|
-
if (
|
|
666
|
-
const t =
|
|
664
|
+
}, Dn = (s) => {
|
|
665
|
+
if (s.length === 0) return null;
|
|
666
|
+
const t = s[s.length - 1], o = W(t.id);
|
|
667
667
|
return o.length === 0 ? null : o.length === 1 ? o[0] : null;
|
|
668
|
-
},
|
|
669
|
-
if (!
|
|
670
|
-
const t = W(
|
|
668
|
+
}, Ve = (s) => {
|
|
669
|
+
if (!s.uvTransformFunc || !H(s)) return !1;
|
|
670
|
+
const t = W(s.id);
|
|
671
671
|
if (t.length !== 1) return !1;
|
|
672
672
|
const o = t[0];
|
|
673
|
-
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc && H(o) ?
|
|
674
|
-
},
|
|
673
|
+
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc && H(o) ? Ve(o) : !1;
|
|
674
|
+
}, Ie = (s, t, o) => {
|
|
675
675
|
const l = [];
|
|
676
|
-
let f =
|
|
676
|
+
let f = s;
|
|
677
677
|
for (; f; ) {
|
|
678
678
|
const v = h.nodes.get(f);
|
|
679
679
|
if (!v) break;
|
|
680
680
|
if (l.length >= 2)
|
|
681
|
-
return console.log(`[Shaders Perf] UV chain depth limit reached (${l.length}), falling back to RTT`), j(
|
|
681
|
+
return console.log(`[Shaders Perf] UV chain depth limit reached (${l.length}), falling back to RTT`), j(s, t, o, !0);
|
|
682
682
|
if (l.push(v), o && o.add(v.id), v.acceptsUVContext && !v.requiresChild) break;
|
|
683
683
|
const c = W(f);
|
|
684
684
|
if (c.length !== 1) break;
|
|
685
685
|
f = c[0].id;
|
|
686
686
|
}
|
|
687
|
-
if (l.length === 0) return
|
|
687
|
+
if (l.length === 0) return x(0, 0, 0, 0);
|
|
688
688
|
const b = l[l.length - 1];
|
|
689
|
-
let g =
|
|
689
|
+
let g = Ce;
|
|
690
690
|
for (let v = 0; v < l.length; v++) {
|
|
691
691
|
const c = l[v];
|
|
692
692
|
c.uvTransformFunc && (g = c.uvTransformFunc({
|
|
693
693
|
uv: g,
|
|
694
694
|
uniforms: c.uniforms,
|
|
695
|
-
viewportSize:
|
|
696
|
-
})), c.transformUniforms && c.metadata.transform &&
|
|
695
|
+
viewportSize: ye
|
|
696
|
+
})), c.transformUniforms && c.metadata.transform && fe(c.metadata.transform) && (g = Ue(g, c.transformUniforms.offsetX, c.transformUniforms.offsetY, c.transformUniforms.rotation, c.transformUniforms.scale, c.transformUniforms.anchorX, c.transformUniforms.anchorY, c.transformUniforms.aspectRatio), c.transformUniforms.edges && (g = ce(g, c.transformUniforms.edges)), c.transformRTTActive = !0);
|
|
697
697
|
}
|
|
698
698
|
for (let v = 0; v < l.length - 1; v++) {
|
|
699
699
|
const c = l[v];
|
|
700
700
|
if (!c.requiresChild) continue;
|
|
701
|
-
const
|
|
702
|
-
c.cleanupCallbacks.push(
|
|
703
|
-
},
|
|
704
|
-
c.beforeRenderCallbacks.push(
|
|
705
|
-
}, T = (
|
|
706
|
-
c.afterRenderCallbacks.push(
|
|
707
|
-
},
|
|
708
|
-
c.resizeCallbacks.push(
|
|
701
|
+
const $ = (O) => {
|
|
702
|
+
c.cleanupCallbacks.push(O);
|
|
703
|
+
}, P = (O) => {
|
|
704
|
+
c.beforeRenderCallbacks.push(O);
|
|
705
|
+
}, T = (O) => {
|
|
706
|
+
c.afterRenderCallbacks.push(O);
|
|
707
|
+
}, S = (O) => {
|
|
708
|
+
c.resizeCallbacks.push(O);
|
|
709
709
|
};
|
|
710
|
-
c.cleanupCallbacks.forEach((
|
|
710
|
+
c.cleanupCallbacks.forEach((O) => {
|
|
711
711
|
try {
|
|
712
|
-
|
|
713
|
-
} catch (
|
|
714
|
-
console.error("Error in cleanup callback:",
|
|
712
|
+
O();
|
|
713
|
+
} catch (Q) {
|
|
714
|
+
console.error("Error in cleanup callback:", Q);
|
|
715
715
|
}
|
|
716
716
|
}), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], c.fragmentNodeFunc({
|
|
717
717
|
uniforms: c.uniforms ?? {},
|
|
718
718
|
childNode: void 0,
|
|
719
719
|
uvContext: void 0,
|
|
720
|
-
onCleanup:
|
|
721
|
-
onBeforeRender:
|
|
720
|
+
onCleanup: $,
|
|
721
|
+
onBeforeRender: P,
|
|
722
722
|
onAfterRender: T,
|
|
723
|
-
onResize:
|
|
723
|
+
onResize: S,
|
|
724
724
|
canvas: e,
|
|
725
725
|
dimensions: {
|
|
726
|
-
width:
|
|
727
|
-
height:
|
|
726
|
+
width: z,
|
|
727
|
+
height: F
|
|
728
728
|
},
|
|
729
729
|
renderer: n
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
732
|
const w = (v) => {
|
|
733
733
|
b.cleanupCallbacks.push(v);
|
|
734
|
-
},
|
|
734
|
+
}, M = (v) => {
|
|
735
735
|
b.beforeRenderCallbacks.push(v);
|
|
736
|
-
},
|
|
736
|
+
}, E = (v) => {
|
|
737
737
|
b.afterRenderCallbacks.push(v);
|
|
738
738
|
}, y = (v) => {
|
|
739
739
|
b.resizeCallbacks.push(v);
|
|
@@ -745,433 +745,450 @@ function ca() {
|
|
|
745
745
|
console.error("Error in cleanup callback:", c);
|
|
746
746
|
}
|
|
747
747
|
}), b.cleanupCallbacks = [], b.beforeRenderCallbacks = [], b.afterRenderCallbacks = [], b.resizeCallbacks = [];
|
|
748
|
-
const
|
|
748
|
+
const u = b.fragmentNodeFunc({
|
|
749
749
|
uniforms: b.uniforms ?? {},
|
|
750
750
|
childNode: void 0,
|
|
751
751
|
uvContext: g,
|
|
752
752
|
onCleanup: w,
|
|
753
|
-
onBeforeRender:
|
|
754
|
-
onAfterRender:
|
|
753
|
+
onBeforeRender: M,
|
|
754
|
+
onAfterRender: E,
|
|
755
755
|
onResize: y,
|
|
756
756
|
canvas: e,
|
|
757
757
|
dimensions: {
|
|
758
|
-
width:
|
|
759
|
-
height:
|
|
758
|
+
width: z,
|
|
759
|
+
height: F
|
|
760
760
|
},
|
|
761
761
|
renderer: n
|
|
762
762
|
});
|
|
763
|
-
for (const v of l) if (v.uniforms.edges?.uniform) return
|
|
764
|
-
return
|
|
765
|
-
}, He = (
|
|
766
|
-
if (
|
|
767
|
-
const l =
|
|
763
|
+
for (const v of l) if (v.uniforms.edges?.uniform) return Re(g, u, null, v.uniforms.edges.uniform);
|
|
764
|
+
return u;
|
|
765
|
+
}, He = (s, t, o) => {
|
|
766
|
+
if (s.length === 0) return x(0, 0, 0, 0);
|
|
767
|
+
const l = Dn(s);
|
|
768
768
|
let f;
|
|
769
769
|
if (l) f = j(l.id, t, o);
|
|
770
|
-
else return
|
|
771
|
-
const b =
|
|
772
|
-
let g =
|
|
773
|
-
for (let
|
|
774
|
-
const y =
|
|
770
|
+
else return x(0, 0, 0, 0);
|
|
771
|
+
const b = _e(f);
|
|
772
|
+
let g = Ce;
|
|
773
|
+
for (let E = s.length - 1; E >= 0; E--) {
|
|
774
|
+
const y = s[E];
|
|
775
775
|
y.uvTransformFunc && (g = y.uvTransformFunc({
|
|
776
776
|
uv: g,
|
|
777
777
|
uniforms: y.uniforms,
|
|
778
|
-
viewportSize:
|
|
779
|
-
}), y.uniforms.edges?.uniform && (g =
|
|
778
|
+
viewportSize: ye
|
|
779
|
+
}), y.uniforms.edges?.uniform && (g = ce(g, y.uniforms.edges.uniform))), o && o.add(y.id);
|
|
780
780
|
}
|
|
781
|
-
const w = b.sample(g),
|
|
782
|
-
return
|
|
783
|
-
}, tn = (
|
|
781
|
+
const w = b.sample(g), M = s[0];
|
|
782
|
+
return M.uniforms.edges?.uniform ? Re(g, w, b, M.uniforms.edges.uniform) : w;
|
|
783
|
+
}, tn = (s, t) => {
|
|
784
784
|
const o = [];
|
|
785
|
-
for (let l = t; l <
|
|
786
|
-
const f =
|
|
785
|
+
for (let l = t; l < s.length; l++) {
|
|
786
|
+
const f = s[l];
|
|
787
787
|
if (!H(f) || W(f.id).length > 0) break;
|
|
788
788
|
o.push(f);
|
|
789
789
|
}
|
|
790
790
|
return o;
|
|
791
|
-
}, on = (
|
|
792
|
-
if (
|
|
793
|
-
const l =
|
|
794
|
-
let f =
|
|
795
|
-
for (let w =
|
|
796
|
-
const
|
|
797
|
-
|
|
791
|
+
}, on = (s, t, o) => {
|
|
792
|
+
if (s.length === 0) return t;
|
|
793
|
+
const l = _e(t);
|
|
794
|
+
let f = Ce;
|
|
795
|
+
for (let w = s.length - 1; w >= 0; w--) {
|
|
796
|
+
const M = s[w];
|
|
797
|
+
M.uvTransformFunc && (f = M.uvTransformFunc({
|
|
798
798
|
uv: f,
|
|
799
|
-
uniforms:
|
|
800
|
-
viewportSize:
|
|
801
|
-
}),
|
|
799
|
+
uniforms: M.uniforms,
|
|
800
|
+
viewportSize: ye
|
|
801
|
+
}), M.uniforms.edges?.uniform && (f = ce(f, M.uniforms.edges.uniform))), o && o.add(M.id);
|
|
802
802
|
}
|
|
803
|
-
const b = l.sample(f), g =
|
|
804
|
-
return g.uniforms.edges?.uniform ?
|
|
805
|
-
},
|
|
803
|
+
const b = l.sample(f), g = s[s.length - 1];
|
|
804
|
+
return g.uniforms.edges?.uniform ? Re(f, b, l, g.uniforms.edges.uniform) : b;
|
|
805
|
+
}, sn = (s) => {
|
|
806
806
|
const t = [], o = [];
|
|
807
807
|
let l = !1;
|
|
808
|
-
for (let g = 0; g <
|
|
809
|
-
const w =
|
|
810
|
-
w.acceptsUVContext && !w.requiresChild && t.push(g), H(w) && !
|
|
808
|
+
for (let g = 0; g < s.length; g++) {
|
|
809
|
+
const w = s[g], M = W(w.id).length > 0;
|
|
810
|
+
w.acceptsUVContext && !w.requiresChild && t.push(g), H(w) && !M && (o.push(g), t.length > 0 && (l = !0));
|
|
811
811
|
}
|
|
812
812
|
if (t.length === 0 || o.length === 0 || !l) return !1;
|
|
813
813
|
const f = Math.min(...t), b = Math.max(...o);
|
|
814
814
|
for (let g = f + 1; g < b; g++) {
|
|
815
|
-
const w =
|
|
815
|
+
const w = s[g];
|
|
816
816
|
if (w.requiresRTT && !H(w) && !(w.acceptsUVContext && !w.requiresChild)) return !1;
|
|
817
817
|
}
|
|
818
818
|
return o.length > 2 ? (console.log(`[Shaders Perf] Too many distortions in sibling group (${o.length}), skipping UV propagation`), !1) : !0;
|
|
819
|
-
},
|
|
819
|
+
}, an = (s, t, o) => {
|
|
820
820
|
const l = performance.now();
|
|
821
|
-
console.log(`[Shaders Perf] composeSiblingsWithUVContext (${
|
|
821
|
+
console.log(`[Shaders Perf] composeSiblingsWithUVContext (${s.length} children)`);
|
|
822
822
|
const f = performance.now(), b = [], g = [];
|
|
823
|
-
|
|
823
|
+
s.forEach((y, u) => {
|
|
824
824
|
const v = W(y.id).length > 0;
|
|
825
825
|
H(y) && !v ? g.push({
|
|
826
826
|
node: y,
|
|
827
|
-
index:
|
|
827
|
+
index: u
|
|
828
828
|
}) : y.acceptsUVContext && !y.requiresChild && !v && b.push({
|
|
829
829
|
node: y,
|
|
830
|
-
index:
|
|
830
|
+
index: u
|
|
831
831
|
});
|
|
832
832
|
}), console.log(`[Shaders Perf] Categorization: ${(performance.now() - f).toFixed(2)}ms (${b.length} gens, ${g.length} dists)`);
|
|
833
833
|
const w = performance.now();
|
|
834
834
|
for (const y of g) {
|
|
835
|
-
const
|
|
836
|
-
|
|
835
|
+
const u = y.node;
|
|
836
|
+
u.cleanupCallbacks.forEach((T) => {
|
|
837
837
|
try {
|
|
838
838
|
T();
|
|
839
|
-
} catch (
|
|
840
|
-
console.error("Cleanup error:",
|
|
839
|
+
} catch (S) {
|
|
840
|
+
console.error("Cleanup error:", S);
|
|
841
841
|
}
|
|
842
|
-
}),
|
|
843
|
-
const v = (T) =>
|
|
844
|
-
|
|
845
|
-
uniforms:
|
|
842
|
+
}), u.cleanupCallbacks = [], u.beforeRenderCallbacks = [], u.afterRenderCallbacks = [], u.resizeCallbacks = [];
|
|
843
|
+
const v = (T) => u.cleanupCallbacks.push(T), c = (T) => u.beforeRenderCallbacks.push(T), $ = (T) => u.afterRenderCallbacks.push(T), P = (T) => u.resizeCallbacks.push(T);
|
|
844
|
+
u.fragmentNodeFunc({
|
|
845
|
+
uniforms: u.uniforms ?? {},
|
|
846
846
|
childNode: void 0,
|
|
847
847
|
uvContext: void 0,
|
|
848
848
|
onCleanup: v,
|
|
849
849
|
onBeforeRender: c,
|
|
850
|
-
onAfterRender:
|
|
851
|
-
onResize:
|
|
850
|
+
onAfterRender: $,
|
|
851
|
+
onResize: P,
|
|
852
852
|
canvas: e,
|
|
853
853
|
dimensions: {
|
|
854
|
-
width:
|
|
855
|
-
height:
|
|
854
|
+
width: z,
|
|
855
|
+
height: F
|
|
856
856
|
},
|
|
857
857
|
renderer: n
|
|
858
|
-
}), o && o.add(
|
|
858
|
+
}), o && o.add(u.id);
|
|
859
859
|
}
|
|
860
860
|
console.log(`[Shaders Perf] Callback registration: ${(performance.now() - w).toFixed(2)}ms (${g.length} distortions)`);
|
|
861
|
-
const
|
|
862
|
-
let
|
|
863
|
-
for (let y = 0; y <
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
const v =
|
|
867
|
-
|
|
868
|
-
const c = W(
|
|
869
|
-
let
|
|
870
|
-
const
|
|
871
|
-
if (
|
|
872
|
-
const T = g.filter((
|
|
873
|
-
let
|
|
874
|
-
for (let
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
uv:
|
|
878
|
-
uniforms:
|
|
879
|
-
viewportSize:
|
|
880
|
-
})),
|
|
861
|
+
const M = performance.now();
|
|
862
|
+
let E;
|
|
863
|
+
for (let y = 0; y < s.length; y++) {
|
|
864
|
+
const u = s[y];
|
|
865
|
+
if (u.metadata.visible === !1) continue;
|
|
866
|
+
const v = u.metadata.opacity ?? 1;
|
|
867
|
+
u.opacityUniform.value = v, o && o.add(u.id);
|
|
868
|
+
const c = W(u.id).length > 0;
|
|
869
|
+
let $;
|
|
870
|
+
const P = b.find((T) => T.index === y);
|
|
871
|
+
if (P) {
|
|
872
|
+
const T = g.filter((_) => _.index > P.index).sort((_, q) => _.index - q.index).map((_) => _.node);
|
|
873
|
+
let S = Ce;
|
|
874
|
+
for (let _ = T.length - 1; _ >= 0; _--) {
|
|
875
|
+
const q = T[_];
|
|
876
|
+
q.uvTransformFunc && (S = q.uvTransformFunc({
|
|
877
|
+
uv: S,
|
|
878
|
+
uniforms: q.uniforms,
|
|
879
|
+
viewportSize: ye
|
|
880
|
+
})), q.transformUniforms && q.metadata.transform && fe(q.metadata.transform) && (S = Ue(S, q.transformUniforms.offsetX, q.transformUniforms.offsetY, q.transformUniforms.rotation, q.transformUniforms.scale, q.transformUniforms.anchorX, q.transformUniforms.anchorY, q.transformUniforms.aspectRatio), q.transformUniforms.edges && (S = ce(S, q.transformUniforms.edges)), q.transformRTTActive = !0), q.uniforms.edges?.uniform && (S = ce(S, q.uniforms.edges.uniform));
|
|
881
881
|
}
|
|
882
|
-
|
|
882
|
+
P.node.transformUniforms && P.node.metadata.transform && fe(P.node.metadata.transform) && (S = Ue(S, P.node.transformUniforms.offsetX, P.node.transformUniforms.offsetY, P.node.transformUniforms.rotation, P.node.transformUniforms.scale, P.node.transformUniforms.anchorX, P.node.transformUniforms.anchorY, P.node.transformUniforms.aspectRatio), P.node.transformUniforms.edges && (S = ce(S, P.node.transformUniforms.edges)), P.node.transformRTTActive = !0), u.cleanupCallbacks.forEach((_) => {
|
|
883
883
|
try {
|
|
884
|
-
|
|
885
|
-
} catch (
|
|
886
|
-
console.error("Cleanup error:",
|
|
884
|
+
_();
|
|
885
|
+
} catch (q) {
|
|
886
|
+
console.error("Cleanup error:", q);
|
|
887
887
|
}
|
|
888
|
-
}),
|
|
889
|
-
const
|
|
890
|
-
let
|
|
891
|
-
uniforms:
|
|
888
|
+
}), u.cleanupCallbacks = [], u.beforeRenderCallbacks = [], u.afterRenderCallbacks = [], u.resizeCallbacks = [];
|
|
889
|
+
const O = (_) => u.cleanupCallbacks.push(_), Q = (_) => u.beforeRenderCallbacks.push(_), J = (_) => u.afterRenderCallbacks.push(_), A = (_) => u.resizeCallbacks.push(_);
|
|
890
|
+
let L = u.fragmentNodeFunc({
|
|
891
|
+
uniforms: u.uniforms ?? {},
|
|
892
892
|
childNode: void 0,
|
|
893
|
-
uvContext:
|
|
894
|
-
onCleanup:
|
|
895
|
-
onBeforeRender:
|
|
896
|
-
onAfterRender:
|
|
897
|
-
onResize:
|
|
893
|
+
uvContext: S,
|
|
894
|
+
onCleanup: O,
|
|
895
|
+
onBeforeRender: Q,
|
|
896
|
+
onAfterRender: J,
|
|
897
|
+
onResize: A,
|
|
898
898
|
canvas: e,
|
|
899
899
|
dimensions: {
|
|
900
|
-
width:
|
|
901
|
-
height:
|
|
900
|
+
width: z,
|
|
901
|
+
height: F
|
|
902
902
|
},
|
|
903
903
|
renderer: n
|
|
904
904
|
});
|
|
905
905
|
if (T.length > 0) {
|
|
906
|
-
const
|
|
907
|
-
|
|
906
|
+
const _ = T[0];
|
|
907
|
+
_.uniforms.edges?.uniform && (L = Re(S, L, null, _.uniforms.edges.uniform));
|
|
908
908
|
}
|
|
909
|
-
|
|
909
|
+
$ = se(L, u, u.id, t);
|
|
910
910
|
} else {
|
|
911
911
|
if (g.find((T) => T.index === y)) continue;
|
|
912
|
-
if (c)
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
912
|
+
if (c) {
|
|
913
|
+
if (Ve(u)) $ = Ie(u.id, t, o);
|
|
914
|
+
else if (H(u)) {
|
|
915
|
+
const S = Ye(u.id);
|
|
916
|
+
S.length > 1 ? $ = He(S, t, o) : $ = j(u.id, t, o);
|
|
917
|
+
} else $ = j(u.id, t, o);
|
|
918
|
+
const T = g.filter((S) => S.index > y).sort((S, O) => S.index - O.index).map((S) => S.node);
|
|
919
|
+
if (T.length > 0) {
|
|
920
|
+
const S = _e($);
|
|
921
|
+
let O = Ce;
|
|
922
|
+
for (let J = T.length - 1; J >= 0; J--) {
|
|
923
|
+
const A = T[J];
|
|
924
|
+
A.uvTransformFunc && (O = A.uvTransformFunc({
|
|
925
|
+
uv: O,
|
|
926
|
+
uniforms: A.uniforms,
|
|
927
|
+
viewportSize: ye
|
|
928
|
+
})), A.transformUniforms && A.metadata.transform && fe(A.metadata.transform) && (O = Ue(O, A.transformUniforms.offsetX, A.transformUniforms.offsetY, A.transformUniforms.rotation, A.transformUniforms.scale, A.transformUniforms.anchorX, A.transformUniforms.anchorY, A.transformUniforms.aspectRatio), A.transformUniforms.edges && (O = ce(O, A.transformUniforms.edges)), A.transformRTTActive = !0), A.uniforms.edges?.uniform && (O = ce(O, A.uniforms.edges.uniform));
|
|
929
|
+
}
|
|
930
|
+
$ = S.sample(O);
|
|
931
|
+
const Q = T[T.length - 1];
|
|
932
|
+
Q.transformUniforms?.edges && ($ = Re(O, $, S, Q.transformUniforms.edges));
|
|
933
|
+
}
|
|
934
|
+
} else {
|
|
935
|
+
u.cleanupCallbacks.forEach((A) => {
|
|
919
936
|
try {
|
|
920
|
-
|
|
921
|
-
} catch (
|
|
922
|
-
console.error("Cleanup error:",
|
|
937
|
+
A();
|
|
938
|
+
} catch (L) {
|
|
939
|
+
console.error("Cleanup error:", L);
|
|
923
940
|
}
|
|
924
|
-
}),
|
|
925
|
-
const T = (
|
|
926
|
-
let
|
|
927
|
-
|
|
928
|
-
uniforms:
|
|
929
|
-
childNode:
|
|
941
|
+
}), u.cleanupCallbacks = [], u.beforeRenderCallbacks = [], u.afterRenderCallbacks = [], u.resizeCallbacks = [];
|
|
942
|
+
const T = (A) => u.cleanupCallbacks.push(A), S = (A) => u.beforeRenderCallbacks.push(A), O = (A) => u.afterRenderCallbacks.push(A), Q = (A) => u.resizeCallbacks.push(A);
|
|
943
|
+
let J = E;
|
|
944
|
+
u.requiresRTT && E !== void 0 && (J = K(x(0, 0, 0, 0), E, "normal", 1)), $ = se(le(u.fragmentNodeFunc({
|
|
945
|
+
uniforms: u.uniforms ?? {},
|
|
946
|
+
childNode: J,
|
|
930
947
|
onCleanup: T,
|
|
931
|
-
onBeforeRender:
|
|
932
|
-
onAfterRender:
|
|
933
|
-
onResize:
|
|
948
|
+
onBeforeRender: S,
|
|
949
|
+
onAfterRender: O,
|
|
950
|
+
onResize: Q,
|
|
934
951
|
canvas: e,
|
|
935
952
|
dimensions: {
|
|
936
|
-
width:
|
|
937
|
-
height:
|
|
953
|
+
width: z,
|
|
954
|
+
height: F
|
|
938
955
|
},
|
|
939
956
|
renderer: n
|
|
940
|
-
}),
|
|
957
|
+
}), u), u, u.id, t);
|
|
941
958
|
}
|
|
942
959
|
}
|
|
943
|
-
|
|
960
|
+
u.requiresChild && u.metadata.blendMode === "normal" && !c ? E = K(x(0, 0, 0, 0), $, "normal", u.opacityUniform) : E === void 0 ? E = K(x(1, 1, 1, 0), $, u.metadata.blendMode, u.opacityUniform) : E = K(E, $, u.metadata.blendMode, u.opacityUniform);
|
|
944
961
|
}
|
|
945
|
-
return console.log(`[Shaders Perf] Node processing: ${(performance.now() -
|
|
946
|
-
}, j = (
|
|
947
|
-
if (
|
|
948
|
-
const f = h.nodes.get(
|
|
949
|
-
if (!f) return
|
|
962
|
+
return console.log(`[Shaders Perf] Node processing: ${(performance.now() - M).toFixed(2)}ms`), console.log(`[Shaders Perf] TOTAL composeSiblingsWithUVContext: ${(performance.now() - l).toFixed(2)}ms`), E ?? x(0, 0, 0, 0);
|
|
963
|
+
}, j = (s, t = /* @__PURE__ */ new Set(), o, l = !1) => {
|
|
964
|
+
if (z === 0 || F === 0) return x(0, 0, 0, 0);
|
|
965
|
+
const f = h.nodes.get(s);
|
|
966
|
+
if (!f) return x(0, 0, 0, 0);
|
|
950
967
|
const b = (y) => {
|
|
951
968
|
f.cleanupCallbacks.push(y);
|
|
952
969
|
}, g = (y) => {
|
|
953
970
|
f.beforeRenderCallbacks.push(y);
|
|
954
971
|
}, w = (y) => {
|
|
955
972
|
f.afterRenderCallbacks.push(y);
|
|
956
|
-
},
|
|
973
|
+
}, M = (y) => {
|
|
957
974
|
f.resizeCallbacks.push(y);
|
|
958
|
-
},
|
|
959
|
-
if (
|
|
960
|
-
return f.requiresRTT && !
|
|
975
|
+
}, E = W(s);
|
|
976
|
+
if (E.length === 0)
|
|
977
|
+
return f.requiresRTT && !te ? x(0, 0, 0, 0) : (f.cleanupCallbacks.forEach((y) => {
|
|
961
978
|
try {
|
|
962
979
|
y();
|
|
963
|
-
} catch (
|
|
964
|
-
console.error("Error in cleanup callback:",
|
|
980
|
+
} catch (u) {
|
|
981
|
+
console.error("Error in cleanup callback:", u);
|
|
965
982
|
}
|
|
966
|
-
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [],
|
|
983
|
+
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [], se(le(f.fragmentNodeFunc({
|
|
967
984
|
uniforms: f.uniforms ?? {},
|
|
968
985
|
childNode: void 0,
|
|
969
986
|
onCleanup: b,
|
|
970
987
|
onBeforeRender: g,
|
|
971
988
|
onAfterRender: w,
|
|
972
|
-
onResize:
|
|
989
|
+
onResize: M,
|
|
973
990
|
canvas: e,
|
|
974
991
|
dimensions: {
|
|
975
|
-
width:
|
|
976
|
-
height:
|
|
992
|
+
width: z,
|
|
993
|
+
height: F
|
|
977
994
|
},
|
|
978
995
|
renderer: n
|
|
979
|
-
}), f), f,
|
|
996
|
+
}), f), f, s, t));
|
|
980
997
|
{
|
|
981
|
-
const y = [...
|
|
998
|
+
const y = [...E].sort((u, v) => u.metadata.renderOrder - v.metadata.renderOrder);
|
|
982
999
|
if (f.parentId === null) {
|
|
983
|
-
if (!l &&
|
|
984
|
-
let
|
|
1000
|
+
if (!l && sn(y)) return se(le(an(y, t, o), f), f, s, t);
|
|
1001
|
+
let u;
|
|
985
1002
|
for (let v = 0; v < y.length; v++) {
|
|
986
1003
|
const c = y[v];
|
|
987
|
-
let
|
|
988
|
-
if (c.metadata.opacity === void 0 ? (
|
|
1004
|
+
let $;
|
|
1005
|
+
if (c.metadata.opacity === void 0 ? ($ = 1, c.opacityUniform.value = $) : ($ = c.metadata.opacity, c.opacityUniform.value = $), c.metadata.visible === !1) continue;
|
|
989
1006
|
o && o.add(c.id);
|
|
990
|
-
const
|
|
1007
|
+
const P = W(c.id).length > 0;
|
|
991
1008
|
let T;
|
|
992
|
-
if (
|
|
993
|
-
else if (
|
|
1009
|
+
if (P) if (l) T = j(c.id, t, o, !0);
|
|
1010
|
+
else if (Ve(c)) T = Ie(c.id, t, o);
|
|
994
1011
|
else if (H(c)) {
|
|
995
|
-
const
|
|
996
|
-
|
|
1012
|
+
const S = Ye(c.id);
|
|
1013
|
+
S.length > 1 ? T = He(S, t, o) : T = j(c.id, t, o);
|
|
997
1014
|
} else T = j(c.id, t, o);
|
|
998
1015
|
else {
|
|
999
|
-
if (H(c) && c.requiresChild &&
|
|
1000
|
-
const
|
|
1001
|
-
if (
|
|
1002
|
-
T = on(
|
|
1016
|
+
if (H(c) && c.requiresChild && u !== void 0) {
|
|
1017
|
+
const S = tn(y, v);
|
|
1018
|
+
if (S.length > 1) {
|
|
1019
|
+
T = on(S, u, o), v += S.length - 1, u = T;
|
|
1003
1020
|
continue;
|
|
1004
1021
|
}
|
|
1005
1022
|
}
|
|
1006
|
-
if (c.requiresRTT && !
|
|
1023
|
+
if (c.requiresRTT && !te) T = x(0, 0, 0, 0);
|
|
1007
1024
|
else {
|
|
1008
|
-
const
|
|
1009
|
-
c.cleanupCallbacks.push(
|
|
1010
|
-
},
|
|
1011
|
-
c.beforeRenderCallbacks.push(
|
|
1012
|
-
},
|
|
1013
|
-
c.afterRenderCallbacks.push(
|
|
1014
|
-
},
|
|
1015
|
-
c.resizeCallbacks.push(
|
|
1025
|
+
const S = (L) => {
|
|
1026
|
+
c.cleanupCallbacks.push(L);
|
|
1027
|
+
}, O = (L) => {
|
|
1028
|
+
c.beforeRenderCallbacks.push(L);
|
|
1029
|
+
}, Q = (L) => {
|
|
1030
|
+
c.afterRenderCallbacks.push(L);
|
|
1031
|
+
}, J = (L) => {
|
|
1032
|
+
c.resizeCallbacks.push(L);
|
|
1016
1033
|
};
|
|
1017
|
-
let
|
|
1018
|
-
c.requiresRTT &&
|
|
1034
|
+
let A = u;
|
|
1035
|
+
c.requiresRTT && u !== void 0 && (A = K(x(0, 0, 0, 0), u, "normal", 1)), c.cleanupCallbacks.forEach((L) => {
|
|
1019
1036
|
try {
|
|
1020
|
-
|
|
1021
|
-
} catch (
|
|
1022
|
-
console.error("Error in cleanup callback:",
|
|
1037
|
+
L();
|
|
1038
|
+
} catch (_) {
|
|
1039
|
+
console.error("Error in cleanup callback:", _);
|
|
1023
1040
|
}
|
|
1024
|
-
}), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T =
|
|
1041
|
+
}), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T = se(le(c.fragmentNodeFunc({
|
|
1025
1042
|
uniforms: c.uniforms ?? {},
|
|
1026
|
-
childNode:
|
|
1027
|
-
onCleanup:
|
|
1028
|
-
onBeforeRender:
|
|
1029
|
-
onAfterRender:
|
|
1030
|
-
onResize:
|
|
1043
|
+
childNode: A,
|
|
1044
|
+
onCleanup: S,
|
|
1045
|
+
onBeforeRender: O,
|
|
1046
|
+
onAfterRender: Q,
|
|
1047
|
+
onResize: J,
|
|
1031
1048
|
canvas: e,
|
|
1032
1049
|
dimensions: {
|
|
1033
|
-
width:
|
|
1034
|
-
height:
|
|
1050
|
+
width: z,
|
|
1051
|
+
height: F
|
|
1035
1052
|
},
|
|
1036
1053
|
renderer: n
|
|
1037
1054
|
}), c), c, c.id, t);
|
|
1038
1055
|
}
|
|
1039
1056
|
}
|
|
1040
|
-
c.requiresChild && c.metadata.blendMode === "normal" && !
|
|
1057
|
+
c.requiresChild && c.metadata.blendMode === "normal" && !P ? u = K(x(0, 0, 0, 0), T, "normal", c.opacityUniform) : u === void 0 ? f.requiresRTT || $ !== 1 ? u = K(x(1, 1, 1, 0), T, c.metadata.blendMode, c.opacityUniform) : u = T : u = K(u, T, c.metadata.blendMode, c.opacityUniform);
|
|
1041
1058
|
}
|
|
1042
|
-
return f.requiresRTT && !
|
|
1059
|
+
return f.requiresRTT && !te ? x(0, 0, 0, 0) : (f.cleanupCallbacks.forEach((v) => {
|
|
1043
1060
|
try {
|
|
1044
1061
|
v();
|
|
1045
1062
|
} catch (c) {
|
|
1046
1063
|
console.error("Error in cleanup callback:", c);
|
|
1047
1064
|
}
|
|
1048
|
-
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [],
|
|
1065
|
+
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [], se(le(f.fragmentNodeFunc({
|
|
1049
1066
|
uniforms: f.uniforms ?? {},
|
|
1050
|
-
childNode:
|
|
1067
|
+
childNode: u,
|
|
1051
1068
|
onCleanup: b,
|
|
1052
1069
|
onBeforeRender: g,
|
|
1053
1070
|
onAfterRender: w,
|
|
1054
|
-
onResize:
|
|
1071
|
+
onResize: M,
|
|
1055
1072
|
canvas: e,
|
|
1056
1073
|
dimensions: {
|
|
1057
|
-
width:
|
|
1058
|
-
height:
|
|
1074
|
+
width: z,
|
|
1075
|
+
height: F
|
|
1059
1076
|
},
|
|
1060
1077
|
renderer: n
|
|
1061
|
-
}), f), f,
|
|
1078
|
+
}), f), f, s, t));
|
|
1062
1079
|
} else {
|
|
1063
|
-
if (!l &&
|
|
1064
|
-
const v =
|
|
1065
|
-
return
|
|
1080
|
+
if (!l && sn(y)) {
|
|
1081
|
+
const v = an(y, t, o);
|
|
1082
|
+
return se(le(f.fragmentNodeFunc({
|
|
1066
1083
|
uniforms: f.uniforms ?? {},
|
|
1067
1084
|
childNode: v,
|
|
1068
1085
|
onCleanup: b,
|
|
1069
1086
|
onBeforeRender: g,
|
|
1070
1087
|
onAfterRender: w,
|
|
1071
|
-
onResize:
|
|
1088
|
+
onResize: M,
|
|
1072
1089
|
canvas: e,
|
|
1073
1090
|
dimensions: {
|
|
1074
|
-
width:
|
|
1075
|
-
height:
|
|
1091
|
+
width: z,
|
|
1092
|
+
height: F
|
|
1076
1093
|
},
|
|
1077
1094
|
renderer: n
|
|
1078
|
-
}), f), f,
|
|
1095
|
+
}), f), f, s, t);
|
|
1079
1096
|
}
|
|
1080
|
-
let
|
|
1097
|
+
let u;
|
|
1081
1098
|
for (let v = 0; v < y.length; v++) {
|
|
1082
1099
|
const c = y[v];
|
|
1083
|
-
let
|
|
1084
|
-
if (c.metadata.opacity === void 0 ? (
|
|
1100
|
+
let $;
|
|
1101
|
+
if (c.metadata.opacity === void 0 ? ($ = 1, c.opacityUniform.value = $) : ($ = c.metadata.opacity, c.opacityUniform.value = $), c.metadata.visible === !1) continue;
|
|
1085
1102
|
o && o.add(c.id);
|
|
1086
|
-
const
|
|
1103
|
+
const P = W(c.id).length > 0;
|
|
1087
1104
|
let T;
|
|
1088
|
-
if (
|
|
1089
|
-
else if (
|
|
1105
|
+
if (P) if (l) T = j(c.id, t, o, !0);
|
|
1106
|
+
else if (Ve(c)) T = Ie(c.id, t, o);
|
|
1090
1107
|
else if (H(c)) {
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1108
|
+
const S = Ye(c.id);
|
|
1109
|
+
S.length > 1 ? T = He(S, t, o) : T = j(c.id, t, o);
|
|
1093
1110
|
} else T = j(c.id, t, o);
|
|
1094
1111
|
else {
|
|
1095
|
-
if (H(c) && c.requiresChild &&
|
|
1096
|
-
const
|
|
1097
|
-
if (
|
|
1098
|
-
T = on(
|
|
1112
|
+
if (H(c) && c.requiresChild && u !== void 0) {
|
|
1113
|
+
const S = tn(y, v);
|
|
1114
|
+
if (S.length > 1) {
|
|
1115
|
+
T = on(S, u, o), v += S.length - 1, u = T;
|
|
1099
1116
|
continue;
|
|
1100
1117
|
}
|
|
1101
1118
|
}
|
|
1102
|
-
if (c.requiresRTT && !
|
|
1119
|
+
if (c.requiresRTT && !te) T = x(0, 0, 0, 0);
|
|
1103
1120
|
else {
|
|
1104
|
-
const
|
|
1105
|
-
c.cleanupCallbacks.push(
|
|
1106
|
-
},
|
|
1107
|
-
c.beforeRenderCallbacks.push(
|
|
1108
|
-
},
|
|
1109
|
-
c.afterRenderCallbacks.push(
|
|
1110
|
-
},
|
|
1111
|
-
c.resizeCallbacks.push(
|
|
1121
|
+
const S = (L) => {
|
|
1122
|
+
c.cleanupCallbacks.push(L);
|
|
1123
|
+
}, O = (L) => {
|
|
1124
|
+
c.beforeRenderCallbacks.push(L);
|
|
1125
|
+
}, Q = (L) => {
|
|
1126
|
+
c.afterRenderCallbacks.push(L);
|
|
1127
|
+
}, J = (L) => {
|
|
1128
|
+
c.resizeCallbacks.push(L);
|
|
1112
1129
|
};
|
|
1113
|
-
let
|
|
1114
|
-
c.requiresRTT &&
|
|
1130
|
+
let A = u;
|
|
1131
|
+
c.requiresRTT && u !== void 0 && (A = K(x(0, 0, 0, 0), u, "normal", 1)), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T = se(le(c.fragmentNodeFunc({
|
|
1115
1132
|
uniforms: c.uniforms ?? {},
|
|
1116
|
-
childNode:
|
|
1117
|
-
onCleanup:
|
|
1118
|
-
onBeforeRender:
|
|
1119
|
-
onAfterRender:
|
|
1120
|
-
onResize:
|
|
1133
|
+
childNode: A,
|
|
1134
|
+
onCleanup: S,
|
|
1135
|
+
onBeforeRender: O,
|
|
1136
|
+
onAfterRender: Q,
|
|
1137
|
+
onResize: J,
|
|
1121
1138
|
canvas: e,
|
|
1122
1139
|
dimensions: {
|
|
1123
|
-
width:
|
|
1124
|
-
height:
|
|
1140
|
+
width: z,
|
|
1141
|
+
height: F
|
|
1125
1142
|
},
|
|
1126
1143
|
renderer: n
|
|
1127
1144
|
}), c), c, c.id, t);
|
|
1128
1145
|
}
|
|
1129
1146
|
}
|
|
1130
|
-
c.requiresChild && c.metadata.blendMode === "normal" && !
|
|
1147
|
+
c.requiresChild && c.metadata.blendMode === "normal" && !P ? u = K(x(0, 0, 0, 0), T, "normal", c.opacityUniform) : u === void 0 ? f.requiresRTT || $ !== 1 ? u = K(x(1, 1, 1, 0), T, c.metadata.blendMode, c.opacityUniform) : u = T : u = K(u, T, c.metadata.blendMode, c.opacityUniform);
|
|
1131
1148
|
}
|
|
1132
|
-
return f.requiresRTT && !
|
|
1149
|
+
return f.requiresRTT && !te ? x(0, 0, 0, 0) : (f.cleanupCallbacks.forEach((v) => {
|
|
1133
1150
|
try {
|
|
1134
1151
|
v();
|
|
1135
1152
|
} catch (c) {
|
|
1136
1153
|
console.error("Error in cleanup callback:", c);
|
|
1137
1154
|
}
|
|
1138
|
-
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [],
|
|
1155
|
+
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [], se(le(f.fragmentNodeFunc({
|
|
1139
1156
|
uniforms: f.uniforms ?? {},
|
|
1140
|
-
childNode:
|
|
1157
|
+
childNode: u,
|
|
1141
1158
|
onCleanup: b,
|
|
1142
1159
|
onBeforeRender: g,
|
|
1143
1160
|
onAfterRender: w,
|
|
1144
|
-
onResize:
|
|
1161
|
+
onResize: M,
|
|
1145
1162
|
canvas: e,
|
|
1146
1163
|
dimensions: {
|
|
1147
|
-
width:
|
|
1148
|
-
height:
|
|
1164
|
+
width: z,
|
|
1165
|
+
height: F
|
|
1149
1166
|
},
|
|
1150
1167
|
renderer: n
|
|
1151
|
-
}), f), f,
|
|
1168
|
+
}), f), f, s, t));
|
|
1152
1169
|
}
|
|
1153
1170
|
}
|
|
1154
|
-
}, ln = (
|
|
1171
|
+
}, ln = (s, t, o, l, f = {}, b) => {
|
|
1155
1172
|
if (t === null) {
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1158
|
-
|
|
1173
|
+
const u = oe.findIndex((v) => v.id === s);
|
|
1174
|
+
if (u !== -1) {
|
|
1175
|
+
oe.splice(u, 1);
|
|
1159
1176
|
return;
|
|
1160
1177
|
}
|
|
1161
|
-
We(
|
|
1178
|
+
We(s);
|
|
1162
1179
|
return;
|
|
1163
1180
|
}
|
|
1164
|
-
if (!
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
id:
|
|
1181
|
+
if (!Ge) {
|
|
1182
|
+
const u = oe.findIndex((v) => v.id === s);
|
|
1183
|
+
u !== -1 ? oe[u] = {
|
|
1184
|
+
id: s,
|
|
1168
1185
|
fragmentNodeFunc: t,
|
|
1169
1186
|
parentId: o,
|
|
1170
1187
|
metadata: l,
|
|
1171
1188
|
uniforms: f,
|
|
1172
1189
|
componentDefinition: b
|
|
1173
|
-
} :
|
|
1174
|
-
id:
|
|
1190
|
+
} : oe.push({
|
|
1191
|
+
id: s,
|
|
1175
1192
|
fragmentNodeFunc: t,
|
|
1176
1193
|
parentId: o,
|
|
1177
1194
|
metadata: l,
|
|
@@ -1182,21 +1199,21 @@ function ca() {
|
|
|
1182
1199
|
}
|
|
1183
1200
|
let g = 0;
|
|
1184
1201
|
if (o !== null) {
|
|
1185
|
-
const
|
|
1186
|
-
if (
|
|
1202
|
+
const u = d.get(o);
|
|
1203
|
+
if (u && u.size > 0) {
|
|
1187
1204
|
let v = 0;
|
|
1188
|
-
for (const c of
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1205
|
+
for (const c of u) {
|
|
1206
|
+
const $ = h.nodes.get(c);
|
|
1207
|
+
$ && $.metadata.renderOrder > v && (v = $.metadata.renderOrder);
|
|
1191
1208
|
}
|
|
1192
1209
|
g = v + 1;
|
|
1193
1210
|
}
|
|
1194
1211
|
}
|
|
1195
1212
|
const w = G(l?.opacity !== void 0 ? l.opacity : 1);
|
|
1196
|
-
let
|
|
1213
|
+
let M;
|
|
1197
1214
|
if (l?.transform) {
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1215
|
+
const u = z / Math.max(1, F);
|
|
1216
|
+
M = {
|
|
1200
1217
|
offsetX: G(l.transform.offsetX),
|
|
1201
1218
|
offsetY: G(l.transform.offsetY),
|
|
1202
1219
|
rotation: G(l.transform.rotation),
|
|
@@ -1204,11 +1221,11 @@ function ca() {
|
|
|
1204
1221
|
anchorX: G(l.transform.anchorX),
|
|
1205
1222
|
anchorY: G(l.transform.anchorY),
|
|
1206
1223
|
edges: G(l.transform.edges === "stretch" ? 0 : l.transform.edges === "transparent" ? 1 : l.transform.edges === "mirror" ? 2 : 3),
|
|
1207
|
-
aspectRatio: G(
|
|
1224
|
+
aspectRatio: G(u)
|
|
1208
1225
|
};
|
|
1209
1226
|
}
|
|
1210
|
-
const
|
|
1211
|
-
id:
|
|
1227
|
+
const E = {
|
|
1228
|
+
id: s,
|
|
1212
1229
|
componentName: b?.name || "Unknown",
|
|
1213
1230
|
fragmentNodeFunc: t,
|
|
1214
1231
|
parentId: o,
|
|
@@ -1229,20 +1246,20 @@ function ca() {
|
|
|
1229
1246
|
beforeRenderCallbacks: [],
|
|
1230
1247
|
afterRenderCallbacks: [],
|
|
1231
1248
|
resizeCallbacks: [],
|
|
1232
|
-
transformUniforms:
|
|
1249
|
+
transformUniforms: M,
|
|
1233
1250
|
transformRTTActive: !1,
|
|
1234
1251
|
uvTransformFunc: b?.uvTransformNode,
|
|
1235
1252
|
acceptsUVContext: b?.acceptsUVContext || !1
|
|
1236
1253
|
};
|
|
1237
|
-
h.nodes.set(
|
|
1254
|
+
h.nodes.set(s, E), o === null && (h.rootId = s);
|
|
1238
1255
|
const y = d.get(o) || /* @__PURE__ */ new Set();
|
|
1239
|
-
y.add(
|
|
1240
|
-
|
|
1241
|
-
}))) : p &&
|
|
1242
|
-
|
|
1256
|
+
y.add(s), d.set(o, y), p && B && z > 0 && F > 0 ? (Ee.includes(s) || Ee.push(s), ge === null && (ge = requestAnimationFrame(() => {
|
|
1257
|
+
ge = null, Ee = [], he();
|
|
1258
|
+
}))) : p && B && (ve || (ve = !0, requestAnimationFrame(() => {
|
|
1259
|
+
ve = !1, z > 0 && F > 0 && he();
|
|
1243
1260
|
})));
|
|
1244
|
-
},
|
|
1245
|
-
const l = h.nodes.get(
|
|
1261
|
+
}, zn = (s, t, o) => {
|
|
1262
|
+
const l = h.nodes.get(s);
|
|
1246
1263
|
if (!l || !l.uniforms) return;
|
|
1247
1264
|
const f = l.uniforms[t];
|
|
1248
1265
|
if (!(!f || !f.uniform)) {
|
|
@@ -1250,18 +1267,18 @@ function ca() {
|
|
|
1250
1267
|
const { updateUniformValue: b } = (Sn(), Hn(qt));
|
|
1251
1268
|
b(f, o);
|
|
1252
1269
|
} else f.uniform.value = o;
|
|
1253
|
-
N &&
|
|
1270
|
+
N && re();
|
|
1254
1271
|
}
|
|
1255
|
-
}, Fn = (
|
|
1256
|
-
const o = h.nodes.get(
|
|
1272
|
+
}, Fn = (s, t) => {
|
|
1273
|
+
const o = h.nodes.get(s);
|
|
1257
1274
|
if (!o) return;
|
|
1258
1275
|
let l = !1;
|
|
1259
1276
|
t.blendMode !== void 0 && o.metadata.blendMode !== t.blendMode && (o.metadata.blendMode = t.blendMode, l = !0), t.opacity !== void 0 && o.metadata.opacity !== t.opacity && (o.metadata.opacity = t.opacity, o.opacityUniform.value = t.opacity), t.renderOrder !== void 0 && o.metadata.renderOrder !== t.renderOrder && (o.metadata.renderOrder = t.renderOrder, l = !0);
|
|
1260
1277
|
const f = t.visible !== !1;
|
|
1261
1278
|
if (o.metadata.visible !== f && (o.metadata.visible = f, l = !0), t.id !== void 0 && o.metadata.id !== t.id && (o.metadata.id = t.id, l = !0), t.mask !== void 0 && (o.metadata.mask?.source !== t.mask?.source || o.metadata.mask?.type !== t.mask?.type) && (o.metadata.mask = t.mask, l = !0), t.transform !== void 0) {
|
|
1262
|
-
const b = o.metadata.transform ?
|
|
1279
|
+
const b = o.metadata.transform ? fe(o.metadata.transform) : !1, g = fe(t.transform);
|
|
1263
1280
|
if (o.metadata.transform = t.transform, !o.transformUniforms && t.transform) {
|
|
1264
|
-
const w =
|
|
1281
|
+
const w = z / Math.max(1, F);
|
|
1265
1282
|
o.transformUniforms = {
|
|
1266
1283
|
offsetX: G(t.transform.offsetX),
|
|
1267
1284
|
offsetY: G(t.transform.offsetY),
|
|
@@ -1275,35 +1292,35 @@ function ca() {
|
|
|
1275
1292
|
} else o.transformUniforms && (o.transformUniforms.offsetX.value = t.transform.offsetX, o.transformUniforms.offsetY.value = t.transform.offsetY, o.transformUniforms.rotation.value = t.transform.rotation, o.transformUniforms.scale.value = t.transform.scale, o.transformUniforms.anchorX.value = t.transform.anchorX, o.transformUniforms.anchorY.value = t.transform.anchorY, o.transformUniforms.edges.value = t.transform.edges === "stretch" ? 0 : t.transform.edges === "transparent" ? 1 : t.transform.edges === "mirror" ? 2 : 3);
|
|
1276
1293
|
g && !o.transformRTTActive && (o.transformRTTActive = !0, l = !0), !b && g && !o.transformRTTActive && (l = !0);
|
|
1277
1294
|
}
|
|
1278
|
-
l && p &&
|
|
1279
|
-
|
|
1280
|
-
}))) : N &&
|
|
1281
|
-
}, We = (
|
|
1282
|
-
if (!h.nodes.has(
|
|
1283
|
-
const t = h.nodes.get(
|
|
1295
|
+
l && p && B ? (Oe.includes(s) || Oe.push(s), be === null && (be = requestAnimationFrame(() => {
|
|
1296
|
+
be = null, Oe = [], he();
|
|
1297
|
+
}))) : N && re();
|
|
1298
|
+
}, We = (s) => {
|
|
1299
|
+
if (!h.nodes.has(s)) return;
|
|
1300
|
+
const t = h.nodes.get(s);
|
|
1284
1301
|
if (t && t.cleanupCallbacks.length > 0) for (const l of t.cleanupCallbacks) try {
|
|
1285
1302
|
l();
|
|
1286
1303
|
} catch (f) {
|
|
1287
|
-
console.error(`Error executing cleanup callback for node ${
|
|
1304
|
+
console.error(`Error executing cleanup callback for node ${s}:`, f);
|
|
1288
1305
|
}
|
|
1289
|
-
const o = W(
|
|
1306
|
+
const o = W(s);
|
|
1290
1307
|
for (const l of o) We(l.id);
|
|
1291
|
-
if (h.rootId ===
|
|
1308
|
+
if (h.rootId === s && (h.rootId = null), t) {
|
|
1292
1309
|
const l = d.get(t.parentId);
|
|
1293
|
-
l && (l.delete(
|
|
1310
|
+
l && (l.delete(s), l.size === 0 && d.delete(t.parentId));
|
|
1294
1311
|
}
|
|
1295
|
-
h.nodes.delete(
|
|
1296
|
-
}, En = (
|
|
1312
|
+
h.nodes.delete(s), p && B && he();
|
|
1313
|
+
}, En = (s) => {
|
|
1297
1314
|
const t = {
|
|
1298
|
-
deltaTime:
|
|
1315
|
+
deltaTime: s,
|
|
1299
1316
|
pointer: {
|
|
1300
|
-
x:
|
|
1301
|
-
y:
|
|
1317
|
+
x: $e,
|
|
1318
|
+
y: De
|
|
1302
1319
|
},
|
|
1303
|
-
pointerActive:
|
|
1320
|
+
pointerActive: ue,
|
|
1304
1321
|
dimensions: {
|
|
1305
|
-
width:
|
|
1306
|
-
height:
|
|
1322
|
+
width: z,
|
|
1323
|
+
height: F
|
|
1307
1324
|
}
|
|
1308
1325
|
};
|
|
1309
1326
|
for (const o of h.nodes.values()) if (o.beforeRenderCallbacks.length > 0) for (const l of o.beforeRenderCallbacks) try {
|
|
@@ -1311,17 +1328,17 @@ function ca() {
|
|
|
1311
1328
|
} catch (f) {
|
|
1312
1329
|
console.error(`Error executing before render callback for node ${o.id}:`, f);
|
|
1313
1330
|
}
|
|
1314
|
-
}, On = (
|
|
1331
|
+
}, On = (s) => {
|
|
1315
1332
|
const t = {
|
|
1316
|
-
deltaTime:
|
|
1333
|
+
deltaTime: s,
|
|
1317
1334
|
pointer: {
|
|
1318
|
-
x:
|
|
1319
|
-
y:
|
|
1335
|
+
x: $e,
|
|
1336
|
+
y: De
|
|
1320
1337
|
},
|
|
1321
|
-
pointerActive:
|
|
1338
|
+
pointerActive: ue,
|
|
1322
1339
|
dimensions: {
|
|
1323
|
-
width:
|
|
1324
|
-
height:
|
|
1340
|
+
width: z,
|
|
1341
|
+
height: F
|
|
1325
1342
|
}
|
|
1326
1343
|
};
|
|
1327
1344
|
for (const o of h.nodes.values()) if (o.afterRenderCallbacks.length > 0) for (const l of o.afterRenderCallbacks) try {
|
|
@@ -1329,24 +1346,24 @@ function ca() {
|
|
|
1329
1346
|
} catch (f) {
|
|
1330
1347
|
console.error(`Error executing after render callback for node ${o.id}:`, f);
|
|
1331
1348
|
}
|
|
1332
|
-
},
|
|
1349
|
+
}, re = async () => {
|
|
1333
1350
|
if (!Un()) return;
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1351
|
+
const s = de ? performance.now() : 0, t = s || performance.now(), o = qe > 0 ? (t - qe) / 1e3 : 0.016, l = Math.min(o, 0.1);
|
|
1352
|
+
qe = t, de && performance.mark("shader-cpu-start"), En(l);
|
|
1336
1353
|
try {
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1354
|
+
if (ze) return;
|
|
1355
|
+
de && performance.mark("shader-gpu-start");
|
|
1339
1356
|
const f = performance.now();
|
|
1340
|
-
n.render(r,
|
|
1357
|
+
n.render(r, a);
|
|
1341
1358
|
const b = performance.now() - f;
|
|
1342
|
-
if (b > 20 && console.log(`[Shaders Perf] renderer.render(): ${b.toFixed(2)}ms`), b > 100 && console.warn(`[Shaders Perf] ⚠️ SLOW RENDER! Likely GPU shader compilation: ${b.toFixed(0)}ms`), On(l),
|
|
1359
|
+
if (b > 20 && console.log(`[Shaders Perf] renderer.render(): ${b.toFixed(2)}ms`), b > 100 && console.warn(`[Shaders Perf] ⚠️ SLOW RENDER! Likely GPU shader compilation: ${b.toFixed(0)}ms`), On(l), de) {
|
|
1343
1360
|
if (performance.mark("shader-gpu-end"), n instanceof Je) try {
|
|
1344
1361
|
const g = n.backend;
|
|
1345
1362
|
if (g && g.get && g.get(n)) {
|
|
1346
1363
|
const w = g.get(n);
|
|
1347
1364
|
if (w?.timestampQuery) {
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1365
|
+
const M = w.timestampQuery.getResult();
|
|
1366
|
+
M != null && ie.recordGpuTime(M / 1e6);
|
|
1350
1367
|
}
|
|
1351
1368
|
}
|
|
1352
1369
|
} catch {
|
|
@@ -1358,7 +1375,7 @@ function ca() {
|
|
|
1358
1375
|
} catch {
|
|
1359
1376
|
}
|
|
1360
1377
|
}
|
|
1361
|
-
if (
|
|
1378
|
+
if (de) {
|
|
1362
1379
|
performance.mark("shader-cpu-end");
|
|
1363
1380
|
try {
|
|
1364
1381
|
performance.measure("shader-cpu-time", "shader-cpu-start", "shader-cpu-end");
|
|
@@ -1366,83 +1383,83 @@ function ca() {
|
|
|
1366
1383
|
w && ie.recordCpuTime(w.duration), performance.clearMarks("shader-cpu-start"), performance.clearMarks("shader-cpu-end"), performance.clearMeasures("shader-cpu-time");
|
|
1367
1384
|
} catch {
|
|
1368
1385
|
}
|
|
1369
|
-
const g = performance.now() -
|
|
1386
|
+
const g = performance.now() - s;
|
|
1370
1387
|
ie.recordFrame(g);
|
|
1371
1388
|
}
|
|
1372
1389
|
} catch (f) {
|
|
1373
1390
|
console.error("Render frame error:", f);
|
|
1374
1391
|
}
|
|
1375
1392
|
}, Bn = () => {
|
|
1376
|
-
const
|
|
1377
|
-
ie.updateNodeCounts(
|
|
1393
|
+
const s = Math.max(0, h.nodes.size - 1), t = Be;
|
|
1394
|
+
ie.updateNodeCounts(s, t);
|
|
1378
1395
|
}, Pn = () => {
|
|
1379
1396
|
Bn();
|
|
1380
|
-
const
|
|
1381
|
-
return ie.getStats(
|
|
1397
|
+
const s = n?.info;
|
|
1398
|
+
return ie.getStats(s);
|
|
1382
1399
|
}, je = () => {
|
|
1383
1400
|
if (R || !ae || !N) return;
|
|
1384
1401
|
ie.setRendering(!0);
|
|
1385
|
-
const
|
|
1386
|
-
R = requestAnimationFrame(
|
|
1402
|
+
const s = () => {
|
|
1403
|
+
R = requestAnimationFrame(s), re().catch(console.warn);
|
|
1387
1404
|
};
|
|
1388
|
-
|
|
1405
|
+
s();
|
|
1389
1406
|
}, Qe = () => {
|
|
1390
1407
|
R && (cancelAnimationFrame(R), R = null), ie.setRendering(!1);
|
|
1391
|
-
}, cn = (
|
|
1408
|
+
}, cn = (s) => {
|
|
1392
1409
|
if (!e) return;
|
|
1393
1410
|
let t, o;
|
|
1394
|
-
if ("touches" in
|
|
1395
|
-
if (
|
|
1396
|
-
t =
|
|
1411
|
+
if ("touches" in s) {
|
|
1412
|
+
if (s.touches.length === 0) return;
|
|
1413
|
+
t = s.touches[0].clientX, o = s.touches[0].clientY;
|
|
1397
1414
|
} else
|
|
1398
|
-
t =
|
|
1415
|
+
t = s.clientX, o = s.clientY;
|
|
1399
1416
|
const l = e.getBoundingClientRect(), f = (t - l.left) / l.width, b = (o - l.top) / l.height;
|
|
1400
|
-
|
|
1401
|
-
}, _n = (
|
|
1402
|
-
!
|
|
1403
|
-
}, Vn = (
|
|
1404
|
-
!
|
|
1417
|
+
$e = f, De = b;
|
|
1418
|
+
}, _n = (s) => {
|
|
1419
|
+
!B || !e || cn(s);
|
|
1420
|
+
}, Vn = (s) => {
|
|
1421
|
+
!B || !e || cn(s);
|
|
1405
1422
|
}, Ln = () => {
|
|
1406
|
-
|
|
1423
|
+
B && (ue = !1, re().catch(console.warn));
|
|
1407
1424
|
}, qn = () => {
|
|
1408
|
-
|
|
1425
|
+
B && (ue = !1, re().catch(console.warn));
|
|
1409
1426
|
}, fn = () => {
|
|
1410
|
-
|
|
1411
|
-
},
|
|
1412
|
-
|
|
1427
|
+
ue = !0, re().catch(console.warn);
|
|
1428
|
+
}, mn = () => {
|
|
1429
|
+
ue = !0, re().catch(console.warn);
|
|
1413
1430
|
}, Gn = () => {
|
|
1414
|
-
if (
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
for (const { id: t, fragmentNodeFunc: o, parentId: l, metadata: f, uniforms: b, componentDefinition: g } of
|
|
1418
|
-
}, Nn = async ({ canvas:
|
|
1419
|
-
if (
|
|
1420
|
-
|
|
1421
|
-
const o =
|
|
1431
|
+
if (oe.length === 0) return;
|
|
1432
|
+
const s = [...oe];
|
|
1433
|
+
oe = [];
|
|
1434
|
+
for (const { id: t, fragmentNodeFunc: o, parentId: l, metadata: f, uniforms: b, componentDefinition: g } of s) o && ln(t, o, l, f, b, g);
|
|
1435
|
+
}, Nn = async ({ canvas: s, enablePerformanceTracking: t = !1 }) => {
|
|
1436
|
+
if (B || ne) return;
|
|
1437
|
+
de = t, ne = !0, I = new AbortController();
|
|
1438
|
+
const o = I;
|
|
1422
1439
|
try {
|
|
1423
|
-
if (e =
|
|
1440
|
+
if (e = s, r = new Jn(), r.background = null, a = new Yn(-1, 1, 1, -1, 0.1, 10), a.position.z = 1, a.lookAt(0, 0, 0), Fe = Xt.register({
|
|
1424
1441
|
onMouseMove: _n,
|
|
1425
1442
|
onTouchMove: Vn,
|
|
1426
1443
|
onMouseUp: Ln,
|
|
1427
1444
|
onTouchEnd: qn
|
|
1428
|
-
}),
|
|
1429
|
-
|
|
1430
|
-
}, window.addEventListener("beforeunload",
|
|
1445
|
+
}), s.addEventListener("mousedown", fn), s.addEventListener("touchstart", mn), Te = () => {
|
|
1446
|
+
un();
|
|
1447
|
+
}, window.addEventListener("beforeunload", Te), o.signal.aborted) return;
|
|
1431
1448
|
try {
|
|
1432
|
-
const
|
|
1433
|
-
canvas:
|
|
1449
|
+
const E = {
|
|
1450
|
+
canvas: s,
|
|
1434
1451
|
antialias: !0,
|
|
1435
1452
|
alpha: !0,
|
|
1436
1453
|
depth: !1,
|
|
1437
1454
|
powerPreference: "high-performance"
|
|
1438
1455
|
};
|
|
1439
|
-
if (
|
|
1440
|
-
} catch (
|
|
1456
|
+
if (de && (E.forceWebGL = !1, E.requiredFeatures = ["timestamp-query"]), n = new Je(E), await n.init(), o.signal.aborted) return;
|
|
1457
|
+
} catch (E) {
|
|
1441
1458
|
if (o.signal.aborted) return;
|
|
1442
|
-
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:",
|
|
1459
|
+
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:", E);
|
|
1443
1460
|
try {
|
|
1444
|
-
if (n = new
|
|
1445
|
-
canvas:
|
|
1461
|
+
if (n = new st({
|
|
1462
|
+
canvas: s,
|
|
1446
1463
|
antialias: !0,
|
|
1447
1464
|
alpha: !0,
|
|
1448
1465
|
depth: !1,
|
|
@@ -1455,38 +1472,38 @@ function ca() {
|
|
|
1455
1472
|
}
|
|
1456
1473
|
}
|
|
1457
1474
|
if (o.signal.aborted) return;
|
|
1458
|
-
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace =
|
|
1459
|
-
const l =
|
|
1475
|
+
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace = In, p = new dn({ transparent: !0 }), p.fragmentNode = x(0, 0, 0, 0), m = new ar(new Kn(2, 2), p), r.add(m);
|
|
1476
|
+
const l = s.parentElement;
|
|
1460
1477
|
if (!l) {
|
|
1461
1478
|
console.warn("[Shaders] Canvas has no parent element for resize observation");
|
|
1462
1479
|
return;
|
|
1463
1480
|
}
|
|
1464
|
-
|
|
1465
|
-
const f =
|
|
1466
|
-
N = f.width > 0 && f.height > 0 && f.top < window.innerHeight && f.bottom > 0 && f.left < window.innerWidth && f.right > 0,
|
|
1467
|
-
const { width: b, height: g } =
|
|
1468
|
-
w > 0 &&
|
|
1481
|
+
U = new ResizeObserver(xn), U.observe(l), V = new IntersectionObserver(Mn, { threshold: 0 }), V.observe(s);
|
|
1482
|
+
const f = s.getBoundingClientRect();
|
|
1483
|
+
N = f.width > 0 && f.height > 0 && f.top < window.innerHeight && f.bottom > 0 && f.left < window.innerWidth && f.right > 0, te = N && f.width > 0 && f.height > 0, ae = !0;
|
|
1484
|
+
const { width: b, height: g } = s.getBoundingClientRect(), w = Math.round(b), M = Math.round(g);
|
|
1485
|
+
w > 0 && M > 0 ? (Xe(w, M), Y = !0, await re()) : Y = !1, ae && N && je(), o.signal.aborted || (B = !0, Ge = !0, Gn());
|
|
1469
1486
|
} catch (l) {
|
|
1470
1487
|
console.error("[Shaders] Initialization error:", l);
|
|
1471
1488
|
} finally {
|
|
1472
|
-
|
|
1489
|
+
ne = !1, I === o && (I = null);
|
|
1473
1490
|
}
|
|
1474
|
-
},
|
|
1475
|
-
!
|
|
1476
|
-
},
|
|
1477
|
-
if (
|
|
1491
|
+
}, Xn = () => {
|
|
1492
|
+
!Yt() || Tn || (console.warn("Shaders is running in development mode. Please purchase a license at https://shaders.com to use it in production."), Tn = !0);
|
|
1493
|
+
}, un = () => {
|
|
1494
|
+
if (I && I.abort(), U && (U.disconnect(), U = null), V && (V.disconnect(), V = null), Fe && (Fe(), Fe = null), e && (e.removeEventListener("mousedown", fn), e.removeEventListener("touchstart", mn)), Te && (window.removeEventListener("beforeunload", Te), Te = null), Qe(), rn(), ke.forEach((s) => {
|
|
1478
1495
|
try {
|
|
1479
|
-
|
|
1496
|
+
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
1480
1497
|
} catch {
|
|
1481
1498
|
}
|
|
1482
|
-
}),
|
|
1483
|
-
r && r.remove(
|
|
1499
|
+
}), ke.clear(), h.nodes.clear(), h.rootId = null, h.idToNodeId.clear(), d.clear(), oe = [], Ge = !1, Ee = [], ge !== null && (cancelAnimationFrame(ge), ge = null), Oe = [], be !== null && (cancelAnimationFrame(be), be = null), we = null, Pe = !1, m) {
|
|
1500
|
+
r && r.remove(m);
|
|
1484
1501
|
try {
|
|
1485
|
-
|
|
1502
|
+
m.geometry && typeof m.geometry.dispose == "function" && m.geometry.dispose();
|
|
1486
1503
|
} catch {
|
|
1487
1504
|
}
|
|
1488
1505
|
try {
|
|
1489
|
-
|
|
1506
|
+
m.material instanceof Qn && typeof m.material.dispose == "function" && m.material.dispose();
|
|
1490
1507
|
} catch {
|
|
1491
1508
|
}
|
|
1492
1509
|
}
|
|
@@ -1494,17 +1511,17 @@ function ca() {
|
|
|
1494
1511
|
n.dispose();
|
|
1495
1512
|
} catch {
|
|
1496
1513
|
}
|
|
1497
|
-
e = null, n = null,
|
|
1514
|
+
e = null, n = null, a = null, r = null, m = null, p = null, B = !1, ne = !1, Y = !1, I = null, z = 0, F = 0, N = !1, ae = !0, $e = 0.5, De = 0.5, ue = !1;
|
|
1498
1515
|
};
|
|
1499
1516
|
return {
|
|
1500
1517
|
initialize: Nn,
|
|
1501
|
-
cleanup:
|
|
1518
|
+
cleanup: un,
|
|
1502
1519
|
registerNode: ln,
|
|
1503
1520
|
removeNode: We,
|
|
1504
|
-
updateUniformValue:
|
|
1521
|
+
updateUniformValue: zn,
|
|
1505
1522
|
updateNodeMetadata: Fn,
|
|
1506
|
-
showLicenseWarning:
|
|
1507
|
-
isInitialized: () =>
|
|
1523
|
+
showLicenseWarning: Xn,
|
|
1524
|
+
isInitialized: () => B,
|
|
1508
1525
|
startAnimation: je,
|
|
1509
1526
|
stopAnimation: Qe,
|
|
1510
1527
|
getPerformanceStats: Pn,
|
|
@@ -1513,68 +1530,68 @@ function ca() {
|
|
|
1513
1530
|
};
|
|
1514
1531
|
}
|
|
1515
1532
|
Sn();
|
|
1516
|
-
function
|
|
1517
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1533
|
+
function fs(e) {
|
|
1534
|
+
const n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), r = {
|
|
1518
1535
|
processingOrder: [],
|
|
1519
1536
|
maskSources: /* @__PURE__ */ new Map(),
|
|
1520
1537
|
circularDependencies: []
|
|
1521
1538
|
};
|
|
1522
|
-
return e.forEach((
|
|
1523
|
-
|
|
1524
|
-
}), e.forEach((
|
|
1525
|
-
if (
|
|
1526
|
-
const p =
|
|
1527
|
-
h ? (
|
|
1539
|
+
return e.forEach((m) => {
|
|
1540
|
+
m.elementId && n.set(m.elementId, m.id);
|
|
1541
|
+
}), e.forEach((m) => {
|
|
1542
|
+
if (m.mask?.source) {
|
|
1543
|
+
const p = m.mask.source.startsWith("#") ? m.mask.source.substring(1) : m.mask.source, h = n.get(p);
|
|
1544
|
+
h ? (a.has(m.id) || a.set(m.id, []), a.get(m.id)?.push(h), r.maskSources.set(m.id, h)) : console.warn(`Mask source "${p}" not found for node "${m.id}"`);
|
|
1528
1545
|
}
|
|
1529
|
-
}), r.processingOrder =
|
|
1546
|
+
}), r.processingOrder = It(a, r.circularDependencies), r;
|
|
1530
1547
|
}
|
|
1531
|
-
function
|
|
1532
|
-
const
|
|
1548
|
+
function It(e, n) {
|
|
1549
|
+
const a = [], r = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
|
|
1533
1550
|
function p(d, R = []) {
|
|
1534
1551
|
if (r.has(d)) return;
|
|
1535
|
-
if (
|
|
1536
|
-
const
|
|
1537
|
-
n.push(
|
|
1552
|
+
if (m.has(d)) {
|
|
1553
|
+
const V = [...R.slice(R.indexOf(d)), d];
|
|
1554
|
+
n.push(V);
|
|
1538
1555
|
return;
|
|
1539
1556
|
}
|
|
1540
|
-
|
|
1541
|
-
const
|
|
1542
|
-
for (const
|
|
1543
|
-
|
|
1557
|
+
m.add(d), R.push(d);
|
|
1558
|
+
const U = e.get(d) || [];
|
|
1559
|
+
for (const V of U) p(V, [...R]);
|
|
1560
|
+
m.delete(d), r.add(d), a.push(d);
|
|
1544
1561
|
}
|
|
1545
1562
|
for (const d of e.keys()) r.has(d) || p(d);
|
|
1546
1563
|
const h = new Set([...e.values()].flat());
|
|
1547
|
-
for (const d of h) !r.has(d) && !e.has(d) &&
|
|
1548
|
-
return
|
|
1564
|
+
for (const d of h) !r.has(d) && !e.has(d) && a.push(d);
|
|
1565
|
+
return a.reverse();
|
|
1549
1566
|
}
|
|
1550
|
-
|
|
1551
|
-
var { vec2: Ht, fract: Wt, sin: jt, dot: Qt } =
|
|
1552
|
-
const Jt = (e) => Wt(jt(Qt(e, Ht(12.12345, 78.12345))).mul(40000.12345)),
|
|
1553
|
-
|
|
1554
|
-
var { vec2: Kt } =
|
|
1555
|
-
const
|
|
1556
|
-
const { vec2:
|
|
1557
|
-
return e.add(
|
|
1567
|
+
D();
|
|
1568
|
+
var { vec2: Ht, fract: Wt, sin: jt, dot: Qt } = pe;
|
|
1569
|
+
const Jt = (e) => Wt(jt(Qt(e, Ht(12.12345, 78.12345))).mul(40000.12345)), ms = (e = 0.03) => (n) => Jt(n).mul(e).mul(0.10012345);
|
|
1570
|
+
D();
|
|
1571
|
+
var { vec2: Kt } = pe;
|
|
1572
|
+
const us = (e = Kt(0), n = 0.02, a = 1, r = 1) => {
|
|
1573
|
+
const { vec2: m, sin: p, cos: h, time: d } = pe, R = r * 1.618033988749895, U = r * 2.718281828459045, V = (Math.sin(r) + 2) * 5, B = (Math.cos(r) + 2) * 5, ne = m(p(e.x.mul(a).mul(V).add(d.mul(0.1)).add(R)), h(e.y.mul(a).mul(V).add(d.mul(0.1)).add(U))), Y = m(p(e.y.mul(a).mul(B).add(d.mul(0.05)).add(U)), h(e.x.mul(a).mul(B).add(d.mul(0.05)).add(R))), I = ne.add(Y).mul(n);
|
|
1574
|
+
return e.add(I);
|
|
1558
1575
|
};
|
|
1559
|
-
|
|
1560
|
-
const
|
|
1561
|
-
const { max: p, smoothstep: h, vec4: d } =
|
|
1562
|
-
return d(e.rgb.add(n.rgb.mul(
|
|
1576
|
+
D();
|
|
1577
|
+
const ds = (e, n, a = 0.6, r = 0.3, m = 1) => {
|
|
1578
|
+
const { max: p, smoothstep: h, vec4: d } = pe, R = p(p(e.r, e.g), e.b), U = h(a, a + r, R).mul(m).mul(1);
|
|
1579
|
+
return d(e.rgb.add(n.rgb.mul(U)), e.a);
|
|
1563
1580
|
};
|
|
1564
|
-
|
|
1565
|
-
const
|
|
1566
|
-
const { inset: n = 0.4, softness:
|
|
1567
|
-
return p(1).sub(h(p(1).sub(p(n)), p(1).sub(p(n)).add(p(
|
|
1581
|
+
D();
|
|
1582
|
+
const hs = (e = {}) => {
|
|
1583
|
+
const { inset: n = 0.4, softness: a = 0.5, offsetX: r = 0, offsetY: m = 0 } = e, { float: p, smoothstep: h, uv: d } = pe, R = d(), U = R.x.sub(0.5).sub(p(r)).mul(2), V = R.y.sub(0.5).add(p(m)).mul(2), B = U.mul(U).add(V.mul(V)).sqrt();
|
|
1584
|
+
return p(1).sub(h(p(1).sub(p(n)), p(1).sub(p(n)).add(p(a)), B.mul(p(1).add(p(a)))));
|
|
1568
1585
|
};
|
|
1569
1586
|
var Zt = () => {
|
|
1570
1587
|
const e = {};
|
|
1571
1588
|
return Object.entries({
|
|
1572
|
-
AngularBlur:
|
|
1589
|
+
AngularBlur: ir,
|
|
1573
1590
|
Ascii: lr,
|
|
1574
1591
|
Blob: cr,
|
|
1575
1592
|
Blur: fr,
|
|
1576
|
-
Bulge:
|
|
1577
|
-
ChannelBlur:
|
|
1593
|
+
Bulge: mr,
|
|
1594
|
+
ChannelBlur: ur,
|
|
1578
1595
|
Checkerboard: dr,
|
|
1579
1596
|
ChromaFlow: hr,
|
|
1580
1597
|
ChromaticAberration: pr,
|
|
@@ -1593,8 +1610,8 @@ var Zt = () => {
|
|
|
1593
1610
|
Grayscale: Mr,
|
|
1594
1611
|
Grid: Ar,
|
|
1595
1612
|
GridDistortion: $r,
|
|
1596
|
-
Group:
|
|
1597
|
-
Halftone:
|
|
1613
|
+
Group: Dr,
|
|
1614
|
+
Halftone: zr,
|
|
1598
1615
|
HueShift: Fr,
|
|
1599
1616
|
ImageTexture: Er,
|
|
1600
1617
|
Invert: Or,
|
|
@@ -1606,9 +1623,9 @@ var Zt = () => {
|
|
|
1606
1623
|
Posterize: qr,
|
|
1607
1624
|
ProgressiveBlur: Gr,
|
|
1608
1625
|
RadialGradient: Nr,
|
|
1609
|
-
RectangularCoordinates:
|
|
1610
|
-
Ripples:
|
|
1611
|
-
Saturation:
|
|
1626
|
+
RectangularCoordinates: Xr,
|
|
1627
|
+
Ripples: Yr,
|
|
1628
|
+
Saturation: Ir,
|
|
1612
1629
|
SimplexNoise: Hr,
|
|
1613
1630
|
SineWave: Wr,
|
|
1614
1631
|
SolidColor: jr,
|
|
@@ -1621,50 +1638,50 @@ var Zt = () => {
|
|
|
1621
1638
|
Vibrance: rt,
|
|
1622
1639
|
WaveDistortion: tt,
|
|
1623
1640
|
ZoomBlur: ot
|
|
1624
|
-
}).forEach(([
|
|
1625
|
-
const
|
|
1641
|
+
}).forEach(([a, r]) => {
|
|
1642
|
+
const m = {};
|
|
1626
1643
|
r.props && Object.entries(r.props).forEach(([p, h]) => {
|
|
1627
|
-
h.ui && (
|
|
1644
|
+
h.ui && (m[p] = {
|
|
1628
1645
|
ui: h.ui,
|
|
1629
1646
|
default: h.default,
|
|
1630
1647
|
description: h.description
|
|
1631
1648
|
});
|
|
1632
1649
|
}), e[r.name] = {
|
|
1633
1650
|
name: r.name,
|
|
1634
|
-
fileName:
|
|
1651
|
+
fileName: a,
|
|
1635
1652
|
category: r.category || "Uncategorized",
|
|
1636
1653
|
definition: r,
|
|
1637
|
-
propsMetadata:
|
|
1654
|
+
propsMetadata: m
|
|
1638
1655
|
};
|
|
1639
1656
|
}), e;
|
|
1640
1657
|
};
|
|
1641
|
-
const
|
|
1642
|
-
function
|
|
1643
|
-
return Object.values(
|
|
1658
|
+
const Le = Zt();
|
|
1659
|
+
function ps() {
|
|
1660
|
+
return Object.values(Le);
|
|
1644
1661
|
}
|
|
1645
|
-
function
|
|
1646
|
-
return
|
|
1662
|
+
function gs(e) {
|
|
1663
|
+
return Le[e];
|
|
1647
1664
|
}
|
|
1648
|
-
function
|
|
1649
|
-
return Object.values(
|
|
1665
|
+
function bs(e) {
|
|
1666
|
+
return Object.values(Le).filter((n) => n.category === e);
|
|
1650
1667
|
}
|
|
1651
|
-
function
|
|
1652
|
-
const e = new Set(Object.values(
|
|
1668
|
+
function vs() {
|
|
1669
|
+
const e = new Set(Object.values(Le).map((n) => n.category));
|
|
1653
1670
|
return Array.from(e).sort();
|
|
1654
1671
|
}
|
|
1655
1672
|
export {
|
|
1656
1673
|
oo as createAnimatedTime,
|
|
1657
1674
|
Gt as createUniformsMap,
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1675
|
+
us as distort,
|
|
1676
|
+
hs as edgeMask,
|
|
1677
|
+
ps as getAllShaders,
|
|
1678
|
+
gs as getShaderByName,
|
|
1679
|
+
vs as getShaderCategories,
|
|
1680
|
+
bs as getShadersByCategory,
|
|
1681
|
+
ds as glow,
|
|
1682
|
+
ms as grain,
|
|
1683
|
+
fs as resolveMaskDependencies,
|
|
1684
|
+
Le as shaderRegistry,
|
|
1685
|
+
cs as shaderRenderer,
|
|
1669
1686
|
Nt as updateUniformValue
|
|
1670
1687
|
};
|