@bendyline/molen-tooling 0.0.12 → 0.0.13
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/capture/harness.js +386 -318
- package/dist/capture/worldgen-preview.js +254 -254
- package/dist/docs-src/guide/adaptive-performance.md +30 -3
- package/dist/docs-src/guide/aircraft.md +125 -3
- package/dist/docs-src/guide/ambient-life.md +15 -1
- package/dist/docs-src/guide/boats.md +9 -4
- package/dist/docs-src/guide/boost-mode.md +64 -0
- package/dist/docs-src/guide/determinism.md +1 -1
- package/dist/docs-src/guide/dioramas.md +11 -4
- package/dist/docs-src/guide/earth-view.md +104 -4
- package/dist/docs-src/guide/entities.md +3 -0
- package/dist/docs-src/guide/graphics-performance.md +177 -13
- package/dist/docs-src/guide/input.md +34 -1
- package/dist/docs-src/guide/liveries.md +167 -0
- package/dist/docs-src/guide/livery-catalog.md +2659 -0
- package/dist/docs-src/guide/livery-gallery.md +2684 -0
- package/dist/docs-src/guide/medium-fi.md +13 -5
- package/dist/docs-src/guide/night-lighting.md +96 -0
- package/dist/docs-src/guide/project.md +1 -1
- package/dist/docs-src/guide/regional-world.md +3 -1
- package/dist/docs-src/guide/rendering-backends.md +6 -2
- package/dist/docs-src/guide/surface-rendering.md +12 -0
- package/dist/docs-src/guide/terrain.md +38 -0
- package/dist/docs-src/guide/vehicles.md +13 -1
- package/dist/docs-src/guide/worldgen.md +20 -5
- package/dist/docs-src/llms.txt +6 -1
- package/dist/docs-src/schemas/archstyle.md +29 -0
- package/dist/docs-src/schemas/components.md +776 -1
- package/dist/docs-src/schemas/regional-catalog.md +39 -0
- package/dist/docs-src/schemas/scatter.md +36 -0
- package/dist/docs-src/schemas/structure-placement-data.md +91 -0
- package/dist/docs-src/schemas/structure-placements.md +91 -0
- package/dist/docs-src/schemas/worldgen-batch.md +105 -0
- package/dist/templates/city-courier/gen/molen-types.ts +103 -1
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +102 -0
- package/dist/templates/index.json +17 -17
- package/dist/templates/skybound/gen/molen-types.ts +103 -1
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +102 -0
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +102 -0
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +103 -1
- package/package.json +12 -12
|
@@ -53,13 +53,13 @@ exported from `@bendyline/molen-earth/client` as `EARTH_SKY_PALETTE`, `EARTH_LIG
|
|
|
53
53
|
|
|
54
54
|
| Element | Value | What it means for an asset |
|
|
55
55
|
| --- | --- | --- |
|
|
56
|
-
| Sun |
|
|
57
|
-
| Sky fill | `dayAmbient`
|
|
56
|
+
| Sun | Near-neutral white `#fff8f0`, intensity 6.1, `referenceElevation` 26° | Sunlit horizontal faces render near their authored color at any time of day: above 26° the rig adapts as a camera's exposure would, so midday is not brighter than the palette |
|
|
57
|
+
| Sky fill | `dayAmbient` 1.25 from the sky dome at `skyLightSaturation` 0.3, warm ground bounce `#9a8f70` | Faces in shade sit at roughly a third of lit faces, gently cool rather than blue, so slopes, streets and darks read with photographic contrast |
|
|
58
58
|
| Tone mapping | ACES filmic, exposure 1.05 | Authored colors keep their hue with a little mid-tone contrast; shade reads cool grey, not navy |
|
|
59
59
|
| Cast shadows | On from the Medium tier up, in a shadow map that follows the camera | Do not bake shadows or ambient occlusion into colors or textures |
|
|
60
60
|
| Sky | Saturated zenith `#2a6cc4` over a pale horizon `#b2cde4`, both lifted by ACES on screen | Large pure-white surfaces outshine it; prefer off-whites and creams |
|
|
61
61
|
| Haze | The sky's own horizon color, from about 2 km | Distant ground dissolves into the horizon; do not add a fog color of your own |
|
|
62
|
-
| Water | `#
|
|
62
|
+
| Water | Deep teal `#1b4450` with a soft sky reflection; hosts may tint it per region (Puget Sound near-black navy, Sydney Harbour green-teal) | Water absorbs most light: from above it is far darker than land. Keep ripples legible nearby; fade small wave detail at airplane distance |
|
|
63
63
|
|
|
64
64
|
Two consequences matter for authoring:
|
|
65
65
|
|
|
@@ -100,15 +100,20 @@ where real buildings have it. Avoid both grey-on-grey and candy color.
|
|
|
100
100
|
| Urban wall: concrete, panel, limestone | 55–90% | 0–25% | light concrete `#d2cec5`, limestone `#ddd6c6`, cool grey `#b8bfc4`, graphite `#8f9397` |
|
|
101
101
|
| Masonry, brick, timber walls | 45–65% | 25–45% | brick `#a8634b`, sandstone `#c9ab84`, cedar `#a77a54` |
|
|
102
102
|
| Pitched roof (shingle, tile, slate) | 35–50% | 6–40% | charcoal `#575c62`, brown `#725c49`, moss `#5a6d55`, terracotta `#a5644b` |
|
|
103
|
-
| Flat roof (membrane, gravel) |
|
|
103
|
+
| Flat roof (membrane, gravel) | 45–90% | 0–12% | white membrane `#e6e6e2`, pale grey `#d3d4d0`, gravel `#b0a693`, dark membrane `#74777b`; mostly pale, a few dark |
|
|
104
104
|
| Trim and frames | 85–95% or 22–30% | 0–30% | white `#f4f1ea`, dark frame `#3b3e42` |
|
|
105
105
|
| Untextured window glass | 35–45% | 20–30% | blue-grey pane `#4d6178` |
|
|
106
106
|
| Lawn and residential ground | 45–55% | 25–35% | lawn `#8aa065`, grass `#7fa258`, park `#6c9a55` |
|
|
107
107
|
| Paved and commercial ground | 60–70% | 5–12% | paving `#aaa59a` |
|
|
108
108
|
| Forest floor and conifers | 30–40% | 25–35% | forest `#3c6a3f`, fir `#3e7052` |
|
|
109
|
-
| Asphalt |
|
|
109
|
+
| Asphalt | 35–42% | 0–10% | road `#646766` (near neutral and weathered: from the air streets read mid grey; a bluer gray turns navy in shade, a darker one crushes to black), with markings `#eee9d4` and `#e8bd57` |
|
|
110
110
|
| Identity and wayfinding accents | 35–60% | 55–90% | signal red `#b81d18`, chrome yellow `#e7b52a` |
|
|
111
111
|
|
|
112
|
+
Regional ground palettes in the `molen.ecology` pack depart from the generic bands on purpose:
|
|
113
|
+
they are calibrated against matched orthophotos of real cities. Desert and dry soil sits near
|
|
114
|
+
45–50% lightness as a warm mid brown, not pale sand; Pacific Northwest lawns and woodland floor
|
|
115
|
+
read darker and bluer under their conifer canopy; dense blocks pave over their unmapped ground.
|
|
116
|
+
|
|
112
117
|
Palette rules:
|
|
113
118
|
|
|
114
119
|
- **Houses carry the hue; urban blocks stay mostly neutral.** A house palette gives at least a
|
|
@@ -561,6 +566,9 @@ record the completed result once. Revisit it when a defect or relevant change wa
|
|
|
561
566
|
5. **Modes.** Check the Economy mode (no shadows) as well as High.
|
|
562
567
|
6. **Distance behavior.** Watch the switches between levels for popping, shimmer on thin parts,
|
|
563
568
|
and floating or sinking at the base.
|
|
569
|
+
7. **Family.** Models made by one builder or template fail together. Render the family's side
|
|
570
|
+
views at one scale on one sheet: an SUV with a sedan's rear, every pickup at a car's ride
|
|
571
|
+
height or two types with the same silhouette show there, not in one model's preview.
|
|
564
572
|
|
|
565
573
|
Useful captures from a project:
|
|
566
574
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Night lighting
|
|
2
|
+
|
|
3
|
+
Earth views light occupied windows and street fixtures as the Sun sets. World Explorer and
|
|
4
|
+
`mountEarthView` share the same smooth transition: off above +2° solar altitude, fully on below
|
|
5
|
+
−6°. Date, location and time-of-day changes use the sky's Sun position, so a city's lights follow
|
|
6
|
+
its local night even when the controls display your own time zone.
|
|
7
|
+
|
|
8
|
+
## Buildings and existing models
|
|
9
|
+
|
|
10
|
+
Generated buildings already identify their glass as the `window` material slot. The client adds
|
|
11
|
+
a compact emission layer on those actual panes. About 55% illuminate, with a deterministic mix
|
|
12
|
+
of warm and neutral whites and brightness levels. Each whole pane stays either on or off;
|
|
13
|
+
the pattern does not flicker with time, material loading or floating-origin shifts. The same
|
|
14
|
+
layer follows all three resident building detail levels. Silhouette boxes without windows stay
|
|
15
|
+
unlit.
|
|
16
|
+
|
|
17
|
+
Authored static GLB structures opt in through material metadata. Existing
|
|
18
|
+
`extras.molenSurface.slot: "window"` bindings are recognized automatically. For glass or lamp
|
|
19
|
+
faces with other materials, add this to the glTF **material's** extras:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"molenNightLight": {
|
|
24
|
+
"kind": "window",
|
|
25
|
+
"occupancy": 0.55,
|
|
26
|
+
"color": "#ffe4b0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Use `kind: "lamp"` for a permanently occupied fixture (default occupancy 1). `color` is optional;
|
|
32
|
+
omitting it gives the warm/neutral mix. An occupancy of 0 disables the layer. Model generators
|
|
33
|
+
should emit separate, disconnected glass panes for independent room occupancy. Connected glass
|
|
34
|
+
sheets illuminate as one surface. Mark only the emitting faces, not a combined wall-and-window
|
|
35
|
+
material. These tags also work on source-derived runtime LODs when those LODs retain the extras.
|
|
36
|
+
|
|
37
|
+
No window locations are guessed from a model's name, base colour or bounding box. Untagged
|
|
38
|
+
landmarks need a generator change to identify the intended glass or fixture faces. The light
|
|
39
|
+
layer follows the model's hierarchy, placement, clipping and lifetime; the original daytime
|
|
40
|
+
materials are retained.
|
|
41
|
+
|
|
42
|
+
## Roads and signals
|
|
43
|
+
|
|
44
|
+
Modern surfaces place lamps along paved streets with sidewalks and at intersections. Placement
|
|
45
|
+
is bounded, terrain-aware and avoids mapped buildings and water. Long blocks get fixtures at roughly 28 m intervals, alternating sides.
|
|
46
|
+
Bridges, tunnels and unpaved roads do not receive inferred block lighting. Explicit
|
|
47
|
+
`tags.lit: "no"` disables block lamps. The existing surface style and `details.streetlights`
|
|
48
|
+
control whether fixtures are generated; historic and unlit styles keep their own choices.
|
|
49
|
+
|
|
50
|
+
Each surface tile batches illuminated lamp heads and soft pavement pools. Pools follow terrain
|
|
51
|
+
height, fade with dusk and share the fixtures' distance culling. Earth hosts also use sixteen
|
|
52
|
+
real warm point lights selected from visible street fixtures near the camera and the ground it
|
|
53
|
+
looks toward. They illuminate building walls, parked cars, moving vehicles and other lit
|
|
54
|
+
materials. The fixed pool keeps shader light counts stable as tiles stream. These lights do
|
|
55
|
+
not cast additional shadows; walls do not occlude them. Distant lamps keep their batched glow
|
|
56
|
+
and pavement pools beyond the real-light budget.
|
|
57
|
+
|
|
58
|
+
Traffic lenses remain self-lit in both daytime and nighttime and keep their simulation-driven
|
|
59
|
+
signal phases. Mapped props that replace inferred fixtures still need their own model lighting
|
|
60
|
+
metadata; arbitrary tagged model lamps currently emit without creating a point light.
|
|
61
|
+
|
|
62
|
+
## Cars
|
|
63
|
+
|
|
64
|
+
Active traffic and the driven car get white headlights and red tail lights, including when
|
|
65
|
+
stopped at a signal. Lenses follow vehicle dimensions and the full chassis rotation, through
|
|
66
|
+
proxy/model changes and floating-origin shifts. Braking brightens the rear lenses. Four nearby
|
|
67
|
+
cars also receive forward, downward-aimed spotlights, with the driven car taking priority.
|
|
68
|
+
Their beams illuminate pavement, walls and vehicles ahead. Parked, unoccupied cars keep their
|
|
69
|
+
lamps off and receive light from their surroundings. Hidden/despawned traffic loses its lights.
|
|
70
|
+
|
|
71
|
+
Traffic lenses are two instanced batches, capped at 512 cars, and all artificial lighting fades
|
|
72
|
+
out at dawn. No light changes the deterministic simulation.
|
|
73
|
+
|
|
74
|
+
`details.maxStreetlightsPerTile` gives lamps their own budget (default
|
|
75
|
+
1.5 × `maxFixturesPerTile`, normally 240), so block lighting does not take parking spaces away.
|
|
76
|
+
Worker and direct surface generation produce the same placement and light pools. Fresh tiles
|
|
77
|
+
and style replacements inherit the current night factor immediately.
|
|
78
|
+
|
|
79
|
+
## Custom hosts
|
|
80
|
+
|
|
81
|
+
`createEarthWorldgen(...).setNightFactor(factor)` and
|
|
82
|
+
`TerrainSurfaceRenderer.setNightFactor(factor)` accept 0..1. Compute that factor with
|
|
83
|
+
`earthNightFactor(sunAltitudeDeg)` from `@bendyline/molen-earth/client`. Fixed daylight hosts
|
|
84
|
+
can leave the default 0. Direct surface objects use `updateTerrainStreetLights(object, factor)`.
|
|
85
|
+
|
|
86
|
+
Lower-level worldgen hosts can create `NightWindowLighting` from
|
|
87
|
+
`@bendyline/molen-worldgen/client`, assign it to their material set's `nightWindows`, and pass it
|
|
88
|
+
to `StructureModelLibrary` or `StructureLodStreamer` as `nightWindows`. Dispose the controller
|
|
89
|
+
after its building/model objects; model eviction retains the shared emission material.
|
|
90
|
+
Compose real spill and traffic lighting with `EarthNightLighting` from
|
|
91
|
+
`@bendyline/molen-earth/client`. Construct it with `{ root, world, surface, sampleHeight }`,
|
|
92
|
+
where `root` uses absolute simulation coordinates (normally the terrain stream object).
|
|
93
|
+
Pass `vehicleHeights` from the ambient content catalog for matching traffic model heights.
|
|
94
|
+
Call `update({ camera, direction, factor, drivenVehicleId })` each frame and dispose it before
|
|
95
|
+
its root. `TerrainSurfaceRenderer.visitStreetLights` exposes only attached, visible source tiles.
|
|
96
|
+
Both graphics backends use standard materials and lights, without shader injection.
|
|
@@ -78,7 +78,7 @@ archives, several GB in all) are on the rolling
|
|
|
78
78
|
[`packs` release](https://github.com/bendyline/molen/releases/tag/packs) with every other pack:
|
|
79
79
|
`npx molen pack fetch https://github.com/bendyline/molen/releases/download/packs/index.json
|
|
80
80
|
<ids…>`. A browser can't read those downloads directly (GitHub sends no CORS headers); host the
|
|
81
|
-
zips yourself, or read the
|
|
81
|
+
zips yourself, or read the hosted copy at `https://qualla.com/_a/index.json`. Without its model
|
|
82
82
|
archives, the style pack draws landmarks as procedural buildings.
|
|
83
83
|
|
|
84
84
|
A project lists the packs it uses, in order, and their types join the registry like the
|
|
@@ -51,7 +51,9 @@ cells are visible in generation diagnostics and do not receive invented wild veg
|
|
|
51
51
|
|
|
52
52
|
Bare and distant terrain receives the same ecological ground palette before detailed map
|
|
53
53
|
surfaces arrive. `createRegionalGroundColor` supplies the terrain stream's optional
|
|
54
|
-
`surfaceColor` callback
|
|
54
|
+
`surfaceColor` callback (with an optional `colorTile` method that colors a whole tile's arrays in
|
|
55
|
+
one call, which Earth's regional palette provides: per-vertex calls boxed a quarter of a million
|
|
56
|
+
arguments per tile on the main thread); it runs before upload for both worker-prepared and local meshes and
|
|
55
57
|
returns linear RGB. An explicit host `style.ground` palette takes precedence in `mountEarthView`.
|
|
56
58
|
Nature-reserve, national-park and protected-area designations retain their protection metadata,
|
|
57
59
|
but do not paint over the physical habitat beneath them. With no mapped physical cover, sparse
|
|
@@ -171,8 +171,12 @@ The world explorer also accepts `gpuOptimizations=0` for an uncached WebGPU comp
|
|
|
171
171
|
|
|
172
172
|
Open [World Explorer](https://molen.dev/play/world-explorer/), then compare the same location
|
|
173
173
|
and settings using [`?backend=webgpu`](https://molen.dev/play/world-explorer/?backend=webgpu) and
|
|
174
|
-
[`?backend=webgl`](https://molen.dev/play/world-explorer/?backend=webgl).
|
|
175
|
-
|
|
174
|
+
[`?backend=webgl`](https://molen.dev/play/world-explorer/?backend=webgl). World Explorer defaults
|
|
175
|
+
to WebGL, as the embedded Earth view does: WebGPU currently builds node state for every new
|
|
176
|
+
instanced mesh, which can leave terrain preparation behind a fast aircraft despite low GPU draw
|
|
177
|
+
times. Explicit `?backend=auto` still negotiates WebGPU with fallback; `?backend=webgpu` pins it
|
|
178
|
+
and enables its screen-space ambient occlusion. The general client/viewer default remains `auto`.
|
|
179
|
+
The performance HUD displays
|
|
176
180
|
the backend that actually rendered and any automatic fallback reason; its
|
|
177
181
|
`#performance-status` element also exposes `data-backend` and `data-fallback-reason` for tests.
|
|
178
182
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Surface styles and parameterized line features
|
|
2
2
|
|
|
3
|
+
[Night lighting](night-lighting.md) adds dusk-driven lamp heads and pavement pools to modern
|
|
4
|
+
street fixtures, with separate lamp budgets and matching direct/worker output.
|
|
5
|
+
|
|
3
6
|
The terrain client renders roads, parking areas, pedestrian surfaces, and street fixtures from
|
|
4
7
|
normalized semantic tiles. World explorer exposes **Surfaces → Modern traffic / Circa 1910 /
|
|
5
8
|
Simple surfaces** in Human mode. Styles change in place, preserving the camera, streamed data,
|
|
@@ -30,6 +33,8 @@ const renderer = createDefaultTerrainSemanticRenderer({ surfaceRenderer: surface
|
|
|
30
33
|
await surfaces.setOptions({ style: '1910' });
|
|
31
34
|
// Call once per frame with absolute simulation time (seconds).
|
|
32
35
|
surfaces.updateSignals(tick / tickRate);
|
|
36
|
+
// And with the scene camera's world position: far tiles' small detail stops drawing.
|
|
37
|
+
surfaces.updateDetail(camera.position);
|
|
33
38
|
console.log(surfaces.stats());
|
|
34
39
|
// Dispose the stream/layers, then the shared controller when the experience closes.
|
|
35
40
|
surfaces.dispose();
|
|
@@ -261,6 +266,13 @@ call `surfaces.updateSignals(elapsedSeconds, resolver?)`; a resolver receives a
|
|
|
261
266
|
`updateTerrainSurfaceSignals(object, elapsedSeconds, resolver?)` on the surface object instead.
|
|
262
267
|
Here `object` is the group returned by `createTerrainSurfaceObject`.
|
|
263
268
|
|
|
269
|
+
`surfaces.updateDetail(position)` hides each tile's small detail beyond its draw distance from the
|
|
270
|
+
camera (the scene camera's world position), measured to the tile's footprint: road signs, street
|
|
271
|
+
fixtures and signal lenses beyond 900 m, lane markings and parked cars beyond 1.5 km. There they
|
|
272
|
+
span a pixel or less, yet from a jet a view held a few hundred such draws for tiles kilometers
|
|
273
|
+
away. Each mesh carries its distance as `userData.detailDistance`; the call does nothing until the
|
|
274
|
+
camera has moved 25 m or tiles have changed, and detail shows again as the camera nears.
|
|
275
|
+
|
|
264
276
|
## Signage data in PMTiles
|
|
265
277
|
|
|
266
278
|
PMTiles is the archive format, so its contents depend on the tile producer. OSM supports
|
|
@@ -340,6 +340,21 @@ function frame(position: [number, number, number]) {
|
|
|
340
340
|
}
|
|
341
341
|
```
|
|
342
342
|
|
|
343
|
+
For movement and ground placement, use `earth.stream.sampleSurfaceHeight(x, z)`: it samples the
|
|
344
|
+
displayed mesh's triangles at their current detail level, including refinement transitions.
|
|
345
|
+
`sampleHeight(x, z)` retains the full-resolution source elevation, which can differ from the
|
|
346
|
+
visible mesh between vertices. Both return `undefined` outside displayed terrain. Roads, land
|
|
347
|
+
cover, bridges and model-owned openings still require collision against their visible geometry;
|
|
348
|
+
the Earth view combines rendered terrain heights with those collision queries for walking and driving.
|
|
349
|
+
|
|
350
|
+
For moving cameras, `stream.update(view, futureViews)` accepts optional predicted views, nearest
|
|
351
|
+
in time first. It prepares a bounded set of future leaves, semantic layers and GPU resources in
|
|
352
|
+
the hidden resident cache without changing the current selection. Omit the second argument to
|
|
353
|
+
stop prediction. Both the Earth view and World Explorer use `createEarthTilePreloader` from
|
|
354
|
+
`@bendyline/molen-earth/client` to predict 4, 8 and 12 seconds of fast travel, capped at 4 km.
|
|
355
|
+
Its `views(nowMs, view, steady)` takes positions already in the Earth adapter's metric world frame;
|
|
356
|
+
pass `steady: false` during scripted camera animations and call `reset()` when changing frames.
|
|
357
|
+
|
|
343
358
|
The selector measures projected source-sample spacing, adapts its error/range to the selected-tile
|
|
344
359
|
budget, requests ancestors before descendants, and retains a displayed parent until all selected
|
|
345
360
|
descendant coverage is resident. A selected tile that is not resident yet shows through its
|
|
@@ -398,6 +413,29 @@ advance its highlights without discontinuities across floating-origin shifts. Op
|
|
|
398
413
|
avoids dark overlap seams while adjacent or parent/child water tiles refine. Expensive semantics
|
|
399
414
|
can be level-bounded, toggled without re-decoding resident objects, and disposed with the elevation
|
|
400
415
|
tile. Applications may replace the decoder, renderer, materials, or model geometry independently.
|
|
416
|
+
When the layer context carries an `admission` queue, the default renderer builds each tile with
|
|
417
|
+
`createTerrainSemanticObjectSliced`: the same group as `createTerrainSemanticObject`, built a couple
|
|
418
|
+
of milliseconds per admitted job (pausing between water polygons and building footprints), so a
|
|
419
|
+
harbor's water or a coarse tile's thousands of footprints no longer hold one frame.
|
|
420
|
+
|
|
421
|
+
Package semantic sources keep the last few decoded tiles, and older ones while a layer still holds
|
|
422
|
+
them, so the layers that each load a tile (classification, surfaces, water, tunnels, building
|
|
423
|
+
detail) share one decode. Tiles cross to workers as packets (`terrainSemanticTilePacket`); a tile
|
|
424
|
+
derived by replacing its buildings or transportation can carry its base's packet and the edit
|
|
425
|
+
(`deriveTerrainSemanticTilePacket`) instead of being cloned whole. A renderer that keeps tiles to
|
|
426
|
+
rebuild them later keeps `keepTerrainSemanticTile(tile)` rather than the tile: calling it answers
|
|
427
|
+
the tile while it lives, else decodes it again from its packet, so the decoded points need not
|
|
428
|
+
stay on the heap meanwhile.
|
|
429
|
+
|
|
430
|
+
Mapped lake polygons also clear coarse elevation and landcover beneath their water surface,
|
|
431
|
+
preserving polygon holes as islands. Small bank faces close the difference between the rendered
|
|
432
|
+
ground triangles and the water level; clipped tile edges do not become artificial banks. These
|
|
433
|
+
openings follow hydrology tile residency, independently of landmark loading, and restore the
|
|
434
|
+
original ground on hide/unload. Roads and bridge surfaces retain their geometry. Source height
|
|
435
|
+
samples remain available for anchoring and physics. Ground clipping keeps shared grid vertices
|
|
436
|
+
indexed instead of duplicating every triangle's attributes.
|
|
437
|
+
`shorelineGroundOffset` defaults to the landcover lift of 0.18m, including when hydrology and
|
|
438
|
+
classification render in separate layers; set it to `0` for a bare elevation surface.
|
|
401
439
|
|
|
402
440
|
For the standard path, `createTerrainPackageSemanticLayers` opens every optional sidecar and returns
|
|
403
441
|
classification, hydrology, and human-feature layers ready for
|
|
@@ -8,6 +8,9 @@ straight practice track. Player controls do not yet follow curved rail-network r
|
|
|
8
8
|
See the [close-view vehicle standard](medium-fi.md#controllable-vehicles-close-view-fidelity)
|
|
9
9
|
for the extra model detail expected around the operator.
|
|
10
10
|
|
|
11
|
+
Compare car colors and RV graphics in the [livery gallery](livery-gallery.md). The
|
|
12
|
+
[complete livery catalog](livery-catalog.md) lists selection ids and reference evidence.
|
|
13
|
+
|
|
11
14
|
World Explorer's parking cars are external entity types with stable IDs and metric dimensions.
|
|
12
15
|
The entity pack includes eleven Bendy road models and eighty U.S. market reference vehicles:
|
|
13
16
|
forty recent models plus forty varied models from 2005–2024. These range from the F-150,
|
|
@@ -148,6 +151,12 @@ ground (under open sky, never a roof or deck), `board(id)` without walking to th
|
|
|
148
151
|
in. The entity's `vehicle.color`, when set, paints the model's `paintMaterial`; without one the
|
|
149
152
|
authored paint stays.
|
|
150
153
|
|
|
154
|
+
Parked cars become simulation entities only within 300 m of the observer passed to `sync`, to
|
|
155
|
+
approach, board and collide with; farther ones that nobody moved are reclaimed and stay part of
|
|
156
|
+
their tile's merged mesh. Under an aircraft a town's parked cars were otherwise thousands of
|
|
157
|
+
dormant entities, spawned as each tile streamed in and visited every tick. The `vehicles` system
|
|
158
|
+
also passes over a dormant car after one lookup until a write replaces its state.
|
|
159
|
+
|
|
151
160
|
Passengers use the same mount contract. A `mountable` lists seats with a role: `driver` seats
|
|
152
161
|
drive, `passenger` seats ride. `mountEntity(world, actor, vehicle, 'passenger')` seats someone
|
|
153
162
|
beside the driver (stopped vehicle, within `reach` of the seat), the `mounted-seats` system carries
|
|
@@ -226,7 +235,10 @@ Surface objects expose `userData.vehicles: VehiclePlacement[]`; each record has
|
|
|
226
235
|
type `kind`, `color`, resolved `spec`, absolute metric `position`, and `yaw`, with optional
|
|
227
236
|
terrain-alignment `pitch` and `roll`. IDs derive from world-space bay positions rather
|
|
228
237
|
than tile IDs. Instance meshes retain `userData.vehicleIds` for promotion and duplicate suppression.
|
|
229
|
-
The worker transports the same placement records as synchronous generation.
|
|
238
|
+
The worker transports the same placement records as synchronous generation. Surface objects with
|
|
239
|
+
parked cars are tagged `'parked-vehicles'` and water surfaces `'water'` (`tagTerrainObject`), and
|
|
240
|
+
Earth view's vehicles visit `taggedTerrainObjects(tag)` shown under their root instead of walking
|
|
241
|
+
the whole scene five times a second; a host building its own such objects tags them the same way.
|
|
230
242
|
|
|
231
243
|
For repeatable visual review open
|
|
232
244
|
[World Explorer with `?synthetic=1&parking=1`](https://molen.dev/play/world-explorer/?synthetic=1&parking=1).
|
|
@@ -336,6 +336,13 @@ anchors repeat every 16 projected meters, with small gaps and varied widths. Eve
|
|
|
336
336
|
unobstructed approach from its street to its entrance or garage; homes never form landlocked rows
|
|
337
337
|
inside a block. Visible ground-following paths and driveways connect the entrances to the roadside.
|
|
338
338
|
Separately mapped sidewalks move the building setback behind the sidewalk while retaining access.
|
|
339
|
+
Inferred homes without an attached garage also receive a simple driveway to the front of the
|
|
340
|
+
house when the corridor is clear. Garage approaches and paths connect to the roadside. Weighted
|
|
341
|
+
`lotFences` (`none`, `timber`, `masonry`, `rail`) select low decorative yard boundaries, including
|
|
342
|
+
some fully open yards. Front fences leave gaps around every path and driveway and stay behind
|
|
343
|
+
mapped sidewalks. Fences follow the terrain, exclude vegetation, use a cheaper shape with simplified
|
|
344
|
+
nearby buildings, and disappear on distant tiles. They do not add physical collision barriers. Yard choices use an
|
|
345
|
+
independent identity salt, so decorating a lot does not move or re-roll its house.
|
|
339
346
|
Mapped footprints, occupied landmark extents, other streets, water and incompatible land uses
|
|
340
347
|
such as parks, farmland, schools and parking exclude the entire parcel, including its approach.
|
|
341
348
|
Slopes above 0.3 or more than three meters of height variation also exclude it.
|
|
@@ -380,9 +387,10 @@ source supplies matching semantic layers.
|
|
|
380
387
|
### Inferred trees around homes
|
|
381
388
|
|
|
382
389
|
Atlas region bindings and the worldwide default accept `treeFillFactor` from 0 to 1. The
|
|
383
|
-
shipped atlas uses 0.
|
|
384
|
-
unclassified regions. These are configurable visual priors,
|
|
385
|
-
or a global climate dataset. Fill is resolved at each home's
|
|
390
|
+
shipped atlas uses 0.35 in North America, overridden by 0.9 in the Pacific Northwest and 0 in
|
|
391
|
+
the Southwest; Japan uses 0.3 and unclassified regions use 0. These are configurable visual priors,
|
|
392
|
+
not measured canopy percentages or a global climate dataset. Fill is resolved at each home's
|
|
393
|
+
location, including region edges.
|
|
386
394
|
|
|
387
395
|
For complete low-rise footprints of 45–700 m², the Earth adapter adds an irregular yard patch
|
|
388
396
|
roughly 18–26 meters beyond the home. Explicit house classifications qualify; small untyped
|
|
@@ -401,7 +409,10 @@ Mapped woodland, parks, parking, playing fields, farmland, barren ground, and ot
|
|
|
401
409
|
land cover are cut out before planting. Road, building, water, and mapped-tree exclusions still
|
|
402
410
|
apply, as do slope/altitude limits and instance budgets. Neighboring buffered footprints
|
|
403
411
|
participate even when their building mesh belongs to another tile; trees emit only inside the
|
|
404
|
-
current tile. Coverage still depends on the footprints supplied in the source tile buffer.
|
|
412
|
+
current tile. Coverage still depends on the footprints supplied in the source tile buffer. When
|
|
413
|
+
a terrain package declares `features.buildingDetail`, classification and building rendering share its
|
|
414
|
+
detailed footprints and mapped trees. The same depth limit and missing-coverage fallback apply
|
|
415
|
+
to both; water rendering does not wait for building detail.
|
|
405
416
|
|
|
406
417
|
The dedicated `home_canopy` scatter rule controls species, spacing, setbacks, and detail tiers;
|
|
407
418
|
custom packs opt in by supplying this rule label. Species use the tile's regional scatter set,
|
|
@@ -518,7 +529,11 @@ scatter material: a shader that can discard switches off hidden-surface removal
|
|
|
518
529
|
GPUs, so a distant forest drawn with the card material shaded every layer of crowns behind the
|
|
519
530
|
first. For the same reason a level drawn with cards hands over to the next at a quarter of the
|
|
520
531
|
projected error its geometry alone would allow (a crown's cards overlap several deep), and the
|
|
521
|
-
distant level neither casts nor receives sun shadows.
|
|
532
|
+
distant level neither casts nor receives sun shadows. With `vanishPixels` a batch stops drawing
|
|
533
|
+
once its largest instance spans fewer pixels than that from the batch's nearest point (15%
|
|
534
|
+
hysteresis): the semantic renderers pass 1.5 for street props and signs, which from a few
|
|
535
|
+
kilometers were a draw each for a pixel or less, but not for plants, as a distant forest is the
|
|
536
|
+
sum of its trees. Buildings retain their structural faces while distant materials and facade details
|
|
522
537
|
simplify; geometry attributes are shared across spatial cells and levels. `setQuality(preset)`
|
|
523
538
|
changes future generation and queues resident architecture for replacement, one building batch
|
|
524
539
|
at a time. The previous buildings stay visible until their replacements are ready; roads remain
|
package/dist/docs-src/llms.txt
CHANGED
|
@@ -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.
|
|
7
|
+
Engine version: 0.0.9. 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
|
|
|
@@ -25,6 +25,9 @@ downloads them into a project and pins them in project.json.
|
|
|
25
25
|
- [Projects & types](guide/project.md): project.json, the namespaced entity type registry, reservations, and typed TS authoring (`defineExperience` + `molen types gen`).
|
|
26
26
|
- [Projects & content packs](guide/project.md): content (entity types and models, style packs, catalogs, stars) ships as `molen/pack@1` zip packs, never in npm packages; list them in project.json `packs` or open them with `@bendyline/molen-pack`.
|
|
27
27
|
- [Reusable entities](guide/entities.md): the `molen.entities` content pack (trees, rocks, aircraft, vehicles) and how to bind it through a pack's asset provider.
|
|
28
|
+
- [Vehicle liveries](guide/liveries.md): selectable paint slots, camouflage and projected markings shared by aircraft, cars, RVs and boats; model-independent recipes and reference provenance.
|
|
29
|
+
- [Livery gallery](guide/livery-gallery.md): rendered aircraft, RV and car comparisons, with an explicit audit of reference-inspired and original designs.
|
|
30
|
+
- [Complete livery catalog](guide/livery-catalog.md): every vehicle type and livery id, evidence classification and source links, generated from the runtime catalog.
|
|
28
31
|
- [Scripting](guide/scripting.md): game logic as scene-data scripts (the verb set, `molen.onCommand` for input) or a setup module; `molen types gen` + `molen scripts check` type-check them. Scripts run with the host process's authority — see "Script trust" below.
|
|
29
32
|
- [Determinism](guide/determinism.md): the contract — what reproduces and at what level per subsystem, what breaks it, what `STATE_FORMAT` means for save files and recorded replays, and what is explicitly not promised.
|
|
30
33
|
- [Browser mount](guide/browser-mount.md): `buildWorld` in a Worker + `await mountExperience` on the page; events and state for HUDs.
|
|
@@ -34,6 +37,7 @@ downloads them into a project and pins them in project.json.
|
|
|
34
37
|
- [Earth view](guide/earth-view.md): `mountEarthView` from `@bendyline/molen-earth` — real-world terrain, buildings, landmarks, orbit/walk/drive/fly (cars on the nearest road, airborne P-51 or OH-6), a `vehicleStatus()` HUD feed, decluttered lat/lon markers, credits and adaptive quality in one call.
|
|
35
38
|
- [WebGPU and WebGL](guide/rendering-backends.md): the `backend` option ('auto' | 'webgl' | 'webgpu') on the asynchronous client factories, legacy WebGL fallback, compatible materials, and world-explorer comparisons.
|
|
36
39
|
- [Earth and authored skies](guide/sky.md): day/night cycles, geographic Sun/Moon positions and lunar phases, catalog stars, simulation clocks, custom-world palettes, and the sky observatory.
|
|
40
|
+
- [Night lighting](guide/night-lighting.md): deterministic occupied windows, streetlamp emission and pavement pools, dusk activation, and light metadata for authored models.
|
|
37
41
|
- [Weather and physical atmosphere](guide/weather.md): independent clouds, precipitation and visibility; profiles, temperature/pressure/wind for simulation and aircraft physics; cloud/rain/snow rendering.
|
|
38
42
|
- [Sound and music](guide/audio.md): sound banks, `audioEnvironment`/`audioSource`/`audioZone` rules driven by weather, sky, listener and entity signals, `molen.audio.*` in scripts, `molen audio plan` to hear a scene headlessly, and the CC0 `molen.sounds` pack.
|
|
39
43
|
- [Graphics performance](guide/graphics-performance.md): sparse transforms, static instancing, worker preparation, staged uploads, animation/light policy and terrain transitions.
|
|
@@ -56,6 +60,7 @@ downloads them into a project and pins them in project.json.
|
|
|
56
60
|
- [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`.
|
|
57
61
|
- [Components](schemas/components.md): the component vocabulary `molen validate` checks against.
|
|
58
62
|
- [Mountable vehicles](guide/vehicles.md): stable parking entities, driver seats, deterministic vehicle physics, safe exits, and cockpit/chase views.
|
|
63
|
+
- [Boost mode](guide/boost-mode.md): optional 4× travel for people, vehicles and ambient life; Earth T toggle, host API and snapshot-safe kernel setting.
|
|
59
64
|
- [Boats and water](guide/boats.md): powered hulls, helm controls, passengers, boarding points, swells, currents and Earth-view water coverage.
|
|
60
65
|
- [Aircraft](guide/aircraft.md): P-51D and OH-6 assets, flight physics, cockpit instruments, practice airfield and controls.
|
|
61
66
|
- [Vehicle interiors and model signals](guide/vehicle-interiors.md): model-owned cabins, declarative simulation-to-GLB bindings, keyframed exterior animation (landing gear, doors, control surfaces), script-owned telemetry, and nearby detail loading.
|
|
@@ -373,6 +373,35 @@ How to turn any outline into a styled building: massing, roof grammar, facade rh
|
|
|
373
373
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
374
374
|
"type": "object",
|
|
375
375
|
"properties": {
|
|
376
|
+
"lotFences": {
|
|
377
|
+
"description": "Weighted fence types for invented residential lots. none leaves the yard open.",
|
|
378
|
+
"minItems": 1,
|
|
379
|
+
"maxItems": 16,
|
|
380
|
+
"type": "array",
|
|
381
|
+
"items": {
|
|
382
|
+
"type": "object",
|
|
383
|
+
"properties": {
|
|
384
|
+
"kind": {
|
|
385
|
+
"type": "string",
|
|
386
|
+
"enum": [
|
|
387
|
+
"none",
|
|
388
|
+
"timber",
|
|
389
|
+
"masonry",
|
|
390
|
+
"rail"
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
"weight": {
|
|
394
|
+
"type": "number",
|
|
395
|
+
"exclusiveMinimum": 0
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"required": [
|
|
399
|
+
"kind",
|
|
400
|
+
"weight"
|
|
401
|
+
],
|
|
402
|
+
"additionalProperties": false
|
|
403
|
+
}
|
|
404
|
+
},
|
|
376
405
|
"lotPlans": {
|
|
377
406
|
"minItems": 1,
|
|
378
407
|
"maxItems": 32,
|