@hypersoniclabs/helix-cli 0.1.25-helix3.509 → 0.1.25-helix3.512

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 (48) hide show
  1. package/README.md +1 -1
  2. package/dist/itemLod/artifact.d.ts +25 -3
  3. package/dist/itemLod/artifact.js +78 -17
  4. package/dist/itemLod/artifact.js.map +1 -1
  5. package/dist/itemLod/atlas.d.ts +223 -0
  6. package/dist/itemLod/atlas.js +636 -0
  7. package/dist/itemLod/atlas.js.map +1 -0
  8. package/dist/itemLod/basis.d.ts +6 -2
  9. package/dist/itemLod/basis.js +16 -6
  10. package/dist/itemLod/basis.js.map +1 -1
  11. package/dist/itemLod/command.js +3 -3
  12. package/dist/itemLod/command.js.map +1 -1
  13. package/dist/itemLod/flat.d.ts +12 -0
  14. package/dist/itemLod/flat.js +124 -0
  15. package/dist/itemLod/flat.js.map +1 -0
  16. package/dist/itemLod/levelGlb.d.ts +19 -0
  17. package/dist/itemLod/levelGlb.js +129 -17
  18. package/dist/itemLod/levelGlb.js.map +1 -1
  19. package/dist/itemLod/mips.d.ts +37 -0
  20. package/dist/itemLod/mips.js +131 -0
  21. package/dist/itemLod/mips.js.map +1 -0
  22. package/dist/itemLod/repair.d.ts +3 -0
  23. package/dist/itemLod/repair.js +75 -0
  24. package/dist/itemLod/repair.js.map +1 -0
  25. package/dist/itemLod/simplify.d.ts +41 -7
  26. package/dist/itemLod/simplify.js +403 -111
  27. package/dist/itemLod/simplify.js.map +1 -1
  28. package/dist/itemLod/textures.d.ts +17 -0
  29. package/dist/itemLod/textures.js +53 -22
  30. package/dist/itemLod/textures.js.map +1 -1
  31. package/dist/tsconfig.build.tsbuildinfo +1 -1
  32. package/docs/item-lod.md +96 -7
  33. package/package.json +2 -2
  34. package/plugins/beamng-vehicle/bin/__pycache__/beamng_abs.cpython-312.pyc +0 -0
  35. package/plugins/beamng-vehicle/bin/__pycache__/beamng_audio.cpython-312.pyc +0 -0
  36. package/plugins/beamng-vehicle/bin/__pycache__/beamng_engine.cpython-312.pyc +0 -0
  37. package/plugins/beamng-vehicle/bin/__pycache__/beamng_expression.cpython-312.pyc +0 -0
  38. package/plugins/beamng-vehicle/bin/__pycache__/beamng_jbeam.cpython-312.pyc +0 -0
  39. package/plugins/beamng-vehicle/bin/__pycache__/beamng_materials.cpython-312.pyc +0 -0
  40. package/plugins/beamng-vehicle/bin/__pycache__/beamng_stock_events.cpython-312.pyc +0 -0
  41. package/plugins/beamng-vehicle/bin/__pycache__/fmod_studio.cpython-312.pyc +0 -0
  42. package/plugins/beamng-vehicle/bin/__pycache__/fsb5.cpython-312.pyc +0 -0
  43. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio.cpython-312.pyc +0 -0
  44. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_ac.cpython-312.pyc +0 -0
  45. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_beamng.cpython-312.pyc +0 -0
  46. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_fixtures.cpython-312.pyc +0 -0
  47. package/plugins/beamng-vehicle/bin/__pycache__/test_beamng_engine.cpython-312.pyc +0 -0
  48. package/plugins/beamng-vehicle/bin/__pycache__/test_sim_audio.cpython-312.pyc +0 -0
package/README.md CHANGED
@@ -76,7 +76,7 @@ The token is stored in `~/.helix/credentials.json` (mode `600`). It's sent as
76
76
  | `helix item set-version <item-id> --package-version <v> --reason <text> [--expected-current-version-id <uuid>] [--as-admin] [--json]` | Move an item to a sealed Package Version of its own package (pin resolved from the public Package API; `POST /api/v1/universal-items/<id>/versions`). The flow for a **listed** item: `continuum publish-package` seals vN → `item set-version`; the visual check is advisory and never gates the move. A refusal (a technical failure or content safety) prints the server's plain reason first, then the remedy. An unknown version lists the sealed ones. A **vehicle** moves its car with the pin: the version's sealed root (role `vehicle-definition`) is verified against the manifest and sent as `vehiclePackage`, the same rider `vehicle publish --item` sends; a version without one is refused with a pointer to that resume. A version the item **already had** is a rollback: `PUT /api/v1/universal-items/<id>/versions/current { revision, reason }` (the server restores that revision's retained `vehiclePackage`; a pin-only revision has none and is refused). `--as-admin` (platform admins, for an item another account created) posts the same body to `POST /api/v1/admin/universal-items/<id>/versions`: same gates (visual QA included, no override), `--reason` recorded with you as the actor. |
77
77
  | `helix item thumbnail refresh <item-id> [--force] [--dry-run] [--json]` | Re-render a published item's canonical thumbnail from its **active Package Version** with the standard server renderer (`POST /api/v1/universal-items/<id>/thumbnail/regenerate`, owner or admin). Prints the status (`generated` / `current` / `dry-run`), old -> new thumbnail URL, renderer version and the source lane + Package Version. `--dry-run` writes nothing; `--force` re-renders even when the stored thumbnail is current. Moving an item to a new Package Version now refreshes the thumbnail automatically unless you uploaded one. An older backend answers 404 and the CLI says it does not support thumbnail refresh yet. Not the world `helix thumbnail set <slug>` command. |
78
78
  | `helix item thumbnail set <item-id> <image> [--json]` | Upload your own thumbnail (png/jpg/webp, up to 10 MiB, checked locally) for a published item (`PUT /api/v1/universal-items/<id>/thumbnail`, moderated). A creator upload stays in place across version moves until you run `thumbnail refresh --force`. 403 = you are not the item's owner. |
79
- | `helix item lods <packageId>[@version] \| --item <id> \| --glb <file> [--out <dir>] [--variant <id>] [--profile prop\|vehicle] [--api-url <url>] [--json]` | Compile the `helix.item-lod/1` Runtime Artifact for a published prop, Device or vehicle Package Version: up to two levels, LOD1 (props at most 25% of the triangles, vehicles max(5000, 10%), textures at most 512 px) and LOD2 (at most 300 triangles, textures at most 256 px), each its own GLB with its own textures (never larger than the source's) and a measured `maxErrorM`, plus an 8-view 512 px octahedral impostor atlas. A level that does not cut half the triangles, or cannot be made strictly smaller in bytes, is omitted. Content-addressed and deterministic; skinned input (avatars, add-ons) is refused. Local preview; the backend worker is the catalogue's source of truth. See [docs/item-lod.md](docs/item-lod.md). |
79
+ | `helix item lods <packageId>[@version] \| --item <id> \| --glb <file> [--out <dir>] [--variant <id>] [--profile prop\|vehicle] [--api-url <url>] [--json]` | Compile the `helix.item-lod/1` Runtime Artifact for a published prop, Device or vehicle Package Version: up to two levels, LOD1 (props at most 25% of the triangles, vehicles max(5000, 10%), textures at most 512 px) and LOD2 (at most 300 triangles, textures at most 256 px), each its own GLB drawn in one primitive per render state (usually 1 or 2, via a baked material atlas) with its own textures (never larger than what they replace) and a measured `maxErrorM`, plus an 8-view 512 px octahedral impostor atlas. A level that does not cut half the triangles, or cannot be made strictly smaller in bytes (a vehicle LOD2 also: one over 25% of the extent from the source), is omitted. Content-addressed and deterministic; skinned input (avatars, add-ons) is refused. Local preview; the backend worker is the catalogue's source of truth. See [docs/item-lod.md](docs/item-lod.md). |
80
80
  | `helix device create <dir> --id <slug> --title <t> --model <mesh.glb> --template standing-desk\|clock\|television` | Scaffold a GLB-backed `helix.device/1` definition, including the interactive TV/media-player template. There is intentionally no website Device editor. |
81
81
  | `helix device validate [dir] [--json]` | Validate the definition, GLB bytes and named-node bindings, typed state/controls, capabilities, and Home+World compatibility, including [declarative character hand reach](docs/device-hand-reach.md). |
82
82
  | `helix device test [dir] [--mode single\|multiplayer\|both] [--json]` | Exercise every interaction, persistence remount, and deterministic one-/two-client authority convergence. |
@@ -5,7 +5,14 @@ import { type ItemLodProfile, type SimplifiedLevel } from './simplify';
5
5
  import { TextureCache } from './textures';
6
6
  /** The `helix.item-lod/1` Runtime Artifact: a small first-load file per level plus an octahedral impostor. */
7
7
  export declare const ITEM_LOD_SCHEMA = "helix.item-lod/1";
8
- export declare const ITEM_LOD_COMPILER = "item-lod/1";
8
+ /**
9
+ * The generator's identity in a derivation key (`item-lod/<n>`): bump it on any change that alters the bytes a compile writes,
10
+ * because a ready or failed Runtime Artifact is terminal for its key. 1 was the first generator, 2 round 2 (zero to two
11
+ * tagged levels, each strictly smaller), 3 round 3 (one draw per render state, vehicle LOD2 shell, a level over its cap is
12
+ * omitted instead of failing the item, an impostor that is not smaller than the source is omitted). The document schema stays
13
+ * `helix.item-lod/1`: the runtime reads the schema id and ignores this one.
14
+ */
15
+ export declare const ITEM_LOD_COMPILER = "item-lod/3";
9
16
  /** Caps the artifact must hold (SCENE-PIPELINE-DESIGN section 4.5). */
10
17
  export declare const ITEM_LOD_CAPS: {
11
18
  readonly lod1TriangleRatio: number;
@@ -37,6 +44,11 @@ export interface ItemLodLevel {
37
44
  bytes: number;
38
45
  /** Longest texture edge in the level; 0 when the level has no textures. */
39
46
  textureMaxEdge: number;
47
+ /**
48
+ * Primitives in the level's GLB, which is its draw calls per placement band: one per render state (opaque or alpha-blended,
49
+ * lit or unlit) because the level's materials share one texture atlas. Absent on levels written by earlier compilers.
50
+ */
51
+ drawCalls?: number;
40
52
  /** The triangle cap this level was held to. */
41
53
  cap: number;
42
54
  /** Retained for artifacts written by the first compiler; a level that cannot reduce is now omitted instead. */
@@ -70,12 +82,16 @@ export interface ItemLodArtifact {
70
82
  * to the impostor. Each omission is explained in `warnings`.
71
83
  */
72
84
  levels: ItemLodLevel[];
73
- impostor: ItemLodImpostor;
85
+ /**
86
+ * The far representation past the last level. Null when it would not be smaller than the source model in bytes (a tiny
87
+ * item's atlas costs more than the item): the runtime then keeps drawing the last level, or the model itself.
88
+ */
89
+ impostor: ItemLodImpostor | null;
74
90
  /** Approximate GPU-resident bytes: vertex and index buffers plus transcoded textures with mips. A tier key is present only if that level is. */
75
91
  estimatedBytes: {
76
92
  lod1?: number;
77
93
  lod2?: number;
78
- impostor: number;
94
+ impostor?: number;
79
95
  };
80
96
  /** Anything the compiler could not carry across (material extensions, morph targets, animation), then one note per omitted level. */
81
97
  warnings: string[];
@@ -100,6 +116,10 @@ export interface ItemLodReportLevel {
100
116
  residentBytes: number;
101
117
  droppedMaterials: number;
102
118
  notes: string[];
119
+ /** Primitives (draw calls per placement band) in the level's GLB. */
120
+ primitives: number;
121
+ /** The material atlas shared by the level's primitives, when the item has more than one material recipe. */
122
+ atlas?: NonNullable<WrittenLevel['atlas']>;
103
123
  /** Which texture spec produced the level (0 is the full set; higher rungs trade texture detail for bytes). */
104
124
  textureRung: number;
105
125
  /** Per texture: how it was made and what it cost. */
@@ -123,9 +143,11 @@ export interface ItemLodReport {
123
143
  lod1: ItemLodReportLevel | null;
124
144
  lod2: ItemLodReportLevel | null;
125
145
  omitted: ItemLodOmission[];
146
+ /** What the capture came to; `omitted` is set when it was left out of the artifact because it was not smaller than the source. */
126
147
  impostor: {
127
148
  bytes: number;
128
149
  coverage: number;
150
+ omitted?: boolean;
129
151
  };
130
152
  caps: CapCheck;
131
153
  warnings: string[];
@@ -10,13 +10,23 @@ const promises_1 = require("node:fs/promises");
10
10
  const node_path_1 = require("node:path");
11
11
  const helix_manifest_1 = require("@hypersoniclabs/helix-manifest");
12
12
  const impostor_1 = require("./impostor");
13
+ const atlas_1 = require("./atlas");
14
+ const flat_1 = require("./flat");
13
15
  const levelGlb_1 = require("./levelGlb");
14
16
  const model_1 = require("./model");
15
17
  const simplify_1 = require("./simplify");
18
+ const repair_1 = require("./repair");
16
19
  const textures_1 = require("./textures");
17
20
  /** The `helix.item-lod/1` Runtime Artifact: a small first-load file per level plus an octahedral impostor. */
18
21
  exports.ITEM_LOD_SCHEMA = 'helix.item-lod/1';
19
- exports.ITEM_LOD_COMPILER = 'item-lod/1';
22
+ /**
23
+ * The generator's identity in a derivation key (`item-lod/<n>`): bump it on any change that alters the bytes a compile writes,
24
+ * because a ready or failed Runtime Artifact is terminal for its key. 1 was the first generator, 2 round 2 (zero to two
25
+ * tagged levels, each strictly smaller), 3 round 3 (one draw per render state, vehicle LOD2 shell, a level over its cap is
26
+ * omitted instead of failing the item, an impostor that is not smaller than the source is omitted). The document schema stays
27
+ * `helix.item-lod/1`: the runtime reads the schema id and ignores this one.
28
+ */
29
+ exports.ITEM_LOD_COMPILER = 'item-lod/3';
20
30
  /** Caps the artifact must hold (SCENE-PIPELINE-DESIGN section 4.5). */
21
31
  exports.ITEM_LOD_CAPS = {
22
32
  lod1TriangleRatio: simplify_1.ITEM_LOD1.maxRatio,
@@ -65,7 +75,7 @@ function checkItemLodCaps(artifact) {
65
75
  above = level.triangles;
66
76
  aboveBytes = level.bytes;
67
77
  }
68
- if (artifact.impostor.size !== impostor_1.IMPOSTOR_SIZE || artifact.impostor.views !== impostor_1.IMPOSTOR_VIEWS)
78
+ if (artifact.impostor && (artifact.impostor.size !== impostor_1.IMPOSTOR_SIZE || artifact.impostor.views !== impostor_1.IMPOSTOR_VIEWS))
69
79
  failures.push('impostor is not 8 views at 512 px');
70
80
  return { ok: failures.length === 0, failures, waivers };
71
81
  }
@@ -127,11 +137,15 @@ function validateItemLodArtifact(value) {
127
137
  for (const key of ['bytes', 'textureMaxEdge', 'cap'])
128
138
  if (!isCount(level[key]))
129
139
  errors.push(`${name}.${key} must be a count`);
140
+ if (level.drawCalls !== undefined && (!isCount(level.drawCalls) || level.drawCalls < 1))
141
+ errors.push(`${name}.drawCalls must be a positive count when present`);
130
142
  });
131
143
  }
132
144
  const i = a.impostor;
133
- if (!i || typeof i !== 'object')
134
- errors.push('impostor is required');
145
+ // Null (or absent) means the impostor was left out because it was not smaller than the source model.
146
+ if (i === undefined || i === null) { /* omitted */ }
147
+ else if (typeof i !== 'object')
148
+ errors.push('impostor must be an object or null');
135
149
  else {
136
150
  if (!isCid(i.object))
137
151
  errors.push('impostor.object must be a CID');
@@ -143,8 +157,10 @@ function validateItemLodArtifact(value) {
143
157
  errors.push('impostor.bytes must be a count');
144
158
  }
145
159
  const e = a.estimatedBytes;
146
- if (!e || !isCount(e.impostor))
147
- errors.push('estimatedBytes needs an impostor count');
160
+ if (!e || typeof e !== 'object')
161
+ errors.push('estimatedBytes is required');
162
+ else if ((i === undefined || i === null) ? e.impostor !== undefined : !isCount(e.impostor))
163
+ errors.push('estimatedBytes.impostor must be a count exactly when the impostor is present');
148
164
  else if (a.levels) {
149
165
  // Every emitted tier has an estimate and no omitted tier has one.
150
166
  for (const tier of [1, 2]) {
@@ -161,7 +177,8 @@ function validateItemLodArtifact(value) {
161
177
  const reportLevel = (level, written, rung) => ({
162
178
  triangles: level.triangles, cap: level.cap, capMet: level.capMet, waived: level.waived, maxErrorM: level.maxErrorM, strictErrorM: level.strictErrorM,
163
179
  bytes: written.bytes.length, textures: written.textureCount, textureMaxEdge: written.textureMaxEdge, residentBytes: written.residentBytes,
164
- droppedMaterials: level.droppedMaterials.length, notes: level.notes, textureRung: rung, textureDetail: written.textures,
180
+ droppedMaterials: level.droppedMaterials.length, notes: [...level.notes, ...written.notes], textureRung: rung, textureDetail: written.textures,
181
+ primitives: written.primitives, ...(written.atlas ? { atlas: written.atlas } : {}),
165
182
  });
166
183
  const percent = (fraction) => `${Math.round(fraction * 1000) / 10} percent`;
167
184
  /**
@@ -170,8 +187,10 @@ const percent = (fraction) => `${Math.round(fraction * 1000) / 10} percent`;
170
187
  */
171
188
  async function writeSmallerLevel(model, simplified, cache, ladder, aboveBytes) {
172
189
  let best = null;
190
+ // The primitives and the material atlas layout depend on the geometry, not on the texture rung.
191
+ const plan = await (0, levelGlb_1.planLevelGlb)(model, simplified.groups, cache, ladder[0]);
173
192
  for (let rung = 0; rung < ladder.length; rung++) {
174
- const written = await (0, levelGlb_1.writeLevelGlb)(model, simplified.groups, cache, { mode: 'level', textures: ladder[rung] });
193
+ const written = await (0, levelGlb_1.writeLevelGlb)(model, simplified.groups, cache, { mode: 'level', textures: ladder[rung], plan });
175
194
  if (written.bytes.length < aboveBytes)
176
195
  return { written, rung, smaller: true };
177
196
  if (!best || written.bytes.length < best.written.bytes.length)
@@ -186,23 +205,58 @@ async function compileItemLods(glb, options) {
186
205
  const profile = options.profile ?? 'prop';
187
206
  progress('reading model');
188
207
  const model = await (0, model_1.readItemModel)(glb);
208
+ model.warnings.push(...await (0, repair_1.repairUnreadableImages)(model));
189
209
  progress(`${model.triangles} triangles, ${model.groups.length} materials, ${model.images.length} images (${profile})`);
190
210
  const cache = new textures_1.TextureCache();
191
211
  // Each tier is emitted only if it cuts at least half the triangles of the level above it (the source for the first tier
192
212
  // emitted) and its file is strictly smaller in bytes than that level's file; otherwise it is omitted and the next tier
193
213
  // is measured against the last one emitted.
194
- const emitted = [], omitted = [];
214
+ const emitted = [], omitted = [], impostorNotes = [];
195
215
  let aboveTriangles = model.triangles, aboveBytes = glb.length;
196
216
  for (const lod of [1, 2]) {
197
- const simplified = lod === 1 ? await (0, simplify_1.simplifyLod1)(model, profile) : await (0, simplify_1.simplifyLod2)(model, aboveTriangles);
217
+ const simplified = lod === 1 ? await (0, simplify_1.simplifyLod1)(model, profile) : await (0, simplify_1.simplifyLod2)(model, aboveTriangles, profile);
198
218
  const cut = 1 - simplified.triangles / aboveTriangles;
219
+ const extent = Math.max(...[0, 1, 2].map(axis => model.bounds.max[axis] - model.bounds.min[axis]));
220
+ if (lod === 2 && profile === 'vehicle' && simplified.maxErrorM > extent * simplify_1.VEHICLE_LOD2_MAX_ERROR_RATIO) {
221
+ const reason = `LOD2 omitted: the best ${simplified.triangles} triangle shape of this vehicle is ${percent(simplified.maxErrorM / extent)} of its longest extent away from the source (limit ${percent(simplify_1.VEHICLE_LOD2_MAX_ERROR_RATIO)}); the runtime goes from LOD1 to the impostor`;
222
+ omitted.push({ lod, reason, triangles: simplified.triangles, bytes: null });
223
+ progress(reason);
224
+ continue;
225
+ }
199
226
  if (simplified.triangles > aboveTriangles * (1 - exports.ITEM_LOD_CAPS.minReduction)) {
200
227
  const reason = `LOD${lod} omitted: it would cut only ${percent(cut)} of the triangles of the level above it (${aboveTriangles} to ${simplified.triangles}); at least ${percent(exports.ITEM_LOD_CAPS.minReduction)} is required`;
201
228
  omitted.push({ lod, reason, triangles: simplified.triangles, bytes: null });
202
229
  progress(reason);
203
230
  continue;
204
231
  }
205
- const attempt = await writeSmallerLevel(model, simplified, cache, lod === 1 ? levelGlb_1.LOD1_TEXTURE_LADDER : levelGlb_1.LOD2_TEXTURE_LADDER, aboveBytes);
232
+ if (!simplified.capMet && !simplified.waived) {
233
+ // The simplifier could not reach the cap (a shape whose every face is its own island and normal): a level over its cap fails
234
+ // the item at the caps check, so it is left out like any tier that is not worth having.
235
+ const reason = `LOD${lod} omitted: the smallest shape found has ${simplified.triangles} triangles, over its cap of ${simplified.cap}; the runtime goes from ${lod === 1 ? 'the model' : 'LOD1'} to the next representation`;
236
+ omitted.push({ lod, reason, triangles: simplified.triangles, bytes: null });
237
+ progress(reason);
238
+ continue;
239
+ }
240
+ let attempt;
241
+ try {
242
+ let levelModel = model, levelSimplified = simplified;
243
+ if (simplified.flatColor) {
244
+ const flat = await (0, flat_1.flattenColours)(model, simplified.groups, image => cache.mips(image));
245
+ levelModel = flat.model;
246
+ levelSimplified = { ...simplified, groups: flat.groups, notes: [...simplified.notes, `colours flattened to one mean colour for each of ${flat.materials} materials (the shell's triangles span UV islands of the shared texture)`] };
247
+ }
248
+ attempt = await writeSmallerLevel(levelModel, levelSimplified, cache, lod === 1 ? levelGlb_1.LOD1_TEXTURE_LADDER : levelGlb_1.LOD2_TEXTURE_LADDER, aboveBytes);
249
+ if (levelSimplified !== simplified)
250
+ simplified.notes = levelSimplified.notes;
251
+ }
252
+ catch (error) {
253
+ if (!(error instanceof atlas_1.AtlasOverflowError))
254
+ throw error;
255
+ const reason = `LOD${lod} omitted: ${error.message}`;
256
+ omitted.push({ lod, reason, triangles: simplified.triangles, bytes: null });
257
+ progress(reason);
258
+ continue;
259
+ }
206
260
  if (!attempt.smaller) {
207
261
  const reason = `LOD${lod} omitted: its smallest file is ${attempt.written.bytes.length} bytes, not smaller than the level above it (${aboveBytes} bytes)`;
208
262
  omitted.push({ lod, reason, triangles: simplified.triangles, bytes: attempt.written.bytes.length });
@@ -220,20 +274,27 @@ async function compileItemLods(glb, options) {
220
274
  const atlas = await (options.captureAtlas ?? impostor_1.captureImpostorAtlas)(captureGlb.bytes, framing);
221
275
  const impostorBytes = await (0, impostor_1.encodeImpostorAtlas)(atlas);
222
276
  progress(`impostor encoded (${impostorBytes.length} bytes)`);
277
+ // An impostor that is not smaller than the model it stands in for costs more to fetch than the model: leave it out.
278
+ const impostorOmitted = impostorBytes.length >= glb.length;
279
+ if (impostorOmitted) {
280
+ const reason = `impostor omitted: its atlas is ${impostorBytes.length} bytes, not smaller than the source model (${glb.length} bytes)`;
281
+ progress(reason);
282
+ impostorNotes.push(reason);
283
+ }
223
284
  const objects = [
224
285
  ...emitted.map((level) => ({ cid: (0, helix_manifest_1.cidFromBytes)(level.written.bytes), bytes: level.written.bytes, mediaType: 'model/gltf-binary', role: level.lod === 1 ? 'lod1' : 'lod2' })),
225
- { cid: (0, helix_manifest_1.cidFromBytes)(impostorBytes), bytes: impostorBytes, mediaType: 'image/ktx2', role: 'impostor' },
286
+ ...(impostorOmitted ? [] : [{ cid: (0, helix_manifest_1.cidFromBytes)(impostorBytes), bytes: impostorBytes, mediaType: 'image/ktx2', role: 'impostor' }]),
226
287
  ];
227
288
  const levels = emitted.map((level, index) => ({
228
289
  lod: level.lod, object: objects[index].cid, triangles: level.simplified.triangles, maxErrorM: Math.round(level.simplified.maxErrorM * 1e5) / 1e5,
229
- bytes: level.written.bytes.length, textureMaxEdge: level.written.textureMaxEdge, cap: level.simplified.cap,
290
+ bytes: level.written.bytes.length, textureMaxEdge: level.written.textureMaxEdge, cap: level.simplified.cap, drawCalls: level.written.primitives,
230
291
  ...(level.simplified.waived ? { waived: level.simplified.waived } : {}),
231
292
  }));
232
- const estimatedBytes = { impostor: (0, textures_1.residentTextureBytes)(impostor_1.IMPOSTOR_SIZE, impostor_1.IMPOSTOR_SIZE) };
293
+ const estimatedBytes = impostorOmitted ? {} : { impostor: (0, textures_1.residentTextureBytes)(impostor_1.IMPOSTOR_SIZE, impostor_1.IMPOSTOR_SIZE) };
233
294
  for (const level of emitted)
234
295
  estimatedBytes[level.lod === 1 ? 'lod1' : 'lod2'] = level.written.residentBytes;
235
296
  const budgetNotes = emitted.filter(level => level.lod === 1 && level.simplified.budgetNote).map(level => level.simplified.budgetNote);
236
- const warnings = [...model.warnings, ...budgetNotes, ...omitted.map(entry => entry.reason)];
297
+ const warnings = [...model.warnings, ...budgetNotes, ...omitted.map(entry => entry.reason), ...impostorNotes];
237
298
  const artifact = {
238
299
  schema: exports.ITEM_LOD_SCHEMA,
239
300
  source: options.source,
@@ -241,7 +302,7 @@ async function compileItemLods(glb, options) {
241
302
  bounds: { min: model.bounds.min, max: model.bounds.max },
242
303
  triangles: [model.triangles, ...emitted.map(level => level.simplified.triangles)],
243
304
  levels,
244
- impostor: { object: objects[objects.length - 1].cid, kind: 'octahedral', views: impostor_1.IMPOSTOR_VIEWS, size: impostor_1.IMPOSTOR_SIZE, format: 'ktx2-uastc',
305
+ impostor: impostorOmitted ? null : { object: objects[objects.length - 1].cid, kind: 'octahedral', views: impostor_1.IMPOSTOR_VIEWS, size: impostor_1.IMPOSTOR_SIZE, format: 'ktx2-uastc',
245
306
  center: framing.center, radius: Math.round(framing.radius * 1e6) / 1e6, bytes: impostorBytes.length },
246
307
  estimatedBytes,
247
308
  warnings,
@@ -261,7 +322,7 @@ async function compileItemLods(glb, options) {
261
322
  report: {
262
323
  sourceTriangles: model.triangles, sourceBytes: glb.length, materials: model.materials.length, images: model.images.length,
263
324
  extensionsUsed: model.extensionsUsed, profile, lod1: reported(1), lod2: reported(2), omitted,
264
- impostor: { bytes: impostorBytes.length, coverage: Math.round((0, impostor_1.impostorCoverage)(atlas) * 1e4) / 1e4 }, caps, warnings,
325
+ impostor: { bytes: impostorBytes.length, coverage: Math.round((0, impostor_1.impostorCoverage)(atlas) * 1e4) / 1e4, ...(impostorOmitted ? { omitted: true } : {}) }, caps, warnings,
265
326
  millis: { total: Date.now() - started },
266
327
  },
267
328
  };
@@ -1 +1 @@
1
- {"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/itemLod/artifact.ts"],"names":[],"mappings":";;;AA6JA,4CA0BC;AAOD,0DAwDC;AA4BD,8CAQC;AAGD,0CAqFC;AAMD,gDAaC;AArYD,+CAAoD;AACpD,yCAA0C;AAC1C,mEAAkF;AAClF,yCAAmL;AACnL,yCAAkL;AAClL,mCAAwD;AACxD,yCAAiM;AACjM,yCAAgE;AAEhE,8GAA8G;AAEjG,QAA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,CAAC;IAC9G,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ;QAAE,MAAM,GAAG,CAAC,YAAY,OAAO,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3F,OAAO,EAAE,YAAY,EAAE,IAAA,gBAAI,EAAC,SAAS,EAAE,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC;AACnE,CAAC"}
@@ -0,0 +1,223 @@
1
+ import type { ItemModel, ModelGroup, ModelImage, ModelMaterial, ModelTextureRef } from './model';
2
+ import { type MipChain, type UvRegion } from './mips';
3
+ /**
4
+ * The material atlas of item-lod/1. A level draws every material of the item with at most one primitive per render state
5
+ * (opaque or alpha-blended, lit or unlit), because the runtime pays one draw call per primitive per placement band.
6
+ *
7
+ * Every source material becomes a "recipe": the texels and factors that decide its surface. Materials with the same recipe
8
+ * share one rectangle of the atlas. A rectangle holds the part of each source texture the material's UVs actually use (its
9
+ * footprint), already multiplied by the material's factors (base colour factor, metallic and roughness factors, normal
10
+ * scale, emissive factor and strength), so one set of atlas textures and one material per primitive reproduces them all.
11
+ * Vertex UVs are remapped affinely into their rectangle. Materials that repeat a texture a few times bake the repeats into
12
+ * the rectangle; materials that repeat it too finely for the atlas to resolve fall back to the texture's mean colour, which
13
+ * is what a mipmapped texture shows at that distance anyway. A material with no texture is a 4 x 4 swatch.
14
+ */
15
+ /** Gutter around a textured rectangle, in atlas pixels at the colour resolution (the mip chain reaches it at level 2). */
16
+ export declare const GUTTER_LOD1 = 4, GUTTER_LOD2 = 2;
17
+ /** A rectangle is at least this many pixels on a side (one compression block). */
18
+ export declare const MIN_RECT = 4;
19
+ /** Tiled footprints larger than this many repeats (in total, or along one axis) fold to the mean colour. */
20
+ export declare const MAX_TILE_CELLS = 36, MAX_TILE_AXIS = 12;
21
+ export declare class AtlasOverflowError extends Error {
22
+ constructor(detail: string);
23
+ }
24
+ export interface PackItem {
25
+ id: number;
26
+ w: number;
27
+ h: number;
28
+ }
29
+ export interface PackedItem {
30
+ id: number;
31
+ x: number;
32
+ y: number;
33
+ }
34
+ /**
35
+ * Shelf packing, tallest first. Deterministic: ties break on width then id. Returns null when the items do not fit.
36
+ */
37
+ export declare function packRects(items: readonly PackItem[], width: number, height: number): PackedItem[] | null;
38
+ export interface RectRequest {
39
+ id: number;
40
+ /** Footprint in source texels (0 for a swatch). */
41
+ fullW: number;
42
+ fullH: number;
43
+ swatch: boolean;
44
+ /** Surface area (square metres) the recipe covers at this level. */
45
+ area: number;
46
+ }
47
+ export interface AtlasRect {
48
+ id: number;
49
+ x: number;
50
+ y: number;
51
+ w: number;
52
+ h: number;
53
+ gutter: number;
54
+ }
55
+ export interface AtlasLayout {
56
+ width: number;
57
+ height: number;
58
+ rects: AtlasRect[];
59
+ gutter: number;
60
+ edge: number;
61
+ }
62
+ /**
63
+ * Chooses rectangle sizes and positions for an atlas of at most `edge` x `edge` pixels. Texel density is uniform across
64
+ * recipes (so the surface area a recipe covers decides its share) and capped at each recipe's own source resolution; the
65
+ * highest density that packs wins, in the smallest power-of-two box that holds the result.
66
+ */
67
+ export declare function layoutAtlas(requests: readonly RectRequest[], edge: number): AtlasLayout;
68
+ export type AtlasSlot = 'baseColor' | 'metallicRoughness' | 'normal' | 'emissive';
69
+ type Transform = NonNullable<ModelTextureRef['transform']>;
70
+ /** What a material samples and how: the UV set, transform and wrap shared by all of its textures. */
71
+ export interface UvMapping {
72
+ texCoord: number;
73
+ transform?: Transform;
74
+ wrapS: number;
75
+ wrapT: number;
76
+ }
77
+ export type AlphaClass = 'OPAQUE' | 'MASK' | 'BLEND';
78
+ export type FootprintClass = 'plain' | 'tiled' | 'mean' | 'swatch';
79
+ /** A material reduced to the properties that decide its texels. */
80
+ export interface ResolvedMaterial {
81
+ index: number;
82
+ mapping: UvMapping | null;
83
+ alpha: AlphaClass;
84
+ cutoff: number;
85
+ base: {
86
+ image: ModelImage | null;
87
+ factor: [number, number, number, number];
88
+ };
89
+ mr: {
90
+ image: ModelImage | null;
91
+ roughness: number;
92
+ metallic: number;
93
+ };
94
+ occlusion: {
95
+ image: ModelImage;
96
+ strength: number;
97
+ } | null;
98
+ normal: {
99
+ image: ModelImage;
100
+ scale: number;
101
+ } | null;
102
+ emissive: {
103
+ image: ModelImage | null;
104
+ factor: [number, number, number];
105
+ strength: number;
106
+ } | null;
107
+ notes: string[];
108
+ }
109
+ export declare function resolveMaterial(material: ModelMaterial): ResolvedMaterial;
110
+ /** Everything that decides a material's texels except where on the texture it reads (which is the footprint) and how its UVs are transformed. */
111
+ export declare function bakeKey(material: ResolvedMaterial): string;
112
+ /** A material's UVs in the space of its texture: the UV set and KHR_texture_transform applied. Null when the group has no such set. */
113
+ export declare function effectiveUv(group: ModelGroup, mapping: UvMapping | null): Float32Array | null;
114
+ export interface Footprint {
115
+ u0: number;
116
+ u1: number;
117
+ v0: number;
118
+ v1: number;
119
+ repeatsU: number;
120
+ repeatsV: number;
121
+ klass: FootprintClass;
122
+ }
123
+ /** The part of the texture a set of UVs reads, and whether it is a plain crop, a small tiling, or a tiling too fine to keep. */
124
+ export declare function footprintOf(bounds: {
125
+ u0: number;
126
+ u1: number;
127
+ v0: number;
128
+ v1: number;
129
+ } | null, mapping: UvMapping | null): Footprint;
130
+ export interface Recipe {
131
+ id: number;
132
+ key: string;
133
+ /** Resolved material every other member of the recipe agrees with. */
134
+ material: ResolvedMaterial;
135
+ klass: FootprintClass;
136
+ footprint: UvRegion;
137
+ /** Footprint in source texels of the sharpest image; the rectangle is never sized beyond it. */
138
+ fullW: number;
139
+ fullH: number;
140
+ area: number;
141
+ /** Source material indices in this recipe. */
142
+ members: number[];
143
+ /** Roughness and metalness this recipe averages to, for levels that drop the metallic-roughness map. */
144
+ meanMr: {
145
+ roughness: number;
146
+ metallic: number;
147
+ };
148
+ /** Source images that feed each atlas texture, and their byte total (the never-larger limit). */
149
+ sourceImages: Record<AtlasSlot, ModelImage[]>;
150
+ }
151
+ export interface BucketPlan {
152
+ alphaMode: AlphaClass;
153
+ doubleSided: boolean;
154
+ unlit: boolean;
155
+ group: ModelGroup;
156
+ /** Source material indices drawn by this primitive. */
157
+ materials: number[];
158
+ /** Recipes (atlas mode) in this bucket, with the surface area each covers. */
159
+ recipes: Array<{
160
+ recipe: number;
161
+ area: number;
162
+ }>;
163
+ }
164
+ export interface AtlasPlan {
165
+ layout: AtlasLayout;
166
+ recipes: Recipe[];
167
+ needs: {
168
+ normal: boolean;
169
+ metallicRoughness: boolean;
170
+ occlusion: boolean;
171
+ emissive: boolean;
172
+ };
173
+ /** The strength the baked emissive texels are divided by (the largest among emitting recipes). */
174
+ emissiveStrength: number;
175
+ /** Roughness and metalness shared by every recipe when no map is needed. */
176
+ constantMr: {
177
+ roughness: number;
178
+ metallic: number;
179
+ };
180
+ folded: number;
181
+ }
182
+ export interface LevelPlan {
183
+ kind: 'direct' | 'atlas';
184
+ buckets: BucketPlan[];
185
+ atlas: AtlasPlan | null;
186
+ /** Direct mode: the source material each bucket is written from. */
187
+ direct?: Array<{
188
+ material: number;
189
+ }>;
190
+ notes: string[];
191
+ }
192
+ export interface PlanContext {
193
+ /** Mip chain of a source image (decoded once per compile). */
194
+ chain(image: ModelImage): Promise<MipChain>;
195
+ /** Pixel size of a source image. */
196
+ size(image: ModelImage): Promise<{
197
+ width: number;
198
+ height: number;
199
+ }>;
200
+ }
201
+ /**
202
+ * Plans how a level's groups are drawn: one primitive per render state, with the material atlas that lets them share one
203
+ * material set. `edge` is the atlas edge cap (512 at LOD1, 256 at LOD2).
204
+ */
205
+ export declare function planLevel(model: ItemModel, allGroups: readonly ModelGroup[], edge: number, context: PlanContext): Promise<LevelPlan>;
206
+ export interface BakeContext {
207
+ chain(image: ModelImage): Promise<MipChain>;
208
+ }
209
+ /**
210
+ * Renders one atlas texture. `shrink` (1 or 0.5) scales the whole layout, for data maps kept at half the colour resolution.
211
+ */
212
+ export declare function bakeAtlasSlot(plan: AtlasPlan, slot: AtlasSlot, shrink: number, context: BakeContext): Promise<{
213
+ data: Uint8Array;
214
+ width: number;
215
+ height: number;
216
+ }>;
217
+ /**
218
+ * Per-pixel weights for judging an encoded atlas texture: a pixel counts for the surface its rectangle is drawn on, shared by
219
+ * the rectangle's pixels, so a small palette strip that paints most of a vehicle is judged as the large area it is. Unused
220
+ * pixels weigh nothing. Same geometry as `bakeAtlasSlot`.
221
+ */
222
+ export declare function atlasPixelWeights(plan: AtlasPlan, shrink: number): Float32Array;
223
+ export {};