@bendyline/molen-tooling 0.0.17 → 0.0.19

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.
@@ -20,8 +20,10 @@ of being mistaken for normal rendering. A second pause within a minute of render
20
20
 
21
21
  Frame times cannot show a level that streams more than it can hold: that work runs outside the
22
22
  frame. A host reports it as `strained` in each sample (the explorer does when half of the
23
- tiles built over ten seconds had been evicted and rebuilt, or when the view fills most of a full
24
- terrain cache). Strain blocks upgrades at once and, sustained for `strainDelayMs` (10 s), lowers
23
+ tiles built over ten seconds had been evicted within the minute before, the terrain stream's
24
+ `thrashedTiles`, or when the view fills most of a full terrain cache). Ground built again
25
+ minutes after it was evicted (`rebuiltTiles` counts it too) is a flight coming back, not strain:
26
+ over a session in one region it becomes nearly every tile built. Strain blocks upgrades at once and, sustained for `strainDelayMs` (10 s), lowers
25
27
  detail with the reason `'streaming'`. `upgradeWorkFraction` (default 0.9) is the share of the
26
28
  target that measured frame work must stay under before a step up.
27
29
  While content streams, slow frames lower detail only when the measured CPU/GPU frame work is itself
@@ -41,13 +43,21 @@ controller's thresholds both ways, Balanced to Medium to Balanced to High in fou
41
43
  step a change of resolution, shadows and terrain detail across the whole view, and a slow takeoff
42
44
  roll left a fast laptop at the lowest tiers for the rest of the flight.
43
45
 
44
- Three things still lower the tier, one step at a time and for good: displayed content over the
45
- memory budget, streaming strain, and frames under 30 a second for ten seconds running, which is a
46
- device the guess was wrong about rather than a busy moment. Slow frames while content loads count
47
- only when frame work itself is heavy, and long stalls never do. Nothing raises the tier: High is a
48
- manual preset (Ultra, whose view alone holds most of the terrain cache, is reached only with
49
- `?tier=5`). Choosing Auto again in the quality menu makes the guess afresh. Manual presets remain
50
- fixed.
46
+ Three things still lower the tier, one step at a time: displayed content over the memory budget,
47
+ streaming strain, and frames under 30 a second for ten seconds running. Slow frames while content
48
+ loads count only when frame work itself is heavy, and long stalls never do. A lowered tier comes
49
+ back one step at a time, never past the guess, once the view has been calm for most of a minute:
50
+ frames at 45 a second or better, frame work within 20 ms, no streaming strain, and displayed
51
+ content within three quarters of the memory budget. A hitch (a frame over 100 ms) costs a couple of
52
+ seconds of that minute rather than restarting it. A tier lost again within three
53
+ minutes of coming back waits twice as long the next time (up to ten minutes), so a device or a
54
+ place that cannot hold it does not flip back and forth. Each lowering used to be for good, and the
55
+ busy moments behind them pass: a ten-minute circle over Seattle lost a tier over downtown and kept
56
+ the lower one at 50 frames a second for the rest of the flight, and a longer session went the same
57
+ way down to Minimum, where a street view shows bare ground with no buildings near and has nothing
58
+ left to load. Nothing raises the tier past the guess: High is a manual preset (Ultra, whose view
59
+ alone holds most of the terrain cache, is reached only with `?tier=5`, which also holds that tier).
60
+ Choosing Auto again in the quality menu makes the guess afresh. Manual presets remain fixed.
51
61
 
52
62
  The explorer applies a tier's resolution, terrain, building, surface and shadow changes over
53
63
  separate frames. The embeddable Earth view keeps its own policy: a default ceiling of Balanced
@@ -237,6 +237,11 @@ frame the engine starts. Every other rotor (helicopter main and tail rotors, and
237
237
  binds as rotors) blurs between 35 and 78 rad/s instead: its blades fade into a faint disc with a
238
238
  slightly darker tip ring, sized from the model, and its hub stays solid.
239
239
 
240
+ Neither casts a sun shadow while it turns fast. A fading propeller's blades leave the shadow
241
+ pass, and so does a rotor above 20 rad/s, hub and all: its blades, grips and pitch links turned
242
+ up to half their spacing between frames, and their hard shadows flashed about the cabin (an
243
+ OH-6's four blades at 50 rad/s, 48 degrees a frame). A slow rotor's shadow turns with it.
244
+
240
245
  For powered lift, declare `spec.poweredLift` with positive `transitTime`, `controlFadeSpeed`,
241
246
  `pitchAuthority`, `rollAuthority`, `yawAuthority` and `damping`, and mark the participating
242
247
  forward-facing engine installations `vectored: true`. `aircraftInput.thrustVector` is 0–1;
@@ -758,14 +763,25 @@ Glass casts no sun shadow: a mesh whose materials all blend at less than full op
758
763
  name contains `canopy` or `bubble`. Three's shadow pass draws a pane as solid, so a windscreen
759
764
  shaded its whole cockpit.
760
765
 
761
- For the aircraft a view follows (flown or watched), hosts also pass `renderer.shadowTexelSize`
762
- to `visual.updateShadows(texel)` each frame, and `undefined` for every other aircraft. Over a
763
- wide view the sun's shadow map coarsens (on High, 0.2 m texels 100 m above the ground, 1.6 m in
764
- cruise at 2,500 ft). It then cannot resolve the aircraft's own canopy frame and seat, and their
765
- shadows on the cockpit jumped from frame to frame as the aircraft crossed the map's texel grid.
766
- Coarser than 0.15 m, the aircraft casts no sun shadow; at 0.12 m or finer it casts again. It
767
- still receives shadows from terrain, buildings and clouds. The Earth view and the world explorer
768
- do this for the mounted aircraft.
766
+ The flown aircraft casts its sun shadow from a map of its own, which travels with it: hosts pass
767
+ `EarthAircraft.shadowSubject` (its model and measured sphere, `undefined` while none is flown) to
768
+ `renderer.setShadowSubject` each frame, as for the driven car. The sun's main map is fixed to the
769
+ ground, and an aircraft crossing it lands on different texels every frame: an OH-6 30 m up is in
770
+ 7 cm texels, and the canopy frame's shade crawled over its panel. Its own map holds it at about
771
+ 13 mm a texel (up to 2048 texels across for a larger aircraft, where the main map has as many),
772
+ and its ground shadow reaches ten times its radius down the light before it fades. See
773
+ [the sky guide](sky.md) for the map itself. WebGL only: `setShadowSubject` returns false on
774
+ WebGPU, and the rule below applies there instead.
775
+
776
+ Without that map, for the aircraft a view follows (flown or watched), hosts pass
777
+ `renderer.shadowTexelSize` to `visual.updateShadows(texel)` each frame, and `undefined` for every
778
+ other aircraft. Over a wide view the sun's shadow map coarsens (on High, 0.2 m texels 100 m above
779
+ the ground, 1.6 m in cruise at 2,500 ft). It then cannot resolve the aircraft's own canopy frame
780
+ and seat, and their shadows on the cockpit jumped from frame to frame as the aircraft crossed the
781
+ map's texel grid. Coarser than 0.15 m, the aircraft casts no sun shadow; at 0.12 m or finer it
782
+ casts again. It still receives shadows from terrain, buildings and clouds. The Earth view and
783
+ the world explorer do this for the mounted aircraft, and pass `undefined` while it has its own
784
+ map.
769
785
 
770
786
  `createAircraftVisual` exposes `cockpit`, a mesh picker and control inventory derived from the
771
787
  interior's authored primary-input bindings and glTF node `extras.aircraftControl` metadata.
@@ -782,6 +798,12 @@ through `flyAircraft`, and mix `AircraftPointerAxes` with their keyboard/gamepad
782
798
  release must clear transient axes. The binder cancels drags on exit, view change, blur and pointer
783
799
  cancellation; it does not write simulation components directly.
784
800
 
801
+ The same inventory drives the [vehicle console](vehicle-console.md)'s touch controls, which copy
802
+ the modeled stick, pedals and levers out of the cockpit and pose them from `AircraftVisual.signals`
803
+ (the readings the cockpit was last posed with). The console works the controls in any view, so the
804
+ Earth view's `EarthAircraft.controlSession()` is the cockpit session without its cockpit-view
805
+ check.
806
+
785
807
  In the engine repository, build the client and kernel, then run a local live review of all 54 bundled aircraft:
786
808
 
787
809
  ```sh
@@ -1,13 +1,14 @@
1
1
  # Inferred building interiors
2
2
 
3
- World explorer enables lazy interiors in the styled **Human** layer: choose **Walk**, approach
4
- a building, and walk through its framed entrance. Near the entrance, the windows become
5
- transparent and reveal the same interior you can enter.
3
+ World explorer enables lazy interiors in the styled **Human** layer: choose **Walk**, walk up to
4
+ a building's front door, press **E** to open it, and walk in. Near the entrance, the windows
5
+ become transparent and reveal the same interior you can enter.
6
6
 
7
7
  `?interiors=0` disables this capability. `?synthetic=1&stores=1` provides a repeatable block of recognizable
8
- stores; `test/visual/interiors.play.json` walks into and out of its fast-food restaurant and grocery store.
8
+ stores; `test/visual/interiors.play.json` opens the doors of its fast-food restaurant and grocery
9
+ store, walks in, and walks back out.
9
10
  Use `?synthetic=1&houses=1` for a residential block with two-storey houses and a bungalow.
10
- `test/visual/houses.play.json` walks through its entrance, climbs the stairs, and enters a bedroom.
11
+ `test/visual/houses.play.json` opens a front door, walks in, climbs the stairs, and enters a bedroom.
11
12
 
12
13
  These layouts are plausible procedural interpretations of building use, **not surveyed floor
13
14
  plans**. Confirmed occupant categories take precedence over building labels, then surrounding
@@ -209,6 +210,16 @@ using the style pack's catalog (and generating no interiors when the pack has no
209
210
  `renderers.updateInteriors(cameraPosition)` each frame. Only complete buildings at the finest
210
211
  semantic level receive sites; coarse representations retain the cheap exterior path.
211
212
 
213
+ A site comes with a building's full detail, and a crowded tile cannot detail every building: a
214
+ dense Seattle tile holds 1,091 buildings and a WebGL host's vertex budget details 75 of them.
215
+ From the air those are the largest. Once the position passed to `updateInteriors` is down among
216
+ the buildings and moving at a walk, the tiles within 90 m of it are regenerated with their
217
+ buildings queued nearest first, and again each 36 m it moves, so the houses round a walker
218
+ (148 of them in that tile, out to 140 m) are the ones with doors. Nothing is regenerated while the
219
+ viewer is inside a building or travelling faster than 10 m/s, and the tile on screen stays
220
+ until its replacement is ready. `viewerFocus: false` on the renderers keeps a tile's first
221
+ choice; World Explorer accepts `?focus=0`, and frozen captures (`?freeze`) never regenerate.
222
+
212
223
  Defaults are a 65 m load distance, 90 m release distance, 12 resident interiors and a 16 MiB
213
224
  resident geometry cap. Distance is measured to the footprint (including courtyard boundaries)
214
225
  and vertically to the available storey envelope, so a large building remains resident while you are inside
@@ -218,7 +229,8 @@ candidate modules and 160 fixtures (hard ceilings 4,096 and 512). The work budge
218
229
  64 iterator steps per frame, with at most one completed upload per frame. This is a cooperative
219
230
  budget, not a hard deadline: triangulation and final buffer upload are indivisible operations.
220
231
 
221
- One opaque portal batch covers unready entrances/windows per region. Publication attaches the
232
+ One opaque portal batch covers unready windows per region; a shut door closes its own doorway
233
+ (see [Doors](#doors)). Publication attaches the
222
234
  complete interior and removes those covers atomically. Eviction restores covers and disposes
223
235
  owned geometry; shared materials survive until streamer disposal. Hidden layers, region
224
236
  disposal and moving out of range cancel pending work. There is no unbounded interior cache:
@@ -241,7 +253,45 @@ the same published geometry, except that visible stair steps are skipped (`walkI
241
253
  a closed wedge supplies smooth stair collision. The published proxy is marked
242
254
  `walkCollisionOnly` and has rendering layers disabled. Hosts using the kernel buffers directly
243
255
  should likewise omit `steps` from physics and add `collision` to their collision scene. Portal index changes invalidate collision, and window glass is
244
- solid from either side. Doorways remain open without an interaction key or door animation.
256
+ solid from either side.
257
+
258
+ ## Doors
259
+
260
+ Every site's entrance has a door, shut until someone opens it. A house gets one painted panel
261
+ door, sometimes with a glass light, in one of a street's usual front-door colors, with a knob
262
+ and a fanlight over it where the opening is taller than a door. Shops, offices and everything
263
+ else get framed glass doors with a pull, in pairs where the doorway is 1.8 m or wider. A car
264
+ park's entrances stay open for cars. The look and the hinge side come from the site's identity,
265
+ so a building keeps its door.
266
+
267
+ `interiorDoors(site, catalog)` in the kernel describes them: each `InteriorDoor` has an `id`
268
+ (`<identity>#door0`), the doorway's `center`, `along` and `inward` directions, its leaves (each a
269
+ `hinge` and a direction across the leaf), and per leaf the `swing` angle about +Y that opens it
270
+ inward (the negative opens it outward). `buildInteriorDoorLeaf` and `buildInteriorDoorFrame`
271
+ build the closed leaves and the fixed transom. The kernel decides nothing about when a door opens.
272
+
273
+ `InteriorStreamer` draws every door of a region in one mesh and swings a leaf by rewriting its
274
+ own vertices, so doors cost one draw per region. Walking collision sees the leaves wherever they
275
+ are, shut or open, and picks up a swing on its next scan.
276
+
277
+ ```ts
278
+ const door = interiors.doorAt(eye, { facing: forward }); // within 1.8 m, in front of the viewer
279
+ if (door && !door.locked) interiors.setDoor(door.id, !door.open, feet);
280
+ ```
281
+
282
+ `doorAt` returns the nearest door within `reach` (1.8 m) of a position, at eye or foot height,
283
+ and ahead of `facing` when given. `setDoor(id, open, from)` opens a door away from `from`, so it
284
+ never swings into whoever opened it: from the street it opens inward, and from inside it opens
285
+ outward. It swings over 0.7 s, quickest at the start, on the streamer's clock (`now`, `performance.now` by default).
286
+ A door opens only onto rooms that are built: asked before then, it reports `waiting` and swings
287
+ when they are published, or gives up if the viewer leaves first. A site whose rooms could not
288
+ be built is `locked` and stays shut. Shutting is refused while `from` stands in the doorway.
289
+ When an interior is released, its door shuts with it.
290
+
291
+ The Earth renderers expose the same `doorAt` and `setDoor`. World Explorer and the Earth view
292
+ use the interact key for them: **E** opens or shuts the door the walker faces, and the explorer's
293
+ status line says which it will do. In the Earth view a door is an interactable of kind `door` (see
294
+ [Earth view](earth-view.md#interaction)).
245
295
 
246
296
  ## Current limits and next extensions
247
297
 
@@ -250,7 +300,8 @@ tower or mall, and every deck of a car park, in complete, non-elevated polygon b
250
300
  exterior geometry budget and have room for human-scale access. It does not promise entry into
251
301
  every mapped fragment: clipped footprints, elevated parts, very low/narrow structures,
252
302
  budget-boxed and omitted buildings lack a site. Additional storeys, switchback stairs, elevators,
253
- animated doors, tenant subdivision and persistent object edits remain future extensions.
303
+ doors between rooms (their doorways are open), tenant subdivision and persistent object edits
304
+ remain future extensions.
254
305
 
255
306
  Ground-floor platforms use the highest sampled perimeter height and an entrance ramp. Very
256
307
  steep sites, terrain protruding inside a large footprint, adjacent buildings obstructing a
@@ -136,7 +136,7 @@ Two constants live in `packages/kernel/src/version.ts` and they do different job
136
136
 
137
137
  | Constant | Today | Role |
138
138
  |---|---|---|
139
- | `ENGINE_VERSION` | `0.0.12` | metadata. Written into a keyframe's `engine` field so a save says which build wrote it. **Never compared on load, never hashed.** |
139
+ | `ENGINE_VERSION` | `0.0.13` | metadata. Written into a keyframe's `engine` field so a save says which build wrote it. **Never compared on load, never hashed.** |
140
140
  | `STATE_FORMAT` | `1` | the gate. Written into a keyframe under the reserved `plugins.$format` key, compared by `applyKeyframeTo`, and folded into `stateHash` as `stateFormat`. |
141
141
 
142
142
  So a release — even one that moves every package — keeps your keyframes
@@ -126,6 +126,11 @@ so from the air the ground carries tree shadows only around the aircraft: the LO
126
126
  host gets the far map from `earthShadowFocus` (its `far` square) and
127
127
  `renderer.setFarShadowCasters(stream.object)`.
128
128
 
129
+ Also on WebGL, the car being driven and the aircraft being flown cast from a third, small map
130
+ that travels with them (`renderer.setShadowSubject(vehicles.shadowSubject)`, and
131
+ `aircraft.shadowSubject` in flight), so a shadow on the ground and in its own cabin holds still
132
+ at any speed; see the [sky guide](sky.md).
133
+
129
134
  Earth viewers reserve a 4096-pixel sun map before preparing materials. WebGPU retains that
130
135
  allocation across quality changes, so High really uses 4096 pixels even after starting at a
131
136
  lower tier; WebGL can resize it with the tier. A chase camera 10 m above ground covers an
@@ -136,6 +141,12 @@ large airliners and their shadows inside the tighter runway footprint.
136
141
  `touchJoystickContainer` adds an on-screen movement stick while walking, driving or flying. By default it
137
142
  appears only on touch devices; pass `touchJoystick: 'always'` to show it everywhere.
138
143
 
144
+ `console: { container }` adds the [vehicle console](vehicle-console.md) instead: touch controls
145
+ drawn as the vehicle's own, the flown aircraft's stick, rudder pedals, throttle, gear and flap
146
+ handles and dials, or a car's wheel and pedals, in a see-through strip along the bottom. It shows
147
+ on touch devices (`touch: 'always'` everywhere), follows the mode, and is `view.console`. A page
148
+ lays out around it with the `--molen-console-height` CSS property it sets on the container.
149
+
139
150
  ## Modes
140
151
 
141
152
  - **orbit** (default): the map camera from [camera navigation](navigation.md). `flyTo(target)`
@@ -176,11 +187,31 @@ heading for a car, with its gear, engine rev/min, traction or stability control
176
187
  (`assist`) and the grip of the surface under it (`surfaceGrip`); airspeed, altitude and height
177
188
  above ground, vertical speed, attitude, load factor (g), sideslip, power, engine, gear, flaps,
178
189
  fuel remaining, stall buffet, the pilot's `greyout` and `redout` under g, and stall/impact flags
179
- for an aircraft (SI units, compass radians). Both carry the type's `label` and, where the type declares them, its name-free
190
+ for an aircraft (SI units, compass radians). Both carry the type's `label` and entity `type`, and, where the type declares them, its name-free
180
191
  `genericLabel` (`Full-size pickup`) and `bodyStyle`, so a HUD that must not show a real
181
192
  manufacturer or model name has something to show instead. An airplane started in flight is trimmed for level flight at its launch speed.
182
193
  `view.setThrottle(power)` sets an aircraft's throttle or collective from an on-screen lever.
183
194
 
195
+ `view.setInstrumentCanvas(canvas)` draws the flown aircraft's own airspeed and altitude
196
+ instruments into a host canvas, side by side: close-ups of the dials (or a glass cockpit's
197
+ readouts) in its cockpit, with the faces, units, needles and calibration the model has, for a HUD
198
+ beside a chase view. `vehicleStatus().instruments` lists them (`{ kind: 'speed' | 'altitude',
199
+ unit? }`, empty until the model loads or for a cockpit without them); give each a square cell of
200
+ the canvas's width. They draw about 20 times a second while flying, not while the canvas is
201
+ hidden, through a small WebGL context of the canvas's own. `undefined` stops and releases it; the
202
+ canvas cannot draw again, so show them later on a new one. The pieces are in
203
+ `@bendyline/molen-client/aircraft` for hosts with their own aircraft:
204
+ `createAircraftInstrumentViews({ model, spec })` crops the instruments out of a loaded cockpit
205
+ and `createAircraftInstrumentDisplay(canvas)` draws them.
206
+
207
+ ```ts
208
+ const status = view.vehicleStatus();
209
+ if (status?.kind === 'aircraft' && status.view === 'chase' && status.instruments.length > 0) {
210
+ gauges.style.aspectRatio = `${status.instruments.length} / 1`;
211
+ view.setInstrumentCanvas(gauges);
212
+ }
213
+ ```
214
+
184
215
  Listen for `modechange`. The input profile, clip planes and touch stick follow the mode
185
216
  automatically.
186
217
 
@@ -347,7 +378,7 @@ walker. `actors.adopt(pedestrianId)` turns an ambient pedestrian into an actor (
347
378
  ```ts
348
379
  const view = await mountEarthView({ /* … */ interaction: { reach: 2.5, pedestrians: true } });
349
380
  view.setInteraction({ pedestrians: false }); // change it later, e.g. only while a game runs
350
- view.interactable(); // { kind: 'actor' | 'vehicle' | 'pedestrian' | 'none', id?, distance? }
381
+ view.interactable(); // { kind: 'actor' | 'vehicle' | 'pedestrian' | 'elevator' | 'door' | 'none', id?, distance?, open? }
351
382
  view.on('interact', (interaction) => {
352
383
  if (interaction.kind === 'actor') {
353
384
  interaction.claim(); // the view does nothing else with this press
@@ -355,17 +386,24 @@ view.on('interact', (interaction) => {
355
386
  } else if (interaction.kind === 'pedestrian') {
356
387
  const id = view.actors.adopt(interaction.id); // stop them and talk
357
388
  if (id) talkTo(id);
389
+ } else if (interaction.kind === 'door' && !interaction.open && !hasKey) {
390
+ interaction.claim(); // keep this door shut until the player finds the key
391
+ say('Locked.');
358
392
  }
359
393
  });
360
394
  ```
361
395
 
362
396
  The interact key (E, or F, or the right mouse button) emits `interact` first with what it found. On
363
397
  foot that is the nearest of: a car or aircraft within reach of its door (aircraft can be boarded on
364
- foot too), an interactable actor within `interaction.reach` (2.5 m) of the walker's eyes and in
365
- sight, and, with `interaction.pedestrians`, an ambient pedestrian. Aboard, it is the vehicle the
366
- viewer is in; otherwise `none`. A handler that calls `claim()` synchronously takes the press, and
367
- nothing else happens. Unclaimed, the view boards or leaves a vehicle as it always did (or explains
368
- why there is nothing to board), and does nothing for an actor or a pedestrian.
398
+ foot too), a building's door within 1.8 m and in front of the walker (`open` says whether it is
399
+ open), an interactable actor within `interaction.reach` (2.5 m) of the walker's eyes and in
400
+ sight, and, with `interaction.pedestrians`, an ambient pedestrian. Standing in a lift, it is the
401
+ `elevator`. Aboard, it is the vehicle the viewer is in; otherwise `none`. A handler that calls
402
+ `claim()` synchronously takes the press, and nothing else happens. Unclaimed, the view boards or
403
+ leaves a vehicle as it always did (or explains why there is nothing to board), opens or shuts a
404
+ door (away from the walker, so it never swings into them), takes a lift up a floor, and does
405
+ nothing for an actor or a pedestrian. A door opens onto rooms that are built, waiting for them
406
+ if need be; see [Doors](building-interiors.md#doors).
369
407
 
370
408
  ### Overrides: replacing mapped places
371
409
 
@@ -854,6 +892,11 @@ For separated buildings or precincts, `buildingCutout.outlines` provides up to 6
854
892
  simple masks and supersedes `outline`. Keep the primary `outline` for compatibility. Separate
855
893
  masks preserve intervening buildings without inventing connecting structure geometry.
856
894
 
895
+ For an open carriage arch or similar at-grade passage, add `surfacePassageIds` and geographic
896
+ `bounds`. List exact transportation feature IDs from the map package. While the landmark is
897
+ loaded, the viewer paints those routes on the terrain through the model and skips their inferred
898
+ tunnel walls and ceiling. Failed loads retain the map's tunnel rendering.
899
+
857
900
  For a whole landmark whose source footprint slightly overlaps a neighboring building, set
858
901
  `buildingCutout.minimumCoverage` to a fraction in `(0, 1]`, for example `0.995`. This changes
859
902
  the mask to whole-building replacement: a mapped feature goes only when the union of that
@@ -912,6 +955,14 @@ model eviction. `build-copernicus-bridge-evidence.py` and the capture runner's
912
955
  neither capture set substitutes altered heights to make a bridge fit. These reports are research
913
956
  evidence and are excluded from the Earth runtime pack.
914
957
 
958
+ The Earth pack's optional `water-features` document supplies stable rendered elevations for
959
+ selected Protomaps water polygons. The viewer applies the same elevation to every tile that
960
+ contains the feature. A `hideLines` entry removes a redundant terrain-draped ribbon by feature
961
+ ID. Piva Lake and the downstream gorge at Mratinje use separate representative stages from
962
+ the retained terrain. Hosts composing their own renderer can provide `waterFeatureStyle` to
963
+ `createDefaultTerrainSemanticRenderer`. Its `elevation` is the final height in the terrain
964
+ frame, in meters. Unmatched features use the terrain sampler.
965
+
915
966
  If `replaceFootprint` is set, mapped buildings are suppressed only once the replacement model
916
967
  has loaded; failed models keep the procedural building. At any zoom a polygon goes when at least
917
968
  half of it stands on the model's own ground footprint (its triangles stamped on a 64-cell grid).
@@ -1081,7 +1132,7 @@ geometry and materials are counted once. Procedural scatter uses its separate in
1081
1132
  | Geometry CPU backing buffers | 64 MB | 192 MB |
1082
1133
  | Estimated geometry GPU uploads | 64 MB | 192 MB |
1083
1134
  | Shared worldgen textures, including mipmaps | 16 MB | 48 MB |
1084
- | Triangle / draw-call allowance | 350,000 / 100 | 1,000,000 / 200 |
1135
+ | Triangle / draw-call allowance | 350,000 / 100 | 1,000,000 / 400 |
1085
1136
  | Concurrent model loads | 2 | 4 |
1086
1137
  | Cooperative preparation time per frame | 2 ms | 4 ms |
1087
1138
 
@@ -1090,9 +1141,15 @@ overhead. Initial payload limits cover the active skyline set, not lifetime trav
1090
1141
  pack metadata. Upgrades can download larger files after a one-second skyline grace period.
1091
1142
  Draw/triangle admission reserves twice the nominal geometry cost for extra passes; shadows and
1092
1143
  other renderer passes have their own costs. Preparation yields between instances; an individual
1093
- GLB parse or GPU upload can exceed the cooperative time allowance.
1144
+ GLB parse or GPU upload can exceed the cooperative time allowance. Every placement is shown, at
1145
+ least on its skyline: skylines are reserved before detail, so a placement that overruns the
1146
+ allowance moves the farthest detailed landmarks down on the next update rather than being refused.
1147
+ Only drawn instances count: one in a tile hidden in the terrain's warm cache costs nothing until
1148
+ the tile is shown again.
1094
1149
 
1095
- Touch devices or browsers reporting at most 4 GB use the phone preset. Hosts can choose explicitly:
1150
+ Touch-first devices (a coarse primary pointer: phones and tablets) or browsers reporting at most
1151
+ 4 GB use the phone preset; a laptop with a touch screen keeps the desktop one. Hosts can choose
1152
+ explicitly:
1096
1153
 
1097
1154
  ```ts
1098
1155
  const view = await mountEarthView({
@@ -1109,8 +1166,10 @@ const view = await mountEarthView({
1109
1166
 
1110
1167
  Runtime variants use separate vertex attribute streams so Float32 positions and Uint8 colors
1111
1168
  do not cause overlapping GPU uploads. The reducer preserves source material references on detailed
1112
- levels; skyline uses a single color material and local convex pieces derived from the source.
1113
- Small openings and fine trim can disappear in that distant silhouette. Detailed levels use
1169
+ levels; skyline uses a single color material. A dense master's skyline is its own surfaces
1170
+ simplified, or local convex pieces where those are closer to the source (convex pieces fill a
1171
+ stadium bowl or a canopy). Small openings and fine trim can disappear in that distant silhouette.
1172
+ Detailed levels use
1114
1173
  conservative reduction and can exceed their advisory triangle targets. Expensive models stay
1115
1174
  coarse when an upgrade does not fit; source-authored LODs may be needed for more detail on phones.
1116
1175
  Geometric error is an estimate for selection, not a certified maximum deviation.
@@ -1189,7 +1248,8 @@ does not establish bridge engineering type, navigation clearance, foundations or
1189
1248
  The SR-520 preview replaces the floating section; its approaches use this same fallback.
1190
1249
 
1191
1250
  Mapped tunnels receive separate inferred underground bores and portal cuts that retain the
1192
- terrain above them. Aircraft support queries use the bore floor while underground. Centerlines
1251
+ terrain above them; a way tagged as a tunnel only beneath bridges is drawn as the street under
1252
+ them instead. Aircraft support queries use the bore floor while underground. Centerlines
1193
1253
  alone do not establish surveyed grades, widths or clearances; see [Tunnels](surface-rendering.md#tunnels)
1194
1254
  for the metadata overrides, inference and bounded route stitching.
1195
1255
 
@@ -1325,8 +1385,9 @@ The runway snapshot covers 10,746 airports with complete endpoint and width reco
1325
1385
  aprons, taxiways and hangars are currently bundled for Boeing Field; elsewhere these depend on
1326
1386
  the map's coverage. Building heights and untagged taxiway widths are interpreted. Runways with
1327
1387
  missing endpoints, closed runways and water runways are omitted. Supplemental airports also
1328
- render when the basemap has no tile (Itami lies outside the bundled Kyoto street-detail
1329
- coverage). Seattle's street-detail coverage includes Boeing Field and its surroundings.
1388
+ render when the basemap has no tile, such as an airport outside a package's street-detail
1389
+ coverage. The bundled Seattle and Kyoto street detail include Boeing Field and Osaka Itami and
1390
+ their surroundings; Kyoto's reaches south to central Osaka.
1330
1391
  No airport data is fetched without a supplied pack. Hosts composing their own
1331
1392
  terrain renderer can use `withEarthAirports`
1332
1393
  around semantic renderers and observers, passing `content.airports` from `loadEarthContent`.
@@ -54,5 +54,14 @@ const id = markers.pick(tap.x, tap.y);
54
54
  - **Budget:** `maxVisible` keeps the highest `priority`, then nearest, markers.
55
55
  - `screenPosition(id)` places DOM callouts next to a marker. `projectWorldToScreen(renderer,
56
56
  position)` projects any world point the same way.
57
+ - **Occlusion:** markers hide behind terrain, buildings and vehicles through the GPU's depth test
58
+ (`occlude`, on by default), which a DOM callout cannot see. So as each marker draws for the
59
+ renderer's camera, the layer asks the GPU whether any of it passed (an occlusion query: three's
60
+ own `occlusionTest` on WebGPU, one `ANY_SAMPLES_PASSED` query per marker on WebGL2). Only
61
+ what can be seen counts: an occluding layer discards near-transparent texels, so a pin's blank
62
+ margin or shadow halo peeking over a roof does not keep it "in sight".
63
+ `screenPosition(id).occluded` reports the latest finished answer, a frame or two behind drawing
64
+ and absent until the first one; hide a callout while it is `true`. `pick` passes over an
65
+ occluded marker, leaving the tap to whatever hides it.
57
66
 
58
67
  The layer never fetches anything you did not pass it, and it adds no draw calls when it is empty.
@@ -147,7 +147,8 @@ where real buildings have it. Avoid both grey-on-grey and candy color.
147
147
  | Painted wall, siding, render | 60–90% | 15–60% | sage `#a3b78f`, slate blue `#8199b2`, cream `#efe3c4`, butter `#e6cf86` |
148
148
  | Urban wall: concrete, panel, limestone | 55–90% | 0–25% | light concrete `#d2cec5`, limestone `#ddd6c6`, cool grey `#b8bfc4`, graphite `#8f9397` |
149
149
  | Masonry, brick, timber walls | 45–65% | 25–45% | brick `#a8634b`, sandstone `#c9ab84`, cedar `#a77a54` |
150
- | Pitched roof (shingle, tile, slate) | 35–50% | 6–40% | charcoal `#575c62`, brown `#725c49`, moss `#5a6d55`, terracotta `#a5644b` |
150
+ | Pitched roof (shingle, slate, dark tile) | 35–50% | 6–40% | charcoal `#575c62`, brown `#725c49`, moss `#5a6d55`, engobe `#625e5c` |
151
+ | Clay tile roof in sun | 48–63% | 35–55% | terracotta `#c06c48`, pale weathered tile `#d1946f`, northern clay `#a25c48` |
151
152
  | Flat roof (membrane, gravel) | 45–90% | 0–12% | white membrane `#e6e6e2`, pale grey `#d3d4d0`, gravel `#b0a693`, dark membrane `#74777b`; mostly pale, a few dark |
152
153
  | Trim and frames | 85–95% or 22–30% | 0–30% | white `#f4f1ea`, dark frame `#3b3e42` |
153
154
  | Untextured window glass | 35–45% | 20–30% | blue-grey pane `#4d6178` |
@@ -189,6 +190,12 @@ Palette rules:
189
190
  lightness points below their walls, so a neighborhood seen from above reads as roofs. Large
190
191
  flat roofs are light membranes and gravel, as they are in reality. A pitched style declares
191
192
  `materials.flatRoof` so its flat fallback is membrane, not shingle tinted charcoal.
193
+ - **Clay tile is the one light pitched roof.** The tile texture and the roof's own shading draw
194
+ a tinted roof at about six tenths of its palette, so a terracotta inside the pitched band
195
+ (`#a8654a`) reaches the screen as dark red-brown at 28–35% lightness. Sunlit tile in
196
+ photographs of Nafplio and Lisbon measures 43–55% at a hue of 15–23°. Clay tile therefore has
197
+ its own band, above the other pitched roofs and still below the pale walls it sits on, and a
198
+ wider per-building jitter (±0.045 lightness), since a tiled town is mottled and never one tone.
192
199
  - **Reserve saturated accents.** Strong saturation belongs to identity: a store's sign band, a
193
200
  landmark's signature color, a bus livery, a fire station. Use one accent per object.
194
201
  - **Real landmarks use their real colors.** The Tacoma Narrows towers are green and the Golden
@@ -451,8 +458,14 @@ A style cannot do all of it. A generated street is also held to these:
451
458
  - **Tops are finished.** A tower ends in a parapet and a plant enclosure or crown and steps back
452
459
  where its style declares setbacks. A skyline shows more than one facade rhythm and more than
453
460
  one glass tint. A straight extrusion with a bare top is a stand-in.
461
+ - **A building is its region's.** Before a footprint is a shop, a hotel or an unknown, it is
462
+ built of what its town is built of: terracotta over warm render on the Mediterranean, slate
463
+ over brick in Britain, a roof terrace in the Maghreb and South Asia. A use changes a building's
464
+ frontage and its inside; it replaces the building only when the building was made for it.
454
465
  - **A row is houses.** A long, narrow residential footprint is divided at its party walls, each
455
- unit with its own roof, color and chimney, not roofed as one shed.
466
+ unit with its own roof, color and chimney, not roofed as one shed. Houses that share a wall
467
+ have no windows in it, and turn their ridges the way their region's rows do: eaves to the
468
+ street, or a gable to it.
456
469
  - **Mapped appearance wins.** Where the map records a roof shape, a wall or roof color or a
457
470
  material, use it, clamped to the palette bands.
458
471
  - **A building has a plot.** A house sits in a yard with an edge (fence, wall or hedge, by
@@ -460,7 +473,11 @@ A style cannot do all of it. A generated street is also held to these:
460
473
  yard and loading doors. Seeded buildings take their density from their mapped neighbors.
461
474
  - **Kinds are told apart.** A place of worship, a school, a fuel station, a greenhouse, a
462
475
  stadium and a building site each read as what they are from the air. A windowless box is a
463
- shed or a failure.
476
+ shed or a failure. A place of worship carries its tradition's crown (a dome, a spire, a
477
+ belfry, a minaret, a stepped tower) in its region's own walls and roof.
478
+ - **A pitched town stays pitched.** Where roofs are tile or slate, an irregular plan, a
479
+ courtyard block and a broad hall are roofed too (`roof.fallback: 'hipped'`), not left as flat
480
+ patches among their neighbours.
464
481
 
465
482
  The [worldgen guide](worldgen.md) and the
466
483
  [structure library](structure-library.md) cover the archstyle format and the 120 shipped styles.
@@ -630,8 +647,20 @@ A rain or snow frame is recognizable with its particles turned off.
630
647
  crown's shell (twenty clusters of four cards up close, six of three at medium distance) around
631
648
  a solid core in the crown's own shade, so the outline breaks into sprigs of leaves and the gaps
632
649
  show foliage rather than sky. Plants are sized by their foliage, not by the cards' clear
633
- corners. A distant crown is one faceted volume (six-sided and lumpy for broadleaf trees), drawn
634
- opaque. Clear atlas texels carry the tone of the leaves beside them, so filtering never blends
650
+ corners. A distant crown is one faceted volume, drawn opaque. For a broadleaf tree it is drawn
651
+ round the near crown's own clusters and core, on the same trunk (six sides and four rings, 56
652
+ triangles; five sides, three rings and no trunk past the horizon handover), so it stands where
653
+ the near crown stands with its lumps in its outline: one ellipsoid over the tree's whole height
654
+ was a ball on the ground, two fifths larger in view than the tree that replaced it. Such a
655
+ crown is a _foliage mass_ (`SCATTER_MASS_UV` in place of `SCATTER_SOLID_UV`; shrubs' far crowns
656
+ are too), and the scatter material shades it as clumps of leaves rather than a smooth ball:
657
+ clumps about 2.3 m across with sprays a finer size among them, each lit toward its top and
658
+ shaded beneath and where it meets the next, each in its own tone, with a relief that tilts the
659
+ normal so a clump has a sunlit side. Both sizes fade to their mean tone as a pixel grows past
660
+ them, so a far wood neither sparkles nor changes brightness. Its tone and reach are set against
661
+ the near tree's (a solid fills its outline and has no shade between cards, so it is drawn nine
662
+ percent narrower and a little toward gray), measured over six suns and two views: within four
663
+ percent of the near tree's area in view and one percent of its brightness. Clear atlas texels carry the tone of the leaves beside them, so filtering never blends
635
664
  a pale rim into a card's cut edge. Cards are for tree crowns only, and only
636
665
  through the shared scatter material: no alpha blending, no per-species textures, no cards on
637
666
  buildings, fences or ground cover. That material (`createScatterMaterialAsync` from
@@ -657,6 +686,9 @@ A rain or snow frame is recognizable with its particles turned off.
657
686
  - **Houses carry their own details.** North American homes have dark shutters, the odd dormer
658
687
  and a chimney, and lap-sided homes case their outside corners with trim boards
659
688
  (`cornerBoards`), all in the shared trim and roof materials, so they cost vertices but no draws.
689
+ A share of a family's houses has a porch (a step, two posts and a canopy); shutters and doors
690
+ are painted from the family's `paint` colors; chimneys stand only where winters have them, and
691
+ roof terraces carry water tanks or solar heaters as instanced props.
660
692
  The High tier's finest tiles budget 900,000 building vertices so a dense suburban block stays
661
693
  fully detailed near the camera instead of dropping to simplified stand-ins. On WebGL, which
662
694
  pays full price for every building and plant draw, the Earth view and the explorer ask for a
@@ -159,12 +159,21 @@ For movement on phones, add the on-screen stick:
159
159
  import { createTouchJoystick } from '@bendyline/molen-client/navigation';
160
160
 
161
161
  const stick = createTouchJoystick(container, input.map); // bottom-left, style with className
162
- stick.setVisible(matchMedia('(pointer: coarse)').matches);
162
+ // Any coarse pointer: phones, tablets and touchscreen laptops.
163
+ stick.setVisible(matchMedia('(any-pointer: coarse)').matches);
163
164
  ```
164
165
 
165
166
  The stick drives the same `nav-forward`/`nav-back`/`nav-left`/`nav-right` actions through
166
167
  `InputMap.setVirtual`, so a phone moves exactly like a keyboard or gamepad. `TouchStick` is its
167
- DOM-free geometry, if you want to draw your own.
168
+ DOM-free geometry, if you want to draw your own; `appearance: 'none'` leaves the zone invisible
169
+ under a stick you draw.
170
+
171
+ For levers, handles and switches, `createTouchLeverZone` and `createTouchButtonZone` put an
172
+ invisible zone over a rectangle you draw: a lever follows the thumb's travel from where it landed
173
+ (so a touch never makes it jump), optionally springing back or settling on notches, and each zone
174
+ captures its own pointer so two thumbs work two controls at once. `TouchLever` is the lever's
175
+ geometry. The [vehicle console](vehicle-console.md) builds a whole set of them, drawn as the
176
+ vehicle's own controls.
168
177
 
169
178
  ## Streaming alongside the camera
170
179
 
@@ -59,8 +59,15 @@ not cast additional shadows; walls do not occlude them. Distant lamps keep their
59
59
  and pavement pools beyond the real-light budget.
60
60
 
61
61
  Traffic lenses remain self-lit in both daytime and nighttime and keep their simulation-driven
62
- signal phases. Mapped props that replace inferred fixtures still need their own model lighting
63
- metadata; arbitrary tagged model lamps currently emit without creating a point light.
62
+ signal phases. After dark each lit lens also gets a soft glow in its own color, about a meter
63
+ across, which follows the phase from red to green (`surface:night-signal-glow`, one batch per
64
+ tile). Road signs light up too: their lettered faces fade in with the night factor, street
65
+ names at 85% as lit panels and the other boards at 60%, as retroreflective faces caught by
66
+ lamps and headlights. Each glow (`surface:night-street-names`, `surface:night-road-signs`)
67
+ draws its face mesh's own geometry, so it adds a draw call per tile, not memory; blank sign
68
+ backs and edges are a separate `surface:sign-backs` mesh and stay dark. Mapped props that
69
+ replace inferred fixtures still need their own model lighting metadata; arbitrary tagged model
70
+ lamps currently emit without creating a point light.
64
71
 
65
72
  ## Cars
66
73
 
@@ -68,7 +68,13 @@ conservative tenancy heuristics, not surveyed lease boundaries.
68
68
  A single business directly identified by its footprint can color the whole shell. Containment-only
69
69
  matches and shared tenants color only their own fascia,
70
70
  canopy and entry accents. Existing residential/civic/tall-building styles and floor counts survive
71
- when a shop is a ground-floor tenant. Measured footprints/heights remain authoritative. Frontage is estimated
71
+ when a shop is a ground-floor tenant. Whether a low building with a business becomes a store
72
+ shell at all depends on its region: North American and Southwest profiles build shops as shells
73
+ wherever they stand, and elsewhere a shop in a row or under flats keeps its region's building
74
+ and gains a frontage, unless it is purpose-built (free-standing on retail land, a catalog chain's
75
+ own building, or 600 m² and more). See
76
+ [rows, shops and places of worship](worldgen.md#rows-shops-and-places-of-worship).
77
+ Measured footprints/heights remain authoritative. Frontage is estimated
72
78
  from the POI and nearby access lines; exact entrance location, sign location and tenant width are
73
79
  generally absent from the archive.
74
80