@plasius/gpu-shared 0.1.11 → 0.1.13

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +36 -3
  2. package/README.md +55 -1
  3. package/assets/brigantine.gltf +549 -24
  4. package/assets/cutter.gltf +538 -0
  5. package/assets/harbor-dock.gltf +680 -0
  6. package/assets/lighthouse.gltf +604 -0
  7. package/dist/chunk-2FIFSBB4.js +74 -0
  8. package/dist/chunk-2FIFSBB4.js.map +1 -0
  9. package/dist/chunk-DABW627O.js +113 -0
  10. package/dist/chunk-DABW627O.js.map +1 -0
  11. package/dist/chunk-DQX4DXBR.js +369 -0
  12. package/dist/chunk-DQX4DXBR.js.map +1 -0
  13. package/dist/chunk-NCPJWLX3.js +17 -0
  14. package/dist/chunk-NCPJWLX3.js.map +1 -0
  15. package/dist/gltf-loader-WAM23F37.js +9 -0
  16. package/dist/index.cjs +1255 -279
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.js +19 -6
  19. package/dist/index.js.map +1 -1
  20. package/dist/showcase-inline-assets-B7U7VX5H.js +7 -0
  21. package/dist/{showcase-runtime-2ZNPKD7D.js → showcase-runtime-PN7N3FZY.js} +808 -237
  22. package/dist/showcase-runtime-PN7N3FZY.js.map +1 -0
  23. package/package.json +15 -1
  24. package/src/asset-url.js +62 -11
  25. package/src/feature-flags.js +1 -0
  26. package/src/gltf-loader.js +322 -32
  27. package/src/i18n.js +71 -0
  28. package/src/index.d.ts +115 -1
  29. package/src/index.js +9 -1
  30. package/src/showcase-inline-assets.js +3 -0
  31. package/src/showcase-runtime.js +912 -188
  32. package/src/translations/en-GB.js +55 -0
  33. package/dist/chunk-DGUM43GV.js +0 -11
  34. package/dist/chunk-OTCJ3VOK.js +0 -35
  35. package/dist/chunk-OTCJ3VOK.js.map +0 -1
  36. package/dist/chunk-QBMXJ3V2.js +0 -142
  37. package/dist/chunk-QBMXJ3V2.js.map +0 -1
  38. package/dist/gltf-loader-LKALCZAV.js +0 -8
  39. package/dist/showcase-runtime-2ZNPKD7D.js.map +0 -1
  40. /package/dist/{chunk-DGUM43GV.js.map → gltf-loader-WAM23F37.js.map} +0 -0
  41. /package/dist/{gltf-loader-LKALCZAV.js.map → showcase-inline-assets-B7U7VX5H.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -5,13 +5,46 @@ All notable changes to this project will be documented in this file.
5
5
  ## [Unreleased]
6
6
 
7
7
  - **Added**
8
- - (placeholder)
8
+ - Deterministic showcase asset generation for a richer shared brigantine,
9
+ cutter, lighthouse, and harbor-dock catalog.
10
+ - Fullscreen capture mode for slide-deck screenshots and video recording,
11
+ including scene-only layout and bounded 1080p canvas scaling.
12
+ - Bundled `en-GB` translation keys and dictionaries for shared showcase labels
13
+ that can be consumed through `@plasius/translations`.
9
14
 
10
15
  - **Changed**
11
- - (placeholder)
16
+ - Routed showcase chrome and debug allocation labels through package-owned
17
+ translation keys with an optional consumer translator override.
18
+ - Expanded the shared GLTF loader contract to preserve the legacy flattened
19
+ mesh fields while exposing transformed multi-primitive/material data for the
20
+ realistic showcase scene.
21
+ - The shared harbor runtime now renders distinct ship models and modeled
22
+ harbor structures instead of one tiny hull mesh plus placeholder boxes.
23
+ - Showcase lighting now adds local lantern response, a lighthouse beam pass,
24
+ and a subtle atmospheric grade for more realistic recorded frames.
12
25
 
13
26
  - **Fixed**
14
- - (placeholder)
27
+ - Restored the package CD workflow so protected `main` releases are prepared by PR and published without direct branch pushes.
28
+ - The shared showcase now propagates the realistic-model feature flag into
29
+ scene state and initializes its DOM scaffold before canvas setup, allowing
30
+ the local realistic asset catalog to mount in browser demos.
31
+ - Generated cylindrical showcase geometry now emits outward-facing side
32
+ winding, so towers, posts, masts, and lanterns no longer carry inverted side
33
+ normals.
34
+ - Generated cylindrical showcase geometry now carries smooth radial side
35
+ normals, reducing the faceted placeholder look on lighthouse bands, masts,
36
+ posts, and lantern glass.
37
+ - The showcase renderer now culls with geometric face normals while shading
38
+ with smoothed asset normals, keeping curved surfaces stable at glancing
39
+ camera angles.
40
+ - The generated lighthouse, mast, lantern, and dock-post assets now use denser
41
+ radial geometry for cleaner silhouettes in recording shots.
42
+ - Showcase shading now applies subtle deterministic material grain and
43
+ lower-surface wear so wood, stone, painted hulls, and plaster read less like
44
+ flat placeholder fills.
45
+ - Low-lying ship triangles no longer pick up the water reflection term just
46
+ because they are near the shoreline plane, so hulls stop reading like
47
+ reflective water surfaces.
15
48
 
16
49
  - **Security**
17
50
  - (placeholder)
package/README.md CHANGED
@@ -30,6 +30,9 @@ npm install @plasius/gpu-shared
30
30
  carrying duplicated runtime copies.
31
31
  - Preserves one shared fix point for cloth motion, visible water continuity, and
32
32
  occluded harbor-light reflections across GPU demo consumers.
33
+ - Ships a package-owned showcase asset catalog with distinct brigantine,
34
+ cutter, lighthouse, and harbor-dock models instead of relying on one tiny
35
+ hull mesh plus placeholder box geometry.
33
36
 
34
37
  ## Usage
35
38
 
@@ -47,6 +50,35 @@ const showcase = await mountGpuShowcase({
47
50
  showcase.destroy();
48
51
  ```
49
52
 
53
+ ### Showcase Translations
54
+
55
+ The shared showcase owns its display keys and bundled `en-GB` defaults without
56
+ making the browser runtime React-bound. Consumers that already use
57
+ `@plasius/translations` can register the package dictionary and pass a
58
+ translator into `mountGpuShowcase`:
59
+
60
+ ```js
61
+ import { createI18n } from "@plasius/translations";
62
+ import {
63
+ gpuSharedTranslationKeys,
64
+ gpuSharedTranslations,
65
+ mountGpuShowcase,
66
+ } from "@plasius/gpu-shared";
67
+
68
+ const i18n = createI18n({
69
+ language: "en-GB",
70
+ fallback: "en-GB",
71
+ translations: gpuSharedTranslations,
72
+ });
73
+
74
+ await mountGpuShowcase({
75
+ root: document.getElementById("app"),
76
+ translate: (key, args) => i18n.t(key, args),
77
+ });
78
+
79
+ console.log(i18n.t(gpuSharedTranslationKeys.debugMainColorBuffer));
80
+ ```
81
+
50
82
  For browser-only demos served without a bundler, keep the import surface on the
51
83
  published package name and resolve it with an import map rather than importing a
52
84
  viewer-private or workspace-private source file:
@@ -71,10 +103,13 @@ import {
71
103
  } from "@plasius/gpu-shared";
72
104
 
73
105
  const shipUrl = resolveShowcaseAssetUrl();
106
+ const lighthouseUrl = resolveShowcaseAssetUrl("lighthouse");
74
107
  const shipModel = await loadGltfModel(shipUrl);
108
+ const lighthouseModel = await loadGltfModel(lighthouseUrl);
75
109
 
76
110
  console.log(showcaseFocusModes);
77
111
  console.log(shipModel.physics);
112
+ console.log(shipModel.primitives.length, lighthouseModel.primitives.length);
78
113
  ```
79
114
 
80
115
  ## Demo
@@ -95,6 +130,16 @@ the banded `@plasius/gpu-fluid` continuity envelope directly, so the default
95
130
  camera keeps finite, visibly animated near-band water motion instead of
96
131
  flattening or dropping the shared water mesh.
97
132
 
133
+ The default showcase asset set now uses a multi-primitive brigantine, a
134
+ distinct cutter profile, a modeled lighthouse, and a modeled dock/warehouse
135
+ scene so the harbor reads closer to a believable coastal night view on high-end
136
+ machines.
137
+
138
+ For slide-deck screenshots or video capture, open the route with
139
+ `?capture=1&renderScale=1`. Capture mode hides the validation chrome, fills the
140
+ viewport with the scene canvas, and caps the backing buffer at 1080p by default
141
+ so recording stays smooth on local machines.
142
+
98
143
  ## Current Boundary
99
144
 
100
145
  `@plasius/gpu-shared` owns the shared browser/demo orchestration surface. It
@@ -107,10 +152,19 @@ surface for these family demos.
107
152
 
108
153
  - `mountGpuShowcase(options)`
109
154
  - Returns `{ state, shipModel, canvas, destroy() }`
155
+ - `captureMode: true` enables fullscreen scene-only presentation for local
156
+ screenshots and video capture.
157
+ - `renderScale` overrides the canvas backing scale when a capture workflow
158
+ needs a specific quality/performance balance.
110
159
  - `loadGltfModel(url)`
111
- - `resolveShowcaseAssetUrl(baseUrl?)`
160
+ - `resolveShowcaseAssetUrl(baseUrlOrAssetName?, assetName?)`
112
161
  - `showcaseFocusModes`
113
162
 
163
+ `resolveShowcaseAssetUrl()` keeps consumers on the package-owned brigantine
164
+ asset URL. If a host cannot actually serve that asset, `loadGltfModel()`
165
+ lazily activates the built-in inline fallback instead of eagerly parsing that
166
+ payload in the top-level package entrypoint.
167
+
114
168
  ## Development
115
169
 
116
170
  ```bash