@hypersoniclabs/helix-cli 0.1.25-helix3.508 → 0.1.25-helix3.511

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/itemLod/artifact.d.ts +67 -10
  3. package/dist/itemLod/artifact.js +170 -46
  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 +21 -0
  9. package/dist/itemLod/basis.js +115 -0
  10. package/dist/itemLod/basis.js.map +1 -0
  11. package/dist/itemLod/command.d.ts +1 -0
  12. package/dist/itemLod/command.js +18 -7
  13. package/dist/itemLod/command.js.map +1 -1
  14. package/dist/itemLod/flat.d.ts +12 -0
  15. package/dist/itemLod/flat.js +124 -0
  16. package/dist/itemLod/flat.js.map +1 -0
  17. package/dist/itemLod/index.d.ts +5 -3
  18. package/dist/itemLod/index.js +3 -2
  19. package/dist/itemLod/index.js.map +1 -1
  20. package/dist/itemLod/levelGlb.d.ts +40 -1
  21. package/dist/itemLod/levelGlb.js +154 -24
  22. package/dist/itemLod/levelGlb.js.map +1 -1
  23. package/dist/itemLod/mips.d.ts +37 -0
  24. package/dist/itemLod/mips.js +131 -0
  25. package/dist/itemLod/mips.js.map +1 -0
  26. package/dist/itemLod/simplify.d.ts +67 -4
  27. package/dist/itemLod/simplify.js +417 -110
  28. package/dist/itemLod/simplify.js.map +1 -1
  29. package/dist/itemLod/textures.d.ts +58 -5
  30. package/dist/itemLod/textures.js +98 -11
  31. package/dist/itemLod/textures.js.map +1 -1
  32. package/dist/tsconfig.build.tsbuildinfo +1 -1
  33. package/docs/item-lod.md +133 -32
  34. package/package.json +2 -2
  35. package/plugins/beamng-vehicle/bin/__pycache__/beamng_abs.cpython-312.pyc +0 -0
  36. package/plugins/beamng-vehicle/bin/__pycache__/beamng_audio.cpython-312.pyc +0 -0
  37. package/plugins/beamng-vehicle/bin/__pycache__/beamng_engine.cpython-312.pyc +0 -0
  38. package/plugins/beamng-vehicle/bin/__pycache__/beamng_expression.cpython-312.pyc +0 -0
  39. package/plugins/beamng-vehicle/bin/__pycache__/beamng_jbeam.cpython-312.pyc +0 -0
  40. package/plugins/beamng-vehicle/bin/__pycache__/beamng_materials.cpython-312.pyc +0 -0
  41. package/plugins/beamng-vehicle/bin/__pycache__/beamng_stock_events.cpython-312.pyc +0 -0
  42. package/plugins/beamng-vehicle/bin/__pycache__/fmod_studio.cpython-312.pyc +0 -0
  43. package/plugins/beamng-vehicle/bin/__pycache__/fsb5.cpython-312.pyc +0 -0
  44. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio.cpython-312.pyc +0 -0
  45. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_ac.cpython-312.pyc +0 -0
  46. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_beamng.cpython-312.pyc +0 -0
  47. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_fixtures.cpython-312.pyc +0 -0
  48. package/plugins/beamng-vehicle/bin/__pycache__/test_beamng_engine.cpython-312.pyc +0 -0
  49. 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>] [--api-url <url>] [--json]` | Compile the `helix.item-lod/1` Runtime Artifact for a published prop, Device or vehicle Package Version: LOD1 (at most 25% of the triangles, textures at most 512 px) and LOD2 (at most 300 triangles, textures at most 256 px), each its own GLB with its own downsampled UASTC KTX2 textures and a measured `maxErrorM`, plus an 8-view 512 px octahedral impostor atlas. Content-addressed and deterministic; a source of 300 triangles or fewer waives the LOD1 cap; 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. |
@@ -1,4 +1,8 @@
1
1
  import { type ImpostorFraming } from './impostor';
2
+ import { type LevelTextureSpec, type WrittenLevel, type WrittenTexture } from './levelGlb';
3
+ import { type ItemModel } from './model';
4
+ import { type ItemLodProfile, type SimplifiedLevel } from './simplify';
5
+ import { TextureCache } from './textures';
2
6
  /** The `helix.item-lod/1` Runtime Artifact: a small first-load file per level plus an octahedral impostor. */
3
7
  export declare const ITEM_LOD_SCHEMA = "helix.item-lod/1";
4
8
  export declare const ITEM_LOD_COMPILER = "item-lod/1";
@@ -8,6 +12,11 @@ export declare const ITEM_LOD_CAPS: {
8
12
  readonly lod1TextureEdge: number;
9
13
  readonly lod2Triangles: number;
10
14
  readonly lod2TextureEdge: number;
15
+ /** Vehicle LOD1 starting budget: max(this, vehicleLod1TriangleRatio of the source); it widens to the prop budget only to hold the error bound. */
16
+ readonly vehicleLod1MinTriangles: 5000;
17
+ readonly vehicleLod1TriangleRatio: 0.1;
18
+ /** A level is emitted only if it cuts at least this fraction of the triangles of the level above it. */
19
+ readonly minReduction: 0.5;
11
20
  };
12
21
  export interface ItemLodSource {
13
22
  /** Null only for a local `--glb` compile, which has no Package behind it. */
@@ -19,6 +28,8 @@ export interface ItemLodSource {
19
28
  modelCid: string;
20
29
  }
21
30
  export interface ItemLodLevel {
31
+ /** Which tier this is. `levels` lists only the tiers that were emitted, nearest first, so read this, not the index. */
32
+ lod: 1 | 2;
22
33
  object: string;
23
34
  triangles: number;
24
35
  maxErrorM: number;
@@ -26,9 +37,14 @@ export interface ItemLodLevel {
26
37
  bytes: number;
27
38
  /** Longest texture edge in the level; 0 when the level has no textures. */
28
39
  textureMaxEdge: number;
40
+ /**
41
+ * Primitives in the level's GLB, which is its draw calls per placement band: one per render state (opaque or alpha-blended,
42
+ * lit or unlit) because the level's materials share one texture atlas. Absent on levels written by earlier compilers.
43
+ */
44
+ drawCalls?: number;
29
45
  /** The triangle cap this level was held to. */
30
46
  cap: number;
31
- /** Present when the cap does not apply because the source is already tiny. */
47
+ /** Retained for artifacts written by the first compiler; a level that cannot reduce is now omitted instead. */
32
48
  waived?: string;
33
49
  }
34
50
  export interface ItemLodImpostor {
@@ -45,21 +61,28 @@ export interface ItemLodImpostor {
45
61
  export interface ItemLodArtifact {
46
62
  schema: typeof ITEM_LOD_SCHEMA;
47
63
  source: ItemLodSource;
64
+ /** Which LOD1 triangle budget applied: props keep at most 25 percent, vehicles max(5000, 10 percent). */
65
+ profile?: ItemLodProfile;
48
66
  bounds: {
49
67
  min: [number, number, number];
50
68
  max: [number, number, number];
51
69
  };
52
- /** [source, LOD1, LOD2] */
53
- triangles: [number, number, number];
54
- levels: [ItemLodLevel, ItemLodLevel];
70
+ /** [source, then one count per entry of `levels`], so `levels[i].triangles === triangles[i + 1]`. */
71
+ triangles: number[];
72
+ /**
73
+ * Zero, one or two levels, nearest first. A tier that does not cut at least half the triangles of the level above it, or
74
+ * cannot be made strictly smaller in bytes, is omitted: with `levels` empty the runtime goes from the full model straight
75
+ * to the impostor. Each omission is explained in `warnings`.
76
+ */
77
+ levels: ItemLodLevel[];
55
78
  impostor: ItemLodImpostor;
56
- /** Approximate GPU-resident bytes: vertex and index buffers plus transcoded textures with mips. */
79
+ /** Approximate GPU-resident bytes: vertex and index buffers plus transcoded textures with mips. A tier key is present only if that level is. */
57
80
  estimatedBytes: {
58
- lod1: number;
59
- lod2: number;
81
+ lod1?: number;
82
+ lod2?: number;
60
83
  impostor: number;
61
84
  };
62
- /** Anything the compiler could not carry across (material extensions, morph targets, animation). */
85
+ /** Anything the compiler could not carry across (material extensions, morph targets, animation), then one note per omitted level. */
63
86
  warnings: string[];
64
87
  }
65
88
  export interface ItemLodObject {
@@ -74,12 +97,29 @@ export interface ItemLodReportLevel {
74
97
  capMet: boolean;
75
98
  waived: string | null;
76
99
  maxErrorM: number;
100
+ /** `maxErrorM` over every source vertex, sub-visible parts included. */
101
+ strictErrorM: number;
77
102
  bytes: number;
78
103
  textures: number;
79
104
  textureMaxEdge: number;
80
105
  residentBytes: number;
81
106
  droppedMaterials: number;
82
107
  notes: string[];
108
+ /** Primitives (draw calls per placement band) in the level's GLB. */
109
+ primitives: number;
110
+ /** The material atlas shared by the level's primitives, when the item has more than one material recipe. */
111
+ atlas?: NonNullable<WrittenLevel['atlas']>;
112
+ /** Which texture spec produced the level (0 is the full set; higher rungs trade texture detail for bytes). */
113
+ textureRung: number;
114
+ /** Per texture: how it was made and what it cost. */
115
+ textureDetail: WrittenTexture[];
116
+ }
117
+ export interface ItemLodOmission {
118
+ lod: 1 | 2;
119
+ reason: string;
120
+ /** What the omitted tier would have been, so the decision can be audited. */
121
+ triangles: number;
122
+ bytes: number | null;
83
123
  }
84
124
  export interface ItemLodReport {
85
125
  sourceTriangles: number;
@@ -87,8 +127,11 @@ export interface ItemLodReport {
87
127
  materials: number;
88
128
  images: number;
89
129
  extensionsUsed: string[];
90
- lod1: ItemLodReportLevel;
91
- lod2: ItemLodReportLevel;
130
+ profile: ItemLodProfile;
131
+ /** Null when that tier was omitted; see `omitted`. */
132
+ lod1: ItemLodReportLevel | null;
133
+ lod2: ItemLodReportLevel | null;
134
+ omitted: ItemLodOmission[];
92
135
  impostor: {
93
136
  bytes: number;
94
137
  coverage: number;
@@ -129,10 +172,24 @@ export declare function validateItemLodArtifact(value: unknown): {
129
172
  };
130
173
  export interface CompileItemLodOptions {
131
174
  source: ItemLodSource;
175
+ /**
176
+ * `vehicle` aims LOD1 at max(5000, 10 percent of the source) triangles, widening up to a quarter only if the measured error
177
+ * would pass 10 percent of the longest extent; default `prop` (at most 25 percent).
178
+ */
179
+ profile?: ItemLodProfile;
132
180
  /** Atlas capture; defaults to the headless placements capture host. Injected by tests. */
133
181
  captureAtlas?: (captureGlb: Uint8Array, framing: ImpostorFraming) => Promise<Uint8Array>;
134
182
  onProgress?: (message: string) => void;
135
183
  }
184
+ /**
185
+ * Writes `simplified` with the first texture spec on the ladder whose file is strictly smaller than `aboveBytes`.
186
+ * Returns what the last attempt measured when none is.
187
+ */
188
+ export declare function writeSmallerLevel(model: ItemModel, simplified: SimplifiedLevel, cache: TextureCache, ladder: readonly LevelTextureSpec[], aboveBytes: number): Promise<{
189
+ written: WrittenLevel;
190
+ rung: number;
191
+ smaller: boolean;
192
+ }>;
136
193
  /** Compile a static GLB into an item-lod/1 artifact and its objects. Deterministic: the same bytes give the same CIDs. */
137
194
  export declare function compileItemLods(glb: Uint8Array, options: CompileItemLodOptions): Promise<ItemLodBuild>;
138
195
  export declare const itemLodObjectPath: (object: ItemLodObject) => string;
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.itemLodObjectPath = exports.ITEM_LOD_CAPS = exports.ITEM_LOD_COMPILER = exports.ITEM_LOD_SCHEMA = void 0;
4
4
  exports.checkItemLodCaps = checkItemLodCaps;
5
5
  exports.validateItemLodArtifact = validateItemLodArtifact;
6
+ exports.writeSmallerLevel = writeSmallerLevel;
6
7
  exports.compileItemLods = compileItemLods;
7
8
  exports.writeItemLodOutput = writeItemLodOutput;
8
9
  const promises_1 = require("node:fs/promises");
9
10
  const node_path_1 = require("node:path");
10
11
  const helix_manifest_1 = require("@hypersoniclabs/helix-manifest");
11
12
  const impostor_1 = require("./impostor");
13
+ const atlas_1 = require("./atlas");
14
+ const flat_1 = require("./flat");
12
15
  const levelGlb_1 = require("./levelGlb");
13
16
  const model_1 = require("./model");
14
17
  const simplify_1 = require("./simplify");
@@ -22,28 +25,48 @@ exports.ITEM_LOD_CAPS = {
22
25
  lod1TextureEdge: levelGlb_1.LOD1_TEXTURES.maxEdge,
23
26
  lod2Triangles: simplify_1.ITEM_LOD2.maxTriangles,
24
27
  lod2TextureEdge: levelGlb_1.LOD2_TEXTURES.maxEdge,
28
+ /** Vehicle LOD1 starting budget: max(this, vehicleLod1TriangleRatio of the source); it widens to the prop budget only to hold the error bound. */
29
+ vehicleLod1MinTriangles: simplify_1.VEHICLE_LOD1_MIN_TRIANGLES,
30
+ vehicleLod1TriangleRatio: simplify_1.VEHICLE_LOD1_RATIO,
31
+ /** A level is emitted only if it cuts at least this fraction of the triangles of the level above it. */
32
+ minReduction: simplify_1.ITEM_LOD_MIN_REDUCTION,
25
33
  };
26
34
  const CID = /^cid:sha256:[a-f0-9]{64}$/;
27
35
  /** Checks the design's caps against an artifact. Waived levels pass but are listed. */
28
36
  function checkItemLodCaps(artifact) {
29
37
  const failures = [], waivers = [];
30
- const [source, t1, t2] = artifact.triangles;
31
- const [lod1, lod2] = artifact.levels;
32
- const lod1Cap = Math.floor(source * exports.ITEM_LOD_CAPS.lod1TriangleRatio);
33
- if (t1 > lod1Cap) {
34
- if (lod1.waived)
35
- waivers.push(`LOD1: ${lod1.waived}`);
36
- else
37
- failures.push(`LOD1 has ${t1} triangles, over 25 percent of the source (${lod1Cap})`);
38
+ const source = artifact.triangles[0];
39
+ const vehicle = artifact.profile === 'vehicle';
40
+ // A vehicle starts at max(5000, 10 percent) and may widen to the prop budget (a quarter) when the error bound needs it.
41
+ const lod1Cap = vehicle ? Math.max(exports.ITEM_LOD_CAPS.vehicleLod1MinTriangles, Math.floor(source * exports.ITEM_LOD_CAPS.lod1TriangleRatio)) : Math.floor(source * exports.ITEM_LOD_CAPS.lod1TriangleRatio);
42
+ let above = source, aboveBytes = Infinity;
43
+ for (const level of artifact.levels) {
44
+ const name = `LOD${level.lod}`;
45
+ if (level.lod === 1) {
46
+ if (level.triangles > lod1Cap) {
47
+ if (level.waived)
48
+ waivers.push(`${name}: ${level.waived}`);
49
+ else
50
+ failures.push(`${name} has ${level.triangles} triangles, over its cap of ${lod1Cap} (${vehicle ? 'max(5000, 25 percent' : '25 percent'} of the source)`);
51
+ }
52
+ if (level.cap > lod1Cap && !level.waived)
53
+ failures.push(`${name} was given a budget of ${level.cap} triangles, over ${lod1Cap}`);
54
+ if (level.textureMaxEdge > exports.ITEM_LOD_CAPS.lod1TextureEdge)
55
+ failures.push(`${name} textures reach ${level.textureMaxEdge}px, over ${exports.ITEM_LOD_CAPS.lod1TextureEdge}`);
56
+ }
57
+ else {
58
+ if (level.triangles > exports.ITEM_LOD_CAPS.lod2Triangles)
59
+ failures.push(`${name} has ${level.triangles} triangles, over ${exports.ITEM_LOD_CAPS.lod2Triangles}`);
60
+ if (level.textureMaxEdge > exports.ITEM_LOD_CAPS.lod2TextureEdge)
61
+ failures.push(`${name} textures reach ${level.textureMaxEdge}px, over ${exports.ITEM_LOD_CAPS.lod2TextureEdge}`);
62
+ }
63
+ if (level.triangles > above * (1 - exports.ITEM_LOD_CAPS.minReduction) + 1e-9 && !level.waived)
64
+ failures.push(`${name} (${level.triangles}) cuts under ${exports.ITEM_LOD_CAPS.minReduction * 100} percent of the triangles above it (${above})`);
65
+ if (level.bytes >= aboveBytes)
66
+ failures.push(`${name} is ${level.bytes} bytes, not smaller than the level above it (${aboveBytes})`);
67
+ above = level.triangles;
68
+ aboveBytes = level.bytes;
38
69
  }
39
- if (t2 > exports.ITEM_LOD_CAPS.lod2Triangles)
40
- failures.push(`LOD2 has ${t2} triangles, over ${exports.ITEM_LOD_CAPS.lod2Triangles}`);
41
- if (t2 > t1)
42
- failures.push(`LOD2 (${t2}) has more triangles than LOD1 (${t1})`);
43
- if (lod1.textureMaxEdge > exports.ITEM_LOD_CAPS.lod1TextureEdge)
44
- failures.push(`LOD1 textures reach ${lod1.textureMaxEdge}px, over ${exports.ITEM_LOD_CAPS.lod1TextureEdge}`);
45
- if (lod2.textureMaxEdge > exports.ITEM_LOD_CAPS.lod2TextureEdge)
46
- failures.push(`LOD2 textures reach ${lod2.textureMaxEdge}px, over ${exports.ITEM_LOD_CAPS.lod2TextureEdge}`);
47
70
  if (artifact.impostor.size !== impostor_1.IMPOSTOR_SIZE || artifact.impostor.views !== impostor_1.IMPOSTOR_VIEWS)
48
71
  failures.push('impostor is not 8 views at 512 px');
49
72
  return { ok: failures.length === 0, failures, waivers };
@@ -59,6 +82,8 @@ function validateItemLodArtifact(value) {
59
82
  return { valid: false, errors: ['artifact must be an object'] };
60
83
  if (a.schema !== exports.ITEM_LOD_SCHEMA)
61
84
  errors.push(`schema must be ${exports.ITEM_LOD_SCHEMA}`);
85
+ if (a.profile !== undefined && a.profile !== 'prop' && a.profile !== 'vehicle')
86
+ errors.push('profile must be "prop" or "vehicle"');
62
87
  const s = a.source;
63
88
  if (!s || typeof s !== 'object')
64
89
  errors.push('source is required');
@@ -77,13 +102,24 @@ function validateItemLodArtifact(value) {
77
102
  }
78
103
  if (!a.bounds || !isVec3(a.bounds.min) || !isVec3(a.bounds.max) || a.bounds.min.some((v, i) => v > a.bounds.max[i]))
79
104
  errors.push('bounds must be finite min/max vectors');
80
- if (!Array.isArray(a.triangles) || a.triangles.length !== 3 || !a.triangles.every(isCount) || a.triangles[0] < 1)
81
- errors.push('triangles must be [source, lod1, lod2] counts');
82
- if (!Array.isArray(a.levels) || a.levels.length !== 2)
83
- errors.push('levels must hold exactly LOD1 and LOD2');
84
- else
105
+ const levelCount = Array.isArray(a.levels) ? a.levels.length : -1;
106
+ if (levelCount < 0 || levelCount > 2)
107
+ errors.push('levels must hold zero, one or two entries (LOD1, LOD2)');
108
+ if (!Array.isArray(a.triangles) || !a.triangles.every(isCount) || a.triangles[0] < 1 || (levelCount >= 0 && a.triangles.length !== levelCount + 1))
109
+ errors.push('triangles must be [source, then one count per level]');
110
+ if (levelCount >= 0 && levelCount <= 2) {
111
+ const seen = new Set();
85
112
  a.levels.forEach((level, index) => {
86
113
  const name = `levels[${index}]`;
114
+ // Artifacts from the first compiler had no `lod` and always held both tiers; their position says which tier each is.
115
+ const lod = level.lod ?? (levelCount === 2 ? index + 1 : undefined);
116
+ if (lod !== 1 && lod !== 2)
117
+ errors.push(`${name}.lod must be 1 or 2`);
118
+ else {
119
+ if (seen.has(lod) || (index > 0 && lod <= (a.levels[index - 1].lod ?? index)))
120
+ errors.push(`${name}.lod repeats or is out of order`);
121
+ seen.add(lod);
122
+ }
87
123
  if (!isCid(level.object))
88
124
  errors.push(`${name}.object must be a CID`);
89
125
  if (!isCount(level.triangles) || level.triangles !== a.triangles?.[index + 1])
@@ -93,7 +129,10 @@ function validateItemLodArtifact(value) {
93
129
  for (const key of ['bytes', 'textureMaxEdge', 'cap'])
94
130
  if (!isCount(level[key]))
95
131
  errors.push(`${name}.${key} must be a count`);
132
+ if (level.drawCalls !== undefined && (!isCount(level.drawCalls) || level.drawCalls < 1))
133
+ errors.push(`${name}.drawCalls must be a positive count when present`);
96
134
  });
135
+ }
97
136
  const i = a.impostor;
98
137
  if (!i || typeof i !== 'object')
99
138
  errors.push('impostor is required');
@@ -108,31 +147,106 @@ function validateItemLodArtifact(value) {
108
147
  errors.push('impostor.bytes must be a count');
109
148
  }
110
149
  const e = a.estimatedBytes;
111
- if (!e || !isCount(e.lod1) || !isCount(e.lod2) || !isCount(e.impostor))
112
- errors.push('estimatedBytes needs lod1, lod2 and impostor counts');
150
+ if (!e || !isCount(e.impostor))
151
+ errors.push('estimatedBytes needs an impostor count');
152
+ else if (a.levels) {
153
+ // Every emitted tier has an estimate and no omitted tier has one.
154
+ for (const tier of [1, 2]) {
155
+ const present = a.levels.some((level, index) => (level.lod ?? (a.levels.length === 2 ? index + 1 : 0)) === tier);
156
+ const key = tier === 1 ? 'lod1' : 'lod2';
157
+ if (present !== (e[key] !== undefined) || (e[key] !== undefined && !isCount(e[key])))
158
+ errors.push(`estimatedBytes.${key} must be a count exactly when LOD${tier} is present`);
159
+ }
160
+ }
113
161
  if (!Array.isArray(a.warnings) || a.warnings.some(w => typeof w !== 'string'))
114
162
  errors.push('warnings must be a string list');
115
163
  return errors.length ? { valid: false, errors } : { valid: true, artifact: a };
116
164
  }
117
- const reportLevel = (level, written) => ({
118
- triangles: level.triangles, cap: level.cap, capMet: level.capMet, waived: level.waived, maxErrorM: level.maxErrorM,
165
+ const reportLevel = (level, written, rung) => ({
166
+ triangles: level.triangles, cap: level.cap, capMet: level.capMet, waived: level.waived, maxErrorM: level.maxErrorM, strictErrorM: level.strictErrorM,
119
167
  bytes: written.bytes.length, textures: written.textureCount, textureMaxEdge: written.textureMaxEdge, residentBytes: written.residentBytes,
120
- droppedMaterials: level.droppedMaterials.length, notes: level.notes,
168
+ droppedMaterials: level.droppedMaterials.length, notes: [...level.notes, ...written.notes], textureRung: rung, textureDetail: written.textures,
169
+ primitives: written.primitives, ...(written.atlas ? { atlas: written.atlas } : {}),
121
170
  });
171
+ const percent = (fraction) => `${Math.round(fraction * 1000) / 10} percent`;
172
+ /**
173
+ * Writes `simplified` with the first texture spec on the ladder whose file is strictly smaller than `aboveBytes`.
174
+ * Returns what the last attempt measured when none is.
175
+ */
176
+ async function writeSmallerLevel(model, simplified, cache, ladder, aboveBytes) {
177
+ let best = null;
178
+ // The primitives and the material atlas layout depend on the geometry, not on the texture rung.
179
+ const plan = await (0, levelGlb_1.planLevelGlb)(model, simplified.groups, cache, ladder[0]);
180
+ for (let rung = 0; rung < ladder.length; rung++) {
181
+ const written = await (0, levelGlb_1.writeLevelGlb)(model, simplified.groups, cache, { mode: 'level', textures: ladder[rung], plan });
182
+ if (written.bytes.length < aboveBytes)
183
+ return { written, rung, smaller: true };
184
+ if (!best || written.bytes.length < best.written.bytes.length)
185
+ best = { written, rung };
186
+ }
187
+ return { ...best, smaller: false };
188
+ }
122
189
  /** Compile a static GLB into an item-lod/1 artifact and its objects. Deterministic: the same bytes give the same CIDs. */
123
190
  async function compileItemLods(glb, options) {
124
191
  const started = Date.now();
125
192
  const progress = options.onProgress ?? (() => undefined);
193
+ const profile = options.profile ?? 'prop';
126
194
  progress('reading model');
127
195
  const model = await (0, model_1.readItemModel)(glb);
128
- progress(`${model.triangles} triangles, ${model.groups.length} materials, ${model.images.length} images`);
129
- const [lod1, lod2] = await (0, simplify_1.simplifyLevels)(model);
130
- progress(`LOD1 ${lod1.triangles} triangles, LOD2 ${lod2.triangles} triangles`);
196
+ progress(`${model.triangles} triangles, ${model.groups.length} materials, ${model.images.length} images (${profile})`);
131
197
  const cache = new textures_1.TextureCache();
132
- const written1 = await (0, levelGlb_1.writeLevelGlb)(model, lod1.groups, cache, { mode: 'level', textures: levelGlb_1.LOD1_TEXTURES });
133
- progress(`LOD1 written (${written1.bytes.length} bytes)`);
134
- const written2 = await (0, levelGlb_1.writeLevelGlb)(model, lod2.groups, cache, { mode: 'level', textures: levelGlb_1.LOD2_TEXTURES });
135
- progress(`LOD2 written (${written2.bytes.length} bytes)`);
198
+ // Each tier is emitted only if it cuts at least half the triangles of the level above it (the source for the first tier
199
+ // emitted) and its file is strictly smaller in bytes than that level's file; otherwise it is omitted and the next tier
200
+ // is measured against the last one emitted.
201
+ const emitted = [], omitted = [];
202
+ let aboveTriangles = model.triangles, aboveBytes = glb.length;
203
+ for (const lod of [1, 2]) {
204
+ const simplified = lod === 1 ? await (0, simplify_1.simplifyLod1)(model, profile) : await (0, simplify_1.simplifyLod2)(model, aboveTriangles, profile);
205
+ const cut = 1 - simplified.triangles / aboveTriangles;
206
+ const extent = Math.max(...[0, 1, 2].map(axis => model.bounds.max[axis] - model.bounds.min[axis]));
207
+ if (lod === 2 && profile === 'vehicle' && simplified.maxErrorM > extent * simplify_1.VEHICLE_LOD2_MAX_ERROR_RATIO) {
208
+ 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`;
209
+ omitted.push({ lod, reason, triangles: simplified.triangles, bytes: null });
210
+ progress(reason);
211
+ continue;
212
+ }
213
+ if (simplified.triangles > aboveTriangles * (1 - exports.ITEM_LOD_CAPS.minReduction)) {
214
+ 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`;
215
+ omitted.push({ lod, reason, triangles: simplified.triangles, bytes: null });
216
+ progress(reason);
217
+ continue;
218
+ }
219
+ let attempt;
220
+ try {
221
+ let levelModel = model, levelSimplified = simplified;
222
+ if (simplified.flatColor) {
223
+ const flat = await (0, flat_1.flattenColours)(model, simplified.groups, image => cache.mips(image));
224
+ levelModel = flat.model;
225
+ 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)`] };
226
+ }
227
+ attempt = await writeSmallerLevel(levelModel, levelSimplified, cache, lod === 1 ? levelGlb_1.LOD1_TEXTURE_LADDER : levelGlb_1.LOD2_TEXTURE_LADDER, aboveBytes);
228
+ if (levelSimplified !== simplified)
229
+ simplified.notes = levelSimplified.notes;
230
+ }
231
+ catch (error) {
232
+ if (!(error instanceof atlas_1.AtlasOverflowError))
233
+ throw error;
234
+ const reason = `LOD${lod} omitted: ${error.message}`;
235
+ omitted.push({ lod, reason, triangles: simplified.triangles, bytes: null });
236
+ progress(reason);
237
+ continue;
238
+ }
239
+ if (!attempt.smaller) {
240
+ const reason = `LOD${lod} omitted: its smallest file is ${attempt.written.bytes.length} bytes, not smaller than the level above it (${aboveBytes} bytes)`;
241
+ omitted.push({ lod, reason, triangles: simplified.triangles, bytes: attempt.written.bytes.length });
242
+ progress(reason);
243
+ continue;
244
+ }
245
+ emitted.push({ lod, simplified, written: attempt.written, rung: attempt.rung });
246
+ progress(`LOD${lod} ${simplified.triangles} triangles, ${attempt.written.bytes.length} bytes (texture rung ${attempt.rung})`);
247
+ aboveTriangles = simplified.triangles;
248
+ aboveBytes = attempt.written.bytes.length;
249
+ }
136
250
  const framing = (0, impostor_1.impostorFraming)(model.bounds);
137
251
  const captureGlb = await (0, levelGlb_1.writeLevelGlb)(model, model.groups, cache, { mode: 'capture', textures: levelGlb_1.LOD1_TEXTURES });
138
252
  progress('capturing impostor (64 views)');
@@ -140,24 +254,30 @@ async function compileItemLods(glb, options) {
140
254
  const impostorBytes = await (0, impostor_1.encodeImpostorAtlas)(atlas);
141
255
  progress(`impostor encoded (${impostorBytes.length} bytes)`);
142
256
  const objects = [
143
- { cid: (0, helix_manifest_1.cidFromBytes)(written1.bytes), bytes: written1.bytes, mediaType: 'model/gltf-binary', role: 'lod1' },
144
- { cid: (0, helix_manifest_1.cidFromBytes)(written2.bytes), bytes: written2.bytes, mediaType: 'model/gltf-binary', role: 'lod2' },
257
+ ...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' })),
145
258
  { cid: (0, helix_manifest_1.cidFromBytes)(impostorBytes), bytes: impostorBytes, mediaType: 'image/ktx2', role: 'impostor' },
146
259
  ];
147
- const level = (simplified, written, object) => ({
148
- object: object.cid, triangles: simplified.triangles, maxErrorM: Math.round(simplified.maxErrorM * 1e5) / 1e5, bytes: written.bytes.length,
149
- textureMaxEdge: written.textureMaxEdge, cap: simplified.cap, ...(simplified.waived ? { waived: simplified.waived } : {}),
150
- });
260
+ const levels = emitted.map((level, index) => ({
261
+ lod: level.lod, object: objects[index].cid, triangles: level.simplified.triangles, maxErrorM: Math.round(level.simplified.maxErrorM * 1e5) / 1e5,
262
+ bytes: level.written.bytes.length, textureMaxEdge: level.written.textureMaxEdge, cap: level.simplified.cap, drawCalls: level.written.primitives,
263
+ ...(level.simplified.waived ? { waived: level.simplified.waived } : {}),
264
+ }));
265
+ const estimatedBytes = { impostor: (0, textures_1.residentTextureBytes)(impostor_1.IMPOSTOR_SIZE, impostor_1.IMPOSTOR_SIZE) };
266
+ for (const level of emitted)
267
+ estimatedBytes[level.lod === 1 ? 'lod1' : 'lod2'] = level.written.residentBytes;
268
+ const budgetNotes = emitted.filter(level => level.lod === 1 && level.simplified.budgetNote).map(level => level.simplified.budgetNote);
269
+ const warnings = [...model.warnings, ...budgetNotes, ...omitted.map(entry => entry.reason)];
151
270
  const artifact = {
152
271
  schema: exports.ITEM_LOD_SCHEMA,
153
272
  source: options.source,
273
+ profile,
154
274
  bounds: { min: model.bounds.min, max: model.bounds.max },
155
- triangles: [model.triangles, lod1.triangles, lod2.triangles],
156
- levels: [level(lod1, written1, objects[0]), level(lod2, written2, objects[1])],
157
- impostor: { object: objects[2].cid, kind: 'octahedral', views: impostor_1.IMPOSTOR_VIEWS, size: impostor_1.IMPOSTOR_SIZE, format: 'ktx2-uastc',
275
+ triangles: [model.triangles, ...emitted.map(level => level.simplified.triangles)],
276
+ levels,
277
+ impostor: { object: objects[objects.length - 1].cid, kind: 'octahedral', views: impostor_1.IMPOSTOR_VIEWS, size: impostor_1.IMPOSTOR_SIZE, format: 'ktx2-uastc',
158
278
  center: framing.center, radius: Math.round(framing.radius * 1e6) / 1e6, bytes: impostorBytes.length },
159
- estimatedBytes: { lod1: written1.residentBytes, lod2: written2.residentBytes, impostor: (0, textures_1.residentTextureBytes)(impostor_1.IMPOSTOR_SIZE, impostor_1.IMPOSTOR_SIZE) },
160
- warnings: model.warnings,
279
+ estimatedBytes,
280
+ warnings,
161
281
  };
162
282
  const validation = validateItemLodArtifact(artifact);
163
283
  if (!validation.valid)
@@ -165,12 +285,16 @@ async function compileItemLods(glb, options) {
165
285
  const artifactBytes = (0, helix_manifest_1.canonicalJsonBytes)(artifact);
166
286
  const caps = checkItemLodCaps(artifact);
167
287
  const previews = [{ name: 'impostor.png', bytes: await (0, impostor_1.impostorPreviewPng)(atlas) }];
288
+ const reported = (lod) => {
289
+ const level = emitted.find(candidate => candidate.lod === lod);
290
+ return level ? reportLevel(level.simplified, level.written, level.rung) : null;
291
+ };
168
292
  return {
169
293
  artifact, artifactBytes, artifactCid: (0, helix_manifest_1.cidFromBytes)(artifactBytes), objects, previews,
170
294
  report: {
171
295
  sourceTriangles: model.triangles, sourceBytes: glb.length, materials: model.materials.length, images: model.images.length,
172
- extensionsUsed: model.extensionsUsed, lod1: reportLevel(lod1, written1), lod2: reportLevel(lod2, written2),
173
- impostor: { bytes: impostorBytes.length, coverage: Math.round((0, impostor_1.impostorCoverage)(atlas) * 1e4) / 1e4 }, caps, warnings: model.warnings,
296
+ extensionsUsed: model.extensionsUsed, profile, lod1: reported(1), lod2: reported(2), omitted,
297
+ impostor: { bytes: impostorBytes.length, coverage: Math.round((0, impostor_1.impostorCoverage)(atlas) * 1e4) / 1e4 }, caps, warnings,
174
298
  millis: { total: Date.now() - started },
175
299
  },
176
300
  };
@@ -1 +1 @@
1
- {"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/itemLod/artifact.ts"],"names":[],"mappings":";;;AA8HA,4CAeC;AAOD,0DAoCC;AAgBD,0CAsDC;AAMD,gDAaC;AAjRD,+CAAoD;AACpD,yCAA0C;AAC1C,mEAAkF;AAClF,yCAAmL;AACnL,yCAA4F;AAC5F,mCAAwD;AACxD,yCAAwF;AACxF,yCAAgE;AAEhE,8GAA8G;AAEjG,QAAA,eAAe,GAAG,kBAAkB,CAAC;AACrC,QAAA,iBAAiB,GAAG,YAAY,CAAC;AAC9C,uEAAuE;AAC1D,QAAA,aAA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