shaders 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/{AngularBlur-BZENxuhv.js → AngularBlur-BTUdXC0g.js} +5 -4
- package/dist/core/{Ascii-joVW9dAD.js → Ascii-Bu8ii7oo.js} +25 -24
- package/dist/core/{Blob-Ds3jasiC.js → Blob-C0G0efjG.js} +11 -10
- package/dist/core/{Blur-sKjcr9_K.js → Blur-BzUO9yxF.js} +13 -12
- package/dist/core/{Bulge-CdcB9we6.js → Bulge-BCXYAzig.js} +9 -8
- package/dist/core/{CRTScreen-BWDSeX_0.js → CRTScreen-cJ3XHrI9.js} +9 -8
- package/dist/core/{ChannelBlur-i9M5gbkh.js → ChannelBlur-BEK1qzGn.js} +17 -16
- package/dist/core/{Checkerboard-D9-UAs26.js → Checkerboard-BPkiSF5I.js} +15 -14
- package/dist/core/{ChromaFlow-DZAJwEBw.js → ChromaFlow-AHO3C4o3.js} +13 -12
- package/dist/core/{ChromaticAberration-DLYIcjJx.js → ChromaticAberration-nVg3r1FK.js} +11 -10
- package/dist/core/{Circle-Ca-LtXkF.js → Circle-C8ltF4BZ.js} +10 -9
- package/dist/core/{CursorTrail-B_VZJBOK.js → CursorTrail-BeJGeovB.js} +11 -10
- package/dist/core/DiffuseBlur-BdGvOoBw.js +40 -0
- package/dist/core/{Dither-MK-9r3tw.js → Dither-CpN3vGSh.js} +12 -11
- package/dist/core/{DotGrid-DP__DqQj.js → DotGrid-BFUzeSQw.js} +9 -8
- package/dist/core/{Duotone-CmkF6eDj.js → Duotone-_nR_o3-g.js} +6 -5
- package/dist/core/FilmGrain-BAKXXtLg.js +29 -0
- package/dist/core/{FloatingParticles-CxcXDtZg.js → FloatingParticles-Fv8JIzKk.js} +11 -10
- package/dist/core/GlassTiles-5MyBj1ff.js +53 -0
- package/dist/core/{Glow-Cz3ImaBH.js → Glow-DvJj7BB7.js} +13 -12
- package/dist/core/{Godrays-BHfh6URI.js → Godrays-cUzAKVXn.js} +18 -17
- package/dist/core/{Grayscale-FPSUcFGC.js → Grayscale-oWIF3PV5.js} +2 -1
- package/dist/core/{Grid-BvM0M3Hl.js → Grid-Bov7AA9m.js} +10 -9
- package/dist/core/{GridDistortion-yjmNv0Q3.js → GridDistortion-CWYom5Dw.js} +11 -10
- package/dist/core/Group-CPk-7fiA.js +18 -0
- package/dist/core/{Halftone-DWIVrS2s.js → Halftone-F7fsdu7W.js} +11 -10
- package/dist/core/{HueShift-CBupF7d4.js → HueShift-CiS4hdtk.js} +2 -1
- package/dist/core/{ImageTexture-GrTz4Fx7.js → ImageTexture-B3Q29OHX.js} +16 -15
- package/dist/core/Invert-Cyc4JHWc.js +21 -0
- package/dist/core/{LinearBlur-DHBRP6Yh.js → LinearBlur-BTC54qzk.js} +8 -7
- package/dist/core/{LinearGradient-B4C3CKhf.js → LinearGradient-LEMeW0KM.js} +3 -2
- package/dist/core/{Liquify-DNHtcXxv.js → Liquify-D2nzMDzq.js} +15 -14
- package/dist/core/{Pixelate-BKooNVcb.js → Pixelate-irPzmtQm.js} +8 -7
- package/dist/core/{PolarCoordinates-DKhEbQhq.js → PolarCoordinates-Ck5ZWrQO.js} +5 -4
- package/dist/core/{Posterize-D81ZG2A9.js → Posterize-DICq_t96.js} +8 -7
- package/dist/core/{ProgressiveBlur-CPdReTnY.js → ProgressiveBlur-BuORe3VH.js} +10 -9
- package/dist/core/{RadialGradient-XmwfZ91d.js → RadialGradient-D0cN67jm.js} +8 -7
- package/dist/core/{RectangularCoordinates-DWY7ptY1.js → RectangularCoordinates-1LIDaeHR.js} +15 -14
- package/dist/core/{Ripples-CndvRX-N.js → Ripples-DH71sFJc.js} +6 -5
- package/dist/core/{Saturation-C6u9sNkr.js → Saturation-DbSXtSeK.js} +10 -9
- package/dist/core/{SimplexNoise-BH0ZZzP4.js → SimplexNoise-DPGC2OPJ.js} +10 -9
- package/dist/core/{SineWave-DBH8MraQ.js → SineWave-CkWtnzHF.js} +10 -9
- package/dist/core/{SolidColor-DR665qss.js → SolidColor-DaB-FHNX.js} +2 -1
- package/dist/core/{Spiral--7KUy0u3.js → Spiral-CcyI8azF.js} +18 -17
- package/dist/core/{Strands-Bi1Is8_o.js → Strands-Co4fkc05.js} +10 -9
- package/dist/core/{Swirl-DuYM23jG.js → Swirl-BoveqtNV.js} +15 -14
- package/dist/core/{TiltShift-BUvZWBsh.js → TiltShift-D53azmRe.js} +4 -3
- package/dist/core/{Tritone-CKifp6Ob.js → Tritone-Cg1rX-hL.js} +11 -10
- package/dist/core/{Twirl-Ztlb9x_h.js → Twirl-raO5pe5X.js} +10 -9
- package/dist/core/{Vibrance-B7EsDw6e.js → Vibrance-DtekSkcz.js} +8 -7
- package/dist/core/{WaveDistortion-HCnk54tD.js → WaveDistortion-C65qO_cZ.js} +6 -5
- package/dist/core/{ZoomBlur-Ck6M9A2W.js → ZoomBlur-B97ZjhXe.js} +10 -9
- package/dist/core/index.js +773 -758
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +1 -1
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +1 -1
- package/dist/core/shaders/Blob/index.d.ts.map +1 -1
- package/dist/core/shaders/Blob/index.js +1 -1
- package/dist/core/shaders/Blur/index.d.ts.map +1 -1
- package/dist/core/shaders/Blur/index.js +1 -1
- package/dist/core/shaders/Bulge/index.d.ts.map +1 -1
- package/dist/core/shaders/Bulge/index.js +1 -1
- package/dist/core/shaders/CRTScreen/index.d.ts.map +1 -1
- package/dist/core/shaders/CRTScreen/index.js +1 -1
- package/dist/core/shaders/ChannelBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +1 -1
- package/dist/core/shaders/Checkerboard/index.d.ts.map +1 -1
- package/dist/core/shaders/Checkerboard/index.js +1 -1
- package/dist/core/shaders/ChromaFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaFlow/index.js +1 -1
- package/dist/core/shaders/ChromaticAberration/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaticAberration/index.js +1 -1
- package/dist/core/shaders/Circle/index.d.ts.map +1 -1
- package/dist/core/shaders/Circle/index.js +1 -1
- package/dist/core/shaders/CursorTrail/index.d.ts.map +1 -1
- package/dist/core/shaders/CursorTrail/index.js +1 -1
- package/dist/core/shaders/DiffuseBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +1 -1
- package/dist/core/shaders/Dither/index.d.ts.map +1 -1
- package/dist/core/shaders/Dither/index.js +1 -1
- package/dist/core/shaders/DotGrid/index.d.ts.map +1 -1
- package/dist/core/shaders/DotGrid/index.js +1 -1
- package/dist/core/shaders/Duotone/index.d.ts.map +1 -1
- package/dist/core/shaders/Duotone/index.js +1 -1
- package/dist/core/shaders/FilmGrain/index.d.ts.map +1 -1
- package/dist/core/shaders/FilmGrain/index.js +1 -1
- package/dist/core/shaders/FloatingParticles/index.d.ts.map +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +1 -1
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Glow/index.d.ts.map +1 -1
- package/dist/core/shaders/Glow/index.js +1 -1
- package/dist/core/shaders/Godrays/index.d.ts.map +1 -1
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/Grayscale/index.d.ts.map +1 -1
- package/dist/core/shaders/Grayscale/index.js +1 -1
- package/dist/core/shaders/Grid/index.d.ts.map +1 -1
- package/dist/core/shaders/Grid/index.js +1 -1
- package/dist/core/shaders/GridDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/GridDistortion/index.js +1 -1
- package/dist/core/shaders/Group/index.d.ts.map +1 -1
- package/dist/core/shaders/Group/index.js +1 -1
- package/dist/core/shaders/Halftone/index.d.ts.map +1 -1
- package/dist/core/shaders/Halftone/index.js +1 -1
- package/dist/core/shaders/HueShift/index.d.ts.map +1 -1
- package/dist/core/shaders/HueShift/index.js +1 -1
- package/dist/core/shaders/ImageTexture/index.d.ts +1 -1
- package/dist/core/shaders/ImageTexture/index.d.ts.map +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/Invert/index.d.ts.map +1 -1
- package/dist/core/shaders/Invert/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.d.ts.map +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Posterize/index.d.ts.map +1 -1
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
- package/dist/core/shaders/RadialGradient/index.d.ts.map +1 -1
- package/dist/core/shaders/RadialGradient/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.d.ts.map +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/Ripples/index.d.ts.map +1 -1
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/Saturation/index.d.ts.map +1 -1
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/SimplexNoise/index.d.ts.map +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +1 -1
- package/dist/core/shaders/SineWave/index.d.ts.map +1 -1
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/SolidColor/index.d.ts.map +1 -1
- package/dist/core/shaders/SolidColor/index.js +1 -1
- package/dist/core/shaders/Spiral/index.d.ts.map +1 -1
- package/dist/core/shaders/Spiral/index.js +1 -1
- package/dist/core/shaders/Strands/index.d.ts.map +1 -1
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/TiltShift/index.d.ts.map +1 -1
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/Tritone/index.d.ts.map +1 -1
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.d.ts.map +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.d.ts.map +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.d.ts.map +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/core/types.d.ts +4 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/react/index.cjs +71 -71
- package/dist/react/index.js +4831 -4764
- package/dist/react/utils/generatePresetCode.cjs +1 -1
- package/dist/react/utils/generatePresetCode.js +1 -1
- package/dist/registry.d.ts +3 -0
- package/dist/registry.js +226 -88
- package/dist/svelte/index.js +5632 -5565
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/{generatePresetCode-T78GxN5X.js → generatePresetCode-D4V6rBae.js} +1 -1
- package/dist/vue/index.js +5169 -5102
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/package.json +1 -1
- package/dist/core/DiffuseBlur-COpm1qrw.js +0 -39
- package/dist/core/FilmGrain-ByNyK2gs.js +0 -28
- package/dist/core/GlassTiles-CxUl9MxF.js +0 -52
- package/dist/core/Group-jZZimqG1.js +0 -17
- package/dist/core/Invert-CCQ1H_Qr.js +0 -20
package/dist/core/index.js
CHANGED
|
@@ -1,190 +1,190 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { n as
|
|
1
|
+
import { A as N, B as In, D as C, E as xe, F as dn, H as Hn, I as Je, J as Wn, K as jn, L as Qn, M as Y, N as x, P as we, R as Jn, S as Ce, T as wn, U as Kn, V as Zn, _ as Me, c as er, d as Z, g as Ke, h as Ze, i as nr, k as pe, l as yn, m as A, n as k, o as hn, 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 ye } 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 zr } from "./Group-
|
|
33
|
-
import { n as Dr } from "./Halftone-
|
|
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
|
|
61
|
-
|
|
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 zr } from "./Group-CPk-7fiA.js";
|
|
33
|
+
import { n as Dr } 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
|
+
Qn();
|
|
62
62
|
A();
|
|
63
|
-
function
|
|
64
|
-
const r =
|
|
65
|
-
return
|
|
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
67
|
A();
|
|
68
|
-
var
|
|
69
|
-
const n = e.x,
|
|
70
|
-
return
|
|
68
|
+
var pn = (e) => Y(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) => Y(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))), gn = (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)), S = ee(h, Z(1 / 3));
|
|
70
|
+
return Y(d.mul(0.2104542553).add(R.mul(0.793617785)).sub(S.mul(0.0040720468)), d.mul(1.9779984951).sub(R.mul(2.428592205)).add(S.mul(0.4505937099)), d.mul(0.0259040371).add(R.mul(0.7827717662)).sub(S.mul(0.808675766)));
|
|
71
71
|
}, lt = (e) => {
|
|
72
|
-
const n = e.x,
|
|
73
|
-
return
|
|
74
|
-
},
|
|
75
|
-
const n = e.x,
|
|
76
|
-
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)), S = ee(h, Z(3));
|
|
73
|
+
return Y(d.mul(4.0767416621).sub(R.mul(3.3077115913)).add(S.mul(0.2309699292)), d.mul(-1.2684380046).add(R.mul(2.6097574011)).sub(S.mul(0.3413193965)), d.mul(-0.0041960863).sub(R.mul(0.7034186147)).add(S.mul(1.707614701)));
|
|
74
|
+
}, bn = (e) => {
|
|
75
|
+
const n = e.x, a = e.y, r = e.z;
|
|
76
|
+
return Y(n, wn(a.mul(a).add(r.mul(r))), nr(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 Y(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 = pn(Y(e.r, e.g, e.b)), h = pn(Y(n.r, n.g, n.b)), d = gn(p), R = gn(h), S = bn(d);
|
|
83
|
+
return x(it(lt(ct(k(i(bn(R), r), i(S, i(e.a, C(1, r))))))), m);
|
|
84
84
|
}
|
|
85
85
|
A();
|
|
86
|
-
var
|
|
87
|
-
const n = e.x,
|
|
88
|
-
return
|
|
89
|
-
},
|
|
90
|
-
const n = e.x,
|
|
91
|
-
return
|
|
86
|
+
var vn = (e) => Y(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) => Y(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))), Cn = (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)), S = ee(h, Z(1 / 3));
|
|
88
|
+
return Y(d.mul(0.2104542553).add(R.mul(0.793617785)).sub(S.mul(0.0040720468)), d.mul(1.9779984951).sub(R.mul(2.428592205)).add(S.mul(0.4505937099)), d.mul(0.0259040371).add(R.mul(0.7827717662)).sub(S.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)), S = ee(h, Z(3));
|
|
91
|
+
return Y(d.mul(4.0767416621).sub(R.mul(3.3077115913)).add(S.mul(0.2309699292)), d.mul(-1.2684380046).add(R.mul(2.6097574011)).sub(S.mul(0.3413193965)), d.mul(-0.0041960863).sub(R.mul(0.7034186147)).add(S.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 = vn(Y(e.r, e.g, e.b)), h = vn(Y(n.r, n.g, n.b)), d = Cn(p);
|
|
95
|
+
return x(mt(ut(k(i(Cn(h), r), i(d, i(e.a, C(1, r)))))), m);
|
|
96
96
|
}
|
|
97
97
|
A();
|
|
98
|
-
function ht(e, n,
|
|
99
|
-
const r =
|
|
100
|
-
return
|
|
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
102
|
A();
|
|
103
|
-
function pt(e, n,
|
|
104
|
-
const r =
|
|
105
|
-
return
|
|
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
107
|
A();
|
|
108
|
-
function gt(e, n,
|
|
109
|
-
const r =
|
|
110
|
-
return
|
|
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
112
|
A();
|
|
113
|
-
function bt(e, n,
|
|
114
|
-
const r =
|
|
115
|
-
return
|
|
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
117
|
A();
|
|
118
|
-
function vt(e, n,
|
|
119
|
-
const r =
|
|
120
|
-
return
|
|
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
122
|
A();
|
|
123
|
-
function Ct(e, n,
|
|
124
|
-
const r =
|
|
125
|
-
return
|
|
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(er(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
127
|
A();
|
|
128
|
-
function Rt(e, n,
|
|
129
|
-
const r =
|
|
130
|
-
return
|
|
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
132
|
A();
|
|
133
|
-
function
|
|
134
|
-
return k(k(
|
|
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
136
|
A();
|
|
137
|
-
function Tt(e, n,
|
|
138
|
-
const r =
|
|
139
|
-
return
|
|
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
141
|
A();
|
|
142
|
-
function kt(e, n,
|
|
143
|
-
const r =
|
|
144
|
-
return
|
|
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
146
|
A();
|
|
147
|
-
function wt(e, n,
|
|
148
|
-
const r =
|
|
149
|
-
return
|
|
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
151
|
A();
|
|
152
|
-
function yt(e, n,
|
|
153
|
-
const r =
|
|
154
|
-
return
|
|
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
156
|
A();
|
|
157
|
-
function St(e, n,
|
|
158
|
-
const r =
|
|
159
|
-
return
|
|
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
161
|
A();
|
|
162
|
-
function Ut(e, n,
|
|
163
|
-
const r =
|
|
164
|
-
return
|
|
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
166
|
A();
|
|
167
|
-
function xt(e, n,
|
|
168
|
-
const r =
|
|
169
|
-
return
|
|
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 = wn(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
171
|
A();
|
|
172
|
-
function Mt(e, n,
|
|
173
|
-
const r =
|
|
174
|
-
return
|
|
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
176
|
A();
|
|
177
|
-
function At(e, n,
|
|
178
|
-
const r =
|
|
179
|
-
return
|
|
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), S = d.length();
|
|
179
|
+
return x(k(i(k(i(R.normalize(), S), p), r), i(e.rgb, i(e.a, C(1, r)))), m);
|
|
180
180
|
}
|
|
181
181
|
A();
|
|
182
|
-
function $t(e, n,
|
|
183
|
-
const r =
|
|
184
|
-
return
|
|
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
|
-
var
|
|
187
|
-
normal:
|
|
186
|
+
var Rn = {
|
|
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 (
|
|
208
|
+
function K(e, n, a = "normal", r = 1) {
|
|
209
|
+
return (Rn[a] || Rn.normal)(e, n, r);
|
|
210
210
|
}
|
|
211
211
|
A();
|
|
212
212
|
function zt(e, n) {
|
|
213
|
-
const
|
|
214
|
-
return
|
|
213
|
+
const a = i(e.a, n.a);
|
|
214
|
+
return x(e.rgb, a);
|
|
215
215
|
}
|
|
216
216
|
A();
|
|
217
217
|
function Dt(e, n) {
|
|
218
|
-
const
|
|
219
|
-
return
|
|
218
|
+
const a = C(1, n.a), r = i(e.a, a);
|
|
219
|
+
return x(e.rgb, r);
|
|
220
220
|
}
|
|
221
221
|
A();
|
|
222
222
|
function Ft(e, n) {
|
|
223
|
-
const
|
|
224
|
-
return
|
|
223
|
+
const a = Y(0.2126, 0.7152, 0.0722), r = yn(n.rgb, a), m = i(e.a, r);
|
|
224
|
+
return x(e.rgb, m);
|
|
225
225
|
}
|
|
226
226
|
A();
|
|
227
227
|
function Et(e, n) {
|
|
228
|
-
const
|
|
229
|
-
return
|
|
228
|
+
const a = Y(0.2126, 0.7152, 0.0722), r = C(1, yn(n.rgb, a)), m = i(e.a, r);
|
|
229
|
+
return x(e.rgb, m);
|
|
230
230
|
}
|
|
231
|
-
var
|
|
231
|
+
var Tn = {
|
|
232
232
|
alpha: zt,
|
|
233
233
|
alphaInverted: Dt,
|
|
234
234
|
luminance: Ft,
|
|
235
235
|
luminanceInverted: Et
|
|
236
236
|
};
|
|
237
|
-
function Ot(e, n,
|
|
238
|
-
return (
|
|
237
|
+
function Ot(e, n, a = "alpha") {
|
|
238
|
+
return (Tn[a] || Tn.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((S,
|
|
352
|
+
const n = this.frameTimesMs.reduce((S, V) => S + 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, D) => z + D, 0) / this.frameIntervals.length) : 0, r = n > 0 ? this.frameTimesMs.reduce((z, D) => z + D, 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, S = performance.memory, V = S ? S.usedJSHeapSize / (1024 * 1024) : null, B = this.calculateMemoryGrowthRate(), ne = r > 0 ? r / this.targetFrameTime * 100 : 0, I = e?.render?.calls ?? null, H = e?.programs?.length ?? null, X = 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,14 +384,14 @@ 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:
|
|
394
|
-
textureCount:
|
|
391
|
+
budgetUsed: Math.round(ne * 10) / 10,
|
|
392
|
+
drawCalls: I,
|
|
393
|
+
shaderPrograms: H,
|
|
394
|
+
textureCount: X,
|
|
395
395
|
intensityScore: ae.score,
|
|
396
396
|
intensityLabel: ae.label,
|
|
397
397
|
isRendering: this.isRendering
|
|
@@ -405,19 +405,19 @@ var Bt = class {
|
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
407
|
A();
|
|
408
|
-
var { vec2:
|
|
409
|
-
const
|
|
410
|
-
const R = r.mul(Lt).div(Vt(180)), S = Pt(R),
|
|
411
|
-
return
|
|
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)), S = Pt(R), V = _t(R), B = Se(p, h), ne = e.sub(B).div(m), I = Se(ne.x.mul(d), ne.y), H = Se(I.x.mul(S).sub(I.y.mul(V)), I.x.mul(V).add(I.y.mul(S)));
|
|
411
|
+
return Se(H.x.div(d), H.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
423
|
const S = p.transform(h);
|
|
@@ -427,14 +427,14 @@ function Gt(e, n, i) {
|
|
|
427
427
|
const S = p.transform(d);
|
|
428
428
|
d = S?.node ?? S;
|
|
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 =
|
|
437
|
-
typeof d == "string" && R.value === null && (R.value = d), r[
|
|
436
|
+
const R = Sn(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
|
-
var
|
|
450
|
-
A(), { uniform:
|
|
449
|
+
var Sn, Un = jn({ "src/utilities/uniforms.ts": (() => {
|
|
450
|
+
A(), { uniform: Sn } = pe;
|
|
451
451
|
}) });
|
|
452
452
|
A();
|
|
453
|
-
var
|
|
453
|
+
var kn = !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, S = null,
|
|
518
|
+
let R = null, S = null, V = null, B = !1, ne = !1, I = !1, H = null, X = !1, ae = !0, z = 0, D = 0, te = !1, Le = 0, Ae = !1, $e = 0.5, ze = 0.5, ue = !1, De = !1, Fe = null, Re = null, de = !1;
|
|
519
519
|
const ie = new Bt();
|
|
520
|
-
let
|
|
521
|
-
const Ne = (
|
|
522
|
-
|
|
523
|
-
width:
|
|
520
|
+
let oe = [], qe = !1, Ee = [], ge = null, Oe = [], be = null, en = /* @__PURE__ */ new Set(), nn = /* @__PURE__ */ new Set(), Be = 0, Te = /* @__PURE__ */ new Set(), Ge = /* @__PURE__ */ new Set(), ke = null, Pe = !1;
|
|
521
|
+
const Ne = (s, t) => {
|
|
522
|
+
s <= 0 || t <= 0 || s === z && t === D || (ke = {
|
|
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, !ke) return;
|
|
527
|
+
const { width: o, height: l } = ke;
|
|
528
|
+
ke = null, z = o, D = l, I || (I = !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 (F) {
|
|
538
|
+
console.error("Error in resize callback:", F);
|
|
539
539
|
}
|
|
540
540
|
});
|
|
541
|
-
}),
|
|
541
|
+
}), re().catch(console.warn);
|
|
542
542
|
})));
|
|
543
|
-
},
|
|
544
|
-
if (!n || !
|
|
545
|
-
const t =
|
|
543
|
+
}, xn = () => B && !!n && !!r && !!a && !!p && z > 0 && D > 0 && X, Mn = (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) {
|
|
@@ -551,80 +551,80 @@ function ca() {
|
|
|
551
551
|
} else
|
|
552
552
|
o = Math.round(t.contentRect.width), l = Math.round(t.contentRect.height);
|
|
553
553
|
o === 0 || l === 0 || Ne(o, l);
|
|
554
|
-
},
|
|
555
|
-
const t =
|
|
554
|
+
}, An = (s) => {
|
|
555
|
+
const t = s[0];
|
|
556
556
|
if (!t) return;
|
|
557
|
-
const o =
|
|
558
|
-
|
|
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 &&
|
|
557
|
+
const o = X;
|
|
558
|
+
X = t.isIntersecting;
|
|
559
|
+
const l = e?.getBoundingClientRect(), f = te;
|
|
560
|
+
if (te = X && !!l && l.width > 0 && l.height > 0, X && !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 || D === 0 || w !== z || M !== D ? (Ne(w, M), !f && te && he()) : p && B && h.rootId && (p.needsUpdate = !0, he(), re().catch(console.warn)));
|
|
564
564
|
}
|
|
565
565
|
ae && je();
|
|
566
|
-
} else !
|
|
567
|
-
},
|
|
568
|
-
if (
|
|
569
|
-
for (const o of
|
|
566
|
+
} else !X && o && Qe();
|
|
567
|
+
}, $n = (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 =
|
|
574
|
-
return
|
|
571
|
+
}, Xe = (s) => {
|
|
572
|
+
Be++;
|
|
573
|
+
const t = hn(s);
|
|
574
|
+
return Te.add(t), t;
|
|
575
575
|
}, rn = () => {
|
|
576
|
-
Ge.forEach((
|
|
576
|
+
Ge.forEach((s) => {
|
|
577
577
|
try {
|
|
578
|
-
|
|
578
|
+
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
579
579
|
} catch {
|
|
580
580
|
}
|
|
581
581
|
}), Ge.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 || De || !h.nodes.get(h.rootId)) return;
|
|
586
|
+
if (z === 0 || D === 0) {
|
|
587
|
+
ve || (ve = !0, requestAnimationFrame(() => {
|
|
588
|
+
ve = !1, z > 0 && D > 0 && he();
|
|
589
589
|
}));
|
|
590
590
|
return;
|
|
591
591
|
}
|
|
592
|
-
|
|
593
|
-
const
|
|
592
|
+
De = !0;
|
|
593
|
+
const s = performance.now();
|
|
594
594
|
console.log("[Shaders Perf] Starting updateMaterial()");
|
|
595
595
|
try {
|
|
596
596
|
const t = performance.now();
|
|
597
|
-
Ge = new Set(
|
|
597
|
+
Ge = new Set(Te), Te.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)`),
|
|
602
|
-
const f = performance.now(), b =
|
|
603
|
-
if (console.log(`[Shaders Perf] composeNodeTree: ${(performance.now() - f).toFixed(2)}ms (RTT ops: ${
|
|
604
|
-
const g =
|
|
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
|
|
601
|
+
}), console.log(`[Shaders Perf] RTT tracking rebuild: ${(performance.now() - l).toFixed(2)}ms (${h.nodes.size} nodes)`), Be = 0;
|
|
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: ${Be})`), b && p) {
|
|
604
|
+
const g = !$n(en, o), w = p.fragmentNode !== b;
|
|
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 F = 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() - F).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
|
+
De = !1;
|
|
624
624
|
}
|
|
625
|
-
|
|
626
|
-
},
|
|
627
|
-
const t = d.get(
|
|
625
|
+
X && re().catch(console.warn);
|
|
626
|
+
}, Q = (s) => {
|
|
627
|
+
const t = d.get(s);
|
|
628
628
|
if (!t) return [];
|
|
629
629
|
const o = [];
|
|
630
630
|
for (const l of t) {
|
|
@@ -632,108 +632,108 @@ function ca() {
|
|
|
632
632
|
f && o.push(f);
|
|
633
633
|
}
|
|
634
634
|
return o;
|
|
635
|
-
},
|
|
636
|
-
for (const [t, o] of h.nodes.entries()) if (o.metadata.id ===
|
|
635
|
+
}, zn = (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
|
|
640
|
-
const f = t.metadata.mask.source, b =
|
|
641
|
-
if (!b) return
|
|
638
|
+
}, se = (s, t, o, l) => {
|
|
639
|
+
if (!t.metadata.mask?.source) return s;
|
|
640
|
+
const f = t.metadata.mask.source, b = zn(f);
|
|
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
|
-
},
|
|
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 = Xe(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 ye(l, o.sample(l), o, t.transformUniforms.edges);
|
|
650
|
+
}, W = (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
|
-
if (!l || !
|
|
655
|
+
if (!l || !W(l)) break;
|
|
656
656
|
t.push(l);
|
|
657
|
-
const f =
|
|
657
|
+
const f = Q(l.id);
|
|
658
658
|
if (f.length !== 1) break;
|
|
659
659
|
const b = f[0];
|
|
660
|
-
if (
|
|
660
|
+
if (W(b)) o = b.id;
|
|
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 = Q(t.id);
|
|
667
667
|
return o.length === 0 ? null : o.length === 1 ? o[0] : null;
|
|
668
|
-
},
|
|
669
|
-
if (!
|
|
670
|
-
const t =
|
|
668
|
+
}, _e = (s) => {
|
|
669
|
+
if (!s.uvTransformFunc || !W(s)) return !1;
|
|
670
|
+
const t = Q(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 &&
|
|
674
|
-
},
|
|
673
|
+
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc && W(o) ? _e(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`),
|
|
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
|
-
const c =
|
|
683
|
+
const c = Q(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: we
|
|
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 $ = (E) => {
|
|
702
|
+
c.cleanupCallbacks.push(E);
|
|
703
|
+
}, P = (E) => {
|
|
704
|
+
c.beforeRenderCallbacks.push(E);
|
|
705
|
+
}, T = (E) => {
|
|
706
|
+
c.afterRenderCallbacks.push(E);
|
|
707
|
+
}, U = (E) => {
|
|
708
|
+
c.resizeCallbacks.push(E);
|
|
709
709
|
};
|
|
710
|
-
c.cleanupCallbacks.forEach((
|
|
710
|
+
c.cleanupCallbacks.forEach((E) => {
|
|
711
711
|
try {
|
|
712
|
-
|
|
713
|
-
} catch (
|
|
714
|
-
console.error("Error in cleanup callback:",
|
|
712
|
+
E();
|
|
713
|
+
} catch (j) {
|
|
714
|
+
console.error("Error in cleanup callback:", j);
|
|
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: U,
|
|
724
724
|
canvas: e,
|
|
725
725
|
dimensions: {
|
|
726
|
-
width:
|
|
727
|
-
height:
|
|
726
|
+
width: z,
|
|
727
|
+
height: D
|
|
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
|
+
}, F = (v) => {
|
|
737
737
|
b.afterRenderCallbacks.push(v);
|
|
738
738
|
}, y = (v) => {
|
|
739
739
|
b.resizeCallbacks.push(v);
|
|
@@ -745,433 +745,448 @@ 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: F,
|
|
755
755
|
onResize: y,
|
|
756
756
|
canvas: e,
|
|
757
757
|
dimensions: {
|
|
758
|
-
width:
|
|
759
|
-
height:
|
|
758
|
+
width: z,
|
|
759
|
+
height: D
|
|
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 ye(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
|
-
if (l) f =
|
|
770
|
-
else return
|
|
771
|
-
const b =
|
|
772
|
-
let g =
|
|
773
|
-
for (let
|
|
774
|
-
const y =
|
|
769
|
+
if (l) f = J(l.id, t, o);
|
|
770
|
+
else return x(0, 0, 0, 0);
|
|
771
|
+
const b = Xe(f);
|
|
772
|
+
let g = Ce;
|
|
773
|
+
for (let F = s.length - 1; F >= 0; F--) {
|
|
774
|
+
const y = s[F];
|
|
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: we
|
|
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 ? ye(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 =
|
|
787
|
-
if (!
|
|
785
|
+
for (let l = t; l < s.length; l++) {
|
|
786
|
+
const f = s[l];
|
|
787
|
+
if (!W(f) || Q(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 = Xe(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: we
|
|
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 ? ye(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),
|
|
808
|
+
for (let g = 0; g < s.length; g++) {
|
|
809
|
+
const w = s[g], M = Q(w.id).length > 0;
|
|
810
|
+
w.acceptsUVContext && !w.requiresChild && t.push(g), W(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 =
|
|
816
|
-
if (w.requiresRTT && !
|
|
815
|
+
const w = s[g];
|
|
816
|
+
if (w.requiresRTT && !W(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
|
-
|
|
824
|
-
const v =
|
|
825
|
-
|
|
823
|
+
s.forEach((y, u) => {
|
|
824
|
+
const v = Q(y.id).length > 0;
|
|
825
|
+
W(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 (U) {
|
|
840
|
+
console.error("Cleanup error:", U);
|
|
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: D
|
|
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 =
|
|
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 F;
|
|
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 = Q(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 U = Ce;
|
|
874
|
+
for (let _ = T.length - 1; _ >= 0; _--) {
|
|
875
|
+
const q = T[_];
|
|
876
|
+
q.uvTransformFunc && (U = q.uvTransformFunc({
|
|
877
|
+
uv: U,
|
|
878
|
+
uniforms: q.uniforms,
|
|
879
|
+
viewportSize: we
|
|
880
|
+
})), q.transformUniforms && q.metadata.transform && fe(q.metadata.transform) && (U = Ue(U, q.transformUniforms.offsetX, q.transformUniforms.offsetY, q.transformUniforms.rotation, q.transformUniforms.scale, q.transformUniforms.anchorX, q.transformUniforms.anchorY, q.transformUniforms.aspectRatio), q.transformUniforms.edges && (U = ce(U, q.transformUniforms.edges)), q.transformRTTActive = !0), q.uniforms.edges?.uniform && (U = ce(U, q.uniforms.edges.uniform));
|
|
881
881
|
}
|
|
882
|
-
|
|
882
|
+
P.node.transformUniforms && P.node.metadata.transform && fe(P.node.metadata.transform) && (U = Ue(U, 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 && (U = ce(U, 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 E = (_) => u.cleanupCallbacks.push(_), j = (_) => u.beforeRenderCallbacks.push(_), O = (_) => u.afterRenderCallbacks.push(_), G = (_) => 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: U,
|
|
894
|
+
onCleanup: E,
|
|
895
|
+
onBeforeRender: j,
|
|
896
|
+
onAfterRender: O,
|
|
897
|
+
onResize: G,
|
|
898
898
|
canvas: e,
|
|
899
899
|
dimensions: {
|
|
900
|
-
width:
|
|
901
|
-
height:
|
|
900
|
+
width: z,
|
|
901
|
+
height: D
|
|
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 = ye(U, 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 (_e(u)) $ = Ie(u.id, t, o);
|
|
914
|
+
else if (W(u)) {
|
|
915
|
+
const U = Ye(u.id);
|
|
916
|
+
U.length > 1 ? $ = He(U, t, o) : $ = J(u.id, t, o);
|
|
917
|
+
} else $ = J(u.id, t, o);
|
|
918
|
+
const T = g.filter((U) => U.index > y).sort((U, E) => U.index - E.index).map((U) => U.node);
|
|
919
|
+
if (T.length > 0) {
|
|
920
|
+
const U = hn($);
|
|
921
|
+
let E = Ce;
|
|
922
|
+
for (let j = T.length - 1; j >= 0; j--) {
|
|
923
|
+
const O = T[j];
|
|
924
|
+
O.uvTransformFunc && (E = O.uvTransformFunc({
|
|
925
|
+
uv: E,
|
|
926
|
+
uniforms: O.uniforms,
|
|
927
|
+
viewportSize: we
|
|
928
|
+
})), O.transformUniforms && O.metadata.transform && fe(O.metadata.transform) && (E = Ue(E, O.transformUniforms.offsetX, O.transformUniforms.offsetY, O.transformUniforms.rotation, O.transformUniforms.scale, O.transformUniforms.anchorX, O.transformUniforms.anchorY, O.transformUniforms.aspectRatio), O.transformUniforms.edges && (E = ce(E, O.transformUniforms.edges)), O.transformRTTActive = !0), O.uniforms.edges?.uniform && (E = ce(E, O.uniforms.edges.uniform));
|
|
929
|
+
}
|
|
930
|
+
$ = U.sample(E);
|
|
931
|
+
}
|
|
932
|
+
} else {
|
|
933
|
+
u.cleanupCallbacks.forEach((G) => {
|
|
919
934
|
try {
|
|
920
|
-
|
|
921
|
-
} catch (
|
|
922
|
-
console.error("Cleanup error:",
|
|
935
|
+
G();
|
|
936
|
+
} catch (L) {
|
|
937
|
+
console.error("Cleanup error:", L);
|
|
923
938
|
}
|
|
924
|
-
}),
|
|
925
|
-
const T = (
|
|
926
|
-
let
|
|
927
|
-
|
|
928
|
-
uniforms:
|
|
929
|
-
childNode:
|
|
939
|
+
}), u.cleanupCallbacks = [], u.beforeRenderCallbacks = [], u.afterRenderCallbacks = [], u.resizeCallbacks = [];
|
|
940
|
+
const T = (G) => u.cleanupCallbacks.push(G), U = (G) => u.beforeRenderCallbacks.push(G), E = (G) => u.afterRenderCallbacks.push(G), j = (G) => u.resizeCallbacks.push(G);
|
|
941
|
+
let O = F;
|
|
942
|
+
u.requiresRTT && F !== void 0 && (O = K(x(0, 0, 0, 0), F, "normal", 1)), $ = se(le(u.fragmentNodeFunc({
|
|
943
|
+
uniforms: u.uniforms ?? {},
|
|
944
|
+
childNode: O,
|
|
930
945
|
onCleanup: T,
|
|
931
|
-
onBeforeRender:
|
|
932
|
-
onAfterRender:
|
|
933
|
-
onResize:
|
|
946
|
+
onBeforeRender: U,
|
|
947
|
+
onAfterRender: E,
|
|
948
|
+
onResize: j,
|
|
934
949
|
canvas: e,
|
|
935
950
|
dimensions: {
|
|
936
|
-
width:
|
|
937
|
-
height:
|
|
951
|
+
width: z,
|
|
952
|
+
height: D
|
|
938
953
|
},
|
|
939
954
|
renderer: n
|
|
940
|
-
}),
|
|
955
|
+
}), u), u, u.id, t);
|
|
941
956
|
}
|
|
942
957
|
}
|
|
943
|
-
|
|
958
|
+
u.requiresChild && u.metadata.blendMode === "normal" && !c ? F = K(x(0, 0, 0, 0), $, "normal", u.opacityUniform) : F === void 0 ? F = K(x(1, 1, 1, 0), $, u.metadata.blendMode, u.opacityUniform) : F = K(F, $, u.metadata.blendMode, u.opacityUniform);
|
|
944
959
|
}
|
|
945
|
-
return console.log(`[Shaders Perf] Node processing: ${(performance.now() -
|
|
946
|
-
},
|
|
947
|
-
if (
|
|
948
|
-
const f = h.nodes.get(
|
|
949
|
-
if (!f) return
|
|
960
|
+
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`), F ?? x(0, 0, 0, 0);
|
|
961
|
+
}, J = (s, t = /* @__PURE__ */ new Set(), o, l = !1) => {
|
|
962
|
+
if (z === 0 || D === 0) return x(0, 0, 0, 0);
|
|
963
|
+
const f = h.nodes.get(s);
|
|
964
|
+
if (!f) return x(0, 0, 0, 0);
|
|
950
965
|
const b = (y) => {
|
|
951
966
|
f.cleanupCallbacks.push(y);
|
|
952
967
|
}, g = (y) => {
|
|
953
968
|
f.beforeRenderCallbacks.push(y);
|
|
954
969
|
}, w = (y) => {
|
|
955
970
|
f.afterRenderCallbacks.push(y);
|
|
956
|
-
},
|
|
971
|
+
}, M = (y) => {
|
|
957
972
|
f.resizeCallbacks.push(y);
|
|
958
|
-
},
|
|
959
|
-
if (
|
|
960
|
-
return f.requiresRTT && !
|
|
973
|
+
}, F = Q(s);
|
|
974
|
+
if (F.length === 0)
|
|
975
|
+
return f.requiresRTT && !te ? x(0, 0, 0, 0) : (f.cleanupCallbacks.forEach((y) => {
|
|
961
976
|
try {
|
|
962
977
|
y();
|
|
963
|
-
} catch (
|
|
964
|
-
console.error("Error in cleanup callback:",
|
|
978
|
+
} catch (u) {
|
|
979
|
+
console.error("Error in cleanup callback:", u);
|
|
965
980
|
}
|
|
966
|
-
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [],
|
|
981
|
+
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [], se(le(f.fragmentNodeFunc({
|
|
967
982
|
uniforms: f.uniforms ?? {},
|
|
968
983
|
childNode: void 0,
|
|
969
984
|
onCleanup: b,
|
|
970
985
|
onBeforeRender: g,
|
|
971
986
|
onAfterRender: w,
|
|
972
|
-
onResize:
|
|
987
|
+
onResize: M,
|
|
973
988
|
canvas: e,
|
|
974
989
|
dimensions: {
|
|
975
|
-
width:
|
|
976
|
-
height:
|
|
990
|
+
width: z,
|
|
991
|
+
height: D
|
|
977
992
|
},
|
|
978
993
|
renderer: n
|
|
979
|
-
}), f), f,
|
|
994
|
+
}), f), f, s, t));
|
|
980
995
|
{
|
|
981
|
-
const y = [...
|
|
996
|
+
const y = [...F].sort((u, v) => u.metadata.renderOrder - v.metadata.renderOrder);
|
|
982
997
|
if (f.parentId === null) {
|
|
983
|
-
if (!l &&
|
|
984
|
-
let
|
|
998
|
+
if (!l && sn(y)) return se(le(an(y, t, o), f), f, s, t);
|
|
999
|
+
let u;
|
|
985
1000
|
for (let v = 0; v < y.length; v++) {
|
|
986
1001
|
const c = y[v];
|
|
987
|
-
let
|
|
988
|
-
if (c.metadata.opacity === void 0 ? (
|
|
1002
|
+
let $;
|
|
1003
|
+
if (c.metadata.opacity === void 0 ? ($ = 1, c.opacityUniform.value = $) : ($ = c.metadata.opacity, c.opacityUniform.value = $), c.metadata.visible === !1) continue;
|
|
989
1004
|
o && o.add(c.id);
|
|
990
|
-
const
|
|
1005
|
+
const P = Q(c.id).length > 0;
|
|
991
1006
|
let T;
|
|
992
|
-
if (
|
|
993
|
-
else if (
|
|
994
|
-
else if (
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
} else T =
|
|
1007
|
+
if (P) if (l) T = J(c.id, t, o, !0);
|
|
1008
|
+
else if (_e(c)) T = Ie(c.id, t, o);
|
|
1009
|
+
else if (W(c)) {
|
|
1010
|
+
const U = Ye(c.id);
|
|
1011
|
+
U.length > 1 ? T = He(U, t, o) : T = J(c.id, t, o);
|
|
1012
|
+
} else T = J(c.id, t, o);
|
|
998
1013
|
else {
|
|
999
|
-
if (
|
|
1000
|
-
const
|
|
1001
|
-
if (
|
|
1002
|
-
T = on(
|
|
1014
|
+
if (W(c) && c.requiresChild && u !== void 0) {
|
|
1015
|
+
const U = tn(y, v);
|
|
1016
|
+
if (U.length > 1) {
|
|
1017
|
+
T = on(U, u, o), v += U.length - 1, u = T;
|
|
1003
1018
|
continue;
|
|
1004
1019
|
}
|
|
1005
1020
|
}
|
|
1006
|
-
if (c.requiresRTT && !
|
|
1021
|
+
if (c.requiresRTT && !te) T = x(0, 0, 0, 0);
|
|
1007
1022
|
else {
|
|
1008
|
-
const
|
|
1009
|
-
c.cleanupCallbacks.push(
|
|
1010
|
-
},
|
|
1011
|
-
c.beforeRenderCallbacks.push(
|
|
1012
|
-
},
|
|
1013
|
-
c.afterRenderCallbacks.push(
|
|
1014
|
-
},
|
|
1015
|
-
c.resizeCallbacks.push(
|
|
1023
|
+
const U = (L) => {
|
|
1024
|
+
c.cleanupCallbacks.push(L);
|
|
1025
|
+
}, E = (L) => {
|
|
1026
|
+
c.beforeRenderCallbacks.push(L);
|
|
1027
|
+
}, j = (L) => {
|
|
1028
|
+
c.afterRenderCallbacks.push(L);
|
|
1029
|
+
}, O = (L) => {
|
|
1030
|
+
c.resizeCallbacks.push(L);
|
|
1016
1031
|
};
|
|
1017
|
-
let
|
|
1018
|
-
c.requiresRTT &&
|
|
1032
|
+
let G = u;
|
|
1033
|
+
c.requiresRTT && u !== void 0 && (G = K(x(0, 0, 0, 0), u, "normal", 1)), c.cleanupCallbacks.forEach((L) => {
|
|
1019
1034
|
try {
|
|
1020
|
-
|
|
1021
|
-
} catch (
|
|
1022
|
-
console.error("Error in cleanup callback:",
|
|
1035
|
+
L();
|
|
1036
|
+
} catch (_) {
|
|
1037
|
+
console.error("Error in cleanup callback:", _);
|
|
1023
1038
|
}
|
|
1024
|
-
}), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T =
|
|
1039
|
+
}), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T = se(le(c.fragmentNodeFunc({
|
|
1025
1040
|
uniforms: c.uniforms ?? {},
|
|
1026
|
-
childNode:
|
|
1027
|
-
onCleanup:
|
|
1028
|
-
onBeforeRender:
|
|
1029
|
-
onAfterRender:
|
|
1030
|
-
onResize:
|
|
1041
|
+
childNode: G,
|
|
1042
|
+
onCleanup: U,
|
|
1043
|
+
onBeforeRender: E,
|
|
1044
|
+
onAfterRender: j,
|
|
1045
|
+
onResize: O,
|
|
1031
1046
|
canvas: e,
|
|
1032
1047
|
dimensions: {
|
|
1033
|
-
width:
|
|
1034
|
-
height:
|
|
1048
|
+
width: z,
|
|
1049
|
+
height: D
|
|
1035
1050
|
},
|
|
1036
1051
|
renderer: n
|
|
1037
1052
|
}), c), c, c.id, t);
|
|
1038
1053
|
}
|
|
1039
1054
|
}
|
|
1040
|
-
c.requiresChild && c.metadata.blendMode === "normal" && !
|
|
1055
|
+
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
1056
|
}
|
|
1042
|
-
return f.requiresRTT && !
|
|
1057
|
+
return f.requiresRTT && !te ? x(0, 0, 0, 0) : (f.cleanupCallbacks.forEach((v) => {
|
|
1043
1058
|
try {
|
|
1044
1059
|
v();
|
|
1045
1060
|
} catch (c) {
|
|
1046
1061
|
console.error("Error in cleanup callback:", c);
|
|
1047
1062
|
}
|
|
1048
|
-
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [],
|
|
1063
|
+
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [], se(le(f.fragmentNodeFunc({
|
|
1049
1064
|
uniforms: f.uniforms ?? {},
|
|
1050
|
-
childNode:
|
|
1065
|
+
childNode: u,
|
|
1051
1066
|
onCleanup: b,
|
|
1052
1067
|
onBeforeRender: g,
|
|
1053
1068
|
onAfterRender: w,
|
|
1054
|
-
onResize:
|
|
1069
|
+
onResize: M,
|
|
1055
1070
|
canvas: e,
|
|
1056
1071
|
dimensions: {
|
|
1057
|
-
width:
|
|
1058
|
-
height:
|
|
1072
|
+
width: z,
|
|
1073
|
+
height: D
|
|
1059
1074
|
},
|
|
1060
1075
|
renderer: n
|
|
1061
|
-
}), f), f,
|
|
1076
|
+
}), f), f, s, t));
|
|
1062
1077
|
} else {
|
|
1063
|
-
if (!l &&
|
|
1064
|
-
const v =
|
|
1065
|
-
return
|
|
1078
|
+
if (!l && sn(y)) {
|
|
1079
|
+
const v = an(y, t, o);
|
|
1080
|
+
return se(le(f.fragmentNodeFunc({
|
|
1066
1081
|
uniforms: f.uniforms ?? {},
|
|
1067
1082
|
childNode: v,
|
|
1068
1083
|
onCleanup: b,
|
|
1069
1084
|
onBeforeRender: g,
|
|
1070
1085
|
onAfterRender: w,
|
|
1071
|
-
onResize:
|
|
1086
|
+
onResize: M,
|
|
1072
1087
|
canvas: e,
|
|
1073
1088
|
dimensions: {
|
|
1074
|
-
width:
|
|
1075
|
-
height:
|
|
1089
|
+
width: z,
|
|
1090
|
+
height: D
|
|
1076
1091
|
},
|
|
1077
1092
|
renderer: n
|
|
1078
|
-
}), f), f,
|
|
1093
|
+
}), f), f, s, t);
|
|
1079
1094
|
}
|
|
1080
|
-
let
|
|
1095
|
+
let u;
|
|
1081
1096
|
for (let v = 0; v < y.length; v++) {
|
|
1082
1097
|
const c = y[v];
|
|
1083
|
-
let
|
|
1084
|
-
if (c.metadata.opacity === void 0 ? (
|
|
1098
|
+
let $;
|
|
1099
|
+
if (c.metadata.opacity === void 0 ? ($ = 1, c.opacityUniform.value = $) : ($ = c.metadata.opacity, c.opacityUniform.value = $), c.metadata.visible === !1) continue;
|
|
1085
1100
|
o && o.add(c.id);
|
|
1086
|
-
const
|
|
1101
|
+
const P = Q(c.id).length > 0;
|
|
1087
1102
|
let T;
|
|
1088
|
-
if (
|
|
1089
|
-
else if (
|
|
1090
|
-
else if (
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
} else T =
|
|
1103
|
+
if (P) if (l) T = J(c.id, t, o, !0);
|
|
1104
|
+
else if (_e(c)) T = Ie(c.id, t, o);
|
|
1105
|
+
else if (W(c)) {
|
|
1106
|
+
const U = Ye(c.id);
|
|
1107
|
+
U.length > 1 ? T = He(U, t, o) : T = J(c.id, t, o);
|
|
1108
|
+
} else T = J(c.id, t, o);
|
|
1094
1109
|
else {
|
|
1095
|
-
if (
|
|
1096
|
-
const
|
|
1097
|
-
if (
|
|
1098
|
-
T = on(
|
|
1110
|
+
if (W(c) && c.requiresChild && u !== void 0) {
|
|
1111
|
+
const U = tn(y, v);
|
|
1112
|
+
if (U.length > 1) {
|
|
1113
|
+
T = on(U, u, o), v += U.length - 1, u = T;
|
|
1099
1114
|
continue;
|
|
1100
1115
|
}
|
|
1101
1116
|
}
|
|
1102
|
-
if (c.requiresRTT && !
|
|
1117
|
+
if (c.requiresRTT && !te) T = x(0, 0, 0, 0);
|
|
1103
1118
|
else {
|
|
1104
|
-
const
|
|
1105
|
-
c.cleanupCallbacks.push(
|
|
1106
|
-
},
|
|
1107
|
-
c.beforeRenderCallbacks.push(
|
|
1108
|
-
},
|
|
1109
|
-
c.afterRenderCallbacks.push(
|
|
1110
|
-
},
|
|
1111
|
-
c.resizeCallbacks.push(
|
|
1119
|
+
const U = (L) => {
|
|
1120
|
+
c.cleanupCallbacks.push(L);
|
|
1121
|
+
}, E = (L) => {
|
|
1122
|
+
c.beforeRenderCallbacks.push(L);
|
|
1123
|
+
}, j = (L) => {
|
|
1124
|
+
c.afterRenderCallbacks.push(L);
|
|
1125
|
+
}, O = (L) => {
|
|
1126
|
+
c.resizeCallbacks.push(L);
|
|
1112
1127
|
};
|
|
1113
|
-
let
|
|
1114
|
-
c.requiresRTT &&
|
|
1128
|
+
let G = u;
|
|
1129
|
+
c.requiresRTT && u !== void 0 && (G = K(x(0, 0, 0, 0), u, "normal", 1)), c.cleanupCallbacks = [], c.beforeRenderCallbacks = [], c.afterRenderCallbacks = [], c.resizeCallbacks = [], T = se(le(c.fragmentNodeFunc({
|
|
1115
1130
|
uniforms: c.uniforms ?? {},
|
|
1116
|
-
childNode:
|
|
1117
|
-
onCleanup:
|
|
1118
|
-
onBeforeRender:
|
|
1119
|
-
onAfterRender:
|
|
1120
|
-
onResize:
|
|
1131
|
+
childNode: G,
|
|
1132
|
+
onCleanup: U,
|
|
1133
|
+
onBeforeRender: E,
|
|
1134
|
+
onAfterRender: j,
|
|
1135
|
+
onResize: O,
|
|
1121
1136
|
canvas: e,
|
|
1122
1137
|
dimensions: {
|
|
1123
|
-
width:
|
|
1124
|
-
height:
|
|
1138
|
+
width: z,
|
|
1139
|
+
height: D
|
|
1125
1140
|
},
|
|
1126
1141
|
renderer: n
|
|
1127
1142
|
}), c), c, c.id, t);
|
|
1128
1143
|
}
|
|
1129
1144
|
}
|
|
1130
|
-
c.requiresChild && c.metadata.blendMode === "normal" && !
|
|
1145
|
+
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
1146
|
}
|
|
1132
|
-
return f.requiresRTT && !
|
|
1147
|
+
return f.requiresRTT && !te ? x(0, 0, 0, 0) : (f.cleanupCallbacks.forEach((v) => {
|
|
1133
1148
|
try {
|
|
1134
1149
|
v();
|
|
1135
1150
|
} catch (c) {
|
|
1136
1151
|
console.error("Error in cleanup callback:", c);
|
|
1137
1152
|
}
|
|
1138
|
-
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [],
|
|
1153
|
+
}), f.cleanupCallbacks = [], f.beforeRenderCallbacks = [], f.afterRenderCallbacks = [], f.resizeCallbacks = [], se(le(f.fragmentNodeFunc({
|
|
1139
1154
|
uniforms: f.uniforms ?? {},
|
|
1140
|
-
childNode:
|
|
1155
|
+
childNode: u,
|
|
1141
1156
|
onCleanup: b,
|
|
1142
1157
|
onBeforeRender: g,
|
|
1143
1158
|
onAfterRender: w,
|
|
1144
|
-
onResize:
|
|
1159
|
+
onResize: M,
|
|
1145
1160
|
canvas: e,
|
|
1146
1161
|
dimensions: {
|
|
1147
|
-
width:
|
|
1148
|
-
height:
|
|
1162
|
+
width: z,
|
|
1163
|
+
height: D
|
|
1149
1164
|
},
|
|
1150
1165
|
renderer: n
|
|
1151
|
-
}), f), f,
|
|
1166
|
+
}), f), f, s, t));
|
|
1152
1167
|
}
|
|
1153
1168
|
}
|
|
1154
|
-
}, ln = (
|
|
1169
|
+
}, ln = (s, t, o, l, f = {}, b) => {
|
|
1155
1170
|
if (t === null) {
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1158
|
-
|
|
1171
|
+
const u = oe.findIndex((v) => v.id === s);
|
|
1172
|
+
if (u !== -1) {
|
|
1173
|
+
oe.splice(u, 1);
|
|
1159
1174
|
return;
|
|
1160
1175
|
}
|
|
1161
|
-
We(
|
|
1176
|
+
We(s);
|
|
1162
1177
|
return;
|
|
1163
1178
|
}
|
|
1164
1179
|
if (!qe) {
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
id:
|
|
1180
|
+
const u = oe.findIndex((v) => v.id === s);
|
|
1181
|
+
u !== -1 ? oe[u] = {
|
|
1182
|
+
id: s,
|
|
1168
1183
|
fragmentNodeFunc: t,
|
|
1169
1184
|
parentId: o,
|
|
1170
1185
|
metadata: l,
|
|
1171
1186
|
uniforms: f,
|
|
1172
1187
|
componentDefinition: b
|
|
1173
|
-
} :
|
|
1174
|
-
id:
|
|
1188
|
+
} : oe.push({
|
|
1189
|
+
id: s,
|
|
1175
1190
|
fragmentNodeFunc: t,
|
|
1176
1191
|
parentId: o,
|
|
1177
1192
|
metadata: l,
|
|
@@ -1182,33 +1197,33 @@ function ca() {
|
|
|
1182
1197
|
}
|
|
1183
1198
|
let g = 0;
|
|
1184
1199
|
if (o !== null) {
|
|
1185
|
-
const
|
|
1186
|
-
if (
|
|
1200
|
+
const u = d.get(o);
|
|
1201
|
+
if (u && u.size > 0) {
|
|
1187
1202
|
let v = 0;
|
|
1188
|
-
for (const c of
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1203
|
+
for (const c of u) {
|
|
1204
|
+
const $ = h.nodes.get(c);
|
|
1205
|
+
$ && $.metadata.renderOrder > v && (v = $.metadata.renderOrder);
|
|
1191
1206
|
}
|
|
1192
1207
|
g = v + 1;
|
|
1193
1208
|
}
|
|
1194
1209
|
}
|
|
1195
|
-
const w =
|
|
1196
|
-
let
|
|
1210
|
+
const w = N(l?.opacity !== void 0 ? l.opacity : 1);
|
|
1211
|
+
let M;
|
|
1197
1212
|
if (l?.transform) {
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
offsetX:
|
|
1201
|
-
offsetY:
|
|
1202
|
-
rotation:
|
|
1203
|
-
scale:
|
|
1204
|
-
anchorX:
|
|
1205
|
-
anchorY:
|
|
1206
|
-
edges:
|
|
1207
|
-
aspectRatio:
|
|
1213
|
+
const u = z / Math.max(1, D);
|
|
1214
|
+
M = {
|
|
1215
|
+
offsetX: N(l.transform.offsetX),
|
|
1216
|
+
offsetY: N(l.transform.offsetY),
|
|
1217
|
+
rotation: N(l.transform.rotation),
|
|
1218
|
+
scale: N(l.transform.scale),
|
|
1219
|
+
anchorX: N(l.transform.anchorX),
|
|
1220
|
+
anchorY: N(l.transform.anchorY),
|
|
1221
|
+
edges: N(l.transform.edges === "stretch" ? 0 : l.transform.edges === "transparent" ? 1 : l.transform.edges === "mirror" ? 2 : 3),
|
|
1222
|
+
aspectRatio: N(u)
|
|
1208
1223
|
};
|
|
1209
1224
|
}
|
|
1210
|
-
const
|
|
1211
|
-
id:
|
|
1225
|
+
const F = {
|
|
1226
|
+
id: s,
|
|
1212
1227
|
componentName: b?.name || "Unknown",
|
|
1213
1228
|
fragmentNodeFunc: t,
|
|
1214
1229
|
parentId: o,
|
|
@@ -1229,81 +1244,81 @@ function ca() {
|
|
|
1229
1244
|
beforeRenderCallbacks: [],
|
|
1230
1245
|
afterRenderCallbacks: [],
|
|
1231
1246
|
resizeCallbacks: [],
|
|
1232
|
-
transformUniforms:
|
|
1247
|
+
transformUniforms: M,
|
|
1233
1248
|
transformRTTActive: !1,
|
|
1234
1249
|
uvTransformFunc: b?.uvTransformNode,
|
|
1235
1250
|
acceptsUVContext: b?.acceptsUVContext || !1
|
|
1236
1251
|
};
|
|
1237
|
-
h.nodes.set(
|
|
1252
|
+
h.nodes.set(s, F), o === null && (h.rootId = s);
|
|
1238
1253
|
const y = d.get(o) || /* @__PURE__ */ new Set();
|
|
1239
|
-
y.add(
|
|
1240
|
-
|
|
1241
|
-
}))) : p &&
|
|
1242
|
-
|
|
1254
|
+
y.add(s), d.set(o, y), p && B && z > 0 && D > 0 ? (Ee.includes(s) || Ee.push(s), ge === null && (ge = requestAnimationFrame(() => {
|
|
1255
|
+
ge = null, Ee = [], he();
|
|
1256
|
+
}))) : p && B && (ve || (ve = !0, requestAnimationFrame(() => {
|
|
1257
|
+
ve = !1, z > 0 && D > 0 && he();
|
|
1243
1258
|
})));
|
|
1244
|
-
},
|
|
1245
|
-
const l = h.nodes.get(
|
|
1259
|
+
}, Fn = (s, t, o) => {
|
|
1260
|
+
const l = h.nodes.get(s);
|
|
1246
1261
|
if (!l || !l.uniforms) return;
|
|
1247
1262
|
const f = l.uniforms[t];
|
|
1248
1263
|
if (!(!f || !f.uniform)) {
|
|
1249
1264
|
if (f.transform) {
|
|
1250
|
-
const { updateUniformValue: b } = (
|
|
1265
|
+
const { updateUniformValue: b } = (Un(), Wn(qt));
|
|
1251
1266
|
b(f, o);
|
|
1252
1267
|
} else f.uniform.value = o;
|
|
1253
|
-
|
|
1268
|
+
X && re();
|
|
1254
1269
|
}
|
|
1255
|
-
},
|
|
1256
|
-
const o = h.nodes.get(
|
|
1270
|
+
}, En = (s, t) => {
|
|
1271
|
+
const o = h.nodes.get(s);
|
|
1257
1272
|
if (!o) return;
|
|
1258
1273
|
let l = !1;
|
|
1259
1274
|
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
1275
|
const f = t.visible !== !1;
|
|
1261
1276
|
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 ?
|
|
1277
|
+
const b = o.metadata.transform ? fe(o.metadata.transform) : !1, g = fe(t.transform);
|
|
1263
1278
|
if (o.metadata.transform = t.transform, !o.transformUniforms && t.transform) {
|
|
1264
|
-
const w =
|
|
1279
|
+
const w = z / Math.max(1, D);
|
|
1265
1280
|
o.transformUniforms = {
|
|
1266
|
-
offsetX:
|
|
1267
|
-
offsetY:
|
|
1268
|
-
rotation:
|
|
1269
|
-
scale:
|
|
1270
|
-
anchorX:
|
|
1271
|
-
anchorY:
|
|
1272
|
-
edges:
|
|
1273
|
-
aspectRatio:
|
|
1281
|
+
offsetX: N(t.transform.offsetX),
|
|
1282
|
+
offsetY: N(t.transform.offsetY),
|
|
1283
|
+
rotation: N(t.transform.rotation),
|
|
1284
|
+
scale: N(t.transform.scale),
|
|
1285
|
+
anchorX: N(t.transform.anchorX),
|
|
1286
|
+
anchorY: N(t.transform.anchorY),
|
|
1287
|
+
edges: N(t.transform.edges === "stretch" ? 0 : t.transform.edges === "transparent" ? 1 : t.transform.edges === "mirror" ? 2 : 3),
|
|
1288
|
+
aspectRatio: N(w)
|
|
1274
1289
|
};
|
|
1275
1290
|
} 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
1291
|
g && !o.transformRTTActive && (o.transformRTTActive = !0, l = !0), !b && g && !o.transformRTTActive && (l = !0);
|
|
1277
1292
|
}
|
|
1278
|
-
l && p &&
|
|
1279
|
-
|
|
1280
|
-
}))) :
|
|
1281
|
-
}, We = (
|
|
1282
|
-
if (!h.nodes.has(
|
|
1283
|
-
const t = h.nodes.get(
|
|
1293
|
+
l && p && B ? (Oe.includes(s) || Oe.push(s), be === null && (be = requestAnimationFrame(() => {
|
|
1294
|
+
be = null, Oe = [], he();
|
|
1295
|
+
}))) : X && re();
|
|
1296
|
+
}, We = (s) => {
|
|
1297
|
+
if (!h.nodes.has(s)) return;
|
|
1298
|
+
const t = h.nodes.get(s);
|
|
1284
1299
|
if (t && t.cleanupCallbacks.length > 0) for (const l of t.cleanupCallbacks) try {
|
|
1285
1300
|
l();
|
|
1286
1301
|
} catch (f) {
|
|
1287
|
-
console.error(`Error executing cleanup callback for node ${
|
|
1302
|
+
console.error(`Error executing cleanup callback for node ${s}:`, f);
|
|
1288
1303
|
}
|
|
1289
|
-
const o =
|
|
1304
|
+
const o = Q(s);
|
|
1290
1305
|
for (const l of o) We(l.id);
|
|
1291
|
-
if (h.rootId ===
|
|
1306
|
+
if (h.rootId === s && (h.rootId = null), t) {
|
|
1292
1307
|
const l = d.get(t.parentId);
|
|
1293
|
-
l && (l.delete(
|
|
1308
|
+
l && (l.delete(s), l.size === 0 && d.delete(t.parentId));
|
|
1294
1309
|
}
|
|
1295
|
-
h.nodes.delete(
|
|
1296
|
-
},
|
|
1310
|
+
h.nodes.delete(s), p && B && he();
|
|
1311
|
+
}, On = (s) => {
|
|
1297
1312
|
const t = {
|
|
1298
|
-
deltaTime:
|
|
1313
|
+
deltaTime: s,
|
|
1299
1314
|
pointer: {
|
|
1300
|
-
x:
|
|
1301
|
-
y:
|
|
1315
|
+
x: $e,
|
|
1316
|
+
y: ze
|
|
1302
1317
|
},
|
|
1303
|
-
pointerActive:
|
|
1318
|
+
pointerActive: ue,
|
|
1304
1319
|
dimensions: {
|
|
1305
|
-
width:
|
|
1306
|
-
height:
|
|
1320
|
+
width: z,
|
|
1321
|
+
height: D
|
|
1307
1322
|
}
|
|
1308
1323
|
};
|
|
1309
1324
|
for (const o of h.nodes.values()) if (o.beforeRenderCallbacks.length > 0) for (const l of o.beforeRenderCallbacks) try {
|
|
@@ -1311,17 +1326,17 @@ function ca() {
|
|
|
1311
1326
|
} catch (f) {
|
|
1312
1327
|
console.error(`Error executing before render callback for node ${o.id}:`, f);
|
|
1313
1328
|
}
|
|
1314
|
-
},
|
|
1329
|
+
}, Bn = (s) => {
|
|
1315
1330
|
const t = {
|
|
1316
|
-
deltaTime:
|
|
1331
|
+
deltaTime: s,
|
|
1317
1332
|
pointer: {
|
|
1318
|
-
x:
|
|
1319
|
-
y:
|
|
1333
|
+
x: $e,
|
|
1334
|
+
y: ze
|
|
1320
1335
|
},
|
|
1321
|
-
pointerActive:
|
|
1336
|
+
pointerActive: ue,
|
|
1322
1337
|
dimensions: {
|
|
1323
|
-
width:
|
|
1324
|
-
height:
|
|
1338
|
+
width: z,
|
|
1339
|
+
height: D
|
|
1325
1340
|
}
|
|
1326
1341
|
};
|
|
1327
1342
|
for (const o of h.nodes.values()) if (o.afterRenderCallbacks.length > 0) for (const l of o.afterRenderCallbacks) try {
|
|
@@ -1329,24 +1344,24 @@ function ca() {
|
|
|
1329
1344
|
} catch (f) {
|
|
1330
1345
|
console.error(`Error executing after render callback for node ${o.id}:`, f);
|
|
1331
1346
|
}
|
|
1332
|
-
},
|
|
1333
|
-
if (!
|
|
1334
|
-
const
|
|
1335
|
-
Le = t,
|
|
1347
|
+
}, re = async () => {
|
|
1348
|
+
if (!xn()) return;
|
|
1349
|
+
const s = de ? performance.now() : 0, t = s || performance.now(), o = Le > 0 ? (t - Le) / 1e3 : 0.016, l = Math.min(o, 0.1);
|
|
1350
|
+
Le = t, de && performance.mark("shader-cpu-start"), On(l);
|
|
1336
1351
|
try {
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1352
|
+
if (De) return;
|
|
1353
|
+
de && performance.mark("shader-gpu-start");
|
|
1339
1354
|
const f = performance.now();
|
|
1340
|
-
n.render(r,
|
|
1355
|
+
n.render(r, a);
|
|
1341
1356
|
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`),
|
|
1357
|
+
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`), Bn(l), de) {
|
|
1343
1358
|
if (performance.mark("shader-gpu-end"), n instanceof Je) try {
|
|
1344
1359
|
const g = n.backend;
|
|
1345
1360
|
if (g && g.get && g.get(n)) {
|
|
1346
1361
|
const w = g.get(n);
|
|
1347
1362
|
if (w?.timestampQuery) {
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1363
|
+
const M = w.timestampQuery.getResult();
|
|
1364
|
+
M != null && ie.recordGpuTime(M / 1e6);
|
|
1350
1365
|
}
|
|
1351
1366
|
}
|
|
1352
1367
|
} catch {
|
|
@@ -1358,7 +1373,7 @@ function ca() {
|
|
|
1358
1373
|
} catch {
|
|
1359
1374
|
}
|
|
1360
1375
|
}
|
|
1361
|
-
if (
|
|
1376
|
+
if (de) {
|
|
1362
1377
|
performance.mark("shader-cpu-end");
|
|
1363
1378
|
try {
|
|
1364
1379
|
performance.measure("shader-cpu-time", "shader-cpu-start", "shader-cpu-end");
|
|
@@ -1366,83 +1381,83 @@ function ca() {
|
|
|
1366
1381
|
w && ie.recordCpuTime(w.duration), performance.clearMarks("shader-cpu-start"), performance.clearMarks("shader-cpu-end"), performance.clearMeasures("shader-cpu-time");
|
|
1367
1382
|
} catch {
|
|
1368
1383
|
}
|
|
1369
|
-
const g = performance.now() -
|
|
1384
|
+
const g = performance.now() - s;
|
|
1370
1385
|
ie.recordFrame(g);
|
|
1371
1386
|
}
|
|
1372
1387
|
} catch (f) {
|
|
1373
1388
|
console.error("Render frame error:", f);
|
|
1374
1389
|
}
|
|
1375
|
-
}, Bn = () => {
|
|
1376
|
-
const a = Math.max(0, h.nodes.size - 1), t = Ee;
|
|
1377
|
-
ie.updateNodeCounts(a, t);
|
|
1378
1390
|
}, Pn = () => {
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1391
|
+
const s = Math.max(0, h.nodes.size - 1), t = Be;
|
|
1392
|
+
ie.updateNodeCounts(s, t);
|
|
1393
|
+
}, _n = () => {
|
|
1394
|
+
Pn();
|
|
1395
|
+
const s = n?.info;
|
|
1396
|
+
return ie.getStats(s);
|
|
1382
1397
|
}, je = () => {
|
|
1383
|
-
if (R || !ae || !
|
|
1398
|
+
if (R || !ae || !X) return;
|
|
1384
1399
|
ie.setRendering(!0);
|
|
1385
|
-
const
|
|
1386
|
-
R = requestAnimationFrame(
|
|
1400
|
+
const s = () => {
|
|
1401
|
+
R = requestAnimationFrame(s), re().catch(console.warn);
|
|
1387
1402
|
};
|
|
1388
|
-
|
|
1403
|
+
s();
|
|
1389
1404
|
}, Qe = () => {
|
|
1390
1405
|
R && (cancelAnimationFrame(R), R = null), ie.setRendering(!1);
|
|
1391
|
-
}, cn = (
|
|
1406
|
+
}, cn = (s) => {
|
|
1392
1407
|
if (!e) return;
|
|
1393
1408
|
let t, o;
|
|
1394
|
-
if ("touches" in
|
|
1395
|
-
if (
|
|
1396
|
-
t =
|
|
1409
|
+
if ("touches" in s) {
|
|
1410
|
+
if (s.touches.length === 0) return;
|
|
1411
|
+
t = s.touches[0].clientX, o = s.touches[0].clientY;
|
|
1397
1412
|
} else
|
|
1398
|
-
t =
|
|
1413
|
+
t = s.clientX, o = s.clientY;
|
|
1399
1414
|
const l = e.getBoundingClientRect(), f = (t - l.left) / l.width, b = (o - l.top) / l.height;
|
|
1400
|
-
|
|
1401
|
-
},
|
|
1402
|
-
!
|
|
1403
|
-
},
|
|
1404
|
-
!
|
|
1405
|
-
}, Ln = () => {
|
|
1406
|
-
E && (fe = !1, ee().catch(console.warn));
|
|
1415
|
+
$e = f, ze = b;
|
|
1416
|
+
}, Vn = (s) => {
|
|
1417
|
+
!B || !e || cn(s);
|
|
1418
|
+
}, Ln = (s) => {
|
|
1419
|
+
!B || !e || cn(s);
|
|
1407
1420
|
}, qn = () => {
|
|
1408
|
-
|
|
1409
|
-
}, fn = () => {
|
|
1410
|
-
fe = !0, ee().catch(console.warn);
|
|
1411
|
-
}, un = () => {
|
|
1412
|
-
fe = !0, ee().catch(console.warn);
|
|
1421
|
+
B && (ue = !1, re().catch(console.warn));
|
|
1413
1422
|
}, Gn = () => {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
const
|
|
1423
|
+
B && (ue = !1, re().catch(console.warn));
|
|
1424
|
+
}, fn = () => {
|
|
1425
|
+
ue = !0, re().catch(console.warn);
|
|
1426
|
+
}, mn = () => {
|
|
1427
|
+
ue = !0, re().catch(console.warn);
|
|
1428
|
+
}, Nn = () => {
|
|
1429
|
+
if (oe.length === 0) return;
|
|
1430
|
+
const s = [...oe];
|
|
1431
|
+
oe = [];
|
|
1432
|
+
for (const { id: t, fragmentNodeFunc: o, parentId: l, metadata: f, uniforms: b, componentDefinition: g } of s) o && ln(t, o, l, f, b, g);
|
|
1433
|
+
}, Xn = async ({ canvas: s, enablePerformanceTracking: t = !1 }) => {
|
|
1434
|
+
if (B || ne) return;
|
|
1435
|
+
de = t, ne = !0, H = new AbortController();
|
|
1436
|
+
const o = H;
|
|
1422
1437
|
try {
|
|
1423
|
-
if (e =
|
|
1424
|
-
onMouseMove:
|
|
1425
|
-
onTouchMove:
|
|
1426
|
-
onMouseUp:
|
|
1427
|
-
onTouchEnd:
|
|
1428
|
-
}),
|
|
1429
|
-
|
|
1430
|
-
}, window.addEventListener("beforeunload",
|
|
1438
|
+
if (e = s, r = new Kn(), r.background = null, a = new In(-1, 1, 1, -1, 0.1, 10), a.position.z = 1, a.lookAt(0, 0, 0), Fe = Xt.register({
|
|
1439
|
+
onMouseMove: Vn,
|
|
1440
|
+
onTouchMove: Ln,
|
|
1441
|
+
onMouseUp: qn,
|
|
1442
|
+
onTouchEnd: Gn
|
|
1443
|
+
}), s.addEventListener("mousedown", fn), s.addEventListener("touchstart", mn), Re = () => {
|
|
1444
|
+
un();
|
|
1445
|
+
}, window.addEventListener("beforeunload", Re), o.signal.aborted) return;
|
|
1431
1446
|
try {
|
|
1432
|
-
const
|
|
1433
|
-
canvas:
|
|
1447
|
+
const F = {
|
|
1448
|
+
canvas: s,
|
|
1434
1449
|
antialias: !0,
|
|
1435
1450
|
alpha: !0,
|
|
1436
1451
|
depth: !1,
|
|
1437
1452
|
powerPreference: "high-performance"
|
|
1438
1453
|
};
|
|
1439
|
-
if (
|
|
1440
|
-
} catch (
|
|
1454
|
+
if (de && (F.forceWebGL = !1, F.requiredFeatures = ["timestamp-query"]), n = new Je(F), await n.init(), o.signal.aborted) return;
|
|
1455
|
+
} catch (F) {
|
|
1441
1456
|
if (o.signal.aborted) return;
|
|
1442
|
-
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:",
|
|
1457
|
+
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:", F);
|
|
1443
1458
|
try {
|
|
1444
|
-
if (n = new
|
|
1445
|
-
canvas:
|
|
1459
|
+
if (n = new st({
|
|
1460
|
+
canvas: s,
|
|
1446
1461
|
antialias: !0,
|
|
1447
1462
|
alpha: !0,
|
|
1448
1463
|
depth: !1,
|
|
@@ -1455,38 +1470,38 @@ function ca() {
|
|
|
1455
1470
|
}
|
|
1456
1471
|
}
|
|
1457
1472
|
if (o.signal.aborted) return;
|
|
1458
|
-
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace =
|
|
1459
|
-
const l =
|
|
1473
|
+
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace = Hn, p = new dn({ transparent: !0 }), p.fragmentNode = x(0, 0, 0, 0), m = new ar(new Zn(2, 2), p), r.add(m);
|
|
1474
|
+
const l = s.parentElement;
|
|
1460
1475
|
if (!l) {
|
|
1461
1476
|
console.warn("[Shaders] Canvas has no parent element for resize observation");
|
|
1462
1477
|
return;
|
|
1463
1478
|
}
|
|
1464
|
-
S = new ResizeObserver(
|
|
1465
|
-
const f =
|
|
1466
|
-
|
|
1467
|
-
const { width: b, height: g } =
|
|
1468
|
-
w > 0 &&
|
|
1479
|
+
S = new ResizeObserver(Mn), S.observe(l), V = new IntersectionObserver(An, { threshold: 0 }), V.observe(s);
|
|
1480
|
+
const f = s.getBoundingClientRect();
|
|
1481
|
+
X = f.width > 0 && f.height > 0 && f.top < window.innerHeight && f.bottom > 0 && f.left < window.innerWidth && f.right > 0, te = X && f.width > 0 && f.height > 0, ae = !0;
|
|
1482
|
+
const { width: b, height: g } = s.getBoundingClientRect(), w = Math.round(b), M = Math.round(g);
|
|
1483
|
+
w > 0 && M > 0 ? (Ne(w, M), I = !0, await re()) : I = !1, ae && X && je(), o.signal.aborted || (B = !0, qe = !0, Nn());
|
|
1469
1484
|
} catch (l) {
|
|
1470
1485
|
console.error("[Shaders] Initialization error:", l);
|
|
1471
1486
|
} finally {
|
|
1472
|
-
|
|
1487
|
+
ne = !1, H === o && (H = null);
|
|
1473
1488
|
}
|
|
1474
|
-
},
|
|
1475
|
-
!
|
|
1476
|
-
},
|
|
1477
|
-
if (
|
|
1489
|
+
}, Yn = () => {
|
|
1490
|
+
!Yt() || kn || (console.warn("Shaders is running in development mode. Please purchase a license at https://shaders.com to use it in production."), kn = !0);
|
|
1491
|
+
}, un = () => {
|
|
1492
|
+
if (H && H.abort(), S && (S.disconnect(), S = null), V && (V.disconnect(), V = null), Fe && (Fe(), Fe = null), e && (e.removeEventListener("mousedown", fn), e.removeEventListener("touchstart", mn)), Re && (window.removeEventListener("beforeunload", Re), Re = null), Qe(), rn(), Te.forEach((s) => {
|
|
1478
1493
|
try {
|
|
1479
|
-
|
|
1494
|
+
s?.renderTarget?.dispose && s.renderTarget.dispose();
|
|
1480
1495
|
} catch {
|
|
1481
1496
|
}
|
|
1482
|
-
}),
|
|
1483
|
-
r && r.remove(
|
|
1497
|
+
}), Te.clear(), h.nodes.clear(), h.rootId = null, h.idToNodeId.clear(), d.clear(), oe = [], qe = !1, Ee = [], ge !== null && (cancelAnimationFrame(ge), ge = null), Oe = [], be !== null && (cancelAnimationFrame(be), be = null), ke = null, Pe = !1, m) {
|
|
1498
|
+
r && r.remove(m);
|
|
1484
1499
|
try {
|
|
1485
|
-
|
|
1500
|
+
m.geometry && typeof m.geometry.dispose == "function" && m.geometry.dispose();
|
|
1486
1501
|
} catch {
|
|
1487
1502
|
}
|
|
1488
1503
|
try {
|
|
1489
|
-
|
|
1504
|
+
m.material instanceof Jn && typeof m.material.dispose == "function" && m.material.dispose();
|
|
1490
1505
|
} catch {
|
|
1491
1506
|
}
|
|
1492
1507
|
}
|
|
@@ -1494,87 +1509,87 @@ function ca() {
|
|
|
1494
1509
|
n.dispose();
|
|
1495
1510
|
} catch {
|
|
1496
1511
|
}
|
|
1497
|
-
e = null, n = null,
|
|
1512
|
+
e = null, n = null, a = null, r = null, m = null, p = null, B = !1, ne = !1, I = !1, H = null, z = 0, D = 0, X = !1, ae = !0, $e = 0.5, ze = 0.5, ue = !1;
|
|
1498
1513
|
};
|
|
1499
1514
|
return {
|
|
1500
|
-
initialize:
|
|
1501
|
-
cleanup:
|
|
1515
|
+
initialize: Xn,
|
|
1516
|
+
cleanup: un,
|
|
1502
1517
|
registerNode: ln,
|
|
1503
1518
|
removeNode: We,
|
|
1504
|
-
updateUniformValue:
|
|
1505
|
-
updateNodeMetadata:
|
|
1506
|
-
showLicenseWarning:
|
|
1507
|
-
isInitialized: () =>
|
|
1519
|
+
updateUniformValue: Fn,
|
|
1520
|
+
updateNodeMetadata: En,
|
|
1521
|
+
showLicenseWarning: Yn,
|
|
1522
|
+
isInitialized: () => B,
|
|
1508
1523
|
startAnimation: je,
|
|
1509
1524
|
stopAnimation: Qe,
|
|
1510
|
-
getPerformanceStats:
|
|
1525
|
+
getPerformanceStats: _n,
|
|
1511
1526
|
getNodeRegistry: () => ({ nodes: new Map(h.nodes) }),
|
|
1512
1527
|
getRendererType: () => n ? n instanceof Je ? "webgpu" : "webgl" : null
|
|
1513
1528
|
};
|
|
1514
1529
|
}
|
|
1515
|
-
|
|
1516
|
-
function
|
|
1517
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1530
|
+
Un();
|
|
1531
|
+
function fs(e) {
|
|
1532
|
+
const n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), r = {
|
|
1518
1533
|
processingOrder: [],
|
|
1519
1534
|
maskSources: /* @__PURE__ */ new Map(),
|
|
1520
1535
|
circularDependencies: []
|
|
1521
1536
|
};
|
|
1522
|
-
return e.forEach((
|
|
1523
|
-
|
|
1524
|
-
}), e.forEach((
|
|
1525
|
-
if (
|
|
1526
|
-
const p =
|
|
1527
|
-
h ? (
|
|
1537
|
+
return e.forEach((m) => {
|
|
1538
|
+
m.elementId && n.set(m.elementId, m.id);
|
|
1539
|
+
}), e.forEach((m) => {
|
|
1540
|
+
if (m.mask?.source) {
|
|
1541
|
+
const p = m.mask.source.startsWith("#") ? m.mask.source.substring(1) : m.mask.source, h = n.get(p);
|
|
1542
|
+
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
1543
|
}
|
|
1529
|
-
}), r.processingOrder =
|
|
1544
|
+
}), r.processingOrder = It(a, r.circularDependencies), r;
|
|
1530
1545
|
}
|
|
1531
|
-
function
|
|
1532
|
-
const
|
|
1546
|
+
function It(e, n) {
|
|
1547
|
+
const a = [], r = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
|
|
1533
1548
|
function p(d, R = []) {
|
|
1534
1549
|
if (r.has(d)) return;
|
|
1535
|
-
if (
|
|
1536
|
-
const
|
|
1537
|
-
n.push(
|
|
1550
|
+
if (m.has(d)) {
|
|
1551
|
+
const V = [...R.slice(R.indexOf(d)), d];
|
|
1552
|
+
n.push(V);
|
|
1538
1553
|
return;
|
|
1539
1554
|
}
|
|
1540
|
-
|
|
1555
|
+
m.add(d), R.push(d);
|
|
1541
1556
|
const S = e.get(d) || [];
|
|
1542
|
-
for (const
|
|
1543
|
-
|
|
1557
|
+
for (const V of S) p(V, [...R]);
|
|
1558
|
+
m.delete(d), r.add(d), a.push(d);
|
|
1544
1559
|
}
|
|
1545
1560
|
for (const d of e.keys()) r.has(d) || p(d);
|
|
1546
1561
|
const h = new Set([...e.values()].flat());
|
|
1547
|
-
for (const d of h) !r.has(d) && !e.has(d) &&
|
|
1548
|
-
return
|
|
1562
|
+
for (const d of h) !r.has(d) && !e.has(d) && a.push(d);
|
|
1563
|
+
return a.reverse();
|
|
1549
1564
|
}
|
|
1550
1565
|
A();
|
|
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)),
|
|
1566
|
+
var { vec2: Ht, fract: Wt, sin: jt, dot: Qt } = pe;
|
|
1567
|
+
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);
|
|
1553
1568
|
A();
|
|
1554
|
-
var { vec2: Kt } =
|
|
1555
|
-
const
|
|
1556
|
-
const { vec2:
|
|
1557
|
-
return e.add(
|
|
1569
|
+
var { vec2: Kt } = pe;
|
|
1570
|
+
const us = (e = Kt(0), n = 0.02, a = 1, r = 1) => {
|
|
1571
|
+
const { vec2: m, sin: p, cos: h, time: d } = pe, R = r * 1.618033988749895, S = 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(S))), I = m(p(e.y.mul(a).mul(B).add(d.mul(0.05)).add(S)), h(e.x.mul(a).mul(B).add(d.mul(0.05)).add(R))), H = ne.add(I).mul(n);
|
|
1572
|
+
return e.add(H);
|
|
1558
1573
|
};
|
|
1559
1574
|
A();
|
|
1560
|
-
const
|
|
1561
|
-
const { max: p, smoothstep: h, vec4: d } =
|
|
1575
|
+
const ds = (e, n, a = 0.6, r = 0.3, m = 1) => {
|
|
1576
|
+
const { max: p, smoothstep: h, vec4: d } = pe, R = p(p(e.r, e.g), e.b), S = h(a, a + r, R).mul(m).mul(1);
|
|
1562
1577
|
return d(e.rgb.add(n.rgb.mul(S)), e.a);
|
|
1563
1578
|
};
|
|
1564
1579
|
A();
|
|
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(
|
|
1580
|
+
const hs = (e = {}) => {
|
|
1581
|
+
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(), S = R.x.sub(0.5).sub(p(r)).mul(2), V = R.y.sub(0.5).add(p(m)).mul(2), B = S.mul(S).add(V.mul(V)).sqrt();
|
|
1582
|
+
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
1583
|
};
|
|
1569
1584
|
var Zt = () => {
|
|
1570
1585
|
const e = {};
|
|
1571
1586
|
return Object.entries({
|
|
1572
|
-
AngularBlur:
|
|
1587
|
+
AngularBlur: ir,
|
|
1573
1588
|
Ascii: lr,
|
|
1574
1589
|
Blob: cr,
|
|
1575
1590
|
Blur: fr,
|
|
1576
|
-
Bulge:
|
|
1577
|
-
ChannelBlur:
|
|
1591
|
+
Bulge: mr,
|
|
1592
|
+
ChannelBlur: ur,
|
|
1578
1593
|
Checkerboard: dr,
|
|
1579
1594
|
ChromaFlow: hr,
|
|
1580
1595
|
ChromaticAberration: pr,
|
|
@@ -1606,9 +1621,9 @@ var Zt = () => {
|
|
|
1606
1621
|
Posterize: qr,
|
|
1607
1622
|
ProgressiveBlur: Gr,
|
|
1608
1623
|
RadialGradient: Nr,
|
|
1609
|
-
RectangularCoordinates:
|
|
1610
|
-
Ripples:
|
|
1611
|
-
Saturation:
|
|
1624
|
+
RectangularCoordinates: Xr,
|
|
1625
|
+
Ripples: Yr,
|
|
1626
|
+
Saturation: Ir,
|
|
1612
1627
|
SimplexNoise: Hr,
|
|
1613
1628
|
SineWave: Wr,
|
|
1614
1629
|
SolidColor: jr,
|
|
@@ -1621,50 +1636,50 @@ var Zt = () => {
|
|
|
1621
1636
|
Vibrance: rt,
|
|
1622
1637
|
WaveDistortion: tt,
|
|
1623
1638
|
ZoomBlur: ot
|
|
1624
|
-
}).forEach(([
|
|
1625
|
-
const
|
|
1639
|
+
}).forEach(([a, r]) => {
|
|
1640
|
+
const m = {};
|
|
1626
1641
|
r.props && Object.entries(r.props).forEach(([p, h]) => {
|
|
1627
|
-
h.ui && (
|
|
1642
|
+
h.ui && (m[p] = {
|
|
1628
1643
|
ui: h.ui,
|
|
1629
1644
|
default: h.default,
|
|
1630
1645
|
description: h.description
|
|
1631
1646
|
});
|
|
1632
1647
|
}), e[r.name] = {
|
|
1633
1648
|
name: r.name,
|
|
1634
|
-
fileName:
|
|
1649
|
+
fileName: a,
|
|
1635
1650
|
category: r.category || "Uncategorized",
|
|
1636
1651
|
definition: r,
|
|
1637
|
-
propsMetadata:
|
|
1652
|
+
propsMetadata: m
|
|
1638
1653
|
};
|
|
1639
1654
|
}), e;
|
|
1640
1655
|
};
|
|
1641
1656
|
const Ve = Zt();
|
|
1642
|
-
function
|
|
1657
|
+
function ps() {
|
|
1643
1658
|
return Object.values(Ve);
|
|
1644
1659
|
}
|
|
1645
|
-
function
|
|
1660
|
+
function gs(e) {
|
|
1646
1661
|
return Ve[e];
|
|
1647
1662
|
}
|
|
1648
|
-
function
|
|
1663
|
+
function bs(e) {
|
|
1649
1664
|
return Object.values(Ve).filter((n) => n.category === e);
|
|
1650
1665
|
}
|
|
1651
|
-
function
|
|
1666
|
+
function vs() {
|
|
1652
1667
|
const e = new Set(Object.values(Ve).map((n) => n.category));
|
|
1653
1668
|
return Array.from(e).sort();
|
|
1654
1669
|
}
|
|
1655
1670
|
export {
|
|
1656
1671
|
oo as createAnimatedTime,
|
|
1657
1672
|
Gt as createUniformsMap,
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1673
|
+
us as distort,
|
|
1674
|
+
hs as edgeMask,
|
|
1675
|
+
ps as getAllShaders,
|
|
1676
|
+
gs as getShaderByName,
|
|
1677
|
+
vs as getShaderCategories,
|
|
1678
|
+
bs as getShadersByCategory,
|
|
1679
|
+
ds as glow,
|
|
1680
|
+
ms as grain,
|
|
1681
|
+
fs as resolveMaskDependencies,
|
|
1667
1682
|
Ve as shaderRegistry,
|
|
1668
|
-
|
|
1683
|
+
cs as shaderRenderer,
|
|
1669
1684
|
Nt as updateUniformValue
|
|
1670
1685
|
};
|