@vctrl/hooks 0.11.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,175 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.16.2](https://github.com/Vectreal/vectreal-platform/compare/hooks-v0.16.1...hooks-v0.16.2) (2026-04-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **hooks:** Synchronize vectreal-monorepo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @vctrl/core bumped to 0.16.2
|
|
16
|
+
|
|
17
|
+
## [0.16.1](https://github.com/Vectreal/vectreal-platform/compare/hooks-v0.16.0...hooks-v0.16.1) (2026-04-11)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Miscellaneous Chores
|
|
21
|
+
|
|
22
|
+
* **hooks:** Synchronize vectreal-monorepo versions
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @vctrl/core bumped to 0.16.1
|
|
30
|
+
|
|
31
|
+
## [0.16.0](https://github.com/Vectreal/vectreal-platform/compare/hooks-v0.15.0...hooks-v0.16.0) (2026-04-11)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Miscellaneous Chores
|
|
35
|
+
|
|
36
|
+
* **hooks:** Synchronize vectreal-monorepo versions
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Dependencies
|
|
40
|
+
|
|
41
|
+
* The following workspace dependencies were updated
|
|
42
|
+
* dependencies
|
|
43
|
+
* @vctrl/core bumped to 0.16.0
|
|
44
|
+
|
|
45
|
+
## [0.15.0](https://github.com/Vectreal/vectreal-platform/compare/hooks-v0.14.0...hooks-v0.15.0) (2026-04-08)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### Features
|
|
49
|
+
|
|
50
|
+
* add advanced optimization panel with toggle settings for quantization, deduplication, and normals optimization ([75d004e](https://github.com/Vectreal/vectreal-platform/commit/75d004e1b71009e1a8cffbf5e846d56d8d3d6ddc))
|
|
51
|
+
* Add authentication callback route for handling OAuth code exchange ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
52
|
+
* Add Google logo SVG asset ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
53
|
+
* add model exporter, loader, and optimizer modules as core package ([3725193](https://github.com/Vectreal/vectreal-platform/commit/372519345f5cd6d3d0be4011e7addd23e947202e))
|
|
54
|
+
* add new texture size option and enhance optimization panel ([f67f823](https://github.com/Vectreal/vectreal-platform/commit/f67f8237507b9caeb5dc0c9e1c25cfab2c6742a4))
|
|
55
|
+
* add platform app ([5a42716](https://github.com/Vectreal/vectreal-platform/commit/5a427161eb1757187ced8f4e590abe373fb131ea))
|
|
56
|
+
* add publish sidebar components for embedding, saving, and sharing scenes ([c846642](https://github.com/Vectreal/vectreal-platform/commit/c846642585db690738d5a8a11a29981750ff9d23))
|
|
57
|
+
* Add publisher buttons for 3D model processing ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
58
|
+
* add scene asset utilities for URI normalization, MIME type detection, and base64 handling ([d81826d](https://github.com/Vectreal/vectreal-platform/commit/d81826d4c8d416ac4e187d3300c5aa6d4eae4a0a))
|
|
59
|
+
* add scene metadata update functionality and enhance scene details UI ([58d0187](https://github.com/Vectreal/vectreal-platform/commit/58d01876a43c6dee1c087317873678083080d651))
|
|
60
|
+
* Add social sign-in route for Google and GitHub authentication ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
61
|
+
* add UI components ([5a42716](https://github.com/Vectreal/vectreal-platform/commit/5a427161eb1757187ced8f4e590abe373fb131ea))
|
|
62
|
+
* add various asset files including icons, manifest, and browser config for improved web app support ([a53bc24](https://github.com/Vectreal/vectreal-platform/commit/a53bc2417c05626b25ffbfbc338bf824b5c62981))
|
|
63
|
+
* Create a basic dashboard page component ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
64
|
+
* Create logout route to handle user sign-out ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
65
|
+
* Create sign-in layout with social login options ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
66
|
+
* Create sign-up page with username, email, and password registration ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
67
|
+
* Create Supabase client for server-side requests ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
68
|
+
* enhance asset handling by integrating asset normalization and lookup functionality ([571eabf](https://github.com/Vectreal/vectreal-platform/commit/571eabf01865afb0d1a86014119bdc06ca9a32ec))
|
|
69
|
+
* enhance asset handling by integrating asset normalization and lookup functionality ([a802fee](https://github.com/Vectreal/vectreal-platform/commit/a802fee7fb28b8624928fe0bdf124852fb2e476b))
|
|
70
|
+
* enhance CI/CD workflows with quality gate and build steps ([b5ad615](https://github.com/Vectreal/vectreal-platform/commit/b5ad6156cb051d9b623f98a2b6ca589dbf5a89f2))
|
|
71
|
+
* enhance CI/CD workflows with quality gate and build steps ([1b7030b](https://github.com/Vectreal/vectreal-platform/commit/1b7030be629b5bffdf5a95ae05893950f76fac68))
|
|
72
|
+
* enhance deployment workflows and configurations for Cloud Run services, add caching and access control improvements ([249da35](https://github.com/Vectreal/vectreal-platform/commit/249da3514d827c1268fd52ef9989b22743f42b8a))
|
|
73
|
+
* enhance model optimization and texture handling ([089f27a](https://github.com/Vectreal/vectreal-platform/commit/089f27a29a7f4160d1c2fd6b7c3c8e0a14941033))
|
|
74
|
+
* enhance model optimization and texture handling ([a98bb0c](https://github.com/Vectreal/vectreal-platform/commit/a98bb0c2fa6cfdf123835be7c093175b2ba1ae5b))
|
|
75
|
+
* enhance model optimization hooks and UI components ([e90bb5d](https://github.com/Vectreal/vectreal-platform/commit/e90bb5d009ed7f3559427f604d3096867a4cce90))
|
|
76
|
+
* enhance project and scene management with new folder creation and content actions ([93df463](https://github.com/Vectreal/vectreal-platform/commit/93df463fbd4c615d6c5e19bb3c9188b689654bb2))
|
|
77
|
+
* enhance publish sidebar with scene and project ID handling, improve embed options, and add validation for saving and publishing ([a7146fe](https://github.com/Vectreal/vectreal-platform/commit/a7146febdd7adf49714add09f9b367bcaffcf315))
|
|
78
|
+
* enhance scene data handling with base64 encoding and optimize request management ([880007f](https://github.com/Vectreal/vectreal-platform/commit/880007feb3685b5849916dafe3aac2743b8123f2))
|
|
79
|
+
* enhance scene metadata handling and settings management ([8ffc99b](https://github.com/Vectreal/vectreal-platform/commit/8ffc99b2eabd7fd83c78c0b581c6cf8c7f7e1073))
|
|
80
|
+
* enhance shared components and utils, add mobile navigation for docs ([b424033](https://github.com/Vectreal/vectreal-platform/commit/b4240331d005009a424be6058fe4db152775b950))
|
|
81
|
+
* enhance texture optimization API with new request structure and error handling ([6ac4d16](https://github.com/Vectreal/vectreal-platform/commit/6ac4d16b120c2178b22528d4d7045615e468982d))
|
|
82
|
+
* first-run onboarding wizard + /docs site with Edit on GitHub ([15c48d9](https://github.com/Vectreal/vectreal-platform/commit/15c48d94eec13df39ee2077745e6e8f3d2aaa3e4))
|
|
83
|
+
* implement apply optimizations button in the sidebar with loading state ([75d004e](https://github.com/Vectreal/vectreal-platform/commit/75d004e1b71009e1a8cffbf5e846d56d8d3d6ddc))
|
|
84
|
+
* Implement Asset Storage Service for managing GLTF scene assets in Google Cloud Storage ([d0761bc](https://github.com/Vectreal/vectreal-platform/commit/d0761bc689fd74d3ffdf9d29ec606a6264237e61))
|
|
85
|
+
* Implement authentication context and hooks for user management ([267f546](https://github.com/Vectreal/vectreal-platform/commit/267f54655f12ddeb9bf1dadcba911f40b85e46fa))
|
|
86
|
+
* Implement authentication layout with user redirection ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
87
|
+
* Implement email OTP confirmation route for user sign-up ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
88
|
+
* Implement hook for capturing scene screenshots in 3D environment ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
89
|
+
* Implement sign-in page with email and password authentication ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
90
|
+
* Implement theme session management with cookie storage ([64bd29c](https://github.com/Vectreal/vectreal-platform/commit/64bd29cc0ad178ddf4057e6b5da7fde5a2af504a))
|
|
91
|
+
* implement utility functions for API responses and styling ([5a42716](https://github.com/Vectreal/vectreal-platform/commit/5a427161eb1757187ced8f4e590abe373fb131ea))
|
|
92
|
+
* Optimize GLTF loading and model transformation processes for improved performance ([8060d9d](https://github.com/Vectreal/vectreal-platform/commit/8060d9ddd24651a0bac11058b5df563228f4a9bd))
|
|
93
|
+
* **packages/hooks:** optimize model and add normals optimization ([6f0bde1](https://github.com/Vectreal/vectreal-platform/commit/6f0bde1c5a47b9be555405f547cc186749c581fc))
|
|
94
|
+
* **packages/viewer:** update peer dependencies, add Storybook configuration, implement robust styling and remove postcss config files ([df8359a](https://github.com/Vectreal/vectreal-platform/commit/df8359a4824d265282634267683e8e4b007f423d))
|
|
95
|
+
* Refactor and enhance publisher settings components ([2a1eb68](https://github.com/Vectreal/vectreal-platform/commit/2a1eb687e157637d346a89f9ae97333e7265efcc))
|
|
96
|
+
* refactor authentication handling to use loadAuthenticatedSession and improve session management across dashboard routes ([e787c5d](https://github.com/Vectreal/vectreal-platform/commit/e787c5dd89f8855ff7af64289448f8e3763018b3))
|
|
97
|
+
* Refactor publisher layout and sidebar components ([2c43273](https://github.com/Vectreal/vectreal-platform/commit/2c43273b239a5d3f60de1d6b79cc417bea8154bf))
|
|
98
|
+
* refactor scene and asset handling with improved type definitions and payload resolution ([99e743b](https://github.com/Vectreal/vectreal-platform/commit/99e743b574c158c79af151c1465eb957df7a350a))
|
|
99
|
+
* refactor scene and asset handling, improve loading logic and UI components ([31e02bc](https://github.com/Vectreal/vectreal-platform/commit/31e02bc3914666c714c2e8af07d8e816e72cd817))
|
|
100
|
+
* Remove official-website in favor of vectreal-platform app ([e805770](https://github.com/Vectreal/vectreal-platform/commit/e805770e672100cb5c026e55f914587d543c3a27))
|
|
101
|
+
* Remove official-website in favor of vectreal-platform app ([#198](https://github.com/Vectreal/vectreal-platform/issues/198)) ([3c1019e](https://github.com/Vectreal/vectreal-platform/commit/3c1019ea1950ce1c99247c957e983078b563ce80))
|
|
102
|
+
* Update package publishing process to use 'publish' target and add preflight checks ([ccfe373](https://github.com/Vectreal/vectreal-platform/commit/ccfe3736521555e3fd6f23334248dbc3251cbf98))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Bug Fixes
|
|
106
|
+
|
|
107
|
+
* adjust ESLint configuration to ignore Storybook files and update Storybook main configuration ([a53bc24](https://github.com/Vectreal/vectreal-platform/commit/a53bc2417c05626b25ffbfbc338bf824b5c62981))
|
|
108
|
+
* Adjust routing for publisher layout to include optional sceneId parameter ([d0761bc](https://github.com/Vectreal/vectreal-platform/commit/d0761bc689fd74d3ffdf9d29ec606a6264237e61))
|
|
109
|
+
* **packages/hooks:** ensure buffers are converted to Uint8Array before adding to zip file ([4e1f99d](https://github.com/Vectreal/vectreal-platform/commit/4e1f99dcd54e45e2549df3ee6c0b3bda25b18a74))
|
|
110
|
+
* **packages/hooks:** optimize hook volumne + emission material extension registration ([6ec7915](https://github.com/Vectreal/vectreal-platform/commit/6ec79153d07d097df608d064ff0a16473a1fb1e7))
|
|
111
|
+
* **packages:** cross dependencies ([4fbe8b3](https://github.com/Vectreal/vectreal-platform/commit/4fbe8b3e07c09976758d7906a23a8780127b7479))
|
|
112
|
+
* **packages:** update dependencies in `package.json` with eslint nx plugin ([1eab9b7](https://github.com/Vectreal/vectreal-platform/commit/1eab9b718b821d3292d90e8b0e6ee1c3f72175b2))
|
|
113
|
+
* update decodeBase64ToUint8Array return type and improve asset data handling in reconstructGltfFiles ([3aa7170](https://github.com/Vectreal/vectreal-platform/commit/3aa71709268f386fd3b49f966fc4f88a15647a2c))
|
|
114
|
+
* update homepage URLs and repository type in package.json files ([#343](https://github.com/Vectreal/vectreal-platform/issues/343)) ([b8d8c69](https://github.com/Vectreal/vectreal-platform/commit/b8d8c691cd632ee95e54708b76630d6194f4a06f))
|
|
115
|
+
* Update repository URLs in package.json files to point to vectreal-platform ([07e2864](https://github.com/Vectreal/vectreal-platform/commit/07e28644fd331a3c85ce2bbde2dd8bac446546bf))
|
|
116
|
+
* update sidebar layout and add close button for better user experience ([75d004e](https://github.com/Vectreal/vectreal-platform/commit/75d004e1b71009e1a8cffbf5e846d56d8d3d6ddc))
|
|
117
|
+
* update types for optimization presets and ensure consistent prop usage ([75d004e](https://github.com/Vectreal/vectreal-platform/commit/75d004e1b71009e1a8cffbf5e846d56d8d3d6ddc))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Reverts
|
|
121
|
+
|
|
122
|
+
* remove release-please generated v0.14.0 changelog entry ([#366](https://github.com/Vectreal/vectreal-platform/issues/366)) ([4ef3b61](https://github.com/Vectreal/vectreal-platform/commit/4ef3b617e7b0a14fe5001b5371f67f2d65cdf819))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Dependencies
|
|
126
|
+
|
|
127
|
+
* The following workspace dependencies were updated
|
|
128
|
+
* dependencies
|
|
129
|
+
* @vctrl/core bumped to 0.15.0
|
|
130
|
+
|
|
131
|
+
## [0.12.2](https://github.com/Vectreal/vectreal-platform/compare/workspace-v0.12.1...hooks-v0.12.2) (2026-04-07)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Reverts
|
|
135
|
+
|
|
136
|
+
* remove release-please generated v0.14.0 changelog entry ([#366](https://github.com/Vectreal/vectreal-platform/issues/366)) ([4ef3b61](https://github.com/Vectreal/vectreal-platform/commit/4ef3b617e7b0a14fe5001b5371f67f2d65cdf819))
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Dependencies
|
|
140
|
+
|
|
141
|
+
* The following workspace dependencies were updated
|
|
142
|
+
* dependencies
|
|
143
|
+
* @vctrl/core bumped to 0.12.2
|
|
144
|
+
|
|
145
|
+
## [0.12.1](https://github.com/Vectreal/vectreal-platform/compare/hooks-v0.12.0...hooks-v0.12.1) (2026-04-07)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### Reverts
|
|
149
|
+
|
|
150
|
+
* remove release-please generated v0.14.0 changelog entry ([#366](https://github.com/Vectreal/vectreal-platform/issues/366)) ([4ef3b61](https://github.com/Vectreal/vectreal-platform/commit/4ef3b617e7b0a14fe5001b5371f67f2d65cdf819))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### Dependencies
|
|
154
|
+
|
|
155
|
+
* The following workspace dependencies were updated
|
|
156
|
+
* dependencies
|
|
157
|
+
* @vctrl/core bumped to 0.12.1
|
|
158
|
+
|
|
159
|
+
## [0.12.0](https://github.com/Vectreal/vectreal-platform/compare/hooks-v0.11.1...hooks-v0.12.0) (2026-04-04)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
### Bug Fixes
|
|
163
|
+
|
|
164
|
+
* update homepage URLs and repository type in package.json files ([#343](https://github.com/Vectreal/vectreal-platform/issues/343)) ([b8d8c69](https://github.com/Vectreal/vectreal-platform/commit/b8d8c691cd632ee95e54708b76630d6194f4a06f))
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
### Dependencies
|
|
168
|
+
|
|
169
|
+
* The following workspace dependencies were updated
|
|
170
|
+
* dependencies
|
|
171
|
+
* @vctrl/core bumped to 0.12.0
|
|
172
|
+
|
|
3
173
|
## [0.11.1](https://github.com/Vectreal/vectreal-platform/compare/hooks-v0.11.0...hooks-v0.11.1) (2026-04-02)
|
|
4
174
|
|
|
5
175
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.16.2",
|
|
3
3
|
"name": "@vctrl/hooks",
|
|
4
4
|
"description": "vctrl/hooks is a React hooks package designed to simplify 3D model loading and management within React applications. It's part of the vectreal-core ecosystem and is primarily used in the vctrl/viewer React component and the official website application.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/vectreal/vectreal-platform/issues"
|
|
7
7
|
},
|
|
8
|
-
"homepage": "https://
|
|
8
|
+
"homepage": "https://vectreal.com",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"vectreal",
|
|
11
11
|
"react",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"model-viewer"
|
|
25
25
|
],
|
|
26
26
|
"repository": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/vectreal/vectreal-platform.git"
|
|
29
29
|
},
|
|
30
30
|
"license": "AGPL-3.0-only",
|
|
31
31
|
"types": "./index.d.ts",
|
|
@@ -4,35 +4,39 @@ import { OptimizationInfo, OptimizationState } from './types'
|
|
|
4
4
|
|
|
5
5
|
import type { OptimizationReport } from '@vctrl/core/model-optimizer'
|
|
6
6
|
|
|
7
|
+
interface OptimizationMetricsSnapshot {
|
|
8
|
+
verticesCount: number
|
|
9
|
+
primitivesCount: number
|
|
10
|
+
meshesCount: number
|
|
11
|
+
textureAssetCount: number
|
|
12
|
+
materialsCount: number
|
|
13
|
+
sceneBytes: number
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
/**
|
|
8
17
|
* Helper function to safely get stats from optimization report.
|
|
9
18
|
*/
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
meshes: number
|
|
14
|
-
textures: number
|
|
15
|
-
materials: number
|
|
16
|
-
totalSize: number
|
|
17
|
-
} {
|
|
19
|
+
function getSnapshotFromReport(
|
|
20
|
+
report: OptimizationReport | null
|
|
21
|
+
): OptimizationMetricsSnapshot {
|
|
18
22
|
if (!report) {
|
|
19
23
|
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
verticesCount: 0,
|
|
25
|
+
primitivesCount: 0,
|
|
26
|
+
meshesCount: 0,
|
|
27
|
+
textureAssetCount: 0,
|
|
28
|
+
materialsCount: 0,
|
|
29
|
+
sceneBytes: 0
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
return {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
verticesCount: report.stats.vertices.after ?? 0,
|
|
35
|
+
primitivesCount: report.stats.triangles.after ?? 0,
|
|
36
|
+
meshesCount: report.stats.meshes.after ?? 0,
|
|
37
|
+
textureAssetCount: report.stats.texturesCount.after ?? 0,
|
|
38
|
+
materialsCount: report.stats.materials.after ?? 0,
|
|
39
|
+
sceneBytes: report.optimizedSize ?? 0
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -57,30 +61,30 @@ export const useCalcOptimizationInfo = (
|
|
|
57
61
|
}, [initialCaptured, report])
|
|
58
62
|
|
|
59
63
|
const info = useMemo(() => {
|
|
60
|
-
const initial =
|
|
61
|
-
const current =
|
|
64
|
+
const initial = getSnapshotFromReport(initialReport.current)
|
|
65
|
+
const current = getSnapshotFromReport(report)
|
|
62
66
|
|
|
63
67
|
return {
|
|
64
68
|
initial: {
|
|
65
|
-
verticesCount: initial.
|
|
66
|
-
primitivesCount: initial.
|
|
67
|
-
meshesCount: initial.
|
|
68
|
-
texturesCount: initial.
|
|
69
|
-
sceneBytes: initial.
|
|
69
|
+
verticesCount: initial.verticesCount,
|
|
70
|
+
primitivesCount: initial.primitivesCount,
|
|
71
|
+
meshesCount: initial.meshesCount,
|
|
72
|
+
texturesCount: initial.textureAssetCount,
|
|
73
|
+
sceneBytes: initial.sceneBytes
|
|
70
74
|
},
|
|
71
75
|
optimized: {
|
|
72
|
-
verticesCount: current.
|
|
73
|
-
primitivesCount: current.
|
|
74
|
-
meshesCount: current.
|
|
75
|
-
texturesCount: current.
|
|
76
|
-
sceneBytes: current.
|
|
76
|
+
verticesCount: current.verticesCount,
|
|
77
|
+
primitivesCount: current.primitivesCount,
|
|
78
|
+
meshesCount: current.meshesCount,
|
|
79
|
+
texturesCount: current.textureAssetCount,
|
|
80
|
+
sceneBytes: current.sceneBytes
|
|
77
81
|
},
|
|
78
82
|
improvement: {
|
|
79
|
-
verticesCount: initial.
|
|
80
|
-
primitivesCount: initial.
|
|
81
|
-
meshesCount: initial.
|
|
82
|
-
texturesCount: initial.
|
|
83
|
-
sceneBytes: initial.
|
|
83
|
+
verticesCount: initial.verticesCount - current.verticesCount,
|
|
84
|
+
primitivesCount: initial.primitivesCount - current.primitivesCount,
|
|
85
|
+
meshesCount: initial.meshesCount - current.meshesCount,
|
|
86
|
+
texturesCount: initial.textureAssetCount - current.textureAssetCount,
|
|
87
|
+
sceneBytes: initial.sceneBytes - current.sceneBytes
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
}, [report])
|