@bendyline/molen-tooling 0.0.7 → 0.0.9

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.
@@ -28,6 +28,8 @@ const renderer = createDefaultTerrainSemanticRenderer({ surfaceRenderer: surface
28
28
  // in createTerrainPackageSemanticLayers.
29
29
 
30
30
  await surfaces.setOptions({ style: '1910' });
31
+ // Call once per frame with absolute simulation time (seconds).
32
+ surfaces.updateSignals(tick / tickRate);
31
33
  console.log(surfaces.stats());
32
34
  // Dispose the stream/layers, then the shared controller when the experience closes.
33
35
  surfaces.dispose();
@@ -106,7 +108,9 @@ await surfaces.setOptions({
106
108
  Nearby nodes on divided roads form one junction; crossings follow
107
109
  the external approaches, and short turning links receive no independent crossings. Same-grade
108
110
  junctions leave their centers clear of lane paint.
109
- Four-way major junctions can receive illustrative traffic signals. Instanced streetlights
111
+ Four-way major junctions can receive curbside masts with bars over the incoming lanes,
112
+ yellow backplates, shaded round lenses, and one signal head per lane (up to three).
113
+ Red, amber and green lenses are self-lit, remaining visible at night. Instanced streetlights
110
114
  occupy eligible corners outside road corridors, buildings, and water.
111
115
  - Parking, plazas, and pedestrian polygons are filled, with holes retained. Pedestrian polygons
112
116
  and mapped paths use distinct heights above parking pavement, including inferred lots, so
@@ -142,12 +146,21 @@ await surfaces.setOptions({
142
146
  - Simple surfaces retain road and parking fills with decoration disabled.
143
147
 
144
148
  The decoder preserves road `subclass`, `service`, `link` (including Protomaps `is_link`), `surface`, `lanes`, `oneway`, `layer`, `bridge`, `tunnel`
145
- and explicit `width`. Properties absent from the source use class-based defaults. Tunnels are
146
- omitted; bridges and differing layers do not form surface junctions. Bridge ribbons retain the
149
+ and explicit `width`. Properties absent from the source use class-based defaults. Tunnel roads are
150
+ excluded from the ground painter; Earth views add separate underground bores as described below.
151
+ Bridges and differing layers do not form surface junctions. Bridge ribbons retain the
147
152
  existing approximate terrain-relative elevation; this renderer does not build engineered bridge
148
153
  decks. Crossing paint, inferred sidewalks, signal placement and parking occupancy are decorative,
149
- not traffic-control or navigation data. [Ambient life](ambient-life.md) builds its own lane graph
150
- from the same features for NPC traffic.
154
+ not surveyed traffic-control or navigation data. [Ambient life](ambient-life.md) builds its own lane graph
155
+ from the same features for NPC traffic. Earth view and world explorer match signal heads to
156
+ that graph, displaying the same phase that controls approaching cars. Without a matching
157
+ simulation junction, signals use a deterministic cycle: 24 seconds green, 3 seconds amber,
158
+ and 2 seconds all-red clearance, with opposing approaches sharing a phase. Custom hosts
159
+ call `surfaces.updateSignals(elapsedSeconds, resolver?)`; a resolver receives a world-space
160
+ `junction`, outward approach `direction`, and junction `radius`, and returns `'red'`, `'amber'`,
161
+ `'green'`, or `undefined` for the default cycle. Direct/static consumers can call
162
+ `updateTerrainSurfaceSignals(object, elapsedSeconds, resolver?)` on the surface object instead.
163
+ Here `object` is the group returned by `createTerrainSurfaceObject`.
151
164
 
152
165
  Ground surfaces render at all available semantic levels. Fine markings and fixtures default to
153
166
  the finest pyramid level; `detailLevelsBelowMax` extends them to coarser levels. Fixture/car and
@@ -169,6 +182,39 @@ Protomaps deliberately includes a subset of OSM features. Its documented `landus
169
182
  kinds do not currently include parking, while roads may carry `parking_aisle` detail.
170
183
  See the [Protomaps layer reference](https://docs.protomaps.com/basemaps/layers).
171
184
 
185
+ ## Tunnels
186
+
187
+ World explorer and `mountEarthView` render mapped `tunnel: true` corridors in Human mode.
188
+ Roads, paths and railways receive an open-ended floor, walls and ceiling. Portal cuts remove
189
+ terrain and draped paving only below the bore ceiling, leaving the hill above it intact.
190
+ Visible mesh collision includes the lining. World explorer's free flight slows near the ground,
191
+ can descend to 2 m above a road, and uses the bore floor and ceiling while underground.
192
+ Aircraft ground support also uses the bore floor at the aircraft's altitude; its existing body
193
+ collision still determines whether an aircraft fits.
194
+
195
+ The Seattle PMTiles fixture contains `is_tunnel` centerlines for the Mount Baker Ridge road and
196
+ bicycle/pedestrian tunnels. It supplies neither surveyed floor elevations nor clearances.
197
+ The default infers a straight grade between terrain heights at the complete route's endpoints,
198
+ with 6.5 m road, 6 m rail and 3.5 m path clearance and the existing transport width defaults.
199
+ These are approximate interiors, not surveyed tunnel geometry. Semantic providers can supply
200
+ `tunnelFloorElevation` (absolute world Y) and `tunnelClearance`; the MVT decoder accepts
201
+ `tunnel_floor_elevation` and `tunnel_clearance`/`tunnel_height`, or configurable property names.
202
+
203
+ Fragments are clipped out of their tile buffers and joined across neighboring tiles before
204
+ grading, so tile boundaries do not create portals or conflicting floor heights. Searches are
205
+ bounded to 16 tiles. Unresolved long routes and branches are omitted rather than assigning a
206
+ terrain height to an underground tile boundary. Tunnel inference runs at the finest source
207
+ feature level and above. Hiding the Human layer also removes its portal cuts and navigation
208
+ support; the original elevation heightfield always remains available for surface anchoring.
209
+
210
+ Custom package hosts opt in with `createTerrainPackageSemanticLayers` (or its profiled variant),
211
+ passing `tunnels: { heights: elevationSource }` alongside their feature renderer. Share the
212
+ elevation source returned by `openTerrainPackagePyramid` with the terrain stream.
213
+ `withTerrainTunnels` wraps a custom semantic renderer, and `sampleTerrainTunnel(root, x, y, z)`
214
+ returns a visible bore's floor and ceiling in the root's coordinate frame. Observers above the
215
+ ceiling continue using the surface height. Static hosts can use `createTerrainTunnelObject`
216
+ with complete route lines and a ground sampler that covers both portals.
217
+
172
218
  ## Lines beyond roads
173
219
 
174
220
  `createTerrainLinearObject(lines, context, profile)` is independent of road semantics. Lines use
@@ -231,6 +231,17 @@ levels and can be frustum-culled independently; no per-frame placement uploads a
231
231
  `propLod: false` disables this camera LOD, and the explorer exposes `?propLod=0` for comparison.
232
232
  The explorer's `AssetCache` still resolves authored GLBs for custom packs and building props.
233
233
 
234
+ Ground cover is the knee-high layer under all of this: `builtin:groundcover.tuft` (a grass
235
+ tussock) and `builtin:groundcover.fern`, each under 70 triangles, plus small shrubs and stones.
236
+ A rule joins it with `"layer": "groundcover"`, which gives it its own instance and model budget
237
+ (`maxGroundCoverInstances`, `maxGroundCoverModels`), so thousands of clumps never thin the trees
238
+ or take their model slots. Ground cover models draw only at the near level; the medium and far
239
+ levels are empty, so the clumps fade out about 400 meters away instead of shimmering. The Earth
240
+ adapter labels land that no map polygon covers `open_ground` (the `OPEN_GROUND_LABEL` export), as a
241
+ tile-wide polygon that every mapped polygon paints over, so verges and unmapped meadows can carry
242
+ ground cover too. The default packs place it in meadows, parks, yards, forest floors and open
243
+ ground, on the finest tile level only, and not at Economy quality.
244
+
234
245
  A population's optional `widthScale: { min: 0.8, max: 1.25 }` multiplies X/Z independently of
235
246
  its uniform `scale`, allowing tall narrow trees, broad bushy trees, and spreading shrubs in the
236
247
  same draw. Width uses its own cell-hash stream, so changing it preserves positions, heights,
@@ -378,7 +389,9 @@ the instances, two levels below keeps a sparse hint, and coarser tiles carry no
378
389
  cells draw only their active LOD; keep `maxPropModels` small because each model needs a draw per
379
390
  visible cell. The per-tile placement budgets still bound the resident instance data. Balanced quality
380
391
  allows 6,000 nearby placements, 1,200 one level below, and 250 two levels below. Economy uses
381
- 2,200 / 400 / 0; high uses 9,000 / 1,800 / 350. The forest rules fill nearby crowns while
392
+ 2,200 / 400 / 0; high uses 9,000 / 1,800 / 350. Ground cover has its own budget on the finest
393
+ level only: 5,000 placements and 3 models at Balanced, 8,000 and 4 at High, none at Economy.
394
+ The forest rules fill nearby crowns while
382
395
  understory is limited to the finest tier; parks and yards retain lower densities and all
383
396
  placements retain road, building, and water clearances.
384
397
 
@@ -4,7 +4,7 @@
4
4
  > three.js rendering client, authored through JSON schemas, a small typed API, and a headless
5
5
  > dev loop. This bundle is version-locked to the engine release.
6
6
 
7
- Engine version: 0.0.4. three.js peer range: >=0.184.0 <0.187.0 (developed against 0.184.0). Node ≥ 22.13, ESM only.
7
+ Engine version: 0.0.6. three.js peer range: >=0.184.0 <0.187.0 (developed against 0.184.0). Node ≥ 22.13, ESM only.
8
8
 
9
9
  ## Start here
10
10
 
@@ -46,6 +46,7 @@ downloads them into a project and pins them in project.json.
46
46
  - [Recognizable places](guide/recognizable-places.md): store identity matching, reusable signs, tenant facades and mapped outdoor props.
47
47
  - [Building interiors](guide/building-interiors.md): deterministic layouts by use, real entrances and frontage windows, lazy rendering and walk collision.
48
48
  - [3D art guidelines](guide/3d-art-guidelines.md): shared polygonal fidelity, scale, material library, LOD and visual review for static and procedural models.
49
+ - [Medium-fi style guide](guide/medium-fi.md): the Earth view's target look (a bright polygonal model railroad), the shared light rig, palette bands, polygon budgets per LOD, landmark recognition rules, rendering modes and the review checklist for any new model or style.
49
50
  - [Materials](guide/materials.md): palette and procedural material-graph textures.
50
51
  - [3D model assets](guide/3d-model-assets.md): prompt-to-glTF authoring, PBR texture conventions, import, visual QA, and browser hosting.
51
52
  - [Logical source bundles](guide/source-bundles.md): one copyable folder per entity, structure, vehicle, prop, or other authored thing, with all definitions and source files listed in `source.json`.
@@ -171,6 +171,106 @@ Per-asset metadata written by `molen asset import`: bounds + collision geometry
171
171
  "pattern": "^sha256:[0-9a-f]{64}$",
172
172
  "description": "'sha256:<hex>' of the pre-import source file."
173
173
  },
174
+ "runtimeLods": {
175
+ "type": "object",
176
+ "properties": {
177
+ "recipe": {
178
+ "type": "integer",
179
+ "exclusiveMinimum": 0,
180
+ "maximum": 9007199254740991
181
+ },
182
+ "recipeHash": {
183
+ "type": "string",
184
+ "pattern": "^sha256:[0-9a-f]{64}$"
185
+ },
186
+ "masterHash": {
187
+ "type": "string",
188
+ "pattern": "^sha256:[0-9a-f]{64}$"
189
+ },
190
+ "levels": {
191
+ "minItems": 4,
192
+ "maxItems": 4,
193
+ "type": "array",
194
+ "items": {
195
+ "type": "object",
196
+ "properties": {
197
+ "name": {
198
+ "type": "string",
199
+ "enum": [
200
+ "skyline",
201
+ "district",
202
+ "street",
203
+ "closeup"
204
+ ]
205
+ },
206
+ "file": {
207
+ "type": "string",
208
+ "minLength": 1,
209
+ "pattern": "^(?![A-Za-z]:|[/\\\\])(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$"
210
+ },
211
+ "hash": {
212
+ "type": "string",
213
+ "pattern": "^sha256:[0-9a-f]{64}$"
214
+ },
215
+ "bytes": {
216
+ "type": "integer",
217
+ "exclusiveMinimum": 0,
218
+ "maximum": 9007199254740991
219
+ },
220
+ "gzipBytes": {
221
+ "type": "integer",
222
+ "exclusiveMinimum": 0,
223
+ "maximum": 9007199254740991
224
+ },
225
+ "triangles": {
226
+ "type": "integer",
227
+ "exclusiveMinimum": 0,
228
+ "maximum": 9007199254740991
229
+ },
230
+ "cpuBytes": {
231
+ "type": "integer",
232
+ "exclusiveMinimum": 0,
233
+ "maximum": 9007199254740991
234
+ },
235
+ "gpuBytes": {
236
+ "type": "integer",
237
+ "exclusiveMinimum": 0,
238
+ "maximum": 9007199254740991
239
+ },
240
+ "errorMeters": {
241
+ "type": "number",
242
+ "minimum": 0
243
+ },
244
+ "drawCalls": {
245
+ "type": "integer",
246
+ "exclusiveMinimum": 0,
247
+ "maximum": 9007199254740991
248
+ }
249
+ },
250
+ "required": [
251
+ "name",
252
+ "file",
253
+ "hash",
254
+ "bytes",
255
+ "gzipBytes",
256
+ "triangles",
257
+ "cpuBytes",
258
+ "gpuBytes",
259
+ "errorMeters",
260
+ "drawCalls"
261
+ ],
262
+ "additionalProperties": false
263
+ }
264
+ }
265
+ },
266
+ "required": [
267
+ "recipe",
268
+ "masterHash",
269
+ "levels"
270
+ ],
271
+ "additionalProperties": false,
272
+ "description": "Separately fetchable source-derived runtime LODs, bound to the master hash."
273
+ },
174
274
  "bounds": {
175
275
  "type": "object",
176
276
  "properties": {
@@ -2270,9 +2270,10 @@ Required: none
2270
2270
  "enum": [
2271
2271
  "none",
2272
2272
  "aces",
2273
- "agx"
2273
+ "agx",
2274
+ "neutral"
2274
2275
  ],
2275
- "description": "Tone-mapping operator: none, aces, or agx."
2276
+ "description": "Tone-mapping operator: none, aces, agx, or neutral (Khronos PBR Neutral: keeps authored base colors and saturation below the highlights)."
2276
2277
  },
2277
2278
  "exposure": {
2278
2279
  "type": "number",
@@ -326,6 +326,15 @@ Label-keyed deterministic prop placement (density, clustering, slope and clearan
326
326
  "additionalProperties": false,
327
327
  "description": "Noise-modulated density for natural clumps and clearings."
328
328
  },
329
+ "layer": {
330
+ "default": "canopy",
331
+ "type": "string",
332
+ "enum": [
333
+ "canopy",
334
+ "groundcover"
335
+ ],
336
+ "description": "Budget pool: canopy (trees, shrubs, rocks) shares the batch instance and model caps; groundcover (knee-high near detail such as tussocks and ferns) has its own, so it never thins the canopy."
337
+ },
329
338
  "slopeMax": {
330
339
  "type": "number",
331
340
  "minimum": 0,
package/dist/index.d.mts CHANGED
@@ -260,6 +260,10 @@ interface ScreenshotInput {
260
260
  clearColor?: string;
261
261
  /** Enable the viewer's shared procedural sky/ground reflections for PBR metals and glass. */
262
262
  reflections?: boolean;
263
+ /** Enable multisample antialiasing for fine model detail; default false for golden captures. */
264
+ antialias?: boolean;
265
+ /** Fit enabled sun shadows to loaded scene bounds; default false for existing captures. */
266
+ fitShadows?: boolean;
263
267
  }
264
268
  interface RenderStats {
265
269
  entitiesRendered: number;
@@ -298,6 +302,8 @@ interface AssetShotInput {
298
302
  clearColor?: string;
299
303
  /** Enable the viewer's shared procedural sky/ground reflection environment. */
300
304
  reflections?: boolean;
305
+ /** Enable multisample antialiasing for fine model detail; default false for golden captures. */
306
+ antialias?: boolean;
301
307
  outDir: string;
302
308
  }
303
309
  interface AssetShotOutput {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, G as schemaToTsType, H as describeOps, L as exportFrames, N as generateTypes, O as extractContentPack, P as renderTypesModule, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, W as checkScripts, X as stageAssets, Y as ASSET_INDEX_FILE, Z as screenshotAsset, a as lineupBatchDoc, at as findProjectFile, b as diffSnapshots, c as validateAsset, ct as loadSetupLike, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, ft as registerExperiencePlaySchema, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, lt as updateProjectFile, m as getSchemaOp, n as worldgenStats, nt as listAssets, o as loadStylePackFromDisk, ot as loadProject, p as getComponentOp, r as previewWorldgen, rt as assetFileIndex, s as simWatch, st as loadSceneDocument, tt as inspectAsset, u as testTypes, ut as parseExperiencePlayScenario, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as locateDocsRoot } from "./ops-2qoHKV54.mjs";
1
+ import { A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, G as schemaToTsType, H as describeOps, L as exportFrames, N as generateTypes, O as extractContentPack, P as renderTypesModule, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, W as checkScripts, X as stageAssets, Y as ASSET_INDEX_FILE, Z as screenshotAsset, a as lineupBatchDoc, at as findProjectFile, b as diffSnapshots, c as validateAsset, ct as loadSetupLike, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, ft as registerExperiencePlaySchema, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, lt as updateProjectFile, m as getSchemaOp, n as worldgenStats, nt as listAssets, o as loadStylePackFromDisk, ot as loadProject, p as getComponentOp, r as previewWorldgen, rt as assetFileIndex, s as simWatch, st as loadSceneDocument, tt as inspectAsset, u as testTypes, ut as parseExperiencePlayScenario, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as locateDocsRoot } from "./ops-CErtZh2t.mjs";
2
2
  import { access, copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { PNG } from "pngjs";
4
4
  import { dirname } from "node:path";
@@ -1,4 +1,4 @@
1
- import { $ as formatPacked, A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, F as previewFigure, H as describeOps, I as listFigurePresets, J as checkSoundbank, K as planAudio, L as exportFrames, M as bakeNetwork, N as generateTypes, O as extractContentPack, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, W as checkScripts, X as stageAssets, Z as screenshotAsset, _ as loadComponentRegistry, b as diffSnapshots, c as validateAsset, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, nt as listAssets, p as getComponentOp, q as importSound, r as previewWorldgen, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-2qoHKV54.mjs";
1
+ import { $ as formatPacked, A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, F as previewFigure, H as describeOps, I as listFigurePresets, J as checkSoundbank, K as planAudio, L as exportFrames, M as bakeNetwork, N as generateTypes, O as extractContentPack, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, W as checkScripts, X as stageAssets, Z as screenshotAsset, _ as loadComponentRegistry, b as diffSnapshots, c as validateAsset, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, nt as listAssets, p as getComponentOp, q as importSound, r as previewWorldgen, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-CErtZh2t.mjs";
2
2
  import { mkdtemp, readFile, rm } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import { z } from "zod";
@@ -6,7 +6,7 @@ import { applyUvPaint, bakeMatGraph, bakePalette, bakePixelGrid, bakeSvg } from
6
6
  import { TransportNetwork, ambientCapability, ambientOf, networkToDocument } from "@bendyline/molen-ambient/kernel";
7
7
  import { FIGURE_PRESET_IDS, deriveRig, descriptorKey, figuresScriptApi, generateFigureBody, installFigures, resolveFigureDescriptor, strideRateFor } from "@bendyline/molen-figures/kernel";
8
8
  import { heightfieldFromPng, terrainPyramidTileOrigin, terrainPyramidTileSize, wgs84ToWebMercatorTile, worldToWgs84 } from "@bendyline/molen-terrain/kernel";
9
- import { createLandmarkLibrary, encodeGlb, generateLandmarkModel, generateWorldgenBatch, groundSamplerForBatch, resolveStylePackDocuments, stylePackAssetIndex, stylePackMaterialRefs, validateStylePackBundle } from "@bendyline/molen-worldgen/kernel";
9
+ import { createLandmarkLibrary, encodeGlb, generateLandmarkModel, generateWorldgenBatch, groundSamplerForBatch, resolveStylePackDocuments, stylePackAssetIndex, validateStylePackBundle } from "@bendyline/molen-worldgen/kernel";
10
10
  import { createPlacesContent, createRegionResolver, semanticTileToBatch, tileGroundSampler, worldgenTileBudgetForQuality } from "@bendyline/molen-worldgen-earth/kernel";
11
11
  import { evaluateCameraTrack, registerCameraTrackSchema } from "@bendyline/molen-client/camera-track";
12
12
  import { createReadStream, watch } from "node:fs";
@@ -1043,12 +1043,17 @@ function buildStats(doc, sizeBytes) {
1043
1043
  const root = doc.getRoot();
1044
1044
  let triangles = 0;
1045
1045
  let vertices = 0;
1046
+ const positions = /* @__PURE__ */ new Set();
1046
1047
  let primitives = 0;
1047
1048
  for (const mesh of root.listMeshes()) {
1048
1049
  triangles += primTriangleCount(mesh);
1049
1050
  for (const prim of mesh.listPrimitives()) {
1050
1051
  primitives++;
1051
- vertices += prim.getAttribute("POSITION")?.getCount() ?? 0;
1052
+ const position = prim.getAttribute("POSITION");
1053
+ if (position && !positions.has(position)) {
1054
+ positions.add(position);
1055
+ vertices += position.getCount();
1056
+ }
1052
1057
  }
1053
1058
  }
1054
1059
  return {
@@ -1605,8 +1610,12 @@ async function inspectAsset(input) {
1605
1610
  } catch (e) {
1606
1611
  verifyErrors.push(`${trimesh.bin}: ${e.message}`);
1607
1612
  }
1613
+ if (sidecar.runtimeLods && sidecar.runtimeLods.masterHash !== sidecar.hash) verifyErrors.push("runtimeLods: stale master hash");
1614
+ for (const level of sidecar.runtimeLods?.levels ?? []) if (sidecar.files.variants[level.name] !== level.file) verifyErrors.push(`runtimeLods: missing or mismatched variant "${level.name}"`);
1608
1615
  for (const [name, file] of Object.entries(sidecar.files.variants)) try {
1609
- await readFile(join(dir, file));
1616
+ const bytes = await readFile(join(dir, file));
1617
+ const level = sidecar.runtimeLods?.levels.find((level) => level.name === name);
1618
+ if (level && (level.file !== file || level.bytes !== bytes.byteLength || level.hash !== sha256$2(bytes))) verifyErrors.push(`variant "${name}" (${file}): runtime LOD hash/size mismatch`);
1610
1619
  } catch (e) {
1611
1620
  verifyErrors.push(`variant "${name}" (${file}): ${e.message}`);
1612
1621
  }
@@ -2080,6 +2089,7 @@ async function screenshotAssetImpl(input) {
2080
2089
  terrain: null,
2081
2090
  clearColor: input.clearColor ?? "#181d24",
2082
2091
  reflections: input.reflections ?? false,
2092
+ antialias: input.antialias ?? false,
2083
2093
  assetsBaseUrl: `${server.url}/files/`,
2084
2094
  assetsIndex: { [sidecar.id]: modelUrlRel }
2085
2095
  };
@@ -7060,6 +7070,8 @@ async function screenshotSceneImpl(input) {
7060
7070
  terrain: terrainPayload ?? null,
7061
7071
  clearColor,
7062
7072
  reflections: input.reflections ?? false,
7073
+ antialias: input.antialias ?? false,
7074
+ fitShadows: input.fitShadows ?? false,
7063
7075
  assetsBaseUrl: filesRoot !== void 0 ? `${server.url}/files/` : null,
7064
7076
  assetsIndex: assetsIndex ?? null
7065
7077
  };
@@ -7639,10 +7651,39 @@ async function contentPacksFor(options = {}) {
7639
7651
  return openProjectPacks(project, { cwd });
7640
7652
  }
7641
7653
  /**
7654
+ * A pack source directory read in place: its id and roles from the settings file, and documents
7655
+ * straight from disk. Opening it as a `Pack` would read and hash every file it includes (for the
7656
+ * default worldgen pack, gigabytes of structure GLBs) only to find the few documents read here.
7657
+ */
7658
+ var SourceDirectory = class {
7659
+ label;
7660
+ manifest;
7661
+ constructor(label, manifest) {
7662
+ this.label = label;
7663
+ this.manifest = manifest;
7664
+ }
7665
+ async readJson(path) {
7666
+ const target = resolve(this.label, ...path.split("/"));
7667
+ if (!target.startsWith(this.label + sep)) throw new Error(`pack "${this.manifest.id}" has no file "${path}"`);
7668
+ return parseJson(await readFile(target, "utf8"));
7669
+ }
7670
+ };
7671
+ async function openSourceDirectory(dir) {
7672
+ const path = join(dir, PACK_SOURCE_FILE);
7673
+ const parsed = validate("pack-source", parseJson(await readFile(path, "utf8")));
7674
+ if (!parsed.ok) throw new Error(`${path}:\n${parsed.formatted}`);
7675
+ const provides = Object.fromEntries(Object.entries(parsed.value.provides).map(([role, paths]) => [role, typeof paths === "string" ? [paths] : [...paths]]));
7676
+ return new SourceDirectory(dir, {
7677
+ id: parsed.value.id,
7678
+ provides
7679
+ });
7680
+ }
7681
+ /**
7642
7682
  * A directory holding a pack's files: a pack source directory is used as it is; a built or
7643
7683
  * downloaded pack is extracted once into the cache, keyed by its content hash.
7644
7684
  */
7645
7685
  async function packDirectory(pack) {
7686
+ if (pack instanceof SourceDirectory) return pack.label;
7646
7687
  try {
7647
7688
  if ((await stat(pack.label)).isDirectory()) return pack.label;
7648
7689
  } catch {}
@@ -7659,9 +7700,11 @@ const isUrl = (path) => /^https?:\/\//.test(path);
7659
7700
  /** A path that names a content pack (built file, URL, or source directory) rather than a document. */
7660
7701
  async function asContentPack(path) {
7661
7702
  if (isUrl(path) || path.endsWith(".zip")) return openContentPack(path, process.cwd());
7703
+ let source = false;
7662
7704
  try {
7663
- if ((await stat(join(path, PACK_SOURCE_FILE))).isFile()) return openContentPack(path, process.cwd());
7705
+ source = (await stat(join(path, PACK_SOURCE_FILE))).isFile();
7664
7706
  } catch {}
7707
+ return source ? openSourceDirectory(resolve(path)) : void 0;
7665
7708
  }
7666
7709
  /** Where `role` comes from: the named pack when it provides it, else the project's packs. */
7667
7710
  async function providedBy(role, own, options) {
@@ -8265,7 +8308,7 @@ async function previewWorldgenImpl(input) {
8265
8308
  filesBaseUrl,
8266
8309
  assetIndex: stylePackAssetIndex(pack, filesBaseUrl),
8267
8310
  landmarks,
8268
- materialRefs: stylePackMaterialRefs(pack),
8311
+ materialRefs: [...new Set(output.buildings?.groups.map((group) => group.materialRef) ?? [])],
8269
8312
  ground: {
8270
8313
  y: groundY,
8271
8314
  minX: bounds.min[0] - extent,
@@ -1,4 +1,4 @@
1
- // AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:b0380d10a8b8df0cc2b0cebae737f44c86e3fbb7a30a1acf606a6284bfa573b6
1
+ // AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:df202d428a8486ff9a43e14cced88f3fe191c7855111ff634dc53bd18fe6f602
2
2
  // Regenerate after editing types/*.json; `molen types check` flags staleness.
3
3
  /** biome-ignore-all format: generated file (stable output beats house wrapping) */
4
4
  import { defineComponent, type JsonObject } from '@bendyline/molen-kernel';
@@ -566,7 +566,7 @@ export type EnvironmentData = {
566
566
  near?: number;
567
567
  far?: number;
568
568
  };
569
- toneMapping?: 'none' | 'aces' | 'agx';
569
+ toneMapping?: 'none' | 'aces' | 'agx' | 'neutral';
570
570
  exposure?: number;
571
571
  shadows?: 'off' | 'low' | 'medium' | 'high';
572
572
  };
@@ -577,7 +577,7 @@ type MolenEnvironmentData = {
577
577
  near?: number;
578
578
  far?: number;
579
579
  };
580
- toneMapping?: 'none' | 'aces' | 'agx';
580
+ toneMapping?: 'none' | 'aces' | 'agx' | 'neutral';
581
581
  exposure?: number;
582
582
  shadows?: 'off' | 'low' | 'medium' | 'high';
583
583
  };
@@ -189,21 +189,21 @@
189
189
  }
190
190
  ],
191
191
  "versions": {
192
- "@bendyline/molen-ambient": "0.0.7",
193
- "@bendyline/molen-client": "0.0.6",
194
- "@bendyline/molen-earth": "0.0.7",
195
- "@bendyline/molen-entities": "0.0.6",
196
- "@bendyline/molen-figures": "0.0.6",
197
- "@bendyline/molen-input-react": "0.0.6",
198
- "@bendyline/molen-kernel": "0.0.4",
199
- "@bendyline/molen-materials": "0.0.5",
200
- "@bendyline/molen-pack": "0.0.5",
201
- "@bendyline/molen-pathfinding": "0.0.4",
202
- "@bendyline/molen-physics-rapier": "0.0.4",
203
- "@bendyline/molen-schema": "0.0.4",
204
- "@bendyline/molen-terrain": "0.0.7",
205
- "@bendyline/molen-tooling": "0.0.7",
206
- "@bendyline/molen-worldgen": "0.0.6",
207
- "@bendyline/molen-worldgen-earth": "0.0.7"
192
+ "@bendyline/molen-ambient": "0.0.9",
193
+ "@bendyline/molen-client": "0.0.8",
194
+ "@bendyline/molen-earth": "0.0.9",
195
+ "@bendyline/molen-entities": "0.0.8",
196
+ "@bendyline/molen-figures": "0.0.8",
197
+ "@bendyline/molen-input-react": "0.0.8",
198
+ "@bendyline/molen-kernel": "0.0.6",
199
+ "@bendyline/molen-materials": "0.0.7",
200
+ "@bendyline/molen-pack": "0.0.7",
201
+ "@bendyline/molen-pathfinding": "0.0.6",
202
+ "@bendyline/molen-physics-rapier": "0.0.6",
203
+ "@bendyline/molen-schema": "0.0.6",
204
+ "@bendyline/molen-terrain": "0.0.9",
205
+ "@bendyline/molen-tooling": "0.0.9",
206
+ "@bendyline/molen-worldgen": "0.0.8",
207
+ "@bendyline/molen-worldgen-earth": "0.0.9"
208
208
  }
209
209
  }
@@ -1,4 +1,4 @@
1
- // AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:b0380d10a8b8df0cc2b0cebae737f44c86e3fbb7a30a1acf606a6284bfa573b6
1
+ // AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:df202d428a8486ff9a43e14cced88f3fe191c7855111ff634dc53bd18fe6f602
2
2
  // Regenerate after editing types/*.json; `molen types check` flags staleness.
3
3
  /** biome-ignore-all format: generated file (stable output beats house wrapping) */
4
4
  import { defineComponent, type JsonObject } from '@bendyline/molen-kernel';
@@ -566,7 +566,7 @@ export type EnvironmentData = {
566
566
  near?: number;
567
567
  far?: number;
568
568
  };
569
- toneMapping?: 'none' | 'aces' | 'agx';
569
+ toneMapping?: 'none' | 'aces' | 'agx' | 'neutral';
570
570
  exposure?: number;
571
571
  shadows?: 'off' | 'low' | 'medium' | 'high';
572
572
  };
@@ -567,7 +567,7 @@ type MolenEnvironmentData = {
567
567
  near?: number;
568
568
  far?: number;
569
569
  };
570
- toneMapping?: 'none' | 'aces' | 'agx';
570
+ toneMapping?: 'none' | 'aces' | 'agx' | 'neutral';
571
571
  exposure?: number;
572
572
  shadows?: 'off' | 'low' | 'medium' | 'high';
573
573
  };
@@ -567,7 +567,7 @@ type MolenEnvironmentData = {
567
567
  near?: number;
568
568
  far?: number;
569
569
  };
570
- toneMapping?: 'none' | 'aces' | 'agx';
570
+ toneMapping?: 'none' | 'aces' | 'agx' | 'neutral';
571
571
  exposure?: number;
572
572
  shadows?: 'off' | 'low' | 'medium' | 'high';
573
573
  };
@@ -1,4 +1,4 @@
1
- // AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:b70522198b174a3b63a4278018b4c5a78393d7b415abd606d033b1865c6431e2
1
+ // AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:a6c959df413f5be4b4335bf4d34fb37b1d04ce40dc6faa3cc2975728f3f22461
2
2
  // Regenerate after editing types/*.json; `molen types check` flags staleness.
3
3
  /** biome-ignore-all format: generated file (stable output beats house wrapping) */
4
4
  import { defineComponent, type JsonObject } from '@bendyline/molen-kernel';
@@ -566,7 +566,7 @@ export type EnvironmentData = {
566
566
  near?: number;
567
567
  far?: number;
568
568
  };
569
- toneMapping?: 'none' | 'aces' | 'agx';
569
+ toneMapping?: 'none' | 'aces' | 'agx' | 'neutral';
570
570
  exposure?: number;
571
571
  shadows?: 'off' | 'low' | 'medium' | 'high';
572
572
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/molen-tooling",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -61,19 +61,19 @@
61
61
  "pmtiles": "4.3.2",
62
62
  "pngjs": "^7.0.0",
63
63
  "quickhull3d": "3.1.1",
64
- "sharp": "0.35.4",
64
+ "sharp": "0.35.5",
65
65
  "zod": "^4.6.5",
66
- "@bendyline/molen-ambient": "0.0.7",
67
- "@bendyline/molen-figures": "0.0.6",
68
- "@bendyline/molen-kernel": "0.0.4",
69
- "@bendyline/molen-client": "0.0.6",
70
- "@bendyline/molen-materials": "0.0.5",
71
- "@bendyline/molen-pack": "0.0.5",
72
- "@bendyline/molen-physics-rapier": "0.0.4",
73
- "@bendyline/molen-worldgen": "0.0.6",
74
- "@bendyline/molen-terrain": "0.0.7",
75
- "@bendyline/molen-worldgen-earth": "0.0.7",
76
- "@bendyline/molen-schema": "0.0.4"
66
+ "@bendyline/molen-ambient": "0.0.9",
67
+ "@bendyline/molen-figures": "0.0.8",
68
+ "@bendyline/molen-client": "0.0.8",
69
+ "@bendyline/molen-materials": "0.0.7",
70
+ "@bendyline/molen-kernel": "0.0.6",
71
+ "@bendyline/molen-pack": "0.0.7",
72
+ "@bendyline/molen-schema": "0.0.6",
73
+ "@bendyline/molen-terrain": "0.0.9",
74
+ "@bendyline/molen-physics-rapier": "0.0.6",
75
+ "@bendyline/molen-worldgen": "0.0.8",
76
+ "@bendyline/molen-worldgen-earth": "0.0.9"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@biomejs/biome": "^2.5.0",