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