@hypersoniclabs/helix-cli 0.1.25-helix3.520 → 0.1.25-helix3.521

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 (27) hide show
  1. package/dist/itemLod/artifact.d.ts +41 -2
  2. package/dist/itemLod/artifact.js +82 -17
  3. package/dist/itemLod/artifact.js.map +1 -1
  4. package/dist/itemLod/gbuffer.d.ts +72 -0
  5. package/dist/itemLod/gbuffer.js +245 -0
  6. package/dist/itemLod/gbuffer.js.map +1 -0
  7. package/dist/itemLod/impostor.d.ts +3 -1
  8. package/dist/itemLod/impostor.js +2 -0
  9. package/dist/itemLod/impostor.js.map +1 -1
  10. package/dist/tsconfig.build.tsbuildinfo +1 -1
  11. package/docs/item-lod.md +39 -2
  12. package/package.json +1 -1
  13. package/plugins/beamng-vehicle/bin/__pycache__/beamng_abs.cpython-312.pyc +0 -0
  14. package/plugins/beamng-vehicle/bin/__pycache__/beamng_audio.cpython-312.pyc +0 -0
  15. package/plugins/beamng-vehicle/bin/__pycache__/beamng_engine.cpython-312.pyc +0 -0
  16. package/plugins/beamng-vehicle/bin/__pycache__/beamng_expression.cpython-312.pyc +0 -0
  17. package/plugins/beamng-vehicle/bin/__pycache__/beamng_jbeam.cpython-312.pyc +0 -0
  18. package/plugins/beamng-vehicle/bin/__pycache__/beamng_materials.cpython-312.pyc +0 -0
  19. package/plugins/beamng-vehicle/bin/__pycache__/beamng_stock_events.cpython-312.pyc +0 -0
  20. package/plugins/beamng-vehicle/bin/__pycache__/fmod_studio.cpython-312.pyc +0 -0
  21. package/plugins/beamng-vehicle/bin/__pycache__/fsb5.cpython-312.pyc +0 -0
  22. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio.cpython-312.pyc +0 -0
  23. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_ac.cpython-312.pyc +0 -0
  24. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_beamng.cpython-312.pyc +0 -0
  25. package/plugins/beamng-vehicle/bin/__pycache__/sim_audio_fixtures.cpython-312.pyc +0 -0
  26. package/plugins/beamng-vehicle/bin/__pycache__/test_beamng_engine.cpython-312.pyc +0 -0
  27. package/plugins/beamng-vehicle/bin/__pycache__/test_sim_audio.cpython-312.pyc +0 -0
package/docs/item-lod.md CHANGED
@@ -239,8 +239,45 @@ empty gutters so filtering shows no dark fringes. Transparent materials are draw
239
239
  range); cutouts keep their alpha test.
240
240
 
241
241
  Capture runs in the shared placements capture host (`src/placements/captureHost.ts`): bundled headless Chromium, localhost
242
- only, one browser at a time under the host slot cap, never the system Chrome. The impostor has no normal map, so a runtime
243
- shades it flat; adding a normal atlas is a follow-up that needs a second object in the artifact.
242
+ only, one browser at a time under the host slot cap, never the system Chrome. An `albedo` or `lit/1` impostor has no normal
243
+ map, so a runtime cannot light it for the scene it stands in; the `gbuffer/1` impostor below is that second object.
244
+
245
+ ### `gbuffer/1`: a runtime-lit impostor (`item-lod/5`, `hemi-oct/1`)
246
+
247
+ `compileItemLods(glb, { source, shading: 'gbuffer/1' })` bakes what a light needs instead of a light: the surface, not its
248
+ shading. It is a contract of its own because it is neither read like `lit/1` nor laid out like it, and it is **not served yet**:
249
+ `'gbuffer/1'` is deliberately absent from `ITEM_LOD_SHADINGS`, so the CLI's `--shading` flag does not accept it and no published
250
+ Package version has one. The backend compiles `item-lod/5` next to `/4` and `/3` and serves it to a read that declares `gbuffer/1`
251
+ (phase 2 of the impostor-gbuffer lane); an engine before it keeps its `lit/1` or albedo rendition.
252
+
253
+ * **Layout `hemi-oct/1`** (`impostor.layout`): 8 x 8 views over the UPPER hemisphere only. Frame `(i, j)` has `u = 2i/7 - 1`,
254
+ `v = 2j/7 - 1`, `x = (u + v)/2`, `z = (u - v)/2`, `y = 1 - |x| - |z|`, normalised. The outer ring of 28 frames lies exactly on the
255
+ horizon (gaps of 9.5 to 16.2 degrees of azimuth) and the four corners look along the item axes. A viewer at or below the
256
+ horizon reads the ring, so it is looked at from where it stands. The full-sphere `oct/1` layout the other shadings use
257
+ spends half its frames below the ground and its nearest ring sat at 9.5 to 13 degrees ELEVATION: a car seen from 0.5 degrees
258
+ was drawn from above, with roof and bonnet over-represented, which was the whole of the +7 to +25 percent over-brightness
259
+ measured before the layout changed (a camera-elevation sweep of the same atlas; the lab reproduced it and the layout closes it).
260
+ * **Maps** (`impostor.maps`, one KTX2 UASTC object each, 512 px, mips): `impostor.object` is `A`, sRGB albedo with the
261
+ coverage in alpha; `maps.surface` is `B`, linear: view-space normal x and y (z is rebuilt as `sqrt(1 - x² - y²)`), roughness,
262
+ metalness; `maps.emissive` is `C`, sRGB, emissive radiance / 4 in RGB (`scale: 0.25`) and the clear coat amount in alpha
263
+ (`clearcoat`), present only when at least 8 texels glow or are coated. View-space normals mean each baked view's own camera
264
+ frame (x right, y up, z to the viewer); the engine turns them into item space per frame and then into the scene's view space.
265
+ * **Passes**: four captures per view (albedo, normal, material, emissive) of the source's own PBR values, written by small
266
+ `ShaderMaterial`s that output the quantity instead of a colour; supersampled (`IMPOSTOR_SSAA`) and reduced, then each map
267
+ dilated into the empty texels of its view cell so filtering at a silhouette mixes in no black. Rows are bottom first.
268
+ * **Artifact**: `impostor.shading: "gbuffer/1"`, `impostor.layout: "hemi-oct/1"`, `impostor.maps`, no `bakeScale`; `compiler`
269
+ is `item-lod/5` (`ITEM_LOD_COMPILER_FOR_SHADING`). The schema id stays `helix.item-lod/1`; a reader that does not know
270
+ `impostor.shading` must not draw the document, which is why the backend serves it only to a declaration.
271
+ * **Omission rule**: the `lit/1` rule (omit when the atlas is not smaller than the source GLB) would drop the impostor of a heavy
272
+ item with small textures, which has no other far representation and whose far placements are two triangles each, because the
273
+ impostor now carries up to three maps. A `gbuffer/1` impostor is omitted only when the source is at most 300 triangles AND
274
+ the maps are at least twice the source bytes (`GBUFFER_MIN_TRIANGLES`, `GBUFFER_BYTES_SLACK`);
275
+ `estimatedBytes.impostor` is the resident cost of all the maps, and `report.json` has `shading` and `maps`.
276
+ * **Measured** (2026-10-11, lab `run/impostor-gbuffer-2026-10-11`): the sedan baked on this Mac's SwiftShader capture host takes
277
+ about 14 s for the impostor (23 s for the whole compile with both LODs): `A` 105 KB, `B` 131 KB, `C` 12 KB.
278
+
279
+ Tests: `src/itemLod/gbuffer.spec.ts` (layout, packing, dilation, KTX2 encode; two real-browser captures) and
280
+ `src/itemLod/artifact.spec.ts` "gbuffer/1 impostor" (artifact shape, validation, omission rule, the `lit/1` rule unchanged).
244
281
 
245
282
  ## Textures that cannot be decoded
246
283
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypersoniclabs/helix-cli",
3
- "version": "0.1.25-helix3.520",
3
+ "version": "0.1.25-helix3.521",
4
4
  "description": "helix — the HELIX creator CLI: scaffold, validate, and publish Instant Worlds",
5
5
  "main": "dist/lib.js",
6
6
  "types": "dist/lib.d.ts",