shaders 2.2.14 → 2.2.16
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-BTUdXC0g.js → AngularBlur-ClvtyURQ.js} +12 -13
- package/dist/core/{Ascii-Bu8ii7oo.js → Ascii-BT0-K_vw.js} +28 -29
- package/dist/core/{Blob-CzWSpVTR.js → Blob-BlQ_1T_8.js} +12 -13
- package/dist/core/{Blur-BzUO9yxF.js → Blur-421AjWLH.js} +8 -9
- package/dist/core/{Bulge-BCXYAzig.js → Bulge-CZRVoR6C.js} +6 -7
- package/dist/core/{CRTScreen-cJ3XHrI9.js → CRTScreen-C_U9g_IR.js} +8 -9
- package/dist/core/{ChannelBlur-BEK1qzGn.js → ChannelBlur-5pzcB6Zv.js} +4 -5
- package/dist/core/{Checkerboard-B8CnUlbi.js → Checkerboard-CrQkqXhD.js} +10 -11
- package/dist/core/{ChromaFlow-AHO3C4o3.js → ChromaFlow-CNrQdL8f.js} +16 -17
- package/dist/core/{ChromaticAberration-nVg3r1FK.js → ChromaticAberration-D9H7O17Y.js} +6 -7
- package/dist/core/{Circle-C8ltF4BZ.js → Circle-DnLaDn8V.js} +7 -8
- package/dist/core/{CursorTrail-BcaRHjU5.js → CursorTrail-NY6n97VG.js} +19 -20
- package/dist/core/{DiffuseBlur-Dq_vFrB1.js → DiffuseBlur-C_n01ABk.js} +11 -12
- package/dist/core/{Dither-CpN3vGSh.js → Dither-4s-c4zh4.js} +6 -7
- package/dist/core/{DotGrid-BFUzeSQw.js → DotGrid-BYl8XdMi.js} +9 -10
- package/dist/core/{Duotone-DGNEAlye.js → Duotone-DbewOoB4.js} +12 -13
- package/dist/core/{FilmGrain-BAKXXtLg.js → FilmGrain-zA_-knOw.js} +7 -8
- package/dist/core/{FloatingParticles-Fv8JIzKk.js → FloatingParticles-BhVnqMsE.js} +22 -23
- package/dist/core/{GlassTiles-5MyBj1ff.js → GlassTiles-CFI57glh.js} +7 -8
- package/dist/core/{Glow-DvJj7BB7.js → Glow-CQgl3IoS.js} +10 -11
- package/dist/core/{Godrays-D3VnYrAm.js → Godrays-BBCtZxbv.js} +18 -19
- package/dist/core/{Grayscale-oWIF3PV5.js → Grayscale-CAEFLteL.js} +9 -10
- package/dist/core/{Grid-Bov7AA9m.js → Grid-DlM-rVbZ.js} +5 -6
- package/dist/core/{GridDistortion-CWYom5Dw.js → GridDistortion-ZOZphSAT.js} +29 -30
- package/dist/core/{Group-CPk-7fiA.js → Group-BQAs3RiH.js} +7 -8
- package/dist/core/{Halftone-F7fsdu7W.js → Halftone-ci4ga-_J.js} +8 -9
- package/dist/core/{HueShift-CiS4hdtk.js → HueShift-CyxzPcJV.js} +11 -12
- package/dist/core/{ImageTexture-B3Q29OHX.js → ImageTexture-CdAGsPuH.js} +18 -20
- package/dist/core/{Invert-Cyc4JHWc.js → Invert-iPsiIqNZ.js} +7 -8
- package/dist/core/{LinearBlur-BTC54qzk.js → LinearBlur-BEaaoIk-.js} +13 -14
- package/dist/core/{LinearGradient-DPe-Z-lw.js → LinearGradient-DR_7RxLX.js} +10 -11
- package/dist/core/{Liquify-D2nzMDzq.js → Liquify-Bi02_ugh.js} +33 -34
- package/dist/core/{Pixelate-irPzmtQm.js → Pixelate-CSsdT1rr.js} +4 -5
- package/dist/core/{PolarCoordinates-Ck5ZWrQO.js → PolarCoordinates-D626ml58.js} +10 -11
- package/dist/core/{Posterize-DICq_t96.js → Posterize-DhZkMaC7.js} +8 -10
- package/dist/core/{ProgressiveBlur-BuORe3VH.js → ProgressiveBlur-CGtCfLF8.js} +16 -17
- package/dist/core/{RadialGradient-CbaCbOJj.js → RadialGradient-C0_WzmbH.js} +13 -14
- package/dist/core/{RectangularCoordinates-1LIDaeHR.js → RectangularCoordinates-DfXw7fhI.js} +6 -7
- package/dist/core/{Ripples-0Ufm3-fY.js → Ripples-DkemN3eh.js} +9 -10
- package/dist/core/{Saturation-DbSXtSeK.js → Saturation-Dup81Pnq.js} +7 -8
- package/dist/core/{SimplexNoise-BKB94dhx.js → SimplexNoise-BYEiCjDj.js} +9 -10
- package/dist/core/{SineWave-CkWtnzHF.js → SineWave-C6MRPtsy.js} +9 -10
- package/dist/core/{SolidColor-DaB-FHNX.js → SolidColor-BZHRczgb.js} +1 -1
- package/dist/core/{Spherize-CqjZj4yV.js → Spherize-DOAnDx2l.js} +13 -14
- package/dist/core/{Spiral-BkzSmPUL.js → Spiral-BMjnWXh1.js} +11 -12
- package/dist/core/{Strands-DyrV6zDO.js → Strands-BOVsuJLe.js} +14 -15
- package/dist/core/{Stretch-DeBlJ-NH.js → Stretch-D6bHc6yp.js} +13 -14
- package/dist/core/{Swirl-BHn9Ji7_.js → Swirl-BFoc0ImG.js} +14 -15
- package/dist/core/{TiltShift-DiArippe.js → TiltShift-BiNvvhzj.js} +14 -15
- package/dist/core/{Tritone-DrzxJUaq.js → Tritone-gdx2AA0m.js} +9 -10
- package/dist/core/{Twirl-C6xj1p52.js → Twirl-BsV8YbqC.js} +8 -9
- package/dist/core/{Vibrance-C6lNgpWH.js → Vibrance-C182fbSw.js} +5 -6
- package/dist/core/{WaveDistortion-DcXxPZ2w.js → WaveDistortion-CmaS2zDB.js} +12 -13
- package/dist/core/{ZoomBlur-_feIVJs6.js → ZoomBlur-DLf5xQ16.js} +10 -11
- package/dist/core/{colorMixing-C-FChLp0.js → colorMixing--dhzx0ch.js} +10 -11
- package/dist/core/edges-CDzKsauJ.js +15 -0
- package/dist/core/index.js +636 -684
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +3 -3
- package/dist/core/shaders/Ascii/index.js +2 -2
- package/dist/core/shaders/Blob/index.js +5 -5
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/Bulge/index.js +4 -4
- package/dist/core/shaders/CRTScreen/index.js +2 -2
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +4 -4
- package/dist/core/shaders/ChromaFlow/index.js +3 -3
- package/dist/core/shaders/ChromaticAberration/index.js +3 -3
- package/dist/core/shaders/Circle/index.js +3 -3
- package/dist/core/shaders/CursorTrail/index.js +4 -4
- package/dist/core/shaders/DiffuseBlur/index.js +4 -4
- package/dist/core/shaders/Dither/index.js +3 -3
- package/dist/core/shaders/DotGrid/index.js +3 -3
- package/dist/core/shaders/Duotone/index.js +4 -4
- package/dist/core/shaders/FilmGrain/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.js +3 -3
- package/dist/core/shaders/GlassTiles/index.js +2 -2
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +3 -3
- package/dist/core/shaders/Grayscale/index.js +2 -2
- package/dist/core/shaders/Grid/index.js +3 -3
- package/dist/core/shaders/GridDistortion/index.js +4 -4
- package/dist/core/shaders/Group/index.js +2 -2
- package/dist/core/shaders/Halftone/index.js +3 -3
- package/dist/core/shaders/HueShift/index.js +2 -2
- package/dist/core/shaders/ImageTexture/index.js +2 -2
- package/dist/core/shaders/Invert/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.js +3 -3
- package/dist/core/shaders/LinearGradient/index.js +4 -4
- package/dist/core/shaders/Liquify/index.js +4 -4
- package/dist/core/shaders/Pixelate/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.js +4 -4
- package/dist/core/shaders/Posterize/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -3
- package/dist/core/shaders/RadialGradient/index.js +4 -4
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -4
- package/dist/core/shaders/Ripples/index.js +5 -5
- package/dist/core/shaders/Saturation/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.js +5 -5
- package/dist/core/shaders/SineWave/index.js +3 -3
- package/dist/core/shaders/SolidColor/index.js +3 -3
- package/dist/core/shaders/Spherize/index.js +3 -3
- package/dist/core/shaders/Spiral/index.js +4 -4
- package/dist/core/shaders/Strands/index.js +4 -4
- package/dist/core/shaders/Stretch/index.js +4 -4
- package/dist/core/shaders/Swirl/index.js +5 -5
- package/dist/core/shaders/TiltShift/index.js +3 -3
- package/dist/core/shaders/Tritone/index.js +4 -4
- package/dist/core/shaders/Twirl/index.js +4 -4
- package/dist/core/shaders/Vibrance/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +4 -4
- package/dist/core/shaders/ZoomBlur/index.js +3 -3
- package/dist/core/three.tsl-Btj1hLsf.js +43845 -0
- package/dist/core/{time-5uQ65blS.js → time-DbRMw6Jm.js} +4 -5
- package/dist/core/{transformations-DBjTkQ5b.js → transformations-CsrIJXh-.js} +176 -177
- package/dist/react/engine/component.template.d.ts +2 -2
- package/dist/react/index.cjs +83 -79
- package/dist/react/index.js +50779 -50512
- package/dist/svelte/components/AngularBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/Ascii.svelte.d.ts +2 -2
- package/dist/svelte/components/Blob.svelte.d.ts +2 -2
- package/dist/svelte/components/Blur.svelte.d.ts +2 -2
- package/dist/svelte/components/Bulge.svelte.d.ts +2 -2
- package/dist/svelte/components/CRTScreen.svelte.d.ts +2 -2
- package/dist/svelte/components/ChannelBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/Checkerboard.svelte.d.ts +2 -2
- package/dist/svelte/components/ChromaFlow.svelte.d.ts +2 -2
- package/dist/svelte/components/ChromaticAberration.svelte.d.ts +2 -2
- package/dist/svelte/components/Circle.svelte.d.ts +2 -2
- package/dist/svelte/components/CursorTrail.svelte.d.ts +2 -2
- package/dist/svelte/components/DiffuseBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/Dither.svelte.d.ts +2 -2
- package/dist/svelte/components/DotGrid.svelte.d.ts +2 -2
- package/dist/svelte/components/Duotone.svelte.d.ts +2 -2
- package/dist/svelte/components/FilmGrain.svelte.d.ts +2 -2
- package/dist/svelte/components/FloatingParticles.svelte.d.ts +2 -2
- package/dist/svelte/components/GlassTiles.svelte.d.ts +2 -2
- package/dist/svelte/components/Glow.svelte.d.ts +2 -2
- package/dist/svelte/components/Godrays.svelte.d.ts +2 -2
- package/dist/svelte/components/Grayscale.svelte.d.ts +2 -2
- package/dist/svelte/components/Grid.svelte.d.ts +2 -2
- package/dist/svelte/components/GridDistortion.svelte.d.ts +2 -2
- package/dist/svelte/components/Group.svelte.d.ts +2 -2
- package/dist/svelte/components/Halftone.svelte.d.ts +2 -2
- package/dist/svelte/components/HueShift.svelte.d.ts +2 -2
- package/dist/svelte/components/ImageTexture.svelte.d.ts +2 -2
- package/dist/svelte/components/Invert.svelte.d.ts +2 -2
- package/dist/svelte/components/LinearBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/LinearGradient.svelte.d.ts +2 -2
- package/dist/svelte/components/Liquify.svelte.d.ts +2 -2
- package/dist/svelte/components/Pixelate.svelte.d.ts +2 -2
- package/dist/svelte/components/PolarCoordinates.svelte.d.ts +2 -2
- package/dist/svelte/components/Posterize.svelte.d.ts +2 -2
- package/dist/svelte/components/ProgressiveBlur.svelte.d.ts +2 -2
- package/dist/svelte/components/RadialGradient.svelte.d.ts +2 -2
- package/dist/svelte/components/RectangularCoordinates.svelte.d.ts +2 -2
- package/dist/svelte/components/Ripples.svelte.d.ts +2 -2
- package/dist/svelte/components/Saturation.svelte.d.ts +2 -2
- package/dist/svelte/components/SimplexNoise.svelte.d.ts +2 -2
- package/dist/svelte/components/SineWave.svelte.d.ts +2 -2
- package/dist/svelte/components/SolidColor.svelte.d.ts +2 -2
- package/dist/svelte/components/Spherize.svelte.d.ts +2 -2
- package/dist/svelte/components/Spiral.svelte.d.ts +2 -2
- package/dist/svelte/components/Strands.svelte.d.ts +2 -2
- package/dist/svelte/components/Stretch.svelte.d.ts +2 -2
- package/dist/svelte/components/Swirl.svelte.d.ts +2 -2
- package/dist/svelte/components/TiltShift.svelte.d.ts +2 -2
- package/dist/svelte/components/Tritone.svelte.d.ts +2 -2
- package/dist/svelte/components/Twirl.svelte.d.ts +2 -2
- package/dist/svelte/components/Vibrance.svelte.d.ts +2 -2
- package/dist/svelte/components/WaveDistortion.svelte.d.ts +2 -2
- package/dist/svelte/components/ZoomBlur.svelte.d.ts +2 -2
- package/dist/svelte/engine/component.template.svelte.d.ts +2 -2
- package/dist/svelte/index.js +50786 -50519
- package/dist/vue/engine/Shader.vue.d.ts +1 -1
- package/dist/vue/index.js +50430 -50163
- package/package.json +1 -1
- package/dist/core/edges-B-tVdqcI.js +0 -16
- package/dist/core/three.tsl-BqgDcRt9.js +0 -43424
package/dist/core/index.js
CHANGED
|
@@ -1,245 +1,219 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n 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 { B as _n, C as Nn, E as R, F as Ze, I as Pn, L as Xn, M as S, N as ye, O as ue, P as fn, R as Yn, T as Se, V as In, _ as c, b as j, c as Hn, d as Q, g as Me, h as Ke, i as Wn, j as _, k as G, l as Cn, m as en, n as k, o as jn, s as Qn, t as Jn, w as Rn, x as pe, z as Zn } from "./three.tsl-Btj1hLsf.js";
|
|
2
|
+
import { n as ae, t as ge } from "./edges-CDzKsauJ.js";
|
|
3
|
+
import { t as Jr } from "./time-DbRMw6Jm.js";
|
|
4
|
+
import "./transformations-CsrIJXh-.js";
|
|
5
|
+
import { n as Kn } from "./AngularBlur-ClvtyURQ.js";
|
|
6
|
+
import { n as et } from "./Ascii-BT0-K_vw.js";
|
|
7
|
+
import "./colorMixing--dhzx0ch.js";
|
|
8
|
+
import { n as nt } from "./Blob-BlQ_1T_8.js";
|
|
9
|
+
import { n as tt } from "./Blur-421AjWLH.js";
|
|
10
|
+
import { n as rt } from "./Bulge-CZRVoR6C.js";
|
|
11
|
+
import { n as ot } from "./ChannelBlur-5pzcB6Zv.js";
|
|
12
|
+
import { n as it } from "./Checkerboard-CrQkqXhD.js";
|
|
13
|
+
import { n as at } from "./ChromaFlow-CNrQdL8f.js";
|
|
14
|
+
import { n as st } from "./ChromaticAberration-D9H7O17Y.js";
|
|
15
|
+
import { n as lt } from "./Circle-DnLaDn8V.js";
|
|
16
|
+
import { n as ct } from "./CRTScreen-C_U9g_IR.js";
|
|
17
|
+
import { n as ft } from "./CursorTrail-NY6n97VG.js";
|
|
18
|
+
import { n as ut } from "./DiffuseBlur-C_n01ABk.js";
|
|
19
|
+
import { n as mt } from "./Dither-4s-c4zh4.js";
|
|
20
|
+
import { n as dt } from "./DotGrid-BYl8XdMi.js";
|
|
21
|
+
import { n as ht } from "./Duotone-DbewOoB4.js";
|
|
22
|
+
import { n as pt } from "./FilmGrain-zA_-knOw.js";
|
|
23
|
+
import { n as gt } from "./FloatingParticles-BhVnqMsE.js";
|
|
24
|
+
import { n as bt } from "./GlassTiles-CFI57glh.js";
|
|
25
|
+
import { n as vt } from "./Glow-CQgl3IoS.js";
|
|
26
|
+
import { n as Ct } from "./Godrays-BBCtZxbv.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 { n as
|
|
60
|
-
import { n as
|
|
61
|
-
import { n as
|
|
62
|
-
import { WebGLRenderer as
|
|
63
|
-
|
|
64
|
-
D();
|
|
65
|
-
function sr(e, n, l = 1) {
|
|
29
|
+
import { n as Rt } from "./Grayscale-CAEFLteL.js";
|
|
30
|
+
import { n as Tt } from "./Grid-DlM-rVbZ.js";
|
|
31
|
+
import { n as kt } from "./GridDistortion-ZOZphSAT.js";
|
|
32
|
+
import { n as yt } from "./Group-BQAs3RiH.js";
|
|
33
|
+
import { n as wt } from "./Halftone-ci4ga-_J.js";
|
|
34
|
+
import { n as Ut } from "./HueShift-CyxzPcJV.js";
|
|
35
|
+
import { n as St } from "./ImageTexture-CdAGsPuH.js";
|
|
36
|
+
import { n as Mt } from "./Invert-iPsiIqNZ.js";
|
|
37
|
+
import { n as xt } from "./LinearBlur-BEaaoIk-.js";
|
|
38
|
+
import { n as At } from "./LinearGradient-DR_7RxLX.js";
|
|
39
|
+
import { n as Dt } from "./Liquify-Bi02_ugh.js";
|
|
40
|
+
import { n as zt } from "./Pixelate-CSsdT1rr.js";
|
|
41
|
+
import { n as Et } from "./PolarCoordinates-D626ml58.js";
|
|
42
|
+
import { n as $t } from "./Posterize-DhZkMaC7.js";
|
|
43
|
+
import { n as Ft } from "./ProgressiveBlur-CGtCfLF8.js";
|
|
44
|
+
import { n as Ot } from "./RadialGradient-C0_WzmbH.js";
|
|
45
|
+
import { n as Bt } from "./RectangularCoordinates-DfXw7fhI.js";
|
|
46
|
+
import { n as qt } from "./Ripples-DkemN3eh.js";
|
|
47
|
+
import { n as Vt } from "./Saturation-Dup81Pnq.js";
|
|
48
|
+
import { n as Gt } from "./SimplexNoise-BYEiCjDj.js";
|
|
49
|
+
import { n as Lt } from "./SineWave-C6MRPtsy.js";
|
|
50
|
+
import { n as _t } from "./SolidColor-BZHRczgb.js";
|
|
51
|
+
import { n as Nt } from "./Spherize-DOAnDx2l.js";
|
|
52
|
+
import { n as Pt } from "./Spiral-BMjnWXh1.js";
|
|
53
|
+
import { n as Xt } from "./Strands-BOVsuJLe.js";
|
|
54
|
+
import { n as Yt } from "./Stretch-D6bHc6yp.js";
|
|
55
|
+
import { n as It } from "./Swirl-BFoc0ImG.js";
|
|
56
|
+
import { n as Ht } from "./TiltShift-BiNvvhzj.js";
|
|
57
|
+
import { n as Wt } from "./Tritone-gdx2AA0m.js";
|
|
58
|
+
import { n as jt } from "./Twirl-BsV8YbqC.js";
|
|
59
|
+
import { n as Qt } from "./Vibrance-C182fbSw.js";
|
|
60
|
+
import { n as Jt } from "./WaveDistortion-CmaS2zDB.js";
|
|
61
|
+
import { n as Zt } from "./ZoomBlur-DLf5xQ16.js";
|
|
62
|
+
import { WebGLRenderer as Kt } from "three";
|
|
63
|
+
function er(e, n, l = 1) {
|
|
66
64
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
67
65
|
return S(k(c(n.rgb, t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
68
66
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, hn = (e) => {
|
|
67
|
+
var un = (e) => _(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))), nr = (e) => _(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))), mn = (e) => {
|
|
68
|
+
const n = e.x, l = e.y, t = e.z, u = n.mul(0.4122214708).add(l.mul(0.5363325363)).add(t.mul(0.0514459929)), p = n.mul(0.2119034982).add(l.mul(0.6806995451).add(t.mul(0.1073969566))), h = n.mul(0.0883024619).add(l.mul(0.2817188376)).add(t.mul(0.6299787005)), d = j(u, Q(1 / 3)), T = j(p, Q(1 / 3)), U = j(h, Q(1 / 3));
|
|
69
|
+
return _(d.mul(0.2104542553).add(T.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(T.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(T.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
70
|
+
}, tr = (e) => {
|
|
71
|
+
const n = e.x, l = e.y, t = e.z, u = n.add(l.mul(0.3963377774)).add(t.mul(0.2158037573)), p = n.sub(l.mul(0.1055613458)).sub(t.mul(0.0638541728)), h = n.sub(l.mul(0.0894841775)).sub(t.mul(1.291485548)), d = j(u, Q(3)), T = j(p, Q(3)), U = j(h, Q(3));
|
|
72
|
+
return _(d.mul(4.0767416621).sub(T.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(T.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(T.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
73
|
+
}, dn = (e) => {
|
|
77
74
|
const n = e.x, l = e.y, t = e.z;
|
|
78
|
-
return
|
|
79
|
-
},
|
|
75
|
+
return _(n, Rn(l.mul(l).add(t.mul(t))), Wn(t, l));
|
|
76
|
+
}, rr = (e) => {
|
|
80
77
|
const n = e.x, l = e.y, t = e.z;
|
|
81
|
-
return
|
|
78
|
+
return _(n, l.mul(Qn(t)), l.mul(Nn(t)));
|
|
82
79
|
};
|
|
83
|
-
function
|
|
84
|
-
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p =
|
|
85
|
-
return S(
|
|
80
|
+
function or(e, n, l = 1) {
|
|
81
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = un(_(e.r, e.g, e.b)), h = un(_(n.r, n.g, n.b)), d = mn(p), T = mn(h), U = dn(d);
|
|
82
|
+
return S(nr(tr(rr(k(c(dn(T), t), c(U, c(e.a, R(1, t))))))), u);
|
|
86
83
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return N(d.mul(4.0767416621).sub(T.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(T.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(T.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
84
|
+
var hn = (e) => _(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))), ir = (e) => _(e.x.mul(0.8224621).add(e.y.mul(0.177538)).add(e.z.mul(0)), e.x.mul(0.0331941).add(e.y.mul(0.9668058)).add(e.z.mul(0)), e.x.mul(0.0170826).add(e.y.mul(0.0723974)).add(e.z.mul(0.9105199))), pn = (e) => {
|
|
85
|
+
const n = e.x, l = e.y, t = e.z, u = n.mul(0.4122214708).add(l.mul(0.5363325363)).add(t.mul(0.0514459929)), p = n.mul(0.2119034982).add(l.mul(0.6806995451).add(t.mul(0.1073969566))), h = n.mul(0.0883024619).add(l.mul(0.2817188376)).add(t.mul(0.6299787005)), d = j(u, Q(1 / 3)), T = j(p, Q(1 / 3)), U = j(h, Q(1 / 3));
|
|
86
|
+
return _(d.mul(0.2104542553).add(T.mul(0.793617785)).sub(U.mul(0.0040720468)), d.mul(1.9779984951).sub(T.mul(2.428592205)).add(U.mul(0.4505937099)), d.mul(0.0259040371).add(T.mul(0.7827717662)).sub(U.mul(0.808675766)));
|
|
87
|
+
}, ar = (e) => {
|
|
88
|
+
const n = e.x, l = e.y, t = e.z, u = n.add(l.mul(0.3963377774)).add(t.mul(0.2158037573)), p = n.sub(l.mul(0.1055613458)).sub(t.mul(0.0638541728)), h = n.sub(l.mul(0.0894841775)).sub(t.mul(1.291485548)), d = j(u, Q(3)), T = j(p, Q(3)), U = j(h, Q(3));
|
|
89
|
+
return _(d.mul(4.0767416621).sub(T.mul(3.3077115913)).add(U.mul(0.2309699292)), d.mul(-1.2684380046).add(T.mul(2.6097574011)).sub(U.mul(0.3413193965)), d.mul(-0.0041960863).sub(T.mul(0.7034186147)).add(U.mul(1.707614701)));
|
|
94
90
|
};
|
|
95
|
-
function
|
|
96
|
-
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p =
|
|
97
|
-
return S(
|
|
91
|
+
function sr(e, n, l = 1) {
|
|
92
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = hn(_(e.r, e.g, e.b)), h = hn(_(n.r, n.g, n.b)), d = pn(p);
|
|
93
|
+
return S(ir(ar(k(c(pn(h), t), c(d, c(e.a, R(1, t)))))), u);
|
|
98
94
|
}
|
|
99
|
-
|
|
100
|
-
function pr(e, n, l = 1) {
|
|
95
|
+
function lr(e, n, l = 1) {
|
|
101
96
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
102
97
|
return S(k(c(c(e.rgb, n.rgb), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
103
98
|
}
|
|
104
|
-
|
|
105
|
-
function gr(e, n, l = 1) {
|
|
99
|
+
function cr(e, n, l = 1) {
|
|
106
100
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
107
101
|
return S(k(c(R(1, c(R(1, e.rgb), R(1, n.rgb))), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
108
102
|
}
|
|
109
|
-
|
|
110
|
-
function br(e, n, l = 1) {
|
|
103
|
+
function fr(e, n, l = 1) {
|
|
111
104
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
112
|
-
return S(k(c(
|
|
105
|
+
return S(k(c(Ke(k(e.rgb, n.rgb), 1), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
113
106
|
}
|
|
114
|
-
|
|
115
|
-
function vr(e, n, l = 1) {
|
|
107
|
+
function ur(e, n, l = 1) {
|
|
116
108
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
117
|
-
return S(k(c(
|
|
109
|
+
return S(k(c(Me(c(2, c(e.rgb, n.rgb)), R(1, c(2, c(R(1, e.rgb), R(1, n.rgb)))), Se(0.5, e.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
118
110
|
}
|
|
119
|
-
|
|
120
|
-
function Cr(e, n, l = 1) {
|
|
111
|
+
function mr(e, n, l = 1) {
|
|
121
112
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
122
|
-
return S(k(c(
|
|
113
|
+
return S(k(c(Jn(R(e.rgb, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
123
114
|
}
|
|
124
|
-
|
|
125
|
-
function Rr(e, n, l = 1) {
|
|
115
|
+
function dr(e, n, l = 1) {
|
|
126
116
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
127
|
-
return S(k(c(
|
|
117
|
+
return S(k(c(Me(e.rgb, Ke(Hn(e.rgb, R(1, n.rgb)), 1), Se(1e-3, R(1, n.rgb))), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
128
118
|
}
|
|
129
|
-
|
|
130
|
-
function Tr(e, n, l = 1) {
|
|
119
|
+
function hr(e, n, l = 1) {
|
|
131
120
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
132
121
|
return S(k(c(R(k(e.rgb, n.rgb), c(2, c(e.rgb, n.rgb))), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
133
122
|
}
|
|
134
|
-
|
|
135
|
-
function le(e) {
|
|
123
|
+
function se(e) {
|
|
136
124
|
return k(k(c(e.r, 0.2126), c(e.g, 0.7152)), c(e.b, 0.0722));
|
|
137
125
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = R(le(e.rgb), le(n.rgb));
|
|
126
|
+
function pr(e, n, l = 1) {
|
|
127
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = R(se(e.rgb), se(n.rgb));
|
|
141
128
|
return S(k(c(k(n.rgb, p), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
142
129
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = le(e.rgb), h = le(n.rgb).div(k(p, 1e-4));
|
|
130
|
+
function gr(e, n, l = 1) {
|
|
131
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = se(e.rgb), h = se(n.rgb).div(k(p, 1e-4));
|
|
146
132
|
return S(k(c(c(e.rgb, h), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
147
133
|
}
|
|
148
|
-
|
|
149
|
-
function wr(e, n, l = 1) {
|
|
134
|
+
function br(e, n, l = 1) {
|
|
150
135
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
151
|
-
return S(k(c(
|
|
136
|
+
return S(k(c(Ke(e.rgb, n.rgb), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
152
137
|
}
|
|
153
|
-
|
|
154
|
-
function Ur(e, n, l = 1) {
|
|
138
|
+
function vr(e, n, l = 1) {
|
|
155
139
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
156
|
-
return S(k(c(
|
|
140
|
+
return S(k(c(en(e.rgb, n.rgb), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
157
141
|
}
|
|
158
|
-
|
|
159
|
-
function Sr(e, n, l = 1) {
|
|
142
|
+
function Cr(e, n, l = 1) {
|
|
160
143
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
161
|
-
return S(k(c(
|
|
144
|
+
return S(k(c(Me(S(0, 0, 0, 1).rgb, en(R(1, R(1, e.rgb).div(k(n.rgb, 1e-4))), 0), Se(1e-4, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
162
145
|
}
|
|
163
|
-
|
|
164
|
-
function Mr(e, n, l = 1) {
|
|
146
|
+
function Rr(e, n, l = 1) {
|
|
165
147
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
166
|
-
return S(k(c(
|
|
148
|
+
return S(k(c(en(k(k(e.rgb, n.rgb), -1), 0), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
167
149
|
}
|
|
168
|
-
|
|
169
|
-
function xr(e, n, l = 1) {
|
|
150
|
+
function Tr(e, n, l = 1) {
|
|
170
151
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = k(c(2, c(e.rgb, n.rgb)), c(c(e.rgb, e.rgb), R(1, c(2, n.rgb)))), h = Rn(e.rgb);
|
|
171
|
-
return S(k(c(
|
|
152
|
+
return S(k(c(Me(p, k(c(2, c(e.rgb, R(1, n.rgb))), c(h, R(c(2, n.rgb), 1))), Se(0.5, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
172
153
|
}
|
|
173
|
-
|
|
174
|
-
function Ar(e, n, l = 1) {
|
|
154
|
+
function kr(e, n, l = 1) {
|
|
175
155
|
const t = c(n.a, l), u = k(t, c(e.a, R(1, t)));
|
|
176
|
-
return S(k(c(
|
|
156
|
+
return S(k(c(Me(c(2, c(e.rgb, n.rgb)), R(1, c(2, c(R(1, e.rgb), R(1, n.rgb)))), Se(0.5, n.rgb)), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
177
157
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = le(e.rgb), h = le(n.rgb), d = e.rgb.sub(p), T = n.rgb.sub(h), U = d.length();
|
|
158
|
+
function yr(e, n, l = 1) {
|
|
159
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = se(e.rgb), h = se(n.rgb), d = e.rgb.sub(p), T = n.rgb.sub(h), U = d.length();
|
|
181
160
|
return S(k(c(k(c(T.normalize(), U), p), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
182
161
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = le(e.rgb), h = le(n.rgb), d = e.rgb.sub(p), T = n.rgb.sub(h);
|
|
162
|
+
function wr(e, n, l = 1) {
|
|
163
|
+
const t = c(n.a, l), u = k(t, c(e.a, R(1, t))), p = se(e.rgb), h = se(n.rgb), d = e.rgb.sub(p), T = n.rgb.sub(h);
|
|
186
164
|
return S(k(c(k(c(d.normalize(), T.length()), p), t), c(e.rgb, c(e.a, R(1, t)))), u);
|
|
187
165
|
}
|
|
188
|
-
var
|
|
189
|
-
normal:
|
|
190
|
-
"normal-oklch":
|
|
191
|
-
"normal-oklab":
|
|
192
|
-
multiply:
|
|
193
|
-
screen:
|
|
194
|
-
linearDodge:
|
|
195
|
-
overlay:
|
|
196
|
-
difference:
|
|
197
|
-
colorDodge:
|
|
198
|
-
exclusion:
|
|
199
|
-
color:
|
|
200
|
-
luminosity:
|
|
201
|
-
darken:
|
|
202
|
-
lighten:
|
|
203
|
-
colorBurn:
|
|
204
|
-
linearBurn:
|
|
205
|
-
softLight:
|
|
206
|
-
hardLight:
|
|
207
|
-
hue:
|
|
208
|
-
saturation:
|
|
166
|
+
var gn = {
|
|
167
|
+
normal: er,
|
|
168
|
+
"normal-oklch": or,
|
|
169
|
+
"normal-oklab": sr,
|
|
170
|
+
multiply: lr,
|
|
171
|
+
screen: cr,
|
|
172
|
+
linearDodge: fr,
|
|
173
|
+
overlay: ur,
|
|
174
|
+
difference: mr,
|
|
175
|
+
colorDodge: dr,
|
|
176
|
+
exclusion: hr,
|
|
177
|
+
color: pr,
|
|
178
|
+
luminosity: gr,
|
|
179
|
+
darken: br,
|
|
180
|
+
lighten: vr,
|
|
181
|
+
colorBurn: Cr,
|
|
182
|
+
linearBurn: Rr,
|
|
183
|
+
softLight: Tr,
|
|
184
|
+
hardLight: kr,
|
|
185
|
+
hue: yr,
|
|
186
|
+
saturation: wr
|
|
209
187
|
};
|
|
210
|
-
function
|
|
211
|
-
return (
|
|
188
|
+
function W(e, n, l = "normal", t = 1) {
|
|
189
|
+
return (gn[l] || gn.normal)(e, n, t);
|
|
212
190
|
}
|
|
213
|
-
|
|
214
|
-
function Er(e, n) {
|
|
191
|
+
function Ur(e, n) {
|
|
215
192
|
const l = c(e.a, n.a);
|
|
216
193
|
return S(e.rgb, l);
|
|
217
194
|
}
|
|
218
|
-
|
|
219
|
-
function $r(e, n) {
|
|
195
|
+
function Sr(e, n) {
|
|
220
196
|
const l = R(1, n.a), t = c(e.a, l);
|
|
221
197
|
return S(e.rgb, t);
|
|
222
198
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const l = N(0.2126, 0.7152, 0.0722), t = Tn(n.rgb, l), u = c(e.a, t);
|
|
199
|
+
function Mr(e, n) {
|
|
200
|
+
const l = _(0.2126, 0.7152, 0.0722), t = Cn(n.rgb, l), u = c(e.a, t);
|
|
226
201
|
return S(e.rgb, u);
|
|
227
202
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const l = N(0.2126, 0.7152, 0.0722), t = R(1, Tn(n.rgb, l)), u = c(e.a, t);
|
|
203
|
+
function xr(e, n) {
|
|
204
|
+
const l = _(0.2126, 0.7152, 0.0722), t = R(1, Cn(n.rgb, l)), u = c(e.a, t);
|
|
231
205
|
return S(e.rgb, u);
|
|
232
206
|
}
|
|
233
|
-
var
|
|
234
|
-
alpha:
|
|
235
|
-
alphaInverted:
|
|
236
|
-
luminance:
|
|
237
|
-
luminanceInverted:
|
|
207
|
+
var bn = {
|
|
208
|
+
alpha: Ur,
|
|
209
|
+
alphaInverted: Sr,
|
|
210
|
+
luminance: Mr,
|
|
211
|
+
luminanceInverted: xr
|
|
238
212
|
};
|
|
239
|
-
function
|
|
240
|
-
return (
|
|
213
|
+
function Ar(e, n, l = "alpha") {
|
|
214
|
+
return (bn[l] || bn.alpha)(e, n);
|
|
241
215
|
}
|
|
242
|
-
var
|
|
216
|
+
var Dr = class {
|
|
243
217
|
frameTimesMs = [];
|
|
244
218
|
maxSamples = 60;
|
|
245
219
|
targetFrameTime = 16.67;
|
|
@@ -351,7 +325,7 @@ var _r = class {
|
|
|
351
325
|
score: 0,
|
|
352
326
|
label: "N/A"
|
|
353
327
|
};
|
|
354
|
-
const n = this.frameTimesMs.reduce((U,
|
|
328
|
+
const n = this.frameTimesMs.reduce((U, B) => U + B, 0) / e, l = Math.min(n / 16.67 * 100, 100), t = this.calculateComplexityScore(), u = Math.min(t / 100 * 100, 100);
|
|
355
329
|
let p = 0;
|
|
356
330
|
this.lastGpuTime !== null && (p = Math.min(this.lastGpuTime / 16.67 * 100, 100));
|
|
357
331
|
const h = this.lastGpuTime !== null ? {
|
|
@@ -373,7 +347,7 @@ var _r = class {
|
|
|
373
347
|
* Gets current performance statistics
|
|
374
348
|
*/
|
|
375
349
|
getStats(e) {
|
|
376
|
-
const n = this.frameTimesMs.length, l = this.frameIntervals.length > 0 ? 1e3 / (this.frameIntervals.reduce((
|
|
350
|
+
const n = this.frameTimesMs.length, l = this.frameIntervals.length > 0 ? 1e3 / (this.frameIntervals.reduce((D, z) => D + z, 0) / this.frameIntervals.length) : 0, t = n > 0 ? this.frameTimesMs.reduce((D, z) => D + z, 0) / n : 0, u = n > 0 ? Math.min(...this.frameTimesMs) : 0, p = n > 0 ? Math.max(...this.frameTimesMs) : 0, h = this.calculateP99(this.frameTimesMs), d = this.calculateStdDev(this.frameTimesMs), T = this.totalFrameCount > 0 ? this.jankFrameCount / this.totalFrameCount * 100 : 0, U = performance.memory, B = U ? U.usedJSHeapSize / (1024 * 1024) : null, O = this.calculateMemoryGrowthRate(), J = t > 0 ? t / this.targetFrameTime * 100 : 0, N = e?.render?.calls ?? null, P = e?.programs?.length ?? null, L = e?.memory?.textures ?? null, oe = this.calculateIntensityScore();
|
|
377
351
|
return {
|
|
378
352
|
fps: Math.round(l),
|
|
379
353
|
avgFrameTime: Math.round(t * 100) / 100,
|
|
@@ -386,16 +360,16 @@ var _r = class {
|
|
|
386
360
|
nodeCount: this.nodeCount,
|
|
387
361
|
rttNodeCount: this.rttNodeCount,
|
|
388
362
|
complexityScore: this.calculateComplexityScore(),
|
|
389
|
-
memoryUsedMB:
|
|
390
|
-
memoryGrowthRate:
|
|
363
|
+
memoryUsedMB: B !== null ? Math.round(B * 100) / 100 : null,
|
|
364
|
+
memoryGrowthRate: O !== null ? Math.round(O * 1e3) / 1e3 : null,
|
|
391
365
|
cpuTime: this.lastCpuTime !== null ? Math.round(this.lastCpuTime * 100) / 100 : null,
|
|
392
366
|
gpuTime: this.lastGpuTime !== null ? Math.round(this.lastGpuTime * 100) / 100 : null,
|
|
393
|
-
budgetUsed: Math.round(
|
|
394
|
-
drawCalls:
|
|
395
|
-
shaderPrograms:
|
|
367
|
+
budgetUsed: Math.round(J * 10) / 10,
|
|
368
|
+
drawCalls: N,
|
|
369
|
+
shaderPrograms: P,
|
|
396
370
|
textureCount: L,
|
|
397
|
-
intensityScore:
|
|
398
|
-
intensityLabel:
|
|
371
|
+
intensityScore: oe.score,
|
|
372
|
+
intensityLabel: oe.label,
|
|
399
373
|
isRendering: this.isRendering
|
|
400
374
|
};
|
|
401
375
|
}
|
|
@@ -405,18 +379,13 @@ var _r = class {
|
|
|
405
379
|
reset() {
|
|
406
380
|
this.frameTimesMs = [], this.frameIntervals = [], this.lastFrameTimestamp = 0, this.jankFrameCount = 0, this.totalFrameCount = 0, this.memorySnapshots = [], this.lastCpuTime = null, this.lastGpuTime = null;
|
|
407
381
|
}
|
|
382
|
+
}, { vec2: we, cos: zr, sin: Er, float: $r, PI: Fr } = ue;
|
|
383
|
+
const re = (e) => e ? e.offsetX !== 0 || e.offsetY !== 0 || e.rotation !== 0 || e.scale !== 1 || e.anchorX !== 0.5 || e.anchorY !== 0.5 : !1, Ue = (e, n, l, t, u, p, h, d) => {
|
|
384
|
+
const T = t.mul(Fr).div($r(180)), U = zr(T), B = Er(T), O = we(p, h), J = e.sub(O).div(u), N = we(J.x.mul(d), J.y), P = we(N.x.mul(U).sub(N.y.mul(B)), N.x.mul(B).add(N.y.mul(U)));
|
|
385
|
+
return we(P.x.div(d), P.y).sub(we(n, l)).add(O);
|
|
408
386
|
};
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const oe = (e) => e ? e.offsetX !== 0 || e.offsetY !== 0 || e.rotation !== 0 || e.scale !== 1 || e.anchorX !== 0.5 || e.anchorY !== 0.5 : !1, Se = (e, n, l, t, u, p, h, d) => {
|
|
412
|
-
const T = t.mul(Lr).div(Gr(180)), U = Vr(T), _ = qr(T), B = Ue(p, h), K = e.sub(B).div(u), P = Ue(K.x.mul(d), K.y), X = Ue(P.x.mul(U).sub(P.y.mul(_)), P.x.mul(_).add(P.y.mul(U)));
|
|
413
|
-
return Ue(X.x.div(d), X.y).sub(Ue(n, l)).add(B);
|
|
414
|
-
};
|
|
415
|
-
var Nr = /* @__PURE__ */ nt({
|
|
416
|
-
createUniformsMap: () => Pr,
|
|
417
|
-
updateUniformValue: () => Xr
|
|
418
|
-
});
|
|
419
|
-
function Pr(e, n, l) {
|
|
387
|
+
var { uniform: Or } = ue;
|
|
388
|
+
function oi(e, n, l) {
|
|
420
389
|
const t = {};
|
|
421
390
|
return Object.entries(e.props).forEach(([u, p]) => {
|
|
422
391
|
const h = n[u];
|
|
@@ -435,24 +404,20 @@ function Pr(e, n, l) {
|
|
|
435
404
|
default: p.default,
|
|
436
405
|
hasTransform: !!p.transform
|
|
437
406
|
}), d = 0);
|
|
438
|
-
const T =
|
|
407
|
+
const T = Or(d).setName(`${u}_${l}`);
|
|
439
408
|
typeof d == "string" && T.value === null && (T.value = d), t[u] = {
|
|
440
409
|
uniform: T,
|
|
441
410
|
transform: p.transform || void 0
|
|
442
411
|
};
|
|
443
412
|
}), t;
|
|
444
413
|
}
|
|
445
|
-
function
|
|
414
|
+
function Br(e, n) {
|
|
446
415
|
if (e?.transform) {
|
|
447
416
|
const l = e.transform(n), t = l?.data ?? l;
|
|
448
417
|
e.uniform.value = t;
|
|
449
418
|
} else e.uniform.value = n;
|
|
450
419
|
}
|
|
451
|
-
var
|
|
452
|
-
D(), { uniform: kn } = me;
|
|
453
|
-
}) });
|
|
454
|
-
D();
|
|
455
|
-
var Cn = !1, Yr = /* @__PURE__ */ (() => {
|
|
420
|
+
var vn = !1, qr = /* @__PURE__ */ (() => {
|
|
456
421
|
let e = 0;
|
|
457
422
|
const n = /* @__PURE__ */ new Set(), l = (h) => {
|
|
458
423
|
n.forEach((d) => {
|
|
@@ -492,7 +457,7 @@ var Cn = !1, Yr = /* @__PURE__ */ (() => {
|
|
|
492
457
|
n.delete(h), e--, e === 0 && (window.removeEventListener("mousemove", l), window.removeEventListener("touchmove", t), window.removeEventListener("mouseup", u), window.removeEventListener("touchend", p));
|
|
493
458
|
};
|
|
494
459
|
} };
|
|
495
|
-
})(),
|
|
460
|
+
})(), Vr = () => {
|
|
496
461
|
try {
|
|
497
462
|
{
|
|
498
463
|
const { MODE: e, DEV: n } = {
|
|
@@ -510,24 +475,24 @@ var Cn = !1, Yr = /* @__PURE__ */ (() => {
|
|
|
510
475
|
return !1;
|
|
511
476
|
}
|
|
512
477
|
};
|
|
513
|
-
function
|
|
478
|
+
function ii() {
|
|
514
479
|
let e = null, n, l, t, u, p;
|
|
515
480
|
const h = {
|
|
516
481
|
nodes: /* @__PURE__ */ new Map(),
|
|
517
482
|
rootId: null,
|
|
518
483
|
idToNodeId: /* @__PURE__ */ new Map()
|
|
519
484
|
}, d = /* @__PURE__ */ new Map();
|
|
520
|
-
let T = null, U = null,
|
|
521
|
-
const
|
|
522
|
-
let
|
|
523
|
-
const
|
|
524
|
-
i <= 0 || r <= 0 || i ===
|
|
485
|
+
let T = null, U = null, B = null, O = !1, J = !1, N = !1, P = null, L = !1, oe = !0, D = 0, z = 0, ee = !1, Ge = 0, Le = !1, xe = 0.5, Ae = 0.5, le = !1, De = !1, ze = null, be = null, ce = !1;
|
|
486
|
+
const ie = new Dr();
|
|
487
|
+
let ne = [], _e = !1, Ee = [], me = null, $e = [], de = null, nn = /* @__PURE__ */ new Set(), tn = /* @__PURE__ */ new Set(), Ne = 0, ve = /* @__PURE__ */ new Set(), Pe = /* @__PURE__ */ new Set(), Ce = null, Fe = !1;
|
|
488
|
+
const Xe = (i, r) => {
|
|
489
|
+
i <= 0 || r <= 0 || i === D && r === z || (Ce = {
|
|
525
490
|
width: i,
|
|
526
491
|
height: r
|
|
527
|
-
},
|
|
528
|
-
if (
|
|
529
|
-
const { width: o, height: f } =
|
|
530
|
-
|
|
492
|
+
}, Fe || (Fe = !0, requestAnimationFrame(() => {
|
|
493
|
+
if (Fe = !1, !Ce) return;
|
|
494
|
+
const { width: o, height: f } = Ce;
|
|
495
|
+
Ce = null, D = o, z = f, N || (N = !0), n.setSize(o, f, !1);
|
|
531
496
|
const s = o / f, v = 2, b = v * s;
|
|
532
497
|
l.left = -b / 2, l.right = b / 2, l.top = v / 2, l.bottom = -v / 2, l.updateProjectionMatrix(), u.scale.set(b, v, 1), h.nodes.forEach((m) => {
|
|
533
498
|
m.transformUniforms?.aspectRatio && (m.transformUniforms.aspectRatio.value = s), m.resizeCallbacks.forEach((M) => {
|
|
@@ -536,13 +501,13 @@ function mi() {
|
|
|
536
501
|
width: o,
|
|
537
502
|
height: f
|
|
538
503
|
});
|
|
539
|
-
} catch (
|
|
540
|
-
console.error("Error in resize callback:",
|
|
504
|
+
} catch (E) {
|
|
505
|
+
console.error("Error in resize callback:", E);
|
|
541
506
|
}
|
|
542
507
|
});
|
|
543
508
|
}), Z().catch(console.warn);
|
|
544
509
|
})));
|
|
545
|
-
},
|
|
510
|
+
}, Tn = () => O && !!n && !!t && !!l && !!p && D > 0 && z > 0 && L, kn = (i) => {
|
|
546
511
|
if (!n || !l || !u) return;
|
|
547
512
|
const r = i[0];
|
|
548
513
|
if (!r) return;
|
|
@@ -552,73 +517,73 @@ function mi() {
|
|
|
552
517
|
s ? (o = Math.round(s.inlineSize), f = Math.round(s.blockSize)) : (o = Math.round(r.contentRect.width), f = Math.round(r.contentRect.height));
|
|
553
518
|
} else
|
|
554
519
|
o = Math.round(r.contentRect.width), f = Math.round(r.contentRect.height);
|
|
555
|
-
o === 0 || f === 0 ||
|
|
556
|
-
},
|
|
520
|
+
o === 0 || f === 0 || Xe(o, f);
|
|
521
|
+
}, yn = (i) => {
|
|
557
522
|
const r = i[0];
|
|
558
523
|
if (!r) return;
|
|
559
524
|
const o = L;
|
|
560
525
|
L = r.isIntersecting;
|
|
561
|
-
const f = e?.getBoundingClientRect(), s =
|
|
562
|
-
if (
|
|
526
|
+
const f = e?.getBoundingClientRect(), s = ee;
|
|
527
|
+
if (ee = L && !!f && f.width > 0 && f.height > 0, L && !o) {
|
|
563
528
|
if (Le = !0, e) {
|
|
564
529
|
const { width: v, height: b } = e.getBoundingClientRect(), m = Math.round(v), M = Math.round(b);
|
|
565
|
-
m > 0 && M > 0 && (
|
|
530
|
+
m > 0 && M > 0 && (D === 0 || z === 0 || m !== D || M !== z ? (Xe(m, M), !s && ee && fe()) : p && O && h.rootId && (p.needsUpdate = !0, fe(), Z().catch(console.warn)));
|
|
566
531
|
}
|
|
567
|
-
|
|
568
|
-
} else !L && o &&
|
|
569
|
-
},
|
|
532
|
+
oe && Qe();
|
|
533
|
+
} else !L && o && Je();
|
|
534
|
+
}, wn = (i, r) => {
|
|
570
535
|
if (i.size !== r.size) return !1;
|
|
571
536
|
for (const o of i) if (!r.has(o)) return !1;
|
|
572
537
|
return !0;
|
|
573
|
-
},
|
|
574
|
-
|
|
575
|
-
const r =
|
|
576
|
-
return
|
|
577
|
-
},
|
|
578
|
-
|
|
538
|
+
}, Re = (i) => {
|
|
539
|
+
Ne++;
|
|
540
|
+
const r = jn(i);
|
|
541
|
+
return ve.add(r), r;
|
|
542
|
+
}, rn = () => {
|
|
543
|
+
Pe.forEach((i) => {
|
|
579
544
|
try {
|
|
580
545
|
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
581
546
|
} catch {
|
|
582
547
|
}
|
|
583
|
-
}),
|
|
548
|
+
}), Pe.clear();
|
|
584
549
|
};
|
|
585
|
-
let
|
|
586
|
-
const
|
|
587
|
-
if (!(!h.rootId || !p ||
|
|
588
|
-
if (
|
|
589
|
-
|
|
590
|
-
|
|
550
|
+
let he = !1;
|
|
551
|
+
const fe = () => {
|
|
552
|
+
if (!(!h.rootId || !p || De) && h.nodes.get(h.rootId)) {
|
|
553
|
+
if (D === 0 || z === 0) {
|
|
554
|
+
he || (he = !0, requestAnimationFrame(() => {
|
|
555
|
+
he = !1, D > 0 && z > 0 && fe();
|
|
591
556
|
}));
|
|
592
557
|
return;
|
|
593
558
|
}
|
|
594
|
-
|
|
559
|
+
De = !0;
|
|
595
560
|
try {
|
|
596
|
-
|
|
561
|
+
Pe = new Set(ve), ve.clear();
|
|
597
562
|
const i = /* @__PURE__ */ new Set();
|
|
598
|
-
|
|
599
|
-
(o.requiresRTT || o.transformRTTActive) &&
|
|
600
|
-
}),
|
|
601
|
-
const r =
|
|
563
|
+
tn.clear(), h.nodes.forEach((o, f) => {
|
|
564
|
+
(o.requiresRTT || o.transformRTTActive) && tn.add(f);
|
|
565
|
+
}), Ne = 0;
|
|
566
|
+
const r = H(h.rootId, /* @__PURE__ */ new Set(), i);
|
|
602
567
|
if (r && p) {
|
|
603
|
-
const o = !
|
|
568
|
+
const o = !wn(nn, i), f = p.fragmentNode !== r;
|
|
604
569
|
if (o || Le || f) {
|
|
605
|
-
|
|
570
|
+
rn();
|
|
606
571
|
try {
|
|
607
572
|
p.dispose(), n.renderTarget && n.renderTarget.dispose();
|
|
608
573
|
} catch {
|
|
609
574
|
}
|
|
610
|
-
const s = new
|
|
611
|
-
s.fragmentNode = r, s.needsUpdate = !0, u.material = s, p = s, Le = !1,
|
|
575
|
+
const s = new fn({ transparent: !0 });
|
|
576
|
+
s.fragmentNode = r, s.needsUpdate = !0, u.material = s, p = s, Le = !1, nn = i;
|
|
612
577
|
}
|
|
613
578
|
}
|
|
614
579
|
} catch (i) {
|
|
615
580
|
console.error("Error composing shader tree:", i);
|
|
616
581
|
} finally {
|
|
617
|
-
|
|
582
|
+
De = !1;
|
|
618
583
|
}
|
|
619
584
|
L && Z().catch(console.warn);
|
|
620
585
|
}
|
|
621
|
-
},
|
|
586
|
+
}, X = (i) => {
|
|
622
587
|
const r = d.get(i);
|
|
623
588
|
if (!r) return [];
|
|
624
589
|
const o = [];
|
|
@@ -627,90 +592,90 @@ function mi() {
|
|
|
627
592
|
s && o.push(s);
|
|
628
593
|
}
|
|
629
594
|
return o;
|
|
630
|
-
},
|
|
595
|
+
}, Un = (i) => {
|
|
631
596
|
for (const [r, o] of h.nodes.entries()) if (o.metadata.id === i) return r;
|
|
632
597
|
return null;
|
|
633
|
-
},
|
|
598
|
+
}, K = (i, r, o, f, s) => {
|
|
634
599
|
if (!r.metadata.mask?.source) return i;
|
|
635
|
-
const v = r.metadata.mask.source, b =
|
|
600
|
+
const v = r.metadata.mask.source, b = Un(v);
|
|
636
601
|
if (!b) return i;
|
|
637
602
|
if (f.has(b))
|
|
638
603
|
return console.error("Uh oh, looks like you've got a circular dependency in your shader masks."), i;
|
|
639
604
|
const m = new Set(f);
|
|
640
605
|
m.add(o);
|
|
641
|
-
const M =
|
|
642
|
-
let
|
|
643
|
-
s && (
|
|
606
|
+
const M = H(b, m);
|
|
607
|
+
let E = M;
|
|
608
|
+
s && (E = Re(M).sample(s));
|
|
644
609
|
const y = r.metadata.mask.type || "alpha";
|
|
645
|
-
return
|
|
646
|
-
},
|
|
647
|
-
if (!r.metadata.transform || !r.transformUniforms || !
|
|
648
|
-
const o =
|
|
649
|
-
return
|
|
650
|
-
},
|
|
610
|
+
return Ar(i, E, y);
|
|
611
|
+
}, te = (i, r) => {
|
|
612
|
+
if (!r.metadata.transform || !r.transformUniforms || !re(r.metadata.transform) && !r.transformRTTActive) return i;
|
|
613
|
+
const o = Re(i), f = Ue(pe, r.transformUniforms.offsetX, r.transformUniforms.offsetY, r.transformUniforms.rotation, r.transformUniforms.scale, r.transformUniforms.anchorX, r.transformUniforms.anchorY, r.transformUniforms.aspectRatio);
|
|
614
|
+
return ge(f, o.sample(f), o, r.transformUniforms.edges);
|
|
615
|
+
}, Y = (i) => !!i.uvTransformFunc && i.requiresChild && i.metadata.blendMode === "normal" && (i.metadata.opacity === void 0 || i.metadata.opacity === 1) && i.metadata.visible !== !1 && !i.metadata.mask?.source && !(i.transformUniforms && i.metadata.transform && re(i.metadata.transform)), Oe = (i) => {
|
|
651
616
|
const r = [];
|
|
652
617
|
let o = i;
|
|
653
618
|
for (; o; ) {
|
|
654
619
|
const f = h.nodes.get(o);
|
|
655
|
-
if (!f || !
|
|
620
|
+
if (!f || !Y(f)) break;
|
|
656
621
|
r.push(f);
|
|
657
|
-
const s =
|
|
622
|
+
const s = X(f.id);
|
|
658
623
|
if (s.length !== 1) break;
|
|
659
624
|
const v = s[0];
|
|
660
|
-
if (
|
|
625
|
+
if (Y(v)) o = v.id;
|
|
661
626
|
else break;
|
|
662
627
|
}
|
|
663
628
|
return r;
|
|
664
|
-
},
|
|
629
|
+
}, Sn = (i) => {
|
|
665
630
|
if (i.length === 0) return null;
|
|
666
|
-
const r = i[i.length - 1], o =
|
|
631
|
+
const r = i[i.length - 1], o = X(r.id);
|
|
667
632
|
return o.length === 0 ? null : o.length === 1 ? o[0] : null;
|
|
668
|
-
},
|
|
669
|
-
if (!i.uvTransformFunc || !
|
|
670
|
-
const r =
|
|
633
|
+
}, Te = (i) => {
|
|
634
|
+
if (!i.uvTransformFunc || !Y(i)) return !1;
|
|
635
|
+
const r = X(i.id);
|
|
671
636
|
if (r.length !== 1) return !1;
|
|
672
637
|
const o = r[0];
|
|
673
|
-
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc &&
|
|
674
|
-
},
|
|
638
|
+
return o.acceptsUVContext && !o.requiresChild ? !0 : o.uvTransformFunc && Y(o) ? Te(o) : !1;
|
|
639
|
+
}, Be = (i, r, o) => {
|
|
675
640
|
const f = [];
|
|
676
641
|
let s = i;
|
|
677
642
|
for (; s; ) {
|
|
678
643
|
const g = h.nodes.get(s);
|
|
679
644
|
if (!g) break;
|
|
680
|
-
if (f.length >= 2) return
|
|
645
|
+
if (f.length >= 2) return H(i, r, o, !0);
|
|
681
646
|
if (f.push(g), o && o.add(g.id), g.acceptsUVContext && !g.requiresChild) break;
|
|
682
|
-
const a =
|
|
647
|
+
const a = X(s);
|
|
683
648
|
if (a.length !== 1) break;
|
|
684
649
|
s = a[0].id;
|
|
685
650
|
}
|
|
686
651
|
if (f.length === 0) return S(0, 0, 0, 0);
|
|
687
652
|
const v = f[f.length - 1];
|
|
688
|
-
let b =
|
|
653
|
+
let b = pe;
|
|
689
654
|
for (let g = 0; g < f.length; g++) {
|
|
690
655
|
const a = f[g];
|
|
691
656
|
a.uvTransformFunc && (b = a.uvTransformFunc({
|
|
692
657
|
uv: b,
|
|
693
658
|
uniforms: a.uniforms,
|
|
694
|
-
viewportSize:
|
|
695
|
-
})), a.transformUniforms && a.metadata.transform &&
|
|
659
|
+
viewportSize: ye
|
|
660
|
+
})), a.transformUniforms && a.metadata.transform && re(a.metadata.transform) && (b = Ue(b, a.transformUniforms.offsetX, a.transformUniforms.offsetY, a.transformUniforms.rotation, a.transformUniforms.scale, a.transformUniforms.anchorX, a.transformUniforms.anchorY, a.transformUniforms.aspectRatio), a.transformUniforms.edges && (b = ae(b, a.transformUniforms.edges)), a.transformRTTActive = !0);
|
|
696
661
|
}
|
|
697
662
|
for (let g = 0; g < f.length - 1; g++) {
|
|
698
663
|
const a = f[g];
|
|
699
664
|
if (!a.requiresChild) continue;
|
|
700
|
-
const A = (
|
|
701
|
-
a.cleanupCallbacks.push(
|
|
702
|
-
}, I = (
|
|
703
|
-
a.beforeRenderCallbacks.push(
|
|
704
|
-
}, x = (
|
|
705
|
-
a.afterRenderCallbacks.push(
|
|
706
|
-
}, w = (
|
|
707
|
-
a.resizeCallbacks.push(
|
|
665
|
+
const A = (q) => {
|
|
666
|
+
a.cleanupCallbacks.push(q);
|
|
667
|
+
}, I = (q) => {
|
|
668
|
+
a.beforeRenderCallbacks.push(q);
|
|
669
|
+
}, x = (q) => {
|
|
670
|
+
a.afterRenderCallbacks.push(q);
|
|
671
|
+
}, w = (q) => {
|
|
672
|
+
a.resizeCallbacks.push(q);
|
|
708
673
|
};
|
|
709
|
-
a.cleanupCallbacks.forEach((
|
|
674
|
+
a.cleanupCallbacks.forEach((q) => {
|
|
710
675
|
try {
|
|
711
|
-
|
|
712
|
-
} catch (
|
|
713
|
-
console.error("Error in cleanup callback:",
|
|
676
|
+
q();
|
|
677
|
+
} catch ($) {
|
|
678
|
+
console.error("Error in cleanup callback:", $);
|
|
714
679
|
}
|
|
715
680
|
}), a.cleanupCallbacks = [], a.beforeRenderCallbacks = [], a.afterRenderCallbacks = [], a.resizeCallbacks = [], a.fragmentNodeFunc({
|
|
716
681
|
uniforms: a.uniforms ?? {},
|
|
@@ -722,8 +687,8 @@ function mi() {
|
|
|
722
687
|
onResize: w,
|
|
723
688
|
canvas: e,
|
|
724
689
|
dimensions: {
|
|
725
|
-
width:
|
|
726
|
-
height:
|
|
690
|
+
width: D,
|
|
691
|
+
height: z
|
|
727
692
|
},
|
|
728
693
|
renderer: n
|
|
729
694
|
});
|
|
@@ -732,7 +697,7 @@ function mi() {
|
|
|
732
697
|
v.cleanupCallbacks.push(g);
|
|
733
698
|
}, M = (g) => {
|
|
734
699
|
v.beforeRenderCallbacks.push(g);
|
|
735
|
-
},
|
|
700
|
+
}, E = (g) => {
|
|
736
701
|
v.afterRenderCallbacks.push(g);
|
|
737
702
|
}, y = (g) => {
|
|
738
703
|
v.resizeCallbacks.push(g);
|
|
@@ -750,80 +715,80 @@ function mi() {
|
|
|
750
715
|
uvContext: b,
|
|
751
716
|
onCleanup: m,
|
|
752
717
|
onBeforeRender: M,
|
|
753
|
-
onAfterRender:
|
|
718
|
+
onAfterRender: E,
|
|
754
719
|
onResize: y,
|
|
755
720
|
canvas: e,
|
|
756
721
|
dimensions: {
|
|
757
|
-
width:
|
|
758
|
-
height:
|
|
722
|
+
width: D,
|
|
723
|
+
height: z
|
|
759
724
|
},
|
|
760
725
|
renderer: n
|
|
761
726
|
});
|
|
762
|
-
for (const g of f) if (g.uniforms.edges?.uniform) return
|
|
727
|
+
for (const g of f) if (g.uniforms.edges?.uniform) return ge(b, C, null, g.uniforms.edges.uniform);
|
|
763
728
|
return C;
|
|
764
|
-
},
|
|
729
|
+
}, qe = (i, r, o) => {
|
|
765
730
|
if (i.length === 0) return S(0, 0, 0, 0);
|
|
766
|
-
const f =
|
|
731
|
+
const f = Sn(i);
|
|
767
732
|
let s;
|
|
768
|
-
if (f) s =
|
|
733
|
+
if (f) s = H(f.id, r, o);
|
|
769
734
|
else {
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
-
s =
|
|
735
|
+
const E = i[i.length - 1];
|
|
736
|
+
if (X(E.id).length === 0) return S(0, 0, 0, 0);
|
|
737
|
+
s = H(E.id, r, o);
|
|
773
738
|
}
|
|
774
|
-
const v =
|
|
775
|
-
let b =
|
|
776
|
-
for (let
|
|
777
|
-
const y = i[
|
|
739
|
+
const v = Re(s);
|
|
740
|
+
let b = pe;
|
|
741
|
+
for (let E = i.length - 1; E >= 0; E--) {
|
|
742
|
+
const y = i[E];
|
|
778
743
|
y.uvTransformFunc && (b = y.uvTransformFunc({
|
|
779
744
|
uv: b,
|
|
780
745
|
uniforms: y.uniforms,
|
|
781
|
-
viewportSize:
|
|
782
|
-
}), y.uniforms.edges?.uniform && (b =
|
|
746
|
+
viewportSize: ye
|
|
747
|
+
}), y.uniforms.edges?.uniform && (b = ae(b, y.uniforms.edges.uniform))), o && o.add(y.id);
|
|
783
748
|
}
|
|
784
749
|
const m = v.sample(b), M = i[0];
|
|
785
|
-
return M.uniforms.edges?.uniform ?
|
|
786
|
-
},
|
|
750
|
+
return M.uniforms.edges?.uniform ? ge(b, m, v, M.uniforms.edges.uniform) : m;
|
|
751
|
+
}, Ye = (i, r) => {
|
|
787
752
|
const o = [];
|
|
788
753
|
for (let f = r; f < i.length; f++) {
|
|
789
754
|
const s = i[f];
|
|
790
|
-
if (!
|
|
755
|
+
if (!Y(s) || X(s.id).length > 0) break;
|
|
791
756
|
o.push(s);
|
|
792
757
|
}
|
|
793
758
|
return o;
|
|
794
759
|
}, Ie = (i, r, o) => {
|
|
795
760
|
if (i.length === 0) return r;
|
|
796
|
-
const f =
|
|
797
|
-
let s =
|
|
761
|
+
const f = Re(r);
|
|
762
|
+
let s = pe;
|
|
798
763
|
for (let m = i.length - 1; m >= 0; m--) {
|
|
799
764
|
const M = i[m];
|
|
800
765
|
M.uvTransformFunc && (s = M.uvTransformFunc({
|
|
801
766
|
uv: s,
|
|
802
767
|
uniforms: M.uniforms,
|
|
803
|
-
viewportSize:
|
|
804
|
-
}), M.uniforms.edges?.uniform && (s =
|
|
768
|
+
viewportSize: ye
|
|
769
|
+
}), M.uniforms.edges?.uniform && (s = ae(s, M.uniforms.edges.uniform))), o && o.add(M.id);
|
|
805
770
|
}
|
|
806
771
|
const v = f.sample(s), b = i[i.length - 1];
|
|
807
|
-
return b.uniforms.edges?.uniform ?
|
|
808
|
-
},
|
|
772
|
+
return b.uniforms.edges?.uniform ? ge(s, v, f, b.uniforms.edges.uniform) : v;
|
|
773
|
+
}, He = (i) => {
|
|
809
774
|
const r = [], o = [];
|
|
810
775
|
let f = !1;
|
|
811
776
|
for (let b = 0; b < i.length; b++) {
|
|
812
|
-
const m = i[b], M =
|
|
813
|
-
m.acceptsUVContext && !m.requiresChild && r.push(b),
|
|
777
|
+
const m = i[b], M = X(m.id).length > 0;
|
|
778
|
+
m.acceptsUVContext && !m.requiresChild && r.push(b), Y(m) && !M && (o.push(b), r.length > 0 && (f = !0));
|
|
814
779
|
}
|
|
815
780
|
if (r.length === 0 || o.length === 0 || !f) return !1;
|
|
816
781
|
const s = Math.min(...r), v = Math.max(...o);
|
|
817
782
|
for (let b = s + 1; b < v; b++) {
|
|
818
783
|
const m = i[b];
|
|
819
|
-
if (m.requiresRTT && !
|
|
784
|
+
if (m.requiresRTT && !Y(m) && !(m.acceptsUVContext && !m.requiresChild)) return !1;
|
|
820
785
|
}
|
|
821
786
|
return !(o.length > 2);
|
|
822
|
-
},
|
|
787
|
+
}, We = (i, r, o) => {
|
|
823
788
|
const f = [], s = [];
|
|
824
789
|
i.forEach((b, m) => {
|
|
825
|
-
const M =
|
|
826
|
-
|
|
790
|
+
const M = X(b.id).length > 0;
|
|
791
|
+
Y(b) && !M ? s.push({
|
|
827
792
|
node: b,
|
|
828
793
|
index: m
|
|
829
794
|
}) : b.acceptsUVContext && !b.requiresChild && !M && f.push({
|
|
@@ -840,19 +805,19 @@ function mi() {
|
|
|
840
805
|
console.error("Cleanup error:", a);
|
|
841
806
|
}
|
|
842
807
|
}), m.cleanupCallbacks = [], m.beforeRenderCallbacks = [], m.afterRenderCallbacks = [], m.resizeCallbacks = [];
|
|
843
|
-
const M = (g) => m.cleanupCallbacks.push(g),
|
|
808
|
+
const M = (g) => m.cleanupCallbacks.push(g), E = (g) => m.beforeRenderCallbacks.push(g), y = (g) => m.afterRenderCallbacks.push(g), C = (g) => m.resizeCallbacks.push(g);
|
|
844
809
|
m.fragmentNodeFunc({
|
|
845
810
|
uniforms: m.uniforms ?? {},
|
|
846
811
|
childNode: void 0,
|
|
847
812
|
uvContext: void 0,
|
|
848
813
|
onCleanup: M,
|
|
849
|
-
onBeforeRender:
|
|
814
|
+
onBeforeRender: E,
|
|
850
815
|
onAfterRender: y,
|
|
851
816
|
onResize: C,
|
|
852
817
|
canvas: e,
|
|
853
818
|
dimensions: {
|
|
854
|
-
width:
|
|
855
|
-
height:
|
|
819
|
+
width: D,
|
|
820
|
+
height: z
|
|
856
821
|
},
|
|
857
822
|
renderer: n
|
|
858
823
|
}), o && o.add(m.id);
|
|
@@ -863,29 +828,29 @@ function mi() {
|
|
|
863
828
|
if (m.metadata.visible === !1) continue;
|
|
864
829
|
const M = m.metadata.opacity ?? 1;
|
|
865
830
|
m.opacityUniform.value = M, o && o.add(m.id);
|
|
866
|
-
const
|
|
831
|
+
const E = X(m.id).length > 0;
|
|
867
832
|
let y;
|
|
868
833
|
const C = f.find((g) => g.index === b);
|
|
869
834
|
if (C) {
|
|
870
|
-
const g = s.filter((
|
|
871
|
-
let a =
|
|
872
|
-
for (let
|
|
873
|
-
const
|
|
874
|
-
|
|
835
|
+
const g = s.filter(($) => $.index > C.index).sort(($, F) => $.index - F.index).map(($) => $.node);
|
|
836
|
+
let a = pe;
|
|
837
|
+
for (let $ = g.length - 1; $ >= 0; $--) {
|
|
838
|
+
const F = g[$];
|
|
839
|
+
F.uvTransformFunc && (a = F.uvTransformFunc({
|
|
875
840
|
uv: a,
|
|
876
|
-
uniforms:
|
|
877
|
-
viewportSize:
|
|
878
|
-
})),
|
|
841
|
+
uniforms: F.uniforms,
|
|
842
|
+
viewportSize: ye
|
|
843
|
+
})), F.transformUniforms && F.metadata.transform && re(F.metadata.transform) && (a = Ue(a, F.transformUniforms.offsetX, F.transformUniforms.offsetY, F.transformUniforms.rotation, F.transformUniforms.scale, F.transformUniforms.anchorX, F.transformUniforms.anchorY, F.transformUniforms.aspectRatio), F.transformUniforms.edges && (a = ae(a, F.transformUniforms.edges)), F.transformRTTActive = !0), F.uniforms.edges?.uniform && (a = ae(a, F.uniforms.edges.uniform));
|
|
879
844
|
}
|
|
880
|
-
C.node.transformUniforms && C.node.metadata.transform &&
|
|
845
|
+
C.node.transformUniforms && C.node.metadata.transform && re(C.node.metadata.transform) && (a = Ue(a, C.node.transformUniforms.offsetX, C.node.transformUniforms.offsetY, C.node.transformUniforms.rotation, C.node.transformUniforms.scale, C.node.transformUniforms.anchorX, C.node.transformUniforms.anchorY, C.node.transformUniforms.aspectRatio), C.node.transformUniforms.edges && (a = ae(a, C.node.transformUniforms.edges)), C.node.transformRTTActive = !0), m.cleanupCallbacks.forEach(($) => {
|
|
881
846
|
try {
|
|
882
|
-
|
|
883
|
-
} catch (
|
|
884
|
-
console.error("Cleanup error:",
|
|
847
|
+
$();
|
|
848
|
+
} catch (F) {
|
|
849
|
+
console.error("Cleanup error:", F);
|
|
885
850
|
}
|
|
886
851
|
}), m.cleanupCallbacks = [], m.beforeRenderCallbacks = [], m.afterRenderCallbacks = [], m.resizeCallbacks = [];
|
|
887
|
-
const A = (
|
|
888
|
-
let
|
|
852
|
+
const A = ($) => m.cleanupCallbacks.push($), I = ($) => m.beforeRenderCallbacks.push($), x = ($) => m.afterRenderCallbacks.push($), w = ($) => m.resizeCallbacks.push($);
|
|
853
|
+
let q = m.fragmentNodeFunc({
|
|
889
854
|
uniforms: m.uniforms ?? {},
|
|
890
855
|
childNode: void 0,
|
|
891
856
|
uvContext: a,
|
|
@@ -895,51 +860,51 @@ function mi() {
|
|
|
895
860
|
onResize: w,
|
|
896
861
|
canvas: e,
|
|
897
862
|
dimensions: {
|
|
898
|
-
width:
|
|
899
|
-
height:
|
|
863
|
+
width: D,
|
|
864
|
+
height: z
|
|
900
865
|
},
|
|
901
866
|
renderer: n
|
|
902
867
|
});
|
|
903
868
|
if (g.length > 0) {
|
|
904
|
-
const
|
|
905
|
-
|
|
869
|
+
const $ = g[0];
|
|
870
|
+
$.uniforms.edges?.uniform && (q = ge(a, q, null, $.uniforms.edges.uniform));
|
|
906
871
|
}
|
|
907
|
-
y =
|
|
872
|
+
y = K(q, m, m.id, r, a);
|
|
908
873
|
} else {
|
|
909
874
|
if (s.find((g) => g.index === b)) continue;
|
|
910
|
-
if (
|
|
911
|
-
if (
|
|
912
|
-
else if (
|
|
913
|
-
const a =
|
|
914
|
-
a.length > 1 ? y =
|
|
915
|
-
} else y =
|
|
875
|
+
if (E) {
|
|
876
|
+
if (Te(m)) y = Be(m.id, r, o);
|
|
877
|
+
else if (Y(m)) {
|
|
878
|
+
const a = Oe(m.id);
|
|
879
|
+
a.length > 1 ? y = qe(a, r, o) : y = H(m.id, r, o);
|
|
880
|
+
} else y = H(m.id, r, o);
|
|
916
881
|
const g = s.filter((a) => a.index > b).sort((a, A) => a.index - A.index).map((a) => a.node);
|
|
917
882
|
if (g.length > 0) {
|
|
918
|
-
const a =
|
|
919
|
-
let A =
|
|
883
|
+
const a = Re(y);
|
|
884
|
+
let A = pe;
|
|
920
885
|
for (let x = g.length - 1; x >= 0; x--) {
|
|
921
886
|
const w = g[x];
|
|
922
887
|
w.uvTransformFunc && (A = w.uvTransformFunc({
|
|
923
888
|
uv: A,
|
|
924
889
|
uniforms: w.uniforms,
|
|
925
|
-
viewportSize:
|
|
926
|
-
})), w.transformUniforms && w.metadata.transform &&
|
|
890
|
+
viewportSize: ye
|
|
891
|
+
})), w.transformUniforms && w.metadata.transform && re(w.metadata.transform) && (A = Ue(A, w.transformUniforms.offsetX, w.transformUniforms.offsetY, w.transformUniforms.rotation, w.transformUniforms.scale, w.transformUniforms.anchorX, w.transformUniforms.anchorY, w.transformUniforms.aspectRatio), w.transformUniforms.edges && (A = ae(A, w.transformUniforms.edges)), w.transformRTTActive = !0), w.uniforms.edges?.uniform && (A = ae(A, w.uniforms.edges.uniform));
|
|
927
892
|
}
|
|
928
893
|
y = a.sample(A);
|
|
929
894
|
const I = g[g.length - 1];
|
|
930
|
-
I.transformUniforms?.edges && (y =
|
|
895
|
+
I.transformUniforms?.edges && (y = ge(A, y, a, I.transformUniforms.edges));
|
|
931
896
|
}
|
|
932
897
|
} else {
|
|
933
898
|
m.cleanupCallbacks.forEach((w) => {
|
|
934
899
|
try {
|
|
935
900
|
w();
|
|
936
|
-
} catch (
|
|
937
|
-
console.error("Cleanup error:",
|
|
901
|
+
} catch (q) {
|
|
902
|
+
console.error("Cleanup error:", q);
|
|
938
903
|
}
|
|
939
904
|
}), m.cleanupCallbacks = [], m.beforeRenderCallbacks = [], m.afterRenderCallbacks = [], m.resizeCallbacks = [];
|
|
940
905
|
const g = (w) => m.cleanupCallbacks.push(w), a = (w) => m.beforeRenderCallbacks.push(w), A = (w) => m.afterRenderCallbacks.push(w), I = (w) => m.resizeCallbacks.push(w);
|
|
941
906
|
let x = v;
|
|
942
|
-
m.requiresRTT && v !== void 0 && (x =
|
|
907
|
+
m.requiresRTT && v !== void 0 && (x = W(S(0, 0, 0, 0), v, "normal", 1)), y = K(te(m.fragmentNodeFunc({
|
|
943
908
|
uniforms: m.uniforms ?? {},
|
|
944
909
|
childNode: x,
|
|
945
910
|
onCleanup: g,
|
|
@@ -948,18 +913,18 @@ function mi() {
|
|
|
948
913
|
onResize: I,
|
|
949
914
|
canvas: e,
|
|
950
915
|
dimensions: {
|
|
951
|
-
width:
|
|
952
|
-
height:
|
|
916
|
+
width: D,
|
|
917
|
+
height: z
|
|
953
918
|
},
|
|
954
919
|
renderer: n
|
|
955
920
|
}), m), m, m.id, r);
|
|
956
921
|
}
|
|
957
922
|
}
|
|
958
|
-
m.requiresChild && m.metadata.blendMode === "normal" &&
|
|
923
|
+
m.requiresChild && m.metadata.blendMode === "normal" && !E ? v = W(S(0, 0, 0, 0), y, "normal", m.opacityUniform) : v === void 0 ? v = W(S(1, 1, 1, 0), y, m.metadata.blendMode, m.opacityUniform) : v = W(v, y, m.metadata.blendMode, m.opacityUniform);
|
|
959
924
|
}
|
|
960
925
|
return v ?? S(0, 0, 0, 0);
|
|
961
|
-
},
|
|
962
|
-
if (
|
|
926
|
+
}, H = (i, r = /* @__PURE__ */ new Set(), o, f = !1) => {
|
|
927
|
+
if (D === 0 || z === 0) return S(0, 0, 0, 0);
|
|
963
928
|
const s = h.nodes.get(i);
|
|
964
929
|
if (!s) return S(0, 0, 0, 0);
|
|
965
930
|
const v = (y) => {
|
|
@@ -970,15 +935,15 @@ function mi() {
|
|
|
970
935
|
s.afterRenderCallbacks.push(y);
|
|
971
936
|
}, M = (y) => {
|
|
972
937
|
s.resizeCallbacks.push(y);
|
|
973
|
-
},
|
|
974
|
-
if (
|
|
975
|
-
return s.requiresRTT && !
|
|
938
|
+
}, E = X(i);
|
|
939
|
+
if (E.length === 0)
|
|
940
|
+
return s.requiresRTT && !ee ? S(0, 0, 0, 0) : (s.cleanupCallbacks.forEach((y) => {
|
|
976
941
|
try {
|
|
977
942
|
y();
|
|
978
943
|
} catch (C) {
|
|
979
944
|
console.error("Error in cleanup callback:", C);
|
|
980
945
|
}
|
|
981
|
-
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [],
|
|
946
|
+
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [], K(te(s.fragmentNodeFunc({
|
|
982
947
|
uniforms: s.uniforms ?? {},
|
|
983
948
|
childNode: void 0,
|
|
984
949
|
onCleanup: v,
|
|
@@ -987,80 +952,80 @@ function mi() {
|
|
|
987
952
|
onResize: M,
|
|
988
953
|
canvas: e,
|
|
989
954
|
dimensions: {
|
|
990
|
-
width:
|
|
991
|
-
height:
|
|
955
|
+
width: D,
|
|
956
|
+
height: z
|
|
992
957
|
},
|
|
993
958
|
renderer: n
|
|
994
959
|
}), s), s, i, r));
|
|
995
960
|
{
|
|
996
|
-
const y = [
|
|
961
|
+
const y = [...E].sort((C, g) => C.metadata.renderOrder - g.metadata.renderOrder);
|
|
997
962
|
if (s.parentId === null) {
|
|
998
|
-
if (!f &&
|
|
963
|
+
if (!f && He(y)) return K(te(We(y, r, o), s), s, i, r);
|
|
999
964
|
let C;
|
|
1000
965
|
for (let g = 0; g < y.length; g++) {
|
|
1001
966
|
const a = y[g];
|
|
1002
967
|
let A;
|
|
1003
968
|
if (a.metadata.opacity === void 0 ? (A = 1, a.opacityUniform.value = A) : (A = a.metadata.opacity, a.opacityUniform.value = A), a.metadata.visible === !1) continue;
|
|
1004
969
|
o && o.add(a.id);
|
|
1005
|
-
const I =
|
|
970
|
+
const I = X(a.id).length > 0;
|
|
1006
971
|
let x;
|
|
1007
|
-
if (I) if (f) x =
|
|
1008
|
-
else if (
|
|
1009
|
-
else if (
|
|
1010
|
-
const w =
|
|
1011
|
-
w.length > 1 ? x =
|
|
1012
|
-
} else x =
|
|
972
|
+
if (I) if (f) x = H(a.id, r, o, !0);
|
|
973
|
+
else if (Te(a)) x = Be(a.id, r, o);
|
|
974
|
+
else if (Y(a)) {
|
|
975
|
+
const w = Oe(a.id);
|
|
976
|
+
w.length > 1 ? x = qe(w, r, o) : x = H(a.id, r, o);
|
|
977
|
+
} else x = H(a.id, r, o);
|
|
1013
978
|
else {
|
|
1014
|
-
if (
|
|
1015
|
-
const w =
|
|
979
|
+
if (Y(a) && a.requiresChild && C !== void 0) {
|
|
980
|
+
const w = Ye(y, g);
|
|
1016
981
|
if (w.length > 1) {
|
|
1017
982
|
x = Ie(w, C, o), g += w.length - 1, C = x;
|
|
1018
983
|
continue;
|
|
1019
984
|
}
|
|
1020
985
|
}
|
|
1021
|
-
if (a.requiresRTT && !
|
|
986
|
+
if (a.requiresRTT && !ee) x = S(0, 0, 0, 0);
|
|
1022
987
|
else {
|
|
1023
|
-
const w = (
|
|
1024
|
-
a.cleanupCallbacks.push(
|
|
1025
|
-
},
|
|
1026
|
-
a.beforeRenderCallbacks.push(
|
|
1027
|
-
},
|
|
1028
|
-
a.afterRenderCallbacks.push(
|
|
1029
|
-
},
|
|
1030
|
-
a.resizeCallbacks.push(
|
|
988
|
+
const w = (V) => {
|
|
989
|
+
a.cleanupCallbacks.push(V);
|
|
990
|
+
}, q = (V) => {
|
|
991
|
+
a.beforeRenderCallbacks.push(V);
|
|
992
|
+
}, $ = (V) => {
|
|
993
|
+
a.afterRenderCallbacks.push(V);
|
|
994
|
+
}, F = (V) => {
|
|
995
|
+
a.resizeCallbacks.push(V);
|
|
1031
996
|
};
|
|
1032
|
-
let
|
|
1033
|
-
a.requiresRTT && C !== void 0 && (
|
|
997
|
+
let ke = C;
|
|
998
|
+
a.requiresRTT && C !== void 0 && (ke = W(S(0, 0, 0, 0), C, "normal", 1)), a.cleanupCallbacks.forEach((V) => {
|
|
1034
999
|
try {
|
|
1035
|
-
|
|
1036
|
-
} catch (
|
|
1037
|
-
console.error("Error in cleanup callback:",
|
|
1000
|
+
V();
|
|
1001
|
+
} catch (Ln) {
|
|
1002
|
+
console.error("Error in cleanup callback:", Ln);
|
|
1038
1003
|
}
|
|
1039
|
-
}), a.cleanupCallbacks = [], a.beforeRenderCallbacks = [], a.afterRenderCallbacks = [], a.resizeCallbacks = [], x =
|
|
1004
|
+
}), a.cleanupCallbacks = [], a.beforeRenderCallbacks = [], a.afterRenderCallbacks = [], a.resizeCallbacks = [], x = K(te(a.fragmentNodeFunc({
|
|
1040
1005
|
uniforms: a.uniforms ?? {},
|
|
1041
|
-
childNode:
|
|
1006
|
+
childNode: ke,
|
|
1042
1007
|
onCleanup: w,
|
|
1043
|
-
onBeforeRender:
|
|
1044
|
-
onAfterRender:
|
|
1045
|
-
onResize:
|
|
1008
|
+
onBeforeRender: q,
|
|
1009
|
+
onAfterRender: $,
|
|
1010
|
+
onResize: F,
|
|
1046
1011
|
canvas: e,
|
|
1047
1012
|
dimensions: {
|
|
1048
|
-
width:
|
|
1049
|
-
height:
|
|
1013
|
+
width: D,
|
|
1014
|
+
height: z
|
|
1050
1015
|
},
|
|
1051
1016
|
renderer: n
|
|
1052
1017
|
}), a), a, a.id, r);
|
|
1053
1018
|
}
|
|
1054
1019
|
}
|
|
1055
|
-
a.requiresChild && a.metadata.blendMode === "normal" && !I ? C =
|
|
1020
|
+
a.requiresChild && a.metadata.blendMode === "normal" && !I ? C = W(S(0, 0, 0, 0), x, "normal", a.opacityUniform) : C === void 0 ? s.requiresRTT || A !== 1 ? C = W(S(1, 1, 1, 0), x, a.metadata.blendMode, a.opacityUniform) : C = x : C = W(C, x, a.metadata.blendMode, a.opacityUniform);
|
|
1056
1021
|
}
|
|
1057
|
-
return s.requiresRTT && !
|
|
1022
|
+
return s.requiresRTT && !ee ? S(0, 0, 0, 0) : (s.cleanupCallbacks.forEach((g) => {
|
|
1058
1023
|
try {
|
|
1059
1024
|
g();
|
|
1060
1025
|
} catch (a) {
|
|
1061
1026
|
console.error("Error in cleanup callback:", a);
|
|
1062
1027
|
}
|
|
1063
|
-
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [],
|
|
1028
|
+
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [], K(te(s.fragmentNodeFunc({
|
|
1064
1029
|
uniforms: s.uniforms ?? {},
|
|
1065
1030
|
childNode: C,
|
|
1066
1031
|
onCleanup: v,
|
|
@@ -1069,15 +1034,15 @@ function mi() {
|
|
|
1069
1034
|
onResize: M,
|
|
1070
1035
|
canvas: e,
|
|
1071
1036
|
dimensions: {
|
|
1072
|
-
width:
|
|
1073
|
-
height:
|
|
1037
|
+
width: D,
|
|
1038
|
+
height: z
|
|
1074
1039
|
},
|
|
1075
1040
|
renderer: n
|
|
1076
1041
|
}), s), s, i, r));
|
|
1077
1042
|
} else {
|
|
1078
|
-
if (!f &&
|
|
1079
|
-
const g =
|
|
1080
|
-
return
|
|
1043
|
+
if (!f && He(y)) {
|
|
1044
|
+
const g = We(y, r, o);
|
|
1045
|
+
return K(te(s.fragmentNodeFunc({
|
|
1081
1046
|
uniforms: s.uniforms ?? {},
|
|
1082
1047
|
childNode: g,
|
|
1083
1048
|
onCleanup: v,
|
|
@@ -1086,8 +1051,8 @@ function mi() {
|
|
|
1086
1051
|
onResize: M,
|
|
1087
1052
|
canvas: e,
|
|
1088
1053
|
dimensions: {
|
|
1089
|
-
width:
|
|
1090
|
-
height:
|
|
1054
|
+
width: D,
|
|
1055
|
+
height: z
|
|
1091
1056
|
},
|
|
1092
1057
|
renderer: n
|
|
1093
1058
|
}), s), s, i, r);
|
|
@@ -1098,59 +1063,59 @@ function mi() {
|
|
|
1098
1063
|
let A;
|
|
1099
1064
|
if (a.metadata.opacity === void 0 ? (A = 1, a.opacityUniform.value = A) : (A = a.metadata.opacity, a.opacityUniform.value = A), a.metadata.visible === !1) continue;
|
|
1100
1065
|
o && o.add(a.id);
|
|
1101
|
-
const I =
|
|
1066
|
+
const I = X(a.id).length > 0;
|
|
1102
1067
|
let x;
|
|
1103
|
-
if (I) if (f) x =
|
|
1104
|
-
else if (
|
|
1105
|
-
else if (
|
|
1106
|
-
const w =
|
|
1107
|
-
w.length > 1 ? x =
|
|
1108
|
-
} else x =
|
|
1068
|
+
if (I) if (f) x = H(a.id, r, o, !0);
|
|
1069
|
+
else if (Te(a)) x = Be(a.id, r, o);
|
|
1070
|
+
else if (Y(a)) {
|
|
1071
|
+
const w = Oe(a.id);
|
|
1072
|
+
w.length > 1 ? x = qe(w, r, o) : x = H(a.id, r, o);
|
|
1073
|
+
} else x = H(a.id, r, o);
|
|
1109
1074
|
else {
|
|
1110
|
-
if (
|
|
1111
|
-
const w =
|
|
1075
|
+
if (Y(a) && a.requiresChild && C !== void 0) {
|
|
1076
|
+
const w = Ye(y, g);
|
|
1112
1077
|
if (w.length > 1) {
|
|
1113
1078
|
x = Ie(w, C, o), g += w.length - 1, C = x;
|
|
1114
1079
|
continue;
|
|
1115
1080
|
}
|
|
1116
1081
|
}
|
|
1117
|
-
if (a.requiresRTT && !
|
|
1082
|
+
if (a.requiresRTT && !ee) x = S(0, 0, 0, 0);
|
|
1118
1083
|
else {
|
|
1119
|
-
const w = (
|
|
1120
|
-
a.cleanupCallbacks.push(
|
|
1121
|
-
},
|
|
1122
|
-
a.beforeRenderCallbacks.push(
|
|
1123
|
-
},
|
|
1124
|
-
a.afterRenderCallbacks.push(
|
|
1125
|
-
},
|
|
1126
|
-
a.resizeCallbacks.push(
|
|
1084
|
+
const w = (V) => {
|
|
1085
|
+
a.cleanupCallbacks.push(V);
|
|
1086
|
+
}, q = (V) => {
|
|
1087
|
+
a.beforeRenderCallbacks.push(V);
|
|
1088
|
+
}, $ = (V) => {
|
|
1089
|
+
a.afterRenderCallbacks.push(V);
|
|
1090
|
+
}, F = (V) => {
|
|
1091
|
+
a.resizeCallbacks.push(V);
|
|
1127
1092
|
};
|
|
1128
|
-
let
|
|
1129
|
-
a.requiresRTT && C !== void 0 && (
|
|
1093
|
+
let ke = C;
|
|
1094
|
+
a.requiresRTT && C !== void 0 && (ke = W(S(0, 0, 0, 0), C, "normal", 1)), a.cleanupCallbacks = [], a.beforeRenderCallbacks = [], a.afterRenderCallbacks = [], a.resizeCallbacks = [], x = K(te(a.fragmentNodeFunc({
|
|
1130
1095
|
uniforms: a.uniforms ?? {},
|
|
1131
|
-
childNode:
|
|
1096
|
+
childNode: ke,
|
|
1132
1097
|
onCleanup: w,
|
|
1133
|
-
onBeforeRender:
|
|
1134
|
-
onAfterRender:
|
|
1135
|
-
onResize:
|
|
1098
|
+
onBeforeRender: q,
|
|
1099
|
+
onAfterRender: $,
|
|
1100
|
+
onResize: F,
|
|
1136
1101
|
canvas: e,
|
|
1137
1102
|
dimensions: {
|
|
1138
|
-
width:
|
|
1139
|
-
height:
|
|
1103
|
+
width: D,
|
|
1104
|
+
height: z
|
|
1140
1105
|
},
|
|
1141
1106
|
renderer: n
|
|
1142
1107
|
}), a), a, a.id, r);
|
|
1143
1108
|
}
|
|
1144
1109
|
}
|
|
1145
|
-
a.requiresChild && a.metadata.blendMode === "normal" && !I ? C =
|
|
1110
|
+
a.requiresChild && a.metadata.blendMode === "normal" && !I ? C = W(S(0, 0, 0, 0), x, "normal", a.opacityUniform) : C === void 0 ? s.requiresRTT || A !== 1 ? C = W(S(1, 1, 1, 0), x, a.metadata.blendMode, a.opacityUniform) : C = x : C = W(C, x, a.metadata.blendMode, a.opacityUniform);
|
|
1146
1111
|
}
|
|
1147
|
-
return s.requiresRTT && !
|
|
1112
|
+
return s.requiresRTT && !ee ? S(0, 0, 0, 0) : (s.cleanupCallbacks.forEach((g) => {
|
|
1148
1113
|
try {
|
|
1149
1114
|
g();
|
|
1150
1115
|
} catch (a) {
|
|
1151
1116
|
console.error("Error in cleanup callback:", a);
|
|
1152
1117
|
}
|
|
1153
|
-
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [],
|
|
1118
|
+
}), s.cleanupCallbacks = [], s.beforeRenderCallbacks = [], s.afterRenderCallbacks = [], s.resizeCallbacks = [], K(te(s.fragmentNodeFunc({
|
|
1154
1119
|
uniforms: s.uniforms ?? {},
|
|
1155
1120
|
childNode: C,
|
|
1156
1121
|
onCleanup: v,
|
|
@@ -1159,33 +1124,33 @@ function mi() {
|
|
|
1159
1124
|
onResize: M,
|
|
1160
1125
|
canvas: e,
|
|
1161
1126
|
dimensions: {
|
|
1162
|
-
width:
|
|
1163
|
-
height:
|
|
1127
|
+
width: D,
|
|
1128
|
+
height: z
|
|
1164
1129
|
},
|
|
1165
1130
|
renderer: n
|
|
1166
1131
|
}), s), s, i, r));
|
|
1167
1132
|
}
|
|
1168
1133
|
}
|
|
1169
|
-
},
|
|
1134
|
+
}, on = (i, r, o, f, s = {}, v) => {
|
|
1170
1135
|
if (r === null) {
|
|
1171
|
-
const C =
|
|
1136
|
+
const C = ne.findIndex((g) => g.id === i);
|
|
1172
1137
|
if (C !== -1) {
|
|
1173
|
-
|
|
1138
|
+
ne.splice(C, 1);
|
|
1174
1139
|
return;
|
|
1175
1140
|
}
|
|
1176
|
-
|
|
1141
|
+
je(i);
|
|
1177
1142
|
return;
|
|
1178
1143
|
}
|
|
1179
|
-
if (!
|
|
1180
|
-
const C =
|
|
1181
|
-
C !== -1 ?
|
|
1144
|
+
if (!_e) {
|
|
1145
|
+
const C = ne.findIndex((g) => g.id === i);
|
|
1146
|
+
C !== -1 ? ne[C] = {
|
|
1182
1147
|
id: i,
|
|
1183
1148
|
fragmentNodeFunc: r,
|
|
1184
1149
|
parentId: o,
|
|
1185
1150
|
metadata: f,
|
|
1186
1151
|
uniforms: s,
|
|
1187
1152
|
componentDefinition: v
|
|
1188
|
-
} :
|
|
1153
|
+
} : ne.push({
|
|
1189
1154
|
id: i,
|
|
1190
1155
|
fragmentNodeFunc: r,
|
|
1191
1156
|
parentId: o,
|
|
@@ -1210,7 +1175,7 @@ function mi() {
|
|
|
1210
1175
|
const m = G(f?.opacity !== void 0 ? f.opacity : 1);
|
|
1211
1176
|
let M;
|
|
1212
1177
|
if (f?.transform) {
|
|
1213
|
-
const C =
|
|
1178
|
+
const C = D / Math.max(1, z);
|
|
1214
1179
|
M = {
|
|
1215
1180
|
offsetX: G(f.transform.offsetX),
|
|
1216
1181
|
offsetY: G(f.transform.offsetY),
|
|
@@ -1222,7 +1187,7 @@ function mi() {
|
|
|
1222
1187
|
aspectRatio: G(C)
|
|
1223
1188
|
};
|
|
1224
1189
|
}
|
|
1225
|
-
const
|
|
1190
|
+
const E = {
|
|
1226
1191
|
id: i,
|
|
1227
1192
|
componentName: v?.name || "Unknown",
|
|
1228
1193
|
fragmentNodeFunc: r,
|
|
@@ -1249,34 +1214,28 @@ function mi() {
|
|
|
1249
1214
|
uvTransformFunc: v?.uvTransformNode,
|
|
1250
1215
|
acceptsUVContext: v?.acceptsUVContext || !1
|
|
1251
1216
|
};
|
|
1252
|
-
h.nodes.set(i,
|
|
1217
|
+
h.nodes.set(i, E), o === null && (h.rootId = i);
|
|
1253
1218
|
const y = d.get(o) || /* @__PURE__ */ new Set();
|
|
1254
|
-
y.add(i), d.set(o, y), p &&
|
|
1255
|
-
|
|
1256
|
-
}))) : p &&
|
|
1257
|
-
|
|
1219
|
+
y.add(i), d.set(o, y), p && O && D > 0 && z > 0 ? (Ee.includes(i) || Ee.push(i), me === null && (me = requestAnimationFrame(() => {
|
|
1220
|
+
me = null, Ee = [], fe();
|
|
1221
|
+
}))) : p && O && (he || (he = !0, requestAnimationFrame(() => {
|
|
1222
|
+
he = !1, D > 0 && z > 0 && fe();
|
|
1258
1223
|
})));
|
|
1259
|
-
},
|
|
1224
|
+
}, Mn = (i, r, o) => {
|
|
1260
1225
|
const f = h.nodes.get(i);
|
|
1261
1226
|
if (!f || !f.uniforms) return;
|
|
1262
1227
|
const s = f.uniforms[r];
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
const { updateUniformValue: v } = (yn(), Hn(Nr));
|
|
1266
|
-
v(s, o);
|
|
1267
|
-
} else s.uniform.value = o;
|
|
1268
|
-
L && Z();
|
|
1269
|
-
}
|
|
1270
|
-
}, zn = (i, r) => {
|
|
1228
|
+
!s || !s.uniform || (s.transform ? Br(s, o) : s.uniform.value = o, L && Z());
|
|
1229
|
+
}, xn = (i, r) => {
|
|
1271
1230
|
const o = h.nodes.get(i);
|
|
1272
1231
|
if (!o) return;
|
|
1273
1232
|
let f = !1;
|
|
1274
1233
|
r.blendMode !== void 0 && o.metadata.blendMode !== r.blendMode && (o.metadata.blendMode = r.blendMode, f = !0), r.opacity !== void 0 && o.metadata.opacity !== r.opacity && (o.metadata.opacity = r.opacity, o.opacityUniform.value = r.opacity), r.renderOrder !== void 0 && o.metadata.renderOrder !== r.renderOrder && (o.metadata.renderOrder = r.renderOrder, f = !0);
|
|
1275
1234
|
const s = r.visible !== !1;
|
|
1276
1235
|
if (o.metadata.visible !== s && (o.metadata.visible = s, f = !0), r.id !== void 0 && o.metadata.id !== r.id && (o.metadata.id = r.id, f = !0), r.mask !== void 0 && (o.metadata.mask?.source !== r.mask?.source || o.metadata.mask?.type !== r.mask?.type) && (o.metadata.mask = r.mask, f = !0), r.transform !== void 0) {
|
|
1277
|
-
const v = o.metadata.transform ?
|
|
1236
|
+
const v = o.metadata.transform ? re(o.metadata.transform) : !1, b = re(r.transform);
|
|
1278
1237
|
if (o.metadata.transform = r.transform, !o.transformUniforms && r.transform) {
|
|
1279
|
-
const m =
|
|
1238
|
+
const m = D / Math.max(1, z);
|
|
1280
1239
|
o.transformUniforms = {
|
|
1281
1240
|
offsetX: G(r.transform.offsetX),
|
|
1282
1241
|
offsetY: G(r.transform.offsetY),
|
|
@@ -1290,10 +1249,10 @@ function mi() {
|
|
|
1290
1249
|
} else o.transformUniforms && (o.transformUniforms.offsetX.value = r.transform.offsetX, o.transformUniforms.offsetY.value = r.transform.offsetY, o.transformUniforms.rotation.value = r.transform.rotation, o.transformUniforms.scale.value = r.transform.scale, o.transformUniforms.anchorX.value = r.transform.anchorX, o.transformUniforms.anchorY.value = r.transform.anchorY, o.transformUniforms.edges.value = r.transform.edges === "stretch" ? 0 : r.transform.edges === "transparent" ? 1 : r.transform.edges === "mirror" ? 2 : 3);
|
|
1291
1250
|
b && !o.transformRTTActive && (o.transformRTTActive = !0, f = !0), !v && b && !o.transformRTTActive && (f = !0);
|
|
1292
1251
|
}
|
|
1293
|
-
f && p &&
|
|
1294
|
-
|
|
1252
|
+
f && p && O ? ($e.includes(i) || $e.push(i), de === null && (de = requestAnimationFrame(() => {
|
|
1253
|
+
de = null, $e = [], fe();
|
|
1295
1254
|
}))) : L && Z();
|
|
1296
|
-
},
|
|
1255
|
+
}, je = (i) => {
|
|
1297
1256
|
if (!h.nodes.has(i)) return;
|
|
1298
1257
|
const r = h.nodes.get(i);
|
|
1299
1258
|
if (r && r.cleanupCallbacks.length > 0) for (const f of r.cleanupCallbacks) try {
|
|
@@ -1301,24 +1260,24 @@ function mi() {
|
|
|
1301
1260
|
} catch (s) {
|
|
1302
1261
|
console.error(`Error executing cleanup callback for node ${i}:`, s);
|
|
1303
1262
|
}
|
|
1304
|
-
const o =
|
|
1305
|
-
for (const f of o)
|
|
1263
|
+
const o = X(i);
|
|
1264
|
+
for (const f of o) je(f.id);
|
|
1306
1265
|
if (h.rootId === i && (h.rootId = null), r) {
|
|
1307
1266
|
const f = d.get(r.parentId);
|
|
1308
1267
|
f && (f.delete(i), f.size === 0 && d.delete(r.parentId));
|
|
1309
1268
|
}
|
|
1310
|
-
h.nodes.delete(i), p &&
|
|
1311
|
-
},
|
|
1269
|
+
h.nodes.delete(i), p && O && fe();
|
|
1270
|
+
}, An = (i) => {
|
|
1312
1271
|
const r = {
|
|
1313
1272
|
deltaTime: i,
|
|
1314
1273
|
pointer: {
|
|
1315
|
-
x:
|
|
1316
|
-
y:
|
|
1274
|
+
x: xe,
|
|
1275
|
+
y: Ae
|
|
1317
1276
|
},
|
|
1318
|
-
pointerActive:
|
|
1277
|
+
pointerActive: le,
|
|
1319
1278
|
dimensions: {
|
|
1320
|
-
width:
|
|
1321
|
-
height:
|
|
1279
|
+
width: D,
|
|
1280
|
+
height: z
|
|
1322
1281
|
}
|
|
1323
1282
|
};
|
|
1324
1283
|
for (const o of h.nodes.values()) if (o.beforeRenderCallbacks.length > 0) for (const f of o.beforeRenderCallbacks) try {
|
|
@@ -1326,17 +1285,17 @@ function mi() {
|
|
|
1326
1285
|
} catch (s) {
|
|
1327
1286
|
console.error(`Error executing before render callback for node ${o.id}:`, s);
|
|
1328
1287
|
}
|
|
1329
|
-
},
|
|
1288
|
+
}, Dn = (i) => {
|
|
1330
1289
|
const r = {
|
|
1331
1290
|
deltaTime: i,
|
|
1332
1291
|
pointer: {
|
|
1333
|
-
x:
|
|
1334
|
-
y:
|
|
1292
|
+
x: xe,
|
|
1293
|
+
y: Ae
|
|
1335
1294
|
},
|
|
1336
|
-
pointerActive:
|
|
1295
|
+
pointerActive: le,
|
|
1337
1296
|
dimensions: {
|
|
1338
|
-
width:
|
|
1339
|
-
height:
|
|
1297
|
+
width: D,
|
|
1298
|
+
height: z
|
|
1340
1299
|
}
|
|
1341
1300
|
};
|
|
1342
1301
|
for (const o of h.nodes.values()) if (o.afterRenderCallbacks.length > 0) for (const f of o.afterRenderCallbacks) try {
|
|
@@ -1345,19 +1304,19 @@ function mi() {
|
|
|
1345
1304
|
console.error(`Error executing after render callback for node ${o.id}:`, s);
|
|
1346
1305
|
}
|
|
1347
1306
|
}, Z = async () => {
|
|
1348
|
-
if (!
|
|
1349
|
-
const i =
|
|
1350
|
-
Ge = r,
|
|
1307
|
+
if (!Tn()) return;
|
|
1308
|
+
const i = ce ? performance.now() : 0, r = i || performance.now(), o = Ge > 0 ? (r - Ge) / 1e3 : 0.016, f = Math.min(o, 0.1);
|
|
1309
|
+
Ge = r, ce && performance.mark("shader-cpu-start"), An(f);
|
|
1351
1310
|
try {
|
|
1352
|
-
if (
|
|
1353
|
-
if (
|
|
1311
|
+
if (De) return;
|
|
1312
|
+
if (ce && performance.mark("shader-gpu-start"), n.render(t, l), Dn(f), ce) {
|
|
1354
1313
|
if (performance.mark("shader-gpu-end"), n instanceof Ze) try {
|
|
1355
1314
|
const s = n.backend;
|
|
1356
1315
|
if (s && s.get && s.get(n)) {
|
|
1357
1316
|
const v = s.get(n);
|
|
1358
1317
|
if (v?.timestampQuery) {
|
|
1359
1318
|
const b = v.timestampQuery.getResult();
|
|
1360
|
-
b != null &&
|
|
1319
|
+
b != null && ie.recordGpuTime(b / 1e6);
|
|
1361
1320
|
}
|
|
1362
1321
|
}
|
|
1363
1322
|
} catch {
|
|
@@ -1365,41 +1324,41 @@ function mi() {
|
|
|
1365
1324
|
try {
|
|
1366
1325
|
performance.measure("shader-gpu-time", "shader-gpu-start", "shader-gpu-end");
|
|
1367
1326
|
const s = performance.getEntriesByName("shader-gpu-time")[0];
|
|
1368
|
-
s &&
|
|
1327
|
+
s && ie.recordGpuTime(s.duration), performance.clearMarks("shader-gpu-start"), performance.clearMarks("shader-gpu-end"), performance.clearMeasures("shader-gpu-time");
|
|
1369
1328
|
} catch {
|
|
1370
1329
|
}
|
|
1371
1330
|
}
|
|
1372
|
-
if (
|
|
1331
|
+
if (ce) {
|
|
1373
1332
|
performance.mark("shader-cpu-end");
|
|
1374
1333
|
try {
|
|
1375
1334
|
performance.measure("shader-cpu-time", "shader-cpu-start", "shader-cpu-end");
|
|
1376
1335
|
const v = performance.getEntriesByName("shader-cpu-time")[0];
|
|
1377
|
-
v &&
|
|
1336
|
+
v && ie.recordCpuTime(v.duration), performance.clearMarks("shader-cpu-start"), performance.clearMarks("shader-cpu-end"), performance.clearMeasures("shader-cpu-time");
|
|
1378
1337
|
} catch {
|
|
1379
1338
|
}
|
|
1380
1339
|
const s = performance.now() - i;
|
|
1381
|
-
|
|
1340
|
+
ie.recordFrame(s);
|
|
1382
1341
|
}
|
|
1383
1342
|
} catch (s) {
|
|
1384
1343
|
console.error("Render frame error:", s);
|
|
1385
1344
|
}
|
|
1386
|
-
},
|
|
1387
|
-
const i = Math.max(0, h.nodes.size - 1), r =
|
|
1388
|
-
|
|
1389
|
-
},
|
|
1390
|
-
|
|
1345
|
+
}, zn = () => {
|
|
1346
|
+
const i = Math.max(0, h.nodes.size - 1), r = Ne;
|
|
1347
|
+
ie.updateNodeCounts(i, r);
|
|
1348
|
+
}, En = () => {
|
|
1349
|
+
zn();
|
|
1391
1350
|
const i = n?.info;
|
|
1392
|
-
return
|
|
1393
|
-
},
|
|
1394
|
-
if (T || !
|
|
1395
|
-
|
|
1351
|
+
return ie.getStats(i);
|
|
1352
|
+
}, Qe = () => {
|
|
1353
|
+
if (T || !oe || !L) return;
|
|
1354
|
+
ie.setRendering(!0);
|
|
1396
1355
|
const i = () => {
|
|
1397
1356
|
T = requestAnimationFrame(i), Z().catch(console.warn);
|
|
1398
1357
|
};
|
|
1399
1358
|
i();
|
|
1400
|
-
},
|
|
1401
|
-
T && (cancelAnimationFrame(T), T = null),
|
|
1402
|
-
},
|
|
1359
|
+
}, Je = () => {
|
|
1360
|
+
T && (cancelAnimationFrame(T), T = null), ie.setRendering(!1);
|
|
1361
|
+
}, an = (i) => {
|
|
1403
1362
|
if (!e) return;
|
|
1404
1363
|
let r, o;
|
|
1405
1364
|
if ("touches" in i) {
|
|
@@ -1408,51 +1367,51 @@ function mi() {
|
|
|
1408
1367
|
} else
|
|
1409
1368
|
r = i.clientX, o = i.clientY;
|
|
1410
1369
|
const f = e.getBoundingClientRect(), s = (r - f.left) / f.width, v = (o - f.top) / f.height;
|
|
1411
|
-
|
|
1412
|
-
},
|
|
1413
|
-
!
|
|
1414
|
-
},
|
|
1415
|
-
!
|
|
1416
|
-
},
|
|
1417
|
-
|
|
1418
|
-
},
|
|
1419
|
-
|
|
1370
|
+
xe = s, Ae = v;
|
|
1371
|
+
}, $n = (i) => {
|
|
1372
|
+
!O || !e || an(i);
|
|
1373
|
+
}, Fn = (i) => {
|
|
1374
|
+
!O || !e || an(i);
|
|
1375
|
+
}, On = () => {
|
|
1376
|
+
O && (le = !1, Z().catch(console.warn));
|
|
1377
|
+
}, Bn = () => {
|
|
1378
|
+
O && (le = !1, Z().catch(console.warn));
|
|
1379
|
+
}, sn = () => {
|
|
1380
|
+
le = !0, Z().catch(console.warn);
|
|
1420
1381
|
}, ln = () => {
|
|
1421
|
-
|
|
1422
|
-
},
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
const i
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
fe = r, K = !0, X = new AbortController();
|
|
1432
|
-
const o = X;
|
|
1382
|
+
le = !0, Z().catch(console.warn);
|
|
1383
|
+
}, qn = () => {
|
|
1384
|
+
if (ne.length === 0) return;
|
|
1385
|
+
const i = [...ne];
|
|
1386
|
+
ne = [];
|
|
1387
|
+
for (const { id: r, fragmentNodeFunc: o, parentId: f, metadata: s, uniforms: v, componentDefinition: b } of i) o && on(r, o, f, s, v, b);
|
|
1388
|
+
}, Vn = async ({ canvas: i, enablePerformanceTracking: r = !1 }) => {
|
|
1389
|
+
if (O || J) return;
|
|
1390
|
+
ce = r, J = !0, P = new AbortController();
|
|
1391
|
+
const o = P;
|
|
1433
1392
|
try {
|
|
1434
|
-
if (e = i, t = new
|
|
1435
|
-
onMouseMove:
|
|
1436
|
-
onTouchMove:
|
|
1437
|
-
onMouseUp:
|
|
1438
|
-
onTouchEnd:
|
|
1439
|
-
}), i.addEventListener("mousedown",
|
|
1440
|
-
|
|
1441
|
-
}, window.addEventListener("beforeunload",
|
|
1393
|
+
if (e = i, t = new In(), t.background = null, l = new Yn(-1, 1, 1, -1, 0.1, 10), l.position.z = 1, l.lookAt(0, 0, 0), ze = qr.register({
|
|
1394
|
+
onMouseMove: $n,
|
|
1395
|
+
onTouchMove: Fn,
|
|
1396
|
+
onMouseUp: On,
|
|
1397
|
+
onTouchEnd: Bn
|
|
1398
|
+
}), i.addEventListener("mousedown", sn), i.addEventListener("touchstart", ln), be = () => {
|
|
1399
|
+
cn();
|
|
1400
|
+
}, window.addEventListener("beforeunload", be), o.signal.aborted) return;
|
|
1442
1401
|
try {
|
|
1443
|
-
const
|
|
1402
|
+
const E = {
|
|
1444
1403
|
canvas: i,
|
|
1445
1404
|
antialias: !0,
|
|
1446
1405
|
alpha: !0,
|
|
1447
1406
|
depth: !1,
|
|
1448
1407
|
powerPreference: "high-performance"
|
|
1449
1408
|
};
|
|
1450
|
-
if (
|
|
1451
|
-
} catch (
|
|
1409
|
+
if (ce && (E.forceWebGL = !1, E.requiredFeatures = ["timestamp-query"]), n = new Ze(E), await n.init(), o.signal.aborted) return;
|
|
1410
|
+
} catch (E) {
|
|
1452
1411
|
if (o.signal.aborted) return;
|
|
1453
|
-
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:",
|
|
1412
|
+
console.warn("[Shaders] WebGPU initialization failed, falling back to WebGL:", E);
|
|
1454
1413
|
try {
|
|
1455
|
-
if (n = new
|
|
1414
|
+
if (n = new Kt({
|
|
1456
1415
|
canvas: i,
|
|
1457
1416
|
antialias: !0,
|
|
1458
1417
|
alpha: !0,
|
|
@@ -1466,38 +1425,38 @@ function mi() {
|
|
|
1466
1425
|
}
|
|
1467
1426
|
}
|
|
1468
1427
|
if (o.signal.aborted) return;
|
|
1469
|
-
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace =
|
|
1428
|
+
n.setPixelRatio(Math.min(window.devicePixelRatio, 2)), n.outputColorSpace = _n, p = new fn({ transparent: !0 }), p.fragmentNode = S(0, 0, 0, 0), u = new Xn(new Zn(2, 2), p), t.add(u);
|
|
1470
1429
|
const f = i.parentElement;
|
|
1471
1430
|
if (!f) {
|
|
1472
1431
|
console.warn("[Shaders] Canvas has no parent element for resize observation");
|
|
1473
1432
|
return;
|
|
1474
1433
|
}
|
|
1475
|
-
U = new ResizeObserver(
|
|
1434
|
+
U = new ResizeObserver(kn), U.observe(f), B = new IntersectionObserver(yn, { threshold: 0 }), B.observe(i);
|
|
1476
1435
|
const s = i.getBoundingClientRect();
|
|
1477
|
-
L = s.width > 0 && s.height > 0 && s.top < window.innerHeight && s.bottom > 0 && s.left < window.innerWidth && s.right > 0,
|
|
1436
|
+
L = s.width > 0 && s.height > 0 && s.top < window.innerHeight && s.bottom > 0 && s.left < window.innerWidth && s.right > 0, ee = L && s.width > 0 && s.height > 0, oe = !0;
|
|
1478
1437
|
const { width: v, height: b } = i.getBoundingClientRect(), m = Math.round(v), M = Math.round(b);
|
|
1479
|
-
m > 0 && M > 0 ? (
|
|
1438
|
+
m > 0 && M > 0 ? (Xe(m, M), N = !0, await Z()) : N = !1, oe && L && Qe(), o.signal.aborted || (O = !0, _e = !0, qn());
|
|
1480
1439
|
} catch (f) {
|
|
1481
1440
|
console.error("[Shaders] Initialization error:", f);
|
|
1482
1441
|
} finally {
|
|
1483
|
-
|
|
1442
|
+
J = !1, P === o && (P = null);
|
|
1484
1443
|
}
|
|
1485
|
-
},
|
|
1486
|
-
!
|
|
1487
|
-
},
|
|
1488
|
-
if (
|
|
1444
|
+
}, Gn = () => {
|
|
1445
|
+
!Vr() || vn || (console.warn("Shaders is running in development mode. Please purchase a license at https://shaders.com to use it in production."), vn = !0);
|
|
1446
|
+
}, cn = () => {
|
|
1447
|
+
if (P && P.abort(), U && (U.disconnect(), U = null), B && (B.disconnect(), B = null), ze && (ze(), ze = null), e && (e.removeEventListener("mousedown", sn), e.removeEventListener("touchstart", ln)), be && (window.removeEventListener("beforeunload", be), be = null), Je(), rn(), ve.forEach((i) => {
|
|
1489
1448
|
try {
|
|
1490
1449
|
i?.renderTarget?.dispose && i.renderTarget.dispose();
|
|
1491
1450
|
} catch {
|
|
1492
1451
|
}
|
|
1493
|
-
}),
|
|
1452
|
+
}), ve.clear(), h.nodes.clear(), h.rootId = null, h.idToNodeId.clear(), d.clear(), ne = [], _e = !1, Ee = [], me !== null && (cancelAnimationFrame(me), me = null), $e = [], de !== null && (cancelAnimationFrame(de), de = null), Ce = null, Fe = !1, u) {
|
|
1494
1453
|
t && t.remove(u);
|
|
1495
1454
|
try {
|
|
1496
1455
|
u.geometry && typeof u.geometry.dispose == "function" && u.geometry.dispose();
|
|
1497
1456
|
} catch {
|
|
1498
1457
|
}
|
|
1499
1458
|
try {
|
|
1500
|
-
u.material instanceof
|
|
1459
|
+
u.material instanceof Pn && typeof u.material.dispose == "function" && u.material.dispose();
|
|
1501
1460
|
} catch {
|
|
1502
1461
|
}
|
|
1503
1462
|
}
|
|
@@ -1505,43 +1464,42 @@ function mi() {
|
|
|
1505
1464
|
n.dispose();
|
|
1506
1465
|
} catch {
|
|
1507
1466
|
}
|
|
1508
|
-
e = null, n = null, l = null, t = null, u = null, p = null,
|
|
1467
|
+
e = null, n = null, l = null, t = null, u = null, p = null, O = !1, J = !1, N = !1, P = null, D = 0, z = 0, L = !1, oe = !0, xe = 0.5, Ae = 0.5, le = !1;
|
|
1509
1468
|
};
|
|
1510
1469
|
return {
|
|
1511
|
-
initialize:
|
|
1512
|
-
cleanup:
|
|
1513
|
-
registerNode:
|
|
1514
|
-
removeNode:
|
|
1515
|
-
updateUniformValue:
|
|
1516
|
-
updateNodeMetadata:
|
|
1517
|
-
showLicenseWarning:
|
|
1518
|
-
isInitialized: () =>
|
|
1519
|
-
startAnimation:
|
|
1520
|
-
stopAnimation:
|
|
1521
|
-
getPerformanceStats:
|
|
1470
|
+
initialize: Vn,
|
|
1471
|
+
cleanup: cn,
|
|
1472
|
+
registerNode: on,
|
|
1473
|
+
removeNode: je,
|
|
1474
|
+
updateUniformValue: Mn,
|
|
1475
|
+
updateNodeMetadata: xn,
|
|
1476
|
+
showLicenseWarning: Gn,
|
|
1477
|
+
isInitialized: () => O,
|
|
1478
|
+
startAnimation: Qe,
|
|
1479
|
+
stopAnimation: Je,
|
|
1480
|
+
getPerformanceStats: En,
|
|
1522
1481
|
getNodeRegistry: () => ({ nodes: new Map(h.nodes) }),
|
|
1523
1482
|
getRendererType: () => n ? n instanceof Ze ? "webgpu" : "webgl" : null,
|
|
1524
1483
|
__testing: {
|
|
1525
|
-
isUVComposable:
|
|
1526
|
-
canSkipRTT:
|
|
1527
|
-
hasUVPropagationOpportunity:
|
|
1528
|
-
needsTransformation:
|
|
1529
|
-
findUVChain:
|
|
1530
|
-
findSiblingUVChain:
|
|
1531
|
-
findChildNodes:
|
|
1532
|
-
composeUVContextChain:
|
|
1533
|
-
composeUVChain:
|
|
1484
|
+
isUVComposable: Y,
|
|
1485
|
+
canSkipRTT: Te,
|
|
1486
|
+
hasUVPropagationOpportunity: He,
|
|
1487
|
+
needsTransformation: re,
|
|
1488
|
+
findUVChain: Oe,
|
|
1489
|
+
findSiblingUVChain: Ye,
|
|
1490
|
+
findChildNodes: X,
|
|
1491
|
+
composeUVContextChain: Be,
|
|
1492
|
+
composeUVChain: qe,
|
|
1534
1493
|
composeSiblingUVChain: Ie,
|
|
1535
|
-
composeSiblingsWithUVContext:
|
|
1536
|
-
applyMaskIfNeeded:
|
|
1537
|
-
applyNodeTransformation:
|
|
1494
|
+
composeSiblingsWithUVContext: We,
|
|
1495
|
+
applyMaskIfNeeded: K,
|
|
1496
|
+
applyNodeTransformation: te,
|
|
1538
1497
|
getNodeRegistry: () => h,
|
|
1539
1498
|
getParentToChildren: () => d
|
|
1540
1499
|
}
|
|
1541
1500
|
};
|
|
1542
1501
|
}
|
|
1543
|
-
|
|
1544
|
-
function di(e) {
|
|
1502
|
+
function ai(e) {
|
|
1545
1503
|
const n = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), t = {
|
|
1546
1504
|
processingOrder: [],
|
|
1547
1505
|
maskSources: /* @__PURE__ */ new Map(),
|
|
@@ -1554,20 +1512,20 @@ function di(e) {
|
|
|
1554
1512
|
const p = u.mask.source.startsWith("#") ? u.mask.source.substring(1) : u.mask.source, h = n.get(p);
|
|
1555
1513
|
h ? (l.has(u.id) || l.set(u.id, []), l.get(u.id)?.push(h), t.maskSources.set(u.id, h)) : console.warn(`Mask source "${p}" not found for node "${u.id}"`);
|
|
1556
1514
|
}
|
|
1557
|
-
}), t.processingOrder =
|
|
1515
|
+
}), t.processingOrder = Gr(l, t.circularDependencies), t;
|
|
1558
1516
|
}
|
|
1559
|
-
function
|
|
1517
|
+
function Gr(e, n) {
|
|
1560
1518
|
const l = [], t = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
1561
1519
|
function p(d, T = []) {
|
|
1562
1520
|
if (t.has(d)) return;
|
|
1563
1521
|
if (u.has(d)) {
|
|
1564
|
-
const
|
|
1565
|
-
n.push(
|
|
1522
|
+
const B = [...T.slice(T.indexOf(d)), d];
|
|
1523
|
+
n.push(B);
|
|
1566
1524
|
return;
|
|
1567
1525
|
}
|
|
1568
1526
|
u.add(d), T.push(d);
|
|
1569
1527
|
const U = e.get(d) || [];
|
|
1570
|
-
for (const
|
|
1528
|
+
for (const B of U) p(B, [...T]);
|
|
1571
1529
|
u.delete(d), t.add(d), l.push(d);
|
|
1572
1530
|
}
|
|
1573
1531
|
for (const d of e.keys()) t.has(d) || p(d);
|
|
@@ -1575,82 +1533,76 @@ function Ir(e, n) {
|
|
|
1575
1533
|
for (const d of h) !t.has(d) && !e.has(d) && l.push(d);
|
|
1576
1534
|
return l.reverse();
|
|
1577
1535
|
}
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
};
|
|
1587
|
-
D();
|
|
1588
|
-
const gi = (e, n, l = 0.6, t = 0.3, u = 1) => {
|
|
1589
|
-
const { max: p, smoothstep: h, vec4: d } = me, T = p(p(e.r, e.g), e.b), U = h(l, l + t, T).mul(u).mul(1);
|
|
1536
|
+
var { vec2: Lr, fract: _r, sin: Nr, dot: Pr } = ue;
|
|
1537
|
+
const Xr = (e) => _r(Nr(Pr(e, Lr(12.12345, 78.12345))).mul(40000.12345)), si = (e = 0.03) => (n) => Xr(n).mul(e).mul(0.10012345);
|
|
1538
|
+
var { vec2: Yr } = ue;
|
|
1539
|
+
const li = (e = Yr(0), n = 0.02, l = 1, t = 1) => {
|
|
1540
|
+
const { vec2: u, sin: p, cos: h, time: d } = ue, T = t * 1.618033988749895, U = t * 2.718281828459045, B = (Math.sin(t) + 2) * 5, O = (Math.cos(t) + 2) * 5, J = u(p(e.x.mul(l).mul(B).add(d.mul(0.1)).add(T)), h(e.y.mul(l).mul(B).add(d.mul(0.1)).add(U))), N = u(p(e.y.mul(l).mul(O).add(d.mul(0.05)).add(U)), h(e.x.mul(l).mul(O).add(d.mul(0.05)).add(T))), P = J.add(N).mul(n);
|
|
1541
|
+
return e.add(P);
|
|
1542
|
+
}, ci = (e, n, l = 0.6, t = 0.3, u = 1) => {
|
|
1543
|
+
const { max: p, smoothstep: h, vec4: d } = ue, T = p(p(e.r, e.g), e.b), U = h(l, l + t, T).mul(u).mul(1);
|
|
1590
1544
|
return d(e.rgb.add(n.rgb.mul(U)), e.a);
|
|
1545
|
+
}, fi = (e = {}) => {
|
|
1546
|
+
const { inset: n = 0.4, softness: l = 0.5, offsetX: t = 0, offsetY: u = 0 } = e, { float: p, smoothstep: h, uv: d } = ue, T = d(), U = T.x.sub(0.5).sub(p(t)).mul(2), B = T.y.sub(0.5).add(p(u)).mul(2), O = U.mul(U).add(B.mul(B)).sqrt();
|
|
1547
|
+
return p(1).sub(h(p(1).sub(p(n)), p(1).sub(p(n)).add(p(l)), O.mul(p(1).add(p(l)))));
|
|
1591
1548
|
};
|
|
1592
|
-
|
|
1593
|
-
const bi = (e = {}) => {
|
|
1594
|
-
const { inset: n = 0.4, softness: l = 0.5, offsetX: t = 0, offsetY: u = 0 } = e, { float: p, smoothstep: h, uv: d } = me, T = d(), U = T.x.sub(0.5).sub(p(t)).mul(2), _ = T.y.sub(0.5).add(p(u)).mul(2), B = U.mul(U).add(_.mul(_)).sqrt();
|
|
1595
|
-
return p(1).sub(h(p(1).sub(p(n)), p(1).sub(p(n)).add(p(l)), B.mul(p(1).add(p(l)))));
|
|
1596
|
-
};
|
|
1597
|
-
var eo = () => {
|
|
1549
|
+
var Ir = () => {
|
|
1598
1550
|
const e = {};
|
|
1599
1551
|
return Object.entries({
|
|
1600
|
-
AngularBlur:
|
|
1601
|
-
Ascii:
|
|
1602
|
-
Blob:
|
|
1603
|
-
Blur:
|
|
1604
|
-
Bulge:
|
|
1605
|
-
ChannelBlur:
|
|
1606
|
-
Checkerboard:
|
|
1607
|
-
ChromaFlow:
|
|
1608
|
-
ChromaticAberration:
|
|
1609
|
-
Circle:
|
|
1610
|
-
CRTScreen:
|
|
1611
|
-
CursorTrail:
|
|
1612
|
-
DiffuseBlur:
|
|
1613
|
-
Dither:
|
|
1614
|
-
DotGrid:
|
|
1615
|
-
Duotone:
|
|
1616
|
-
FilmGrain:
|
|
1617
|
-
FloatingParticles:
|
|
1618
|
-
GlassTiles:
|
|
1619
|
-
Glow:
|
|
1620
|
-
Godrays:
|
|
1621
|
-
Grayscale:
|
|
1622
|
-
Grid:
|
|
1623
|
-
GridDistortion:
|
|
1624
|
-
Group:
|
|
1625
|
-
Halftone:
|
|
1626
|
-
HueShift:
|
|
1627
|
-
ImageTexture:
|
|
1628
|
-
Invert:
|
|
1629
|
-
LinearBlur:
|
|
1630
|
-
LinearGradient:
|
|
1631
|
-
Liquify:
|
|
1632
|
-
Pixelate:
|
|
1633
|
-
PolarCoordinates:
|
|
1634
|
-
Posterize:
|
|
1635
|
-
ProgressiveBlur:
|
|
1636
|
-
RadialGradient:
|
|
1637
|
-
RectangularCoordinates:
|
|
1638
|
-
Ripples:
|
|
1639
|
-
Saturation:
|
|
1640
|
-
SimplexNoise:
|
|
1641
|
-
SineWave:
|
|
1642
|
-
SolidColor:
|
|
1643
|
-
Spherize:
|
|
1644
|
-
Spiral:
|
|
1645
|
-
Strands:
|
|
1646
|
-
Stretch:
|
|
1647
|
-
Swirl:
|
|
1648
|
-
TiltShift:
|
|
1649
|
-
Tritone:
|
|
1650
|
-
Twirl:
|
|
1651
|
-
Vibrance:
|
|
1652
|
-
WaveDistortion:
|
|
1653
|
-
ZoomBlur:
|
|
1552
|
+
AngularBlur: Kn,
|
|
1553
|
+
Ascii: et,
|
|
1554
|
+
Blob: nt,
|
|
1555
|
+
Blur: tt,
|
|
1556
|
+
Bulge: rt,
|
|
1557
|
+
ChannelBlur: ot,
|
|
1558
|
+
Checkerboard: it,
|
|
1559
|
+
ChromaFlow: at,
|
|
1560
|
+
ChromaticAberration: st,
|
|
1561
|
+
Circle: lt,
|
|
1562
|
+
CRTScreen: ct,
|
|
1563
|
+
CursorTrail: ft,
|
|
1564
|
+
DiffuseBlur: ut,
|
|
1565
|
+
Dither: mt,
|
|
1566
|
+
DotGrid: dt,
|
|
1567
|
+
Duotone: ht,
|
|
1568
|
+
FilmGrain: pt,
|
|
1569
|
+
FloatingParticles: gt,
|
|
1570
|
+
GlassTiles: bt,
|
|
1571
|
+
Glow: vt,
|
|
1572
|
+
Godrays: Ct,
|
|
1573
|
+
Grayscale: Rt,
|
|
1574
|
+
Grid: Tt,
|
|
1575
|
+
GridDistortion: kt,
|
|
1576
|
+
Group: yt,
|
|
1577
|
+
Halftone: wt,
|
|
1578
|
+
HueShift: Ut,
|
|
1579
|
+
ImageTexture: St,
|
|
1580
|
+
Invert: Mt,
|
|
1581
|
+
LinearBlur: xt,
|
|
1582
|
+
LinearGradient: At,
|
|
1583
|
+
Liquify: Dt,
|
|
1584
|
+
Pixelate: zt,
|
|
1585
|
+
PolarCoordinates: Et,
|
|
1586
|
+
Posterize: $t,
|
|
1587
|
+
ProgressiveBlur: Ft,
|
|
1588
|
+
RadialGradient: Ot,
|
|
1589
|
+
RectangularCoordinates: Bt,
|
|
1590
|
+
Ripples: qt,
|
|
1591
|
+
Saturation: Vt,
|
|
1592
|
+
SimplexNoise: Gt,
|
|
1593
|
+
SineWave: Lt,
|
|
1594
|
+
SolidColor: _t,
|
|
1595
|
+
Spherize: Nt,
|
|
1596
|
+
Spiral: Pt,
|
|
1597
|
+
Strands: Xt,
|
|
1598
|
+
Stretch: Yt,
|
|
1599
|
+
Swirl: It,
|
|
1600
|
+
TiltShift: Ht,
|
|
1601
|
+
Tritone: Wt,
|
|
1602
|
+
Twirl: jt,
|
|
1603
|
+
Vibrance: Qt,
|
|
1604
|
+
WaveDistortion: Jt,
|
|
1605
|
+
ZoomBlur: Zt
|
|
1654
1606
|
}).forEach(([l, t]) => {
|
|
1655
1607
|
const u = {};
|
|
1656
1608
|
t.props && Object.entries(t.props).forEach(([p, h]) => {
|
|
@@ -1668,33 +1620,33 @@ var eo = () => {
|
|
|
1668
1620
|
};
|
|
1669
1621
|
}), e;
|
|
1670
1622
|
};
|
|
1671
|
-
const
|
|
1672
|
-
function
|
|
1673
|
-
return Object.values(
|
|
1623
|
+
const Ve = Ir();
|
|
1624
|
+
function ui() {
|
|
1625
|
+
return Object.values(Ve);
|
|
1674
1626
|
}
|
|
1675
|
-
function
|
|
1676
|
-
return
|
|
1627
|
+
function mi(e) {
|
|
1628
|
+
return Ve[e];
|
|
1677
1629
|
}
|
|
1678
|
-
function
|
|
1679
|
-
return Object.values(
|
|
1630
|
+
function di(e) {
|
|
1631
|
+
return Object.values(Ve).filter((n) => n.category === e);
|
|
1680
1632
|
}
|
|
1681
|
-
function
|
|
1682
|
-
const e = new Set(Object.values(
|
|
1633
|
+
function hi() {
|
|
1634
|
+
const e = new Set(Object.values(Ve).map((n) => n.category));
|
|
1683
1635
|
return Array.from(e).sort();
|
|
1684
1636
|
}
|
|
1685
1637
|
export {
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1638
|
+
Jr as createAnimatedTime,
|
|
1639
|
+
oi as createUniformsMap,
|
|
1640
|
+
li as distort,
|
|
1641
|
+
fi as edgeMask,
|
|
1642
|
+
ui as getAllShaders,
|
|
1643
|
+
mi as getShaderByName,
|
|
1644
|
+
hi as getShaderCategories,
|
|
1645
|
+
di as getShadersByCategory,
|
|
1646
|
+
ci as glow,
|
|
1647
|
+
si as grain,
|
|
1648
|
+
ai as resolveMaskDependencies,
|
|
1649
|
+
Ve as shaderRegistry,
|
|
1650
|
+
ii as shaderRenderer,
|
|
1651
|
+
Br as updateUniformValue
|
|
1700
1652
|
};
|