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