@bendyline/molen-tooling 0.0.4 → 0.0.5

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.
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- 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, Q as formatBytes, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, 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, s as simWatch, t as formatWorldgenStats, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-DMGcWoL2.mjs";
2
+ 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, Q as formatBytes, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, 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, s as simWatch, t as formatWorldgenStats, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-DHyZWZUE.mjs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { formatIssues } from "@bendyline/molen-schema";
@@ -1254,7 +1254,7 @@ async function cmdWorldgen(args) {
1254
1254
  return 2;
1255
1255
  }
1256
1256
  async function cmdMcp() {
1257
- const { startMcpServer } = await import("./mcp-BtuworIW.mjs");
1257
+ const { startMcpServer } = await import("./mcp-DKm1h9hD.mjs");
1258
1258
  await startMcpServer();
1259
1259
  return 0;
1260
1260
  }
@@ -51,8 +51,11 @@ Transitions have 15% hysteresis.
51
51
 
52
52
  Builtin vegetation uses three shared models in spatial cells; the far fir/conifer is 12 triangles
53
53
  and the far broadleaf crown is 20. Building cells use authored materials nearby, a single
54
- vertex-color material farther away, then remove window/door/trim faces while retaining walls,
55
- roof shapes and foundations. Cell bounds let frustum culling reject offscreen batches.
54
+ vertex-color material farther away (where window glass keeps a dark glass tone rather than turning
55
+ white, and buildings still cast shadows), then remove door, trim and detail faces while retaining
56
+ walls, roof shapes, foundations and windows, so a distant facade keeps its rows of windows. Cells
57
+ store positions as 16-bit offsets with one uniform scale per cell and normals as 8-bit values,
58
+ 20 bytes a vertex instead of 35. Cell bounds let frustum culling reject offscreen batches.
56
59
  These are conservative authored detail tolerances, not measured mesh-simplification error bounds.
57
60
 
58
61
  Terrain selection also culls by horizontal view direction. Mesh frustum culling and the GPU
@@ -60,6 +60,15 @@ Pass `reflections: false` for the legacy light-only appearance. A host-assigned
60
60
  compass bearing, 0 north and clockwise) place the sun, and unless `environment.sun.direction` is
61
61
  given the sunlight comes from the same point, so lit faces agree with the glow in the sky. `fog`,
62
62
  `water`, `background` and the rest of `environment` (ambient light, tone mapping, exposure) follow.
63
+ `ground` recolors the terrain package's bare-ground surface layers by name (for example
64
+ `{ lowland: '#8b9e70' }`), and `landcover` sets landcover class colors (forest, grass, park,
65
+ residential, commercial…) over the style pack's palette; an unlisted class falls back to a
66
+ neutral olive.
67
+
68
+ Buildings, trees and landmarks cast sun shadows onto everything around what the camera frames:
69
+ the orbit target (sized to the view), or a little ahead of the walker, car or aircraft. The
70
+ shadow map follows that focus in whole texels, so edges hold still as it moves. Adaptive quality
71
+ turns shadows off at its two lowest levels; `shadows: false` turns them off entirely.
63
72
 
64
73
  `touchJoystickContainer` adds an on-screen movement stick while walking, driving or flying. By default it
65
74
  appears only on touch devices; pass `touchJoystick: 'always'` to show it everywhere.
@@ -69,7 +78,10 @@ appears only on touch devices; pass `touchJoystick: 'always'` to show it everywh
69
78
  - **orbit** (default): the map camera from [camera navigation](navigation.md). `flyTo(target)`
70
79
  animates and `jumpTo(target)` moves at once. The target takes `latitude`, `longitude`, and
71
80
  optionally `range` in meters, `heading` (a compass bearing in radians) and `pitch` (radians of
72
- tilt below the horizon).
81
+ tilt below the horizon). The camera stays within `earthOrbitMaxRange(viewDistance)` of its target
82
+ (45% of the current performance tier's terrain view distance, at least 2 km), so it cannot pull
83
+ back past where the scene still draws; a farther `range` is clamped, and the limit follows
84
+ adaptive quality.
73
85
  - **walk**: `setMode('walk')` drops a walker at the view center. It has capsule collision against
74
86
  terrain, buildings and props, WASD or the touch stick to move, mouse-look with pointer lock, and
75
87
  Space to jump.
@@ -181,7 +193,10 @@ const view = await mountEarthView({
181
193
  });
182
194
  ```
183
195
 
184
- The host can return `archives` in the result to fetch tiles from its own PMTiles service. Keep
196
+ The host can return `archives` in the result to fetch tiles from its own PMTiles service
197
+ (`elevation`, `landcover`, `features`, and `buildingDetail` for a package's finer building tier;
198
+ see [terrain](terrain.md)). A building-detail archive that fails to open is reported as an error
199
+ and the view carries on with the feature tiles' own footprints. Keep
185
200
  pack attribution visible through `view.credits`, which follows the active terrain source. Listen
186
201
  for `terrainchange` to refresh an attribution panel when the package changes. Direct jumps and
187
202
  completed flights resolve the destination immediately; manual panning rechecks the host source
@@ -278,9 +293,13 @@ model eviction. `build-copernicus-bridge-evidence.py` and the capture runner's
278
293
  neither capture set substitutes altered heights to make a bridge fit. These reports are research
279
294
  evidence and are excluded from the Earth runtime pack.
280
295
 
281
- If `replaceFootprint` is set, a nongeneralized mapped building is suppressed only when the
282
- anchor falls inside its polygon and the replacement model has loaded. Failed models keep the
283
- procedural building. An Earth pack without a placement document still loads.
296
+ If `replaceFootprint` is set, a mapped building is suppressed only when the anchor falls inside
297
+ its polygon and the replacement model has loaded. Failed models keep the procedural building.
298
+ Generalized sources (Protomaps below zoom 15, and tiles overzoomed from them) merge neighboring
299
+ footprints, so there the polygon is suppressed only when neither side exceeds the loaded model's
300
+ horizontal extent by more than 1.6 times plus 12 meters; a larger polygon is a merged block of
301
+ other buildings and keeps its procedural shell. An Earth pack without a placement document still
302
+ loads.
284
303
 
285
304
  For unsurveyed orientation, `orientation: 'mapped'` requires an explicit
286
305
  `mapIdentity: { wikidata: 'Q…', maxDistance: 150 }`. The viewer admits that model only after a
@@ -320,8 +339,8 @@ uniformly scale native models, bounded from 0.2 to 5 times native dimensions; fo
320
339
  adjusts the three dimensions independently. Explicit source `direction`
321
340
  or compass bearings take priority; otherwise footprints use their longest axis and points
322
341
  default north. This default is an estimate, especially for rotatable turbine nacelles.
323
- Rules with `replaceFootprint: true` can also replace a nongeneralized footprint containing a
324
- matching POI, after the asset loads. This is useful when a windmill is a POI plus an unclassified
342
+ Rules with `replaceFootprint: true` can also replace a footprint containing a matching POI,
343
+ after the asset loads, under the same size rule for generalized footprints. This is useful when a windmill is a POI plus an unclassified
325
344
  building outline; the default leaves point features independent of building shells.
326
345
 
327
346
  The renderer admits at most 64 category models per tile and obeys each rule's smaller budget.
@@ -462,7 +481,28 @@ These regional forms are visual priors, not surveyed attributes of individual bu
462
481
  - `view.credits` holds the package's required attributions, OpenStreetMap first with its link.
463
482
  Keep them visible whenever the view is.
464
483
  - `quality: 'auto'` adapts terrain budgets, building detail and pixel ratio to measured frame
465
- times (`stats().qualityLevel`, 0-5). A preset pins the quality.
484
+ times (`stats().qualityLevel`, 0-5, with `stats().qualityReason`). A preset pins the quality.
485
+ It starts at `earthInitialQualityLevel()`: level 1 on touch devices and at 2 GiB or less, 2 at
486
+ 4 GiB, otherwise 3, and climbs no higher than `maxQualityLevel` (default 3; above it buildings
487
+ switch to the high preset, which rebuilds them across the view). Where the browser can time the GPU (`renderer.createGpuTimer()`), the view
488
+ reports GPU and CPU work per frame, so slow frames while tiles stream in lower the level only
489
+ when rendering itself is the cost; without GPU timing it goes by frame times alone. The view
490
+ first calibrates quickly, so a slow device settles within seconds. Once a level has held for
491
+ 12 s it turns sticky, because a level change swaps resolution and detail across the view: down
492
+ after 2.5 s of sustained overload, up after 20 s of headroom, at least 6 s apart. Any change
493
+ waits until the camera has been still for 0.6 s (at most 4 s); memory pressure above 1.25
494
+ applies it at once.
495
+ - Ground 20° past each side of the view stays loaded as bare terrain (the stream's
496
+ `peripheralDegrees`), so turning the camera reveals ground at once and its buildings and trees
497
+ follow.
498
+ - Memory pressure (`stats().memoryPressure`) is the geometry on screen over `memoryBudget`, a
499
+ fixed per-device budget: `earthMemoryBudget()` gives 96 MiB per GiB the browser reports within
500
+ 192–768 MiB, or 256 MiB on touch devices and 512 MiB elsewhere without a report. Above 1 the
501
+ level steps down, and since stepping down selects fewer, coarser tiles, pressure falls rather
502
+ than cascading to the minimum. The terrain cache keeps at least the budget, so ground just left
503
+ is still warm when the view pans back.
504
+ - `stats().worldgen` counts styled building generation since the current terrain stream started
505
+ (with content packs): tiles generated, buildings drawn as geometry, and instanced stand-ins.
466
506
  - `setPaused(true)` stops rendering while the view is hidden, and `dispose()` releases the GPU
467
507
  context, workers and listeners. Mounting is abortable through `signal`.
468
508
 
@@ -4,8 +4,11 @@
4
4
  pins, labels you render to images, waypoints. A marker keeps a constant on-screen size. It sits on
5
5
  the ground, re-snapping as finer terrain streams in, hides behind hills and buildings through the
6
6
  depth test, and can fade with distance. With `declutter: true` a pin whose on-screen footprint
7
- overlaps a more important one is hidden: higher `priority` first, then pins already on screen (so
8
- they do not flicker as the camera moves), then the nearest. The Earth view declutters its markers. They ignore the scene's fog, so distance haze never washes a
7
+ overlaps a more important one is hidden: higher `priority` first, then pins already on screen, then
8
+ the nearest. A pin on screen keeps its place until the inner part of its footprint is covered,
9
+ while a newcomer needs its whole footprint clear, so pins do not flicker as the camera moves. Pins
10
+ fade in and out over `fadeMs` (default 180; 0 pops), and a pin fading out no longer takes taps.
11
+ The Earth view declutters its markers. They ignore the scene's fog, so distance haze never washes a
9
12
  pin into a blank card; the layer's own `fade` handles distance. Markers are budgeted so the nearest or most important ones
10
13
  draw, and `pick(x, y)` resolves a click or tap to a marker id.
11
14
 
@@ -48,7 +48,10 @@ zoom). Motion eases toward a goal, so every change feels smooth.
48
48
  `flyTo({ target, range, heading, pitch }, { durationMs })` animates to a framing. It rises
49
49
  mid-flight on long hops so the camera clears the scenery, and any direct input cancels it.
50
50
  `set(state)` jumps immediately, and `state` reads the current framing. The target settles onto the
51
- ground as finer terrain arrives, and the camera never dips below `minClearance`.
51
+ ground as finer terrain arrives, and the camera never dips below `minClearance`. `minRange` and
52
+ `maxRange` (default 20 m and 400 km) bound the distance; `setRangeLimits({ minRange, maxRange })`
53
+ changes them later, for example when the distance a scene draws changes, and a camera outside the
54
+ new limits eases back inside them. `rangeLimits` reads them.
52
55
 
53
56
  ## Fly
54
57
 
@@ -88,6 +88,11 @@ When enabled, sky lighting replaces `environment.ambient` and `environment.sun`.
88
88
  instead. Sunlight fades around the horizon; moonlight depends on altitude, phase and darkness.
89
89
  Only the Sun casts a sky shadow in phase 1. Shadows also require `environment.shadows` and
90
90
  scene geometry that casts/receives shadows; their local frustum follows the camera.
91
+ `renderer.setShadowQuality('off' | 'low' | 'medium' | 'high')` turns sun shadows on or off at a
92
+ map resolution without rebuilding the environment, and `renderer.setShadowFocus({ center,
93
+ radius })` aims them at a point in absolute world coordinates covering ±`radius` meters — for a
94
+ large world, what the camera frames rather than the camera itself. The box moves in whole
95
+ shadow-map texels so edges do not shimmer; `setShadowFocus(undefined)` restores the default.
91
96
  `sun.visible`/`moon.visible` control the disks independently of lighting. Use the corresponding
92
97
  light intensity to disable illumination. `sun.size` and `moon.size` are visual multipliers;
93
98
  the default 1 preserves real angular size. Larger values help stylized scenes and small displays.
@@ -99,7 +99,9 @@ await surfaces.setOptions({
99
99
  ## What is drawn
100
100
 
101
101
  - Modern streets use asphalt, exposed shoulder strips, curb/sidewalk bands, lane dividers, edge paint, stop
102
- bars and zebra crossings. Mapped paths are cut at same-grade carriageway edges, so footway
102
+ bars and zebra crossings. Shoulders, like the other street details, are drawn on the finest
103
+ detail tiles only: a few decimeters wide, they are below a pixel on the coarser tiles kilometers
104
+ away, where draping them segment by segment once cost more memory than the roads themselves. Mapped paths are cut at same-grade carriageway edges, so footway
103
105
  fills cannot compete with asphalt at walking height; paths beneath bridges remain continuous.
104
106
  Nearby nodes on divided roads form one junction; crossings follow
105
107
  the external approaches, and short turning links receive no independent crossings. Same-grade
@@ -176,7 +176,9 @@ movement trigger coherent grid-snapped rebases for every engine-owned object aut
176
176
 
177
177
  `terrainStreamBudgetForQuality('economy' | 'balanced' | 'high')` returns portable residency and
178
178
  concurrency budgets. `stream.stats()` reports decoded samples, geometry bytes, triangles, draw
179
- calls, instances, loading/failure counts, and evictions for live quality diagnostics.
179
+ calls, instances, loading/failure counts, and evictions for live quality diagnostics. It walks
180
+ every resident tile's objects to count them, so call it for diagnostics, not every frame:
181
+ `stream.loading()` (tiles and layers loading now) and `stream.pressure()` are constant-time.
180
182
 
181
183
  ## 4. Screenshot it headlessly
182
184
 
@@ -295,15 +297,28 @@ function frame(position: [number, number, number]) {
295
297
 
296
298
  The selector measures projected source-sample spacing, adapts its error/range to the selected-tile
297
299
  budget, requests ancestors before descendants, and retains a displayed parent until all selected
298
- descendant coverage is resident. `stream.stats()` adds selected/displayed counts, effective
300
+ descendant coverage is resident. A selected tile that is not resident yet shows through its
301
+ nearest cached ancestor, except where finer ground is already on screen over it, which stays until
302
+ the tile arrives. When the warm cache has lost the intermediate levels, that ancestor can be far
303
+ coarser than the view; it stands in only if it would not hide detail on screen elsewhere, and
304
+ otherwise the new tile's patch waits briefly empty rather than the whole area dropping to the
305
+ coarse tile. `stream.stats()` adds selected/displayed counts, effective
299
306
  screen-space error, displayed-level range, and leaf fallback count. Quality presets set explicit
300
307
  error, view-distance, concurrency, selection, and residency budgets. Include `direction` and
301
308
  `aspect` in each view update to reject tiles safely outside a guarded horizontal camera cone while
302
- retaining direction-independent coarse coverage to the configured distance. In-flight surface
309
+ retaining direction-independent coarse coverage to the configured distance. `peripheralDegrees`
310
+ widens that cone for ground only: tiles up to that many degrees past it stay selected at reduced
311
+ detail (`peripheralDetail`, default 0.4, weighs their error) as bare terrain, without layers, so
312
+ turning the camera reveals ground that is already there; layers build once the tile is in view. In-flight surface
303
313
  requests finish into a bounded warm cache instead of being restarted on every small camera turn;
304
314
  hidden cached tiles are evicted only when capacity is needed. Sparse descendants also share a
305
315
  bounded decoded-ancestor cache, avoiding repeated PNG decode/resample work while panning.
306
316
 
317
+ With `shadows: true` every tile surface and layer mesh receives sun shadows, and layer meshes
318
+ taller than `shadowCasterHeight` (default 1.5 m: buildings, trees, landmarks) cast them. A layer
319
+ marks draped parts with `userData.shadowCaster = false` (inherited by their children; landcover,
320
+ water and road surfaces are marked) and water with `userData.shadowReceiver = false`.
321
+
307
322
  `TerrainPyramidTileLayer` provides the same classification/hydrology/human-feature lifecycle over
308
323
  adaptive tiles. Its optional inclusive `minLevel`/`maxLevel` bounds keep expensive decoration off
309
324
  coarse fallback and horizon tiles. Layer objects become visible only with their selected surface,
@@ -362,6 +377,39 @@ ancestors, since one ancestor serves up to four children at a time. Layers creat
362
377
  `createTerrainPackageSemanticLayers` then reach the package's `maxLevel`; pass `overzoom: false`
363
378
  to stop them at the sidecar's levels.
364
379
 
380
+ Basemaps also generalize buildings below their last zoom: Protomaps keeps almost no footprints
381
+ below zoom 15, so a zoom-13 or zoom-14 feature tile shows streets and trees but no houses. A
382
+ package can carry that last zoom separately, often only near where people look, as a building
383
+ detail sidecar:
384
+
385
+ ```json
386
+ "features": {
387
+ "source": { "kind": "pmtiles-set", "url": "https://tiles.example/archive-set.json" },
388
+ "encoding": "mvt",
389
+ "layers": ["water", "transportation", "building", "poi"],
390
+ "profile": "protomaps-basemap@1",
391
+ "buildingDetail": {
392
+ "source": { "kind": "pmtiles-set", "url": "https://tiles.example/hd/archive-set.json" },
393
+ "level": 15
394
+ }
395
+ }
396
+ ```
397
+
398
+ The human-feature layer then takes its buildings and places from the detail level for tiles up to
399
+ two levels coarser (`buildingDetail: { maxDepth }` on `createTerrainPackageSemanticLayers`, or
400
+ `false` to keep the generalized footprints); roads, water and land use stay as the feature tiles
401
+ have them. `composeTerrainBuildingDetail` assembles a coarser tile from its detail descendants
402
+ (4 or 16 tiles): a footprint seen by several descendants is matched by its source id and its
403
+ clipped copies are unioned, so each building appears once, whole, cut exactly where a real tile
404
+ at the coarser level with a proportionally narrower buffer would cut it. `buildingSourceLevel` on
405
+ the composed tile tells renderers that narrower buffer, so tile-edge ownership still agrees between
406
+ neighbours. Descendants the archive lacks keep the coarse tile's buildings in their part of the
407
+ tile. `createBuildingDetailTerrainSemanticSource` wraps any feature source this way and keeps
408
+ recently loaded detail tiles, since a tile and its children share them. Only the `building` and
409
+ `poi` layers of detail tiles are decoded. The detail archive is optional: if it cannot be opened,
410
+ `openTerrainPackageSemantics` reports `buildingDetailError` and the feature tiles carry on alone.
411
+ Hosts with their own transport pass `buildingDetailArchive`.
412
+
365
413
  The package elevation pyramid may be sparse. `createTerrainPackagePyramidHeightSource` walks to the
366
414
  nearest declared ancestor when an exact tile is absent, then crops and resamples that ancestor into
367
415
  the requested tile bounds. This supports broad coarse coverage plus a small regional detail window
@@ -329,22 +329,35 @@ Containment is a spatial inference because stock Protomaps does not publish pare
329
329
 
330
330
  ## 8. Budgets and quality
331
331
 
332
- `worldgenTileBudgetForQuality(quality, levelBelowMax)` caps buildings and vertices per tile.
333
- Building batches reserve simple architecture before allocating extra detail to the largest
334
- footprints. The budget fallback preserves the authored footprint, roof shape, and (where the
335
- active style tier permits them) up to three window columns and two rows per wall, using shared
336
- vertex-colored materials during reservation. Eligible simplified buildings recover their shared
337
- textures when material groups fit, even if no geometric detail fits. High admits 24 material
338
- groups at the finest level, including flat fallback slots. The fallback omits raised window
339
- surrounds, trim bands, overhangs, separate foundation meshes, and roof
340
- props. Simplified and coarse buildings extend their walls below the lowest sampled ground,
341
- keeping roofs and windows level without gaps on downhill sides or extra vertices and draw calls.
342
- Box fallbacks do the same; intentionally elevated `minHeight` parts retain their clearance.
343
- `detailedCount` limits eligibility for extra detail; it no longer turns all later buildings into
344
- boxes. Vertex and material-group caps still apply, with boxes used when the simple geometry
345
- cannot fit or the requested tier is beyond the style's last tier. Buildings beyond
346
- `maxBuildings` are still omitted. Quality and detail remain tile-based, not camera-distance
347
- updates per building.
332
+ `worldgenTileBudgetForQuality(quality, levelBelowMax)` caps buildings and vertices per tile. The
333
+ numbers are sized for real footprints: a zoom-15 suburb puts 800 to 1,600 houses in a zoom-14
334
+ tile, and a downtown about 1,700 footprints and parts.
335
+
336
+ A batch spends its budget in priority order, largest footprints first. First every building gets
337
+ walls and its roof shape (the style's coarsest tier); only when even that does not fit does a
338
+ building become an instanced stand-in. Then buildings gain a simplified facade while it fits, then
339
+ the largest (`detailedCount`) gain full detail. The simplified facade preserves the authored
340
+ footprint, roof shape and, where the active style tier permits them, a window on every floor:
341
+ walls with up to three bays keep their real windows, and longer walls draw each floor's punched or
342
+ grid windows as one strip whose window texture repeats once per bay, four vertices a floor and
343
+ wall. It uses shared vertex-colored materials during reservation; eligible simplified buildings
344
+ recover their shared textures when material groups fit, even if no geometric detail fits. Interior
345
+ openings come with full detail only: cut into every budget facade they would cost a crowded
346
+ neighbourhood its windows. High admits 24 material groups at the finest level, including flat
347
+ fallback slots. The fallback omits raised window surrounds, trim bands, overhangs, separate
348
+ foundation meshes, and roof props. Simplified and coarse buildings extend their walls below the
349
+ lowest sampled ground, keeping roofs and windows level without gaps on downhill sides or extra
350
+ vertices and draw calls. Stand-ins do the same; intentionally elevated `minHeight` parts retain
351
+ their clearance.
352
+
353
+ Stand-ins are instanced: `builtin:box` for flat-roofed buildings, and `builtin:box.gable` (set
354
+ `buildings:box.gable`) for pitched ones, a box whose walls stop at the eave (`GABLE_BOX_EAVE` of
355
+ its height) under a roof ridged along its longer side, the roof shaded darker than the walls. From
356
+ the air a neighbourhood of stand-ins still reads as roofs. `buildingBoxGeometry(modelRef)` returns
357
+ the shared geometry for either. Buildings beyond `maxBuildings` are still omitted. Quality and
358
+ detail remain tile-based, not camera-distance updates per building. `worldgenBuildingCellSize`
359
+ batches the finest level's buildings into 512 m cells and coarser levels' into 1024 m cells, since
360
+ each cell is a draw.
348
361
 
349
362
  Generation is cooperative: the renderer yields between chunks of both reservation and detail
350
363
  work, and aborts when a tile is evicted. The explorer HUD reports buildings, boxes, and generation
@@ -353,7 +366,7 @@ time per tile.
353
366
  Detail tiers come from the level below the finest (tier 0 at the finest level, 1 one level
354
367
  below, ...) plus one at economy quality. A style's `lod.tiers` say which features survive each
355
368
  tier: roof shape, roof features, facade windows, facade bands, props; beyond the last tier the
356
- building is a tinted box. `maxMaterialGroups` caps the mesh groups (draw calls) of one batch:
369
+ building is a stand-in. `maxMaterialGroups` caps the mesh groups (draw calls) of one batch:
357
370
  once a batch would exceed it, later buildings render their textured parts as vertex colors
358
371
  (`stats.materialsCollapsed`), so the largest buildings keep their textures first.
359
372
 
@@ -682,6 +682,108 @@ Installable tiled-world package: coordinate space, elevation, optional semantic
682
682
  "type": "string",
683
683
  "const": "protomaps-basemap@1",
684
684
  "description": "Attribute profile of the tiles; always 'protomaps-basemap@1' when set."
685
+ },
686
+ "buildingDetail": {
687
+ "type": "object",
688
+ "properties": {
689
+ "source": {
690
+ "anyOf": [
691
+ {
692
+ "type": "object",
693
+ "properties": {
694
+ "kind": {
695
+ "type": "string",
696
+ "const": "pmtiles",
697
+ "description": "Archive kind; always 'pmtiles'."
698
+ },
699
+ "path": {
700
+ "type": "string",
701
+ "minLength": 1,
702
+ "description": "Package-relative path of the PMTiles archive."
703
+ }
704
+ },
705
+ "required": [
706
+ "kind",
707
+ "path"
708
+ ],
709
+ "additionalProperties": false
710
+ },
711
+ {
712
+ "type": "object",
713
+ "properties": {
714
+ "kind": {
715
+ "type": "string",
716
+ "const": "pmtiles",
717
+ "description": "Archive kind; always 'pmtiles'."
718
+ },
719
+ "url": {
720
+ "type": "string",
721
+ "format": "uri",
722
+ "description": "Absolute URL of the PMTiles archive."
723
+ }
724
+ },
725
+ "required": [
726
+ "kind",
727
+ "url"
728
+ ],
729
+ "additionalProperties": false
730
+ },
731
+ {
732
+ "type": "object",
733
+ "properties": {
734
+ "kind": {
735
+ "type": "string",
736
+ "const": "pmtiles-set",
737
+ "description": "Archive kind 'pmtiles-set': a molen/archive-set@1 document naming many archives."
738
+ },
739
+ "path": {
740
+ "type": "string",
741
+ "minLength": 1,
742
+ "description": "Package-relative path of the archive-set document."
743
+ }
744
+ },
745
+ "required": [
746
+ "kind",
747
+ "path"
748
+ ],
749
+ "additionalProperties": false
750
+ },
751
+ {
752
+ "type": "object",
753
+ "properties": {
754
+ "kind": {
755
+ "type": "string",
756
+ "const": "pmtiles-set",
757
+ "description": "Archive kind 'pmtiles-set': a molen/archive-set@1 document naming many archives."
758
+ },
759
+ "url": {
760
+ "type": "string",
761
+ "format": "uri",
762
+ "description": "Absolute URL of the archive-set document."
763
+ }
764
+ },
765
+ "required": [
766
+ "kind",
767
+ "url"
768
+ ],
769
+ "additionalProperties": false
770
+ }
771
+ ],
772
+ "description": "Archive holding finer feature tiles read only for building footprints and places."
773
+ },
774
+ "level": {
775
+ "type": "integer",
776
+ "minimum": 0,
777
+ "maximum": 30,
778
+ "description": "The one level the archive is read at (e.g. 15, where Protomaps keeps every building)."
779
+ }
780
+ },
781
+ "required": [
782
+ "source",
783
+ "level"
784
+ ],
785
+ "additionalProperties": false,
786
+ "description": "Optional finer tiles for buildings: basemaps generalize footprints below their last zoom, so coarser feature tiles take their buildings from this level where it has tiles."
685
787
  }
686
788
  },
687
789
  "required": [
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-DMGcWoL2.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-DHyZWZUE.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-DMGcWoL2.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-DHyZWZUE.mjs";
2
2
  import { mkdtemp, readFile, rm } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import { z } from "zod";
@@ -8108,7 +8108,7 @@ function worldgenPreviewBounds(output, landmarks = {}) {
8108
8108
  if (positions !== void 0) for (let index = 0; index + 2 < positions.length; index += 3) include(positions[index], positions[index + 1], positions[index + 2]);
8109
8109
  for (const set of output.placements) {
8110
8110
  const model = set.modelRef.startsWith("builtin:") ? generateLandmarkModel(set.modelRef.slice(8), landmarks) : void 0;
8111
- const points = set.modelRef === "builtin:box" || set.modelRef.startsWith("builtin:tree.mapped.") ? [
8111
+ const points = set.modelRef === "builtin:box" || set.modelRef === "builtin:box.gable" || set.modelRef.startsWith("builtin:tree.mapped.") ? [
8112
8112
  -.5,
8113
8113
  0,
8114
8114
  -.5,
@@ -189,21 +189,21 @@
189
189
  }
190
190
  ],
191
191
  "versions": {
192
- "@bendyline/molen-ambient": "0.0.4",
193
- "@bendyline/molen-client": "0.0.4",
194
- "@bendyline/molen-earth": "0.0.4",
195
- "@bendyline/molen-entities": "0.0.4",
196
- "@bendyline/molen-figures": "0.0.4",
197
- "@bendyline/molen-input-react": "0.0.4",
192
+ "@bendyline/molen-ambient": "0.0.5",
193
+ "@bendyline/molen-client": "0.0.5",
194
+ "@bendyline/molen-earth": "0.0.5",
195
+ "@bendyline/molen-entities": "0.0.5",
196
+ "@bendyline/molen-figures": "0.0.5",
197
+ "@bendyline/molen-input-react": "0.0.5",
198
198
  "@bendyline/molen-kernel": "0.0.4",
199
199
  "@bendyline/molen-materials": "0.0.4",
200
200
  "@bendyline/molen-pack": "0.0.4",
201
201
  "@bendyline/molen-pathfinding": "0.0.4",
202
202
  "@bendyline/molen-physics-rapier": "0.0.4",
203
203
  "@bendyline/molen-schema": "0.0.4",
204
- "@bendyline/molen-terrain": "0.0.4",
205
- "@bendyline/molen-tooling": "0.0.4",
206
- "@bendyline/molen-worldgen": "0.0.4",
207
- "@bendyline/molen-worldgen-earth": "0.0.4"
204
+ "@bendyline/molen-terrain": "0.0.5",
205
+ "@bendyline/molen-tooling": "0.0.5",
206
+ "@bendyline/molen-worldgen": "0.0.5",
207
+ "@bendyline/molen-worldgen-earth": "0.0.5"
208
208
  }
209
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/molen-tooling",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -63,17 +63,17 @@
63
63
  "quickhull3d": "3.1.1",
64
64
  "sharp": "0.35.4",
65
65
  "zod": "^4.6.5",
66
- "@bendyline/molen-ambient": "0.0.4",
67
- "@bendyline/molen-client": "0.0.4",
66
+ "@bendyline/molen-ambient": "0.0.5",
67
+ "@bendyline/molen-client": "0.0.5",
68
68
  "@bendyline/molen-kernel": "0.0.4",
69
+ "@bendyline/molen-materials": "0.0.4",
69
70
  "@bendyline/molen-pack": "0.0.4",
71
+ "@bendyline/molen-figures": "0.0.5",
70
72
  "@bendyline/molen-physics-rapier": "0.0.4",
71
- "@bendyline/molen-materials": "0.0.4",
73
+ "@bendyline/molen-terrain": "0.0.5",
72
74
  "@bendyline/molen-schema": "0.0.4",
73
- "@bendyline/molen-figures": "0.0.4",
74
- "@bendyline/molen-terrain": "0.0.4",
75
- "@bendyline/molen-worldgen": "0.0.4",
76
- "@bendyline/molen-worldgen-earth": "0.0.4"
75
+ "@bendyline/molen-worldgen": "0.0.5",
76
+ "@bendyline/molen-worldgen-earth": "0.0.5"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@biomejs/biome": "^2.5.0",