shaders 2.2.24 → 2.2.25
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-Dl2gwk68.js +64 -0
- package/dist/core/Ascii-Dha_QpT3.js +286 -0
- package/dist/core/Beam-CTN9Ni43.js +139 -0
- package/dist/core/Blob-CxFDZovO.js +218 -0
- package/dist/core/Blur-Y2FsmFk_.js +77 -0
- package/dist/core/Bulge-Cb-t0xqI.js +132 -0
- package/dist/core/CRTScreen-CtERsenz.js +112 -0
- package/dist/core/ChannelBlur-CvM6GJgZ.js +118 -0
- package/dist/core/Checkerboard-CgB-egNY.js +83 -0
- package/dist/core/ChromaFlow-vRCwhQpN.js +222 -0
- package/dist/core/ChromaticAberration-FTquTQIL.js +88 -0
- package/dist/core/Circle-Daziv5d7.js +67 -0
- package/dist/core/CursorTrail-Bsz9e6Fn.js +145 -0
- package/dist/core/DiffuseBlur-Cj2PtRNd.js +83 -0
- package/dist/core/Dither-D2Nf4p3w.js +66 -0
- package/dist/core/DotGrid-CzOwquo4.js +75 -0
- package/dist/core/Duotone-XuTN9tI7.js +65 -0
- package/dist/core/FilmGrain-D3-nbi12.js +28 -0
- package/dist/core/FloatingParticles-D9Nnu1qg.js +217 -0
- package/dist/core/GlassTiles-CnjCvajI.js +69 -0
- package/dist/core/Glow-BluFc9be.js +75 -0
- package/dist/core/Godrays-ChLh_vGl.js +144 -0
- package/dist/core/Grayscale-DRny75A9.js +20 -0
- package/dist/core/Grid-DgyDa4H1.js +58 -0
- package/dist/core/GridDistortion-BAspCYvp.js +188 -0
- package/dist/core/Group-Dul7PUBl.js +14 -0
- package/dist/core/Halftone-Ifv5F_FT.js +65 -0
- package/dist/core/HueShift-De8ukMWs.js +31 -0
- package/dist/core/ImageTexture-DvYcQgJB.js +143 -0
- package/dist/core/Invert-Fz0NtIJc.js +21 -0
- package/dist/core/LinearBlur-LmhnQoA4.js +62 -0
- package/dist/core/LinearGradient-xbloQjzt.js +133 -0
- package/dist/core/Liquify-DMe1V5-O.js +175 -0
- package/dist/core/Pixelate-Cv8537Pj.js +37 -0
- package/dist/core/PolarCoordinates-DDvDhBE-.js +112 -0
- package/dist/core/Posterize-3m3xkWOz.js +29 -0
- package/dist/core/ProgressiveBlur-EGkevObV.js +121 -0
- package/dist/core/RadialGradient-B7ZZB_VJ.js +71 -0
- package/dist/core/RectangularCoordinates-muWR8mZS.js +101 -0
- package/dist/core/Ripples-8XaZaXQF.js +117 -0
- package/dist/core/Saturation-CYFI1jzN.js +30 -0
- package/dist/core/SimplexNoise-DJUe0wz_.js +99 -0
- package/dist/core/SineWave-Dl3nFO1W.js +120 -0
- package/dist/core/SolidColor-CWGq_Bjq.js +21 -0
- package/dist/core/Spherize-C-jZEUsN.js +128 -0
- package/dist/core/Spiral-BSB_R39p.js +132 -0
- package/dist/core/Strands-0stO5BMy.js +161 -0
- package/dist/core/Stretch-B645paha.js +133 -0
- package/dist/core/Swirl-CVnbawit.js +173 -0
- package/dist/core/TiltShift-0CxNRI6L.js +134 -0
- package/dist/core/Tritone-Daa-I5UD.js +76 -0
- package/dist/core/Twirl-2CJVZEtk.js +96 -0
- package/dist/core/Vibrance-DRtecEvb.js +30 -0
- package/dist/core/WaveDistortion-BscXN2rs.js +173 -0
- package/dist/core/ZoomBlur-CAqK0Kju.js +62 -0
- package/dist/core/colorMixing-BXiTAqJU.js +69 -0
- package/dist/core/edges-Bn_OIa_h.js +26 -0
- package/dist/core/index.js +2257 -1606
- package/dist/core/shaders/AngularBlur/index.js +3 -7
- package/dist/core/shaders/Ascii/index.js +2 -6
- package/dist/core/shaders/Beam/index.js +4 -8
- package/dist/core/shaders/Blob/index.js +5 -9
- package/dist/core/shaders/Blur/index.js +2 -6
- package/dist/core/shaders/Bulge/index.js +4 -8
- package/dist/core/shaders/CRTScreen/index.js +2 -6
- package/dist/core/shaders/ChannelBlur/index.js +2 -6
- package/dist/core/shaders/Checkerboard/index.js +4 -8
- package/dist/core/shaders/ChromaFlow/index.js +3 -7
- package/dist/core/shaders/ChromaticAberration/index.js +3 -7
- package/dist/core/shaders/Circle/index.js +3 -7
- package/dist/core/shaders/CursorTrail/index.js +4 -8
- package/dist/core/shaders/DiffuseBlur/index.js +4 -8
- package/dist/core/shaders/Dither/index.js +3 -7
- package/dist/core/shaders/DotGrid/index.js +3 -7
- package/dist/core/shaders/Duotone/index.js +4 -8
- package/dist/core/shaders/FilmGrain/index.js +2 -6
- package/dist/core/shaders/FloatingParticles/index.js +3 -7
- package/dist/core/shaders/GlassTiles/index.js +2 -6
- package/dist/core/shaders/Glow/index.js +2 -6
- package/dist/core/shaders/Godrays/index.js +3 -7
- package/dist/core/shaders/Grayscale/index.js +2 -8
- package/dist/core/shaders/Grid/index.js +3 -7
- package/dist/core/shaders/GridDistortion/index.js +4 -8
- package/dist/core/shaders/Group/index.js +2 -6
- package/dist/core/shaders/Halftone/index.js +3 -7
- package/dist/core/shaders/HueShift/index.js +2 -8
- package/dist/core/shaders/ImageTexture/index.js +2 -6
- package/dist/core/shaders/Invert/index.js +2 -6
- package/dist/core/shaders/LinearBlur/index.js +3 -7
- package/dist/core/shaders/LinearGradient/index.js +4 -8
- package/dist/core/shaders/Liquify/index.js +4 -8
- package/dist/core/shaders/Pixelate/index.js +2 -6
- package/dist/core/shaders/PolarCoordinates/index.js +4 -8
- package/dist/core/shaders/Posterize/index.js +2 -7
- package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
- package/dist/core/shaders/RadialGradient/index.js +4 -8
- package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
- package/dist/core/shaders/Ripples/index.js +5 -9
- package/dist/core/shaders/Saturation/index.js +2 -8
- package/dist/core/shaders/SimplexNoise/index.js +5 -9
- package/dist/core/shaders/SineWave/index.js +3 -7
- package/dist/core/shaders/SolidColor/index.js +3 -7
- package/dist/core/shaders/Spherize/index.js +3 -7
- package/dist/core/shaders/Spiral/index.js +4 -8
- package/dist/core/shaders/Strands/index.js +4 -8
- package/dist/core/shaders/Stretch/index.js +4 -8
- package/dist/core/shaders/Swirl/index.js +5 -9
- package/dist/core/shaders/TiltShift/index.js +3 -7
- package/dist/core/shaders/Tritone/index.js +4 -8
- package/dist/core/shaders/Twirl/index.js +4 -8
- package/dist/core/shaders/Vibrance/index.js +2 -8
- package/dist/core/shaders/WaveDistortion/index.js +4 -8
- package/dist/core/shaders/ZoomBlur/index.js +3 -7
- package/dist/core/telemetry/index.js +189 -157
- package/dist/core/time-CTJvRUZ4.js +10 -0
- package/dist/core/transformations-DxfQXZWi.js +4715 -0
- package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
- package/dist/react/index.js +7645 -104827
- package/dist/react/utils/generatePresetCode.js +2 -5
- package/dist/solid/index.js +6670 -102727
- package/dist/solid/utils/generatePresetCode.js +583 -554
- package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
- package/dist/svelte/index.js +6175 -102645
- package/dist/svelte/utils/generatePresetCode.js +2 -5
- package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
- package/dist/vue/index.js +6929 -103706
- package/dist/vue/utils/generatePresetCode.js +2 -5
- package/package.json +4 -1
- package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
- package/dist/core/Ascii-BT0-K_vw.js +0 -196
- package/dist/core/Beam-BAKql1AP.js +0 -116
- package/dist/core/Blob-CVSxhHJG.js +0 -169
- package/dist/core/Blur-C1TTBHCX.js +0 -64
- package/dist/core/Bulge-DV8tX-cw.js +0 -103
- package/dist/core/CRTScreen-VTJQoOeq.js +0 -91
- package/dist/core/ChannelBlur-BLZ9kBNA.js +0 -89
- package/dist/core/Checkerboard-DQ4Df3vm.js +0 -75
- package/dist/core/ChromaFlow-BggN1_Av.js +0 -134
- package/dist/core/ChromaticAberration-DlTaHNcp.js +0 -82
- package/dist/core/Circle-B9ObWlq5.js +0 -62
- package/dist/core/ColorAdjustment-FeXXpypd.js +0 -14
- package/dist/core/CursorTrail-C7QdUj8O.js +0 -105
- package/dist/core/DiffuseBlur-Mx6LBsqz.js +0 -69
- package/dist/core/Dither-CeIdV_9C.js +0 -61
- package/dist/core/DotGrid-D6xUvYrt.js +0 -61
- package/dist/core/Duotone-C2Pqt2gR.js +0 -66
- package/dist/core/FilmGrain-CJ9n_fgk.js +0 -28
- package/dist/core/FloatingParticles-iGtMs44K.js +0 -160
- package/dist/core/GlassTiles-D_lVyag2.js +0 -52
- package/dist/core/Glow-B0jj-6OC.js +0 -66
- package/dist/core/Godrays-DjLVuZa4.js +0 -105
- package/dist/core/Grayscale-BbsdDa_X.js +0 -21
- package/dist/core/Grid-ByjU-_ua.js +0 -50
- package/dist/core/GridDistortion-C_eIlhkW.js +0 -147
- package/dist/core/Group-CyaDLGpI.js +0 -17
- package/dist/core/Halftone-BvuAe_k-.js +0 -55
- package/dist/core/HueShift-B_qE9c08.js +0 -32
- package/dist/core/ImageTexture-h00TFC1l.js +0 -105
- package/dist/core/Invert-BEDDB0sm.js +0 -20
- package/dist/core/LinearBlur-CLKxuyeT.js +0 -56
- package/dist/core/LinearGradient-BPo8TX_M.js +0 -111
- package/dist/core/Liquify-DGkfeixZ.js +0 -139
- package/dist/core/Pixelate-Bzy_7LnJ.js +0 -38
- package/dist/core/PolarCoordinates-BUumPeTv.js +0 -103
- package/dist/core/Posterize-ggKIJlmm.js +0 -46
- package/dist/core/ProgressiveBlur-D6_6T7SS.js +0 -102
- package/dist/core/RadialGradient-DEY9fRqa.js +0 -71
- package/dist/core/RectangularCoordinates-CZ-cFrCh.js +0 -92
- package/dist/core/Ripples-BwNlcsnV.js +0 -106
- package/dist/core/Saturation-Dl3gCWuZ.js +0 -31
- package/dist/core/SimplexNoise-BhE_WyGt.js +0 -94
- package/dist/core/SineWave-Db_Y0Mcv.js +0 -107
- package/dist/core/SolidColor-CerOp4EQ.js +0 -22
- package/dist/core/Spherize-Dh8E5XwG.js +0 -103
- package/dist/core/Spiral-BvygQEfP.js +0 -115
- package/dist/core/Strands-maaPn4On.js +0 -125
- package/dist/core/Stretch-CnA0-nSz.js +0 -103
- package/dist/core/Swirl-CQBUahTB.js +0 -148
- package/dist/core/TSLBase-Bt7Z4hv_.js +0 -8053
- package/dist/core/TiltShift-qFj0oFzN.js +0 -114
- package/dist/core/Tritone-AiixmTg8.js +0 -75
- package/dist/core/Twirl-ooHQcV89.js +0 -82
- package/dist/core/Vibrance-C2FRlLkK.js +0 -31
- package/dist/core/WaveDistortion-CN8MjKlm.js +0 -132
- package/dist/core/ZoomBlur-CxWGx8PH.js +0 -56
- package/dist/core/colorMixing--dhzx0ch.js +0 -21
- package/dist/core/edges-CDzKsauJ.js +0 -15
- package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
- package/dist/core/time-DbRMw6Jm.js +0 -10
- package/dist/core/transformations-CsrIJXh-.js +0 -3992
- package/dist/react/generatePresetCode-CVj6IV8Y.js +0 -646
- package/dist/svelte/generatePresetCode-CVj6IV8Y.js +0 -646
- package/dist/vue/generatePresetCode-DCaIsDhE.js +0 -652
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../
|
|
4
|
-
import "../../
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
p as componentDefinition,
|
|
8
|
-
a as default
|
|
9
|
-
};
|
|
1
|
+
import "../../time-CTJvRUZ4.js";
|
|
2
|
+
import "../../transformations-DxfQXZWi.js";
|
|
3
|
+
import "../../colorMixing-BXiTAqJU.js";
|
|
4
|
+
import { n as componentDefinition, t as Swirl_default } from "../../Swirl-CVnbawit.js";
|
|
5
|
+
export { componentDefinition, Swirl_default as default };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
a as componentDefinition,
|
|
6
|
-
e as default
|
|
7
|
-
};
|
|
1
|
+
import "../../transformations-DxfQXZWi.js";
|
|
2
|
+
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-0CxNRI6L.js";
|
|
3
|
+
export { componentDefinition, TiltShift_default as default };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
e as componentDefinition,
|
|
7
|
-
m as default
|
|
8
|
-
};
|
|
1
|
+
import "../../transformations-DxfQXZWi.js";
|
|
2
|
+
import "../../colorMixing-BXiTAqJU.js";
|
|
3
|
+
import { n as componentDefinition, t as Tritone_default } from "../../Tritone-Daa-I5UD.js";
|
|
4
|
+
export { componentDefinition, Tritone_default as default };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
m as componentDefinition,
|
|
7
|
-
p as default
|
|
8
|
-
};
|
|
1
|
+
import "../../edges-Bn_OIa_h.js";
|
|
2
|
+
import "../../transformations-DxfQXZWi.js";
|
|
3
|
+
import { n as componentDefinition, t as Twirl_default } from "../../Twirl-2CJVZEtk.js";
|
|
4
|
+
export { componentDefinition, Twirl_default as default };
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
|
|
3
|
-
import "../../ColorAdjustment-FeXXpypd.js";
|
|
4
|
-
import { n as a, t as e } from "../../Vibrance-C2FRlLkK.js";
|
|
5
|
-
export {
|
|
6
|
-
a as componentDefinition,
|
|
7
|
-
e as default
|
|
8
|
-
};
|
|
1
|
+
import { n as componentDefinition, t as Vibrance_default } from "../../Vibrance-DRtecEvb.js";
|
|
2
|
+
export { componentDefinition, Vibrance_default as default };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../
|
|
3
|
-
import "../../
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
a as componentDefinition,
|
|
7
|
-
e as default
|
|
8
|
-
};
|
|
1
|
+
import "../../edges-Bn_OIa_h.js";
|
|
2
|
+
import "../../transformations-DxfQXZWi.js";
|
|
3
|
+
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-BscXN2rs.js";
|
|
4
|
+
export { componentDefinition, WaveDistortion_default as default };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
m as componentDefinition,
|
|
6
|
-
r as default
|
|
7
|
-
};
|
|
1
|
+
import "../../transformations-DxfQXZWi.js";
|
|
2
|
+
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-CAqK0Kju.js";
|
|
3
|
+
export { componentDefinition, ZoomBlur_default as default };
|
|
@@ -1,162 +1,194 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const TELEMETRY_CONFIG = {
|
|
2
|
+
samplingRate: .05,
|
|
3
|
+
collectionDuration: 1e4,
|
|
4
|
+
warmupDuration: 1e3,
|
|
5
|
+
sampleInterval: 100,
|
|
6
|
+
apiEndpoint: "https://shaders.com/api/telemetry"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
function collectEnvironment() {
|
|
9
|
+
if (typeof window === "undefined" || typeof navigator === "undefined") return {
|
|
10
|
+
domain: "unknown",
|
|
11
|
+
url: "unknown",
|
|
12
|
+
userAgent: "unknown",
|
|
13
|
+
viewport: {
|
|
14
|
+
width: 0,
|
|
15
|
+
height: 0
|
|
16
|
+
},
|
|
17
|
+
devicePixelRatio: 1,
|
|
18
|
+
locale: "en-US"
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
domain: window.location.hostname,
|
|
22
|
+
url: window.location.pathname,
|
|
23
|
+
userAgent: navigator.userAgent,
|
|
24
|
+
viewport: {
|
|
25
|
+
width: window.innerWidth,
|
|
26
|
+
height: window.innerHeight
|
|
27
|
+
},
|
|
28
|
+
devicePixelRatio: window.devicePixelRatio,
|
|
29
|
+
locale: navigator.language
|
|
30
|
+
};
|
|
30
31
|
}
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
32
|
+
var TelemetryCollector = class {
|
|
33
|
+
renderer;
|
|
34
|
+
sessionId;
|
|
35
|
+
frameSamples = [];
|
|
36
|
+
sampleInterval = null;
|
|
37
|
+
stopped = false;
|
|
38
|
+
constructor(renderer) {
|
|
39
|
+
this.renderer = renderer;
|
|
40
|
+
this.sessionId = `tel_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
|
|
41
|
+
}
|
|
42
|
+
stop() {
|
|
43
|
+
this.stopped = true;
|
|
44
|
+
if (this.sampleInterval) {
|
|
45
|
+
clearInterval(this.sampleInterval);
|
|
46
|
+
this.sampleInterval = null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async start() {
|
|
50
|
+
try {
|
|
51
|
+
await this.sleep(TELEMETRY_CONFIG.warmupDuration);
|
|
52
|
+
if (this.stopped) return;
|
|
53
|
+
this.sampleInterval = setInterval(() => {
|
|
54
|
+
if (this.stopped) return;
|
|
55
|
+
try {
|
|
56
|
+
const stats = this.renderer.getPerformanceStats();
|
|
57
|
+
this.frameSamples.push(stats);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error("Telemetry sampling error:", error);
|
|
60
|
+
}
|
|
61
|
+
}, TELEMETRY_CONFIG.sampleInterval);
|
|
62
|
+
await this.sleep(TELEMETRY_CONFIG.collectionDuration - TELEMETRY_CONFIG.warmupDuration);
|
|
63
|
+
if (this.stopped) return;
|
|
64
|
+
if (this.sampleInterval) {
|
|
65
|
+
clearInterval(this.sampleInterval);
|
|
66
|
+
this.sampleInterval = null;
|
|
67
|
+
}
|
|
68
|
+
if (!this.stopped && this.frameSamples.length >= 10) {
|
|
69
|
+
const payload = this.aggregateData();
|
|
70
|
+
await this.sendTelemetry(payload);
|
|
71
|
+
} else if (this.frameSamples.length < 10) console.log("[Telemetry] Insufficient samples collected, skipping send");
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error("Telemetry collection error:", error);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
sleep(ms) {
|
|
77
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
78
|
+
}
|
|
79
|
+
aggregateData() {
|
|
80
|
+
const performance = this.aggregatePerformance();
|
|
81
|
+
const renderer = this.detectRendererType();
|
|
82
|
+
const components = this.extractComponents();
|
|
83
|
+
const environment = collectEnvironment();
|
|
84
|
+
return {
|
|
85
|
+
sessionId: this.sessionId,
|
|
86
|
+
timestamp: Date.now(),
|
|
87
|
+
collectionDuration: TELEMETRY_CONFIG.collectionDuration,
|
|
88
|
+
performance,
|
|
89
|
+
renderer,
|
|
90
|
+
components,
|
|
91
|
+
environment
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
aggregatePerformance() {
|
|
95
|
+
if (this.frameSamples.length === 0) return {
|
|
96
|
+
fps: 0,
|
|
97
|
+
frameTime: {
|
|
98
|
+
avg: 0,
|
|
99
|
+
min: 0,
|
|
100
|
+
max: 0,
|
|
101
|
+
p99: 0
|
|
102
|
+
},
|
|
103
|
+
jankPercent: 0,
|
|
104
|
+
budgetUsed: 0
|
|
105
|
+
};
|
|
106
|
+
const frameTimes = this.frameSamples.map((s) => s.avgFrameTime);
|
|
107
|
+
const jankPercents = this.frameSamples.map((s) => s.jankPercent);
|
|
108
|
+
const budgetUseds = this.frameSamples.map((s) => s.budgetUsed);
|
|
109
|
+
const fpsValues = this.frameSamples.map((s) => s.fps);
|
|
110
|
+
const fps = this.calculateMedian(fpsValues);
|
|
111
|
+
const avgFrameTime = this.calculateMean(frameTimes);
|
|
112
|
+
const minFrameTime = Math.min(...frameTimes);
|
|
113
|
+
const maxFrameTime = Math.max(...frameTimes);
|
|
114
|
+
const p99FrameTime = this.calculatePercentile(frameTimes, 99);
|
|
115
|
+
const jankPercent = this.calculateMean(jankPercents);
|
|
116
|
+
const budgetUsed = this.calculateMean(budgetUseds);
|
|
117
|
+
return {
|
|
118
|
+
fps: Math.round(fps * 10) / 10,
|
|
119
|
+
frameTime: {
|
|
120
|
+
avg: Math.round(avgFrameTime * 10) / 10,
|
|
121
|
+
min: Math.round(minFrameTime * 10) / 10,
|
|
122
|
+
max: Math.round(maxFrameTime * 10) / 10,
|
|
123
|
+
p99: Math.round(p99FrameTime * 10) / 10
|
|
124
|
+
},
|
|
125
|
+
jankPercent: Math.round(jankPercent * 10) / 10,
|
|
126
|
+
budgetUsed: Math.round(budgetUsed * 10) / 10
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
detectRendererType() {
|
|
130
|
+
const latestSample = this.frameSamples[this.frameSamples.length - 1];
|
|
131
|
+
return {
|
|
132
|
+
type: this.renderer.getRendererType?.() || "webgl",
|
|
133
|
+
drawCalls: latestSample?.drawCalls ?? null,
|
|
134
|
+
textureCount: latestSample?.textureCount ?? null
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
extractComponents() {
|
|
138
|
+
try {
|
|
139
|
+
const nodeRegistry = this.renderer.getNodeRegistry();
|
|
140
|
+
const components = [];
|
|
141
|
+
for (const [_, nodeInfo] of nodeRegistry.nodes) {
|
|
142
|
+
if (nodeInfo.parentId === null) continue;
|
|
143
|
+
components.push({
|
|
144
|
+
name: nodeInfo.componentName,
|
|
145
|
+
requiresRTT: nodeInfo.requiresRTT,
|
|
146
|
+
renderOrder: nodeInfo.metadata.renderOrder
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return components.sort((a, b) => a.renderOrder - b.renderOrder);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
console.error("Failed to extract components:", error);
|
|
152
|
+
return [];
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async sendTelemetry(payload) {
|
|
156
|
+
try {
|
|
157
|
+
const response = await fetch(TELEMETRY_CONFIG.apiEndpoint, {
|
|
158
|
+
method: "POST",
|
|
159
|
+
headers: { "Content-Type": "application/json" },
|
|
160
|
+
body: JSON.stringify(payload)
|
|
161
|
+
});
|
|
162
|
+
if (!response.ok) console.warn("Telemetry send failed:", response.status, response.statusText);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
console.error("Telemetry send error:", error);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
calculateMean(values) {
|
|
168
|
+
if (values.length === 0) return 0;
|
|
169
|
+
return values.reduce((a, b) => a + b, 0) / values.length;
|
|
170
|
+
}
|
|
171
|
+
calculateMedian(values) {
|
|
172
|
+
if (values.length === 0) return 0;
|
|
173
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
174
|
+
const mid = Math.floor(sorted.length / 2);
|
|
175
|
+
if (sorted.length % 2 === 0) return (sorted[mid - 1] + sorted[mid]) / 2;
|
|
176
|
+
else return sorted[mid];
|
|
177
|
+
}
|
|
178
|
+
calculatePercentile(values, percentile) {
|
|
179
|
+
if (values.length === 0) return 0;
|
|
180
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
181
|
+
const index = Math.ceil(percentile / 100 * sorted.length) - 1;
|
|
182
|
+
return sorted[Math.max(0, index)];
|
|
183
|
+
}
|
|
149
184
|
};
|
|
150
|
-
function
|
|
151
|
-
|
|
185
|
+
function shouldCollectTelemetry() {
|
|
186
|
+
if (typeof window !== "undefined" && window.location?.search?.includes("telemetry=true")) return true;
|
|
187
|
+
return Math.random() < TELEMETRY_CONFIG.samplingRate;
|
|
152
188
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
189
|
+
function isExternalUser() {
|
|
190
|
+
if (typeof window === "undefined" || !window.location) return false;
|
|
191
|
+
const hostname = window.location.hostname;
|
|
192
|
+
return !hostname.includes("shaders.com") && hostname !== "localhost" && hostname !== "127.0.0.1";
|
|
157
193
|
}
|
|
158
|
-
export {
|
|
159
|
-
h as TelemetryCollector,
|
|
160
|
-
g as isExternalUser,
|
|
161
|
-
f as shouldCollectTelemetry
|
|
162
|
-
};
|
|
194
|
+
export { TelemetryCollector, isExternalUser, shouldCollectTelemetry };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { uniform } from "three/tsl";
|
|
2
|
+
const createAnimatedTime = (params, speedUniform, seedUniform) => {
|
|
3
|
+
const accumulatedTime = uniform(0);
|
|
4
|
+
params.onBeforeRender(({ deltaTime }) => {
|
|
5
|
+
accumulatedTime.value += deltaTime * speedUniform.uniform.value;
|
|
6
|
+
});
|
|
7
|
+
if (seedUniform) return accumulatedTime.add(seedUniform.uniform);
|
|
8
|
+
return accumulatedTime;
|
|
9
|
+
};
|
|
10
|
+
export { createAnimatedTime as t };
|