@bendyline/molen-tooling 0.0.16 → 0.0.17
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 +376 -363
- package/dist/capture/worldgen-preview.js +256 -256
- package/dist/docs-src/guide/3d-art-guidelines.md +10 -7
- package/dist/docs-src/guide/determinism.md +1 -1
- package/dist/docs-src/guide/earth-view.md +17 -0
- package/dist/docs-src/guide/entities.md +4 -1
- package/dist/docs-src/guide/graphics-performance.md +78 -6
- package/dist/docs-src/guide/medium-fi.md +3 -2
- package/dist/docs-src/guide/night-lighting.md +3 -0
- package/dist/docs-src/guide/recognizable-places.md +47 -4
- package/dist/docs-src/guide/rendering-backends.md +5 -2
- package/dist/docs-src/guide/surface-rendering.md +10 -3
- package/dist/docs-src/guide/typography.md +36 -0
- package/dist/docs-src/guide/vehicles.md +6 -1
- package/dist/docs-src/llms.txt +1 -1
- package/dist/docs-src/schemas/README.md +1 -0
- package/dist/docs-src/schemas/components.md +41 -0
- package/dist/docs-src/schemas/sign-looks.md +174 -0
- package/dist/docs-src/schemas/worldgen-batch.md +41 -0
- package/dist/templates/city-courier/gen/molen-types.ts +9 -1
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +8 -0
- package/dist/templates/index.json +17 -17
- package/dist/templates/skybound/gen/molen-types.ts +9 -1
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +8 -0
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +8 -0
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +9 -1
- package/package.json +12 -12
|
@@ -25,10 +25,11 @@ reconstructions. Surface detail does not compensate for incorrect body or cabin
|
|
|
25
25
|
## Recognition and shape
|
|
26
26
|
|
|
27
27
|
Work from large to small: footprint and height, roof and massing, entrance and facade rhythm,
|
|
28
|
-
then sign and surface detail.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
emblem
|
|
28
|
+
then sign and surface detail. A mapped business shows its mapped name on a plain plate, set in the
|
|
29
|
+
shared lettering faces, in a look of plate, letter and band colors; a recognized chain's colors are
|
|
30
|
+
source-inspired, never its logo, emblem or typeface. A descriptor model stands in where there is
|
|
31
|
+
no name: a generic category wordmark, an initial-based emblem, a controlled accent color and an
|
|
32
|
+
entrance treatment, with generic model IDs, filenames, titles and emblem geometry.
|
|
32
33
|
|
|
33
34
|
Keep mapped footprints, courtyards, height, and minimum height when supplied. Missing height is
|
|
34
35
|
unknown: the category recipe supplies a conservative default. An identified tenant does not
|
|
@@ -74,7 +75,7 @@ model; scene and tile budgets still control total instances and building vertice
|
|
|
74
75
|
|
|
75
76
|
| Asset | Near target | Medium/distant treatment |
|
|
76
77
|
| --- | --- | --- |
|
|
77
|
-
| Identity sign |
|
|
78
|
+
| Identity sign | Descriptor model under 650 triangles, one material; a named sign about 10 plus 2 a letter | Remove small lettering first; retain symbol, plate and color |
|
|
78
79
|
| Bench, rack, charger, lamp | 50–500 triangles | Merge slats/cables; retain silhouette |
|
|
79
80
|
| Ordinary tree | 300–2,000 triangles | Fewer crown clusters, then a faceted crown/cone |
|
|
80
81
|
| Small static building | 1,000–8,000 triangles | Remove furniture and small facade details |
|
|
@@ -84,8 +85,10 @@ model; scene and tile budgets still control total instances and building vertice
|
|
|
84
85
|
|
|
85
86
|
Higher budgets need a visible reason and a distance fallback. Repeated street furniture and signs
|
|
86
87
|
should be instanced by model reference. Prefer a shared vertex-color material; do not allocate
|
|
87
|
-
one material or texture per store.
|
|
88
|
-
|
|
88
|
+
one material or texture per store. Named signs follow the same rule: every one shares one glyph
|
|
89
|
+
atlas texture and one material, and a tile's names are a single mesh. Never put an unlimited number
|
|
90
|
+
of signs on a complex outline: the current frontage contract admits at most twelve per generated
|
|
91
|
+
building.
|
|
89
92
|
|
|
90
93
|
The sign library preserves exact geometry between instances. Source business identity controls
|
|
91
94
|
matching; stable feature identity controls placement and variation. Do not use wall-clock time,
|
|
@@ -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.
|
|
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.** |
|
|
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
|
|
@@ -526,6 +526,23 @@ Entity types come from every opened pack that provides `types` documents, merged
|
|
|
526
526
|
library with the entities pack first: pass your own pack's id in `ids` (for example
|
|
527
527
|
`[...Object.values(EARTH_PACK_IDS), 'my.app']`) and its figure or prop types sit beside the stock
|
|
528
528
|
cars and aircraft in `content.types`. A type id declared by two packs is an error that names both.
|
|
529
|
+
A type that fails its checks is left out, with any type that extends it, and reported through
|
|
530
|
+
`onWarning` (default `console.warn`); the rest still load.
|
|
531
|
+
|
|
532
|
+
Types are fully validated by default, which costs about half a second of main thread for the stock
|
|
533
|
+
aircraft and vehicles before a view can mount. A host that serves packs it built and validated
|
|
534
|
+
itself (`molen pack verify`, or `createTypeLibrary` in its build) can pass
|
|
535
|
+
`loadEarthContent(packs, { typeChecks: 'structure' })`: only what resolving relies on is checked,
|
|
536
|
+
and component fields this engine version does not know are kept instead of rejected.
|
|
537
|
+
`loadEarthContent` reads types, fonts, the style pack and the catalogs at once, so a large types
|
|
538
|
+
download does not hold up the rest.
|
|
539
|
+
|
|
540
|
+
Storefront signs show the names the map gives their places, set from the `molen.earth` pack's
|
|
541
|
+
glyph atlas; Japanese names need the Kyoto glyph pack, `molen.glyphs.kyoto`, opened beside it (pass
|
|
542
|
+
its id in `ids`). Other scripts, and names no open pack can set, fall back to the map's English
|
|
543
|
+
name, then to a generic descriptor such as `EATERY`. `signNames: 'generic'` on `mountEarthView`
|
|
544
|
+
shows the descriptors everywhere, with no business name. See
|
|
545
|
+
[Names on signs](recognizable-places.md#names-on-signs).
|
|
529
546
|
|
|
530
547
|
`openPacksFromIndex(indexUrl, ids, fetchImpl)` accepts a host fetch implementation for the index,
|
|
531
548
|
archive opening and subsequent asset requests. Landmark model bytes are loaded as nearby
|
|
@@ -48,7 +48,10 @@ The entity type id and renderable asset ref are identical, such as
|
|
|
48
48
|
`molen.entities.tree.conifer.pine`. For the type definitions, list the pack in the project's
|
|
49
49
|
`packs` (see [Projects & types](project.md)); the CLI then resolves every `molen.entities.*` type.
|
|
50
50
|
In code, read the documents the manifest `provides` as `types` and pass them to
|
|
51
|
-
`createTypeLibrary` from `@bendyline/molen-kernel/content`.
|
|
51
|
+
`createTypeLibrary` from `@bendyline/molen-kernel/content`. It validates every document against
|
|
52
|
+
the schema by default; `{ checks: 'structure' }` checks only what resolving needs (the envelope,
|
|
53
|
+
type shapes, namespaces, script sources and `extends` cycles), for content validated where it was
|
|
54
|
+
built, and `onSkip` leaves out a failing type, with any that extend it, instead of throwing.
|
|
52
55
|
|
|
53
56
|
In the engine repository, run `molen asset list` in `content/entities`, `molen types check --project
|
|
54
57
|
content/entities/project.json`, or render `content/entities/scenes/gallery.scene.json` with
|
|
@@ -81,6 +81,13 @@ or more each while work waits), also get that share of themselves as budget: 2 m
|
|
|
81
81
|
software frame left streaming under half a percent of the time, and a town's semantic layers
|
|
82
82
|
spent their two-minute deadline in the queue. Interactive rates and a single long frame keep the
|
|
83
83
|
fixed budget. `setLimits` changes the budget from the next frame on.
|
|
84
|
+
|
|
85
|
+
A fixed small budget protects the frame rate of a view that keeps up, and starves one that does
|
|
86
|
+
not. `backlog: { afterMs, maxMilliseconds, maxBytes }` (in the options or `setLimits`) lets the
|
|
87
|
+
budget grow while work is backing up: once the oldest waiting job outside the background lane
|
|
88
|
+
has waited `afterMs`, the frame's time and byte budgets rise with its wait and reach the backlog
|
|
89
|
+
values at twice that. They fall back as soon as the queue keeps up again, so a view at rest and a
|
|
90
|
+
slow pan never pay for it.
|
|
84
91
|
A job's `priority` is `'normal'`, `'background'` or `'urgent'` (ahead of normal jobs, in its own
|
|
85
92
|
order). Background jobs run in budget normal jobs leave and, once one has waited
|
|
86
93
|
`backgroundWaitMs` (default 750), take a turn after every `backgroundShare` other jobs (default
|
|
@@ -137,7 +144,33 @@ Kyoto, some 1.4 million of the objects each collection walks.
|
|
|
137
144
|
|
|
138
145
|
Three updates every object's world matrix each frame, hidden ones included. Hidden terrain tiles,
|
|
139
146
|
pooled ambient figures (each with its skeleton) and the explorer's parked-aircraft cockpits skip
|
|
140
|
-
that walk until they show again.
|
|
147
|
+
that walk until they show again.
|
|
148
|
+
|
|
149
|
+
Three also culls one mesh at a time, and only once it has walked to it: for world matrices, for
|
|
150
|
+
levels of detail and what to draw, and once more for each shadow map. A streamed world keeps
|
|
151
|
+
most of its tiles outside the view, finished and ready for a turn of the camera. On WebGL the
|
|
152
|
+
renderer leaves a render group (`createRenderGroup`, which the terrain stream uses for each tile)
|
|
153
|
+
out of the scene walk while its bounds lie wholly outside the camera's view, and out of a
|
|
154
|
+
directional light's shadow map while they lie outside that map; a group the camera cannot see
|
|
155
|
+
still casts into a map that reaches it. The group is hidden for the render alone, so nothing else
|
|
156
|
+
sees it change. Its owner states the bounds in `userData.renderBounds` (`RENDER_BOUNDS`: a
|
|
157
|
+
`Box3` in the frame of the group's parent, holding everything it draws) and keeps them true:
|
|
158
|
+
`expandRenderBounds` measures content from the bounds its meshes carry, and code that adds or replaces geometry
|
|
159
|
+
inside streamed content later (a landmark's next level of detail) calls
|
|
160
|
+
`markRenderBoundsChanged(object)`, after which the group is not culled until its owner has
|
|
161
|
+
measured it again. The terrain stream does all of this for its tiles. Over Seattle at High about
|
|
162
|
+
half of the tiles on show lay outside the view of a low flight, and leaving them out took the
|
|
163
|
+
main thread's time in a frame's render from 17-22 ms to 12-13 ms with the same draws.
|
|
164
|
+
`cullRenderGroups: false` turns it off (`?cull=0` in World Explorer).
|
|
165
|
+
|
|
166
|
+
An instanced detail switch (the level-of-detail batch for plants and props) chooses its level
|
|
167
|
+
again only once the camera could have reached a handover: each choice keeps how far the
|
|
168
|
+
measured distance was from the nearest threshold, and the camera's travel since, with any change
|
|
169
|
+
in the error budgets, is weighed against that. In flight nearly every batch is well short of its
|
|
170
|
+
next handover, and choosing again for each of some 2,200 of them every frame was 2.6 ms of a
|
|
171
|
+
33 ms frame.
|
|
172
|
+
|
|
173
|
+
Far detail stops drawing: a surface tile's signs, fixtures,
|
|
141
174
|
signal lenses, markings and parked cars past their draw distance (`updateDetail`, see
|
|
142
175
|
[surface rendering](surface-rendering.md)) and street props below 1.5 px (`vanishPixels`, see
|
|
143
176
|
[worldgen](worldgen.md)); at High over a town that cut a fifth of the draws. A visibility pass makes
|
|
@@ -148,13 +181,33 @@ cuts on every frame, sharing one 4 ms budget a frame with `stream.update`: hosts
|
|
|
148
181
|
ten times a second while the camera is still, and at one budget an update, ground that a descent
|
|
149
182
|
had just shown stood uncut over its own harbor for most of a second.
|
|
150
183
|
|
|
184
|
+
Where the stream's height source can cut off the main thread (`TerrainPyramidHeightSource.cutGround`,
|
|
185
|
+
a `TerrainGroundCutter`; the elevation worker's source has one), the clipping is done there. The
|
|
186
|
+
controller sends the mesh's arrays as copies, goes on to other ground, and swaps the cut in when
|
|
187
|
+
it lands, so the frame's budget pays for gathering openings and the swap alone; a cut whose
|
|
188
|
+
opening goes meanwhile is called off, and one the cutter fails is made on the main thread. A
|
|
189
|
+
mesh of fewer than 5,000 vertices (`cutVertices`) is still cut on the main thread, in the pass
|
|
190
|
+
that first shows it: a few milliseconds, against ground standing uncut for the trip's frames. A
|
|
191
|
+
tile's land cover over a shoreline is some 38,000 vertices against 50 openings: 46 ms of clipping,
|
|
192
|
+
of which a low flight over Seattle at High finished 48 in 50 seconds at 4 ms a frame, leaving most
|
|
193
|
+
ground it passed waiting for its cut. The worker made some 250 in a minute of the same flight,
|
|
194
|
+
and cutting fell from 7% of the main thread to under 2%.
|
|
195
|
+
|
|
151
196
|
Earth hosts admit more while frames have time to spare: `createEarthAdmissionGovernor(backend)`
|
|
152
197
|
smooths each frame's main-thread work and, through `earthAdmission`, switches the queue to 8 MiB
|
|
153
198
|
of uploads a frame (and 4 ms of work on WebGL) below 10 ms of work, back to the renderer's
|
|
154
199
|
defaults above 13 ms. Each terrain tile and layer passes several admission jobs; at 2 MiB a frame
|
|
155
200
|
everything behind a building cell's upload waited 30 ms a job, and ground and buildings beneath a
|
|
156
201
|
jet appeared a second late. A render-bound frame (High detail over a town) loses a sixth of its
|
|
157
|
-
rate to the larger budget, so it keeps the defaults
|
|
202
|
+
rate to the larger budget, so it keeps the defaults while it keeps up. Either budget carries a
|
|
203
|
+
backlog (above) that grows it toward the arrival budget, 8 ms and 16 MiB, once work has waited
|
|
204
|
+
`EARTH_BACKLOG_MS` (400 ms): a P-51 at 290 kt over Seattle at High always had busy frames, the
|
|
205
|
+
2 ms published a quarter of the layers the flight asked for, each job waited 3 s on average for
|
|
206
|
+
each of a layer's several turns, and no tile beyond 2 km had all of its layers on show at any
|
|
207
|
+
point of the flight: bare ground ahead, buildings arriving beneath. Held at 4 ms the same flight kept its 30 frames a second and finished four
|
|
208
|
+
fifths of the ground within 2 km; at 8 ms it finished nearly all of the view at 22 frames a
|
|
209
|
+
second, drawing three times the triangles. The backlog moves between the two as the queue needs.
|
|
210
|
+
This is not a hard GPU/driver time bound. Texture
|
|
158
211
|
initialization, geometry preparation and async shader compilation use public Three facilities;
|
|
159
212
|
shared resources share pending preparation promises. A cancelled tile cannot cancel another
|
|
160
213
|
tile waiting on the same resource; queued work is dropped once every tile waiting for it has
|
|
@@ -165,8 +218,11 @@ camera and waits only for the selected levels. The other levels prepare in the q
|
|
|
165
218
|
lane (`priority: 'background'`), which runs only in budget that normal jobs leave, and are dropped
|
|
166
219
|
if their mesh or geometry is disposed first. This includes geometry-switch LODs whose current
|
|
167
220
|
level is empty: invisible ground cover does not delay an aerial tile, and a later approach waits
|
|
168
|
-
for its preparation before revealing it.
|
|
169
|
-
|
|
221
|
+
for its preparation before revealing it. Preparation shares the visible-light list instead of
|
|
222
|
+
walking the whole scene for each mesh, and the walk that finds the lights is made again only when
|
|
223
|
+
the scene's own children change or a quarter of a second has passed (each frame still checks
|
|
224
|
+
which of them are on show): once a frame, it was 1.2 ms of every frame of a flight over a city.
|
|
225
|
+
A mesh that swaps its own material (an instanced
|
|
170
226
|
detail switch's opaque and shadow-free twins) lists every material in `userData.materialVariants`,
|
|
171
227
|
and the renderer sets `userData.materialReady(material)`, which the mesh's owner asks before
|
|
172
228
|
switching. Until it returns true the owner keeps what it shows; the first question queues that
|
|
@@ -231,10 +287,21 @@ admitted job of up to 20 ms. The grading itself finds each sample row's polygon
|
|
|
231
287
|
ground edges once, instead of testing every edge of an airport's grounds for every sample: a tenth
|
|
232
288
|
of a second a tile over Boeing Field.
|
|
233
289
|
|
|
290
|
+
Road earthworks (`createTerrainRoadGrading`'s `transformHeightfield`) are graded in the worker
|
|
291
|
+
too, where the source has `gradeEarthworks`. The host sends the tile's field and the road lines
|
|
292
|
+
that reach it; the worker reads the reference ground from its own decoded tiles, grades, and
|
|
293
|
+
meshes the result in the same trip, about 30 ms a town tile. On the main thread that was 2 ms
|
|
294
|
+
slices between frames, outside the frame queue, and 4 to 9% of the thread in a low flight over a
|
|
295
|
+
city. A reference tile is read as samples (`load`), without the full-resolution mesh
|
|
296
|
+
`loadPrepared` builds for a tile to be drawn. Bridge profiles (`gradeTile`) are still worked out
|
|
297
|
+
on the main thread, about 3% of it in that flight: a worker would need the tile's roads and its
|
|
298
|
+
neighbors' copied across, most of which no bridge is near.
|
|
299
|
+
|
|
234
300
|
The worker entry calls `installTerrainElevationWorker(self)`, exported from
|
|
235
301
|
`@bendyline/molen-terrain/client` (use the worker-scope type cast shown by World Explorer when
|
|
236
302
|
compiling with DOM rather than WebWorker types). The host reads archive bytes; the worker
|
|
237
|
-
owns PNG decoding, its decoded tile cache, ancestor resampling
|
|
303
|
+
owns PNG decoding, its decoded tile cache, ancestor resampling, surface meshing, road earthworks
|
|
304
|
+
and ground cuts. Worker
|
|
238
305
|
buffers transfer without detaching archive caches or reusable topology. Omitting the worker
|
|
239
306
|
retains the in-thread path. Worker errors are surfaced; they do not silently trigger duplicate work.
|
|
240
307
|
|
|
@@ -393,7 +460,12 @@ rebase above it is applied when it shows again. `stats()` walks every displayed
|
|
|
393
460
|
exact byte totals and adds hidden tiles' tracked buffers; a live panel passes
|
|
394
461
|
`{ geometry: 'tracked' }` for the retained estimate and visible-only counts. Ground cutouts stay on hidden tiles while their
|
|
395
462
|
openings remain, keep the source grid's indices for triangles away from every opening, and
|
|
396
|
-
re-count only the tiles whose ground they changed.
|
|
463
|
+
re-count only the tiles whose ground they changed. A cut is its source grid's vertices as they
|
|
464
|
+
are, then the few made on clipped edges, and the source stays for the next cut; once a cut is
|
|
465
|
+
applied the source's attributes read from the cut's arrays, so the pair holds its vertices once in
|
|
466
|
+
main memory. Over Seattle, where most ground meets water somewhere, the second copy was 174 of
|
|
467
|
+
1,139 MiB on show at High (the page's array buffers fell from 1,403 to 1,233 MiB without it). The
|
|
468
|
+
source's GPU buffers stay until its tile goes.
|
|
397
469
|
|
|
398
470
|
Height queries prefer displayed terrain and fall back to resident heights outside the visible
|
|
399
471
|
cut. An aircraft's center can pass behind its cockpit camera at a tile boundary; it must not wait
|
|
@@ -421,8 +421,9 @@ reference and proportion work; Bendy styling is not a substitute for the real ve
|
|
|
421
421
|
- Never bake directional light, shadows, ambient occlusion or dirt gradients into base color.
|
|
422
422
|
- Glass is a dark blue-grey pane with a modest reflection, not a mirror: the shared window graphs
|
|
423
423
|
give frames a satin roughness and panes a smooth one, so the sky reflects in the pane and
|
|
424
|
-
brightens it toward grazing angles.
|
|
425
|
-
|
|
424
|
+
brightens it toward grazing angles.
|
|
425
|
+
- Identity lettering is geometry, vertex color, or letters from the one shared glyph atlas
|
|
426
|
+
(storefront names), never a texture per business.
|
|
426
427
|
- Photographs from research are evidence, not textures, and never ship inside a model.
|
|
427
428
|
|
|
428
429
|
## Procedural buildings that fit any footprint
|
|
@@ -43,6 +43,9 @@ materials are retained.
|
|
|
43
43
|
|
|
44
44
|
Modern surfaces place lamps along paved streets with sidewalks and at intersections. Placement
|
|
45
45
|
is bounded, terrain-aware and avoids mapped buildings and water. Long blocks get fixtures at roughly 28 m intervals, alternating sides.
|
|
46
|
+
Arterials (motorways, trunk and primary roads, and any road of four or more lanes) get 7.4 m
|
|
47
|
+
mast arms whose heads hang over the carriageway; other streets get 5 m post-top lanterns at the
|
|
48
|
+
curb. A corner lamp is a mast arm when any road at its junction is an arterial.
|
|
46
49
|
Bridges, tunnels and unpaved roads do not receive inferred block lighting. Explicit
|
|
47
50
|
`tags.lit: "no"` disables block lamps. The existing surface style and `details.streetlights`
|
|
48
51
|
control whether fixtures are generated; historic and unlit styles keep their own choices.
|
|
@@ -9,12 +9,38 @@ the archive's zoom-15 tiles.
|
|
|
9
9
|
## Identity library
|
|
10
10
|
|
|
11
11
|
The Earth catalog recognizes **44 mapped source businesses** by exact aliases and verified source
|
|
12
|
-
IDs. Each match selects a
|
|
13
|
-
Walmart maps to `sign.mart_store`, Taco Bell maps to `sign.taco_place`, Best Buy maps to
|
|
12
|
+
IDs. Each match selects a descriptor model, the sign a place shows when it has no name to show: for
|
|
13
|
+
example, Walmart maps to `sign.mart_store`, Taco Bell maps to `sign.taco_place`, Best Buy maps to
|
|
14
14
|
`sign.electronics_store`, and The Home Depot maps to `sign.hardware_store`. The
|
|
15
15
|
[retail catalog](https://github.com/bendyline/molen/blob/main/content/earth/businesses/README.md) documents the
|
|
16
16
|
source data and mapping policy.
|
|
17
17
|
|
|
18
|
+
## Names on signs
|
|
19
|
+
|
|
20
|
+
A storefront sign shows the name the map gives its place, so a street reads as its real
|
|
21
|
+
counterpart does: Thai Tom and Samir's Mediterranean Grill on Seattle's University Way, スターバックス
|
|
22
|
+
and 大垣書店 on Kyoto's Karasuma-dori.
|
|
23
|
+
|
|
24
|
+
- **One name per chain.** A business the catalog recognizes shows the same name on every branch:
|
|
25
|
+
its first alias, or the alias the map wrote in another script. Its plate, letters and accent band
|
|
26
|
+
take its descriptor sign's palette (white on red for Safeway, green for Starbucks), never a logo,
|
|
27
|
+
emblem, wordmark or brand typeface.
|
|
28
|
+
- **Its own name for everything else.** A place the catalog does not know shows its mapped name,
|
|
29
|
+
cleaned of store numbers, a trailing parenthesized branch (`(Downtown)`) and decorative symbols.
|
|
30
|
+
It takes a look from its category's family in the
|
|
31
|
+
[sign looks](https://github.com/bendyline/molen/blob/main/content/earth/businesses/sign-looks.json)
|
|
32
|
+
(`molen/sign-looks@1`), picked by the name, so every branch of a local chain matches.
|
|
33
|
+
- **Fallbacks.** A name the loaded faces cannot set falls back to the map's English name, then to
|
|
34
|
+
the descriptor sign. So does a place without a name, and every place when the host passes
|
|
35
|
+
`signNames: 'generic'`.
|
|
36
|
+
|
|
37
|
+
Names are set from glyph atlases (see [Fonts and lettering](typography.md#glyph-atlases)): the Earth
|
|
38
|
+
pack's Latin faces, plus any region pack that adds its scripts, such as the Kyoto pack's Japanese.
|
|
39
|
+
A tile's named signs are one mesh, two triangles a letter, drawn with one shared texture and
|
|
40
|
+
material: on Seattle's University Way the 149 storefronts of one tile are 5,322 triangles, where
|
|
41
|
+
their descriptor models were 59,233. Letters are drawn while they are a few pixels tall and plates
|
|
42
|
+
until they are under two, then neither.
|
|
43
|
+
|
|
18
44
|
Nine generic treatments cover grocery, restaurant, cafe, pharmacy, shop, department store, shopping
|
|
19
45
|
mall, outlet center and strip mall. These also support unnamed points with known categories.
|
|
20
46
|
Unknown identities keep the normal architectural fallback. This is a stylized descriptor library,
|
|
@@ -72,7 +98,8 @@ stores, enclosed malls, strip malls and outlet centers. Broad frontages raise an
|
|
|
72
98
|
fascia to remain readable on taller shells; source heights and floor counts still win. The building
|
|
73
99
|
generator adapts that treatment to a measured footprint; this is not a fixed building mesh.
|
|
74
100
|
Mapped-business descriptors use `symbol: "letters"` with initials derived from their generic
|
|
75
|
-
titles. Source recognition stays in the Earth catalog
|
|
101
|
+
titles. Source recognition stays in the Earth catalog and the descriptor models stay generic; the
|
|
102
|
+
names a sign shows come from the map, set as described in [Names on signs](#names-on-signs).
|
|
76
103
|
Furniture uses `generator: "boxes"` with ordered
|
|
77
104
|
metric parts and optional detail tiers (0 near, 1 medium, 2 distant).
|
|
78
105
|
|
|
@@ -85,6 +112,13 @@ only data crosses the Worker boundary. Without `places`, mapped businesses are n
|
|
|
85
112
|
no street furniture is placed. Rendering cache keys include both content hashes, so palette and
|
|
86
113
|
recipe changes invalidate cached terrain render output.
|
|
87
114
|
|
|
115
|
+
To show names, add `signLooks` (the Earth pack's `sign-looks` document) and `glyphs` (every open
|
|
116
|
+
pack's `glyph-atlas` documents, the Earth pack's first); `signNames: 'generic'` leaves them off.
|
|
117
|
+
The renderers then need a `signMaterial`: `createSignMaterialAsync(backend, texture,
|
|
118
|
+
range)` from `@bendyline/molen-worldgen/client`, over `createSignAtlasTexture` of the atlas pages.
|
|
119
|
+
`loadEarthContent` and the Earth view do all of this: the content's `signAtlas()` reads the pages,
|
|
120
|
+
and the view's `signNames` option turns names off.
|
|
121
|
+
|
|
88
122
|
Landmarks alone are `createLandmarkLibrary({ catalog, models })` from
|
|
89
123
|
`@bendyline/molen-worldgen/kernel`, or `resolveLandmarkCatalogDocuments(catalog, readDocument)` for
|
|
90
124
|
just the definitions; pass definitions to `generateLandmarkModel(id, definitions, tier)` or
|
|
@@ -120,7 +154,10 @@ The engine uses generic `BuildingRequest.appearance` and `storefronts` fields; g
|
|
|
120
154
|
and category matching stay in the Earth adapter. Custom scenes can supply those same fields through
|
|
121
155
|
`worldgenBuilding`. Each storefront supplies an identity, local anchor, accent, model reference,
|
|
122
156
|
optional native sign size, and desired width. Canonical signs are 4 × 1.35 m, front +Z, base Y=0.
|
|
123
|
-
Signs and outdoor objects use shared instanced geometry and a shared vertex-color material.
|
|
157
|
+
Signs and outdoor objects use shared instanced geometry and a shared vertex-color material. A
|
|
158
|
+
storefront may also carry a `sign` (text, plate, ink, optional band, font role, letter spacing):
|
|
159
|
+
with a glyph atlas set on the batch (`glyphs`), it is set as a name in the batch's sign mesh
|
|
160
|
+
(`WorldgenBatchOutput.signs`); without one, or when the atlas lacks a letter, the sign model shows.
|
|
124
161
|
|
|
125
162
|
## Mapped outdoor objects
|
|
126
163
|
|
|
@@ -131,6 +168,12 @@ are ground-fitted, deduplicated and budgeted before procedural scatter.
|
|
|
131
168
|
|
|
132
169
|
When the source supplies them, tree height/crown diameter/leaf type, lamp height, numeric direction,
|
|
133
170
|
and bike-parking capacity influence the model. Missing dimensions use conservative defaults.
|
|
171
|
+
Without a mapped direction, a lamp faces the nearest street within 18 m, even where a sidewalk
|
|
172
|
+
mapped as its own line runs closer (a lamp in the planting strip has that sidewalk behind it);
|
|
173
|
+
with no street in reach it faces the nearest path. Motorways, trunk and primary roads and roads
|
|
174
|
+
of four or more lanes keep the mast-arm `street_lamp`, reaching over their traffic; other
|
|
175
|
+
streets, paths and plazas get the post-top `street_lamp.post` where the library holds it. A
|
|
176
|
+
mapped lamp height scales the arm's 7.2 m pole or the post's 4.8 m.
|
|
134
177
|
A charging POI denotes a station, so the renderer places a representative pedestal rather than
|
|
135
178
|
inventing a surveyed bank of connectors. The library includes a red/white fast-charger variant.
|
|
136
179
|
|
|
@@ -146,8 +146,11 @@ instance-matrix buffers; camera, material, animation and other uniforms continue
|
|
|
146
146
|
normally. Revalidate this adapter before widening the three peer range. Large instance buffers retain Three's vertex-attribute path.
|
|
147
147
|
|
|
148
148
|
Use `renderer.createRenderGroup()` for independent opaque terrain/content chunks. It returns
|
|
149
|
-
a managed WebGPU `BundleGroup`, or a normal Three `Group` on WebGL
|
|
150
|
-
|
|
149
|
+
a managed WebGPU `BundleGroup`, or a normal Three `Group` on WebGL, which the renderer leaves out
|
|
150
|
+
of the scene walks and shadow maps its stated bounds cannot reach (see
|
|
151
|
+
[graphics performance](graphics-performance.md#staged-preparation-and-admission)). The pyramid
|
|
152
|
+
terrain stream accepts `createTileGroup: () => renderer.createRenderGroup()` and keeps each
|
|
153
|
+
tile's bounds; World Explorer already uses it.
|
|
151
154
|
The renderer checks command state on every frame, updating LOD and re-recording when the
|
|
152
155
|
camera, hierarchy, visibility, transforms, draw counts, geometry, materials or lighting change.
|
|
153
156
|
During camera motion it uses normal draw submission and skips command snapshots, retaining
|
|
@@ -107,7 +107,8 @@ setTerrainGroundOrigin(pavement, [worldOrigin[0], worldOrigin[2]]);
|
|
|
107
107
|
|
|
108
108
|
The material reads a `surfaceDetail` attribute the surface builder writes on every road, sidewalk,
|
|
109
109
|
curb, marking and lot: meters along the band, meters across it from its edge, the surface kind
|
|
110
|
-
and band width, and a road's lane width and wear grade
|
|
110
|
+
and band width, and a road's lane width and wear grade or the surface a marking is painted on.
|
|
111
|
+
Roads and lots get asphalt aggregate
|
|
111
112
|
(within a few meters, crisp pale chips and dark pits a few centimeters across), blotchy wear,
|
|
112
113
|
polished wheel tracks and an oil line in each lane, grit in the gutters, storm-drain grates,
|
|
113
114
|
manhole covers and the odd darker repaired section; asphalt and concrete both get hairline cracks.
|
|
@@ -117,7 +118,12 @@ on secondary and tertiary roads (1), more on residential streets (2) and most on
|
|
|
117
118
|
alleys (3). A band sets its grade with `wear` beside `lanes`; lots get oil
|
|
118
119
|
stains; sidewalks and footways get 1.5 m saw-cut slabs and curbs 3 m ones, each slab its own
|
|
119
120
|
tone, weathered with water stains and, close up, the odd spot of gum; plazas and pedestrian areas get a half-meter paver grid; markings wear through to the
|
|
120
|
-
asphalt.
|
|
121
|
+
asphalt. A marking narrower than a pixel fades into the color and shading of the
|
|
122
|
+
surface it lies on (`beneath` on a paint `TerrainLineBand`, a road's by default; a parking lot's
|
|
123
|
+
lines take on its oil stains), so from the air lines and rows of bays melt into the asphalt
|
|
124
|
+
instead of breaking into dashes that beat into moiré. A mark drawn with `surfaceSince` passes its
|
|
125
|
+
narrowest dimension as the width, which sets that fade.
|
|
126
|
+
Detail fades to the plain swatch with distance, so it never shimmers, and each layer's
|
|
121
127
|
noise is evaluated only where it still shows: distant pavement skips the fine layers, and only
|
|
122
128
|
fragments within 2 m of a frayed edge evaluate the fray. `setMaterial(undefined)` restores the plain material. Your own geometry can opt in with
|
|
123
129
|
`TerrainSurfaceMeshBuilder.surfaceSince(start, TERRAIN_SURFACE_KIND.road, …)`, or a
|
|
@@ -242,7 +248,8 @@ await surfaces.setOptions({
|
|
|
242
248
|
Mapped signal junctions and inferred crossings of two substantial arterials can receive curbside masts with bars over the incoming lanes,
|
|
243
249
|
yellow backplates, shaded round lenses, and one signal head per lane (up to three).
|
|
244
250
|
Red, amber and green lenses are self-lit, remaining visible at night. Instanced streetlights
|
|
245
|
-
occupy eligible corners outside road corridors, buildings, and water
|
|
251
|
+
occupy eligible corners outside road corridors, buildings, and water: mast arms where an
|
|
252
|
+
arterial meets the junction, post-top lanterns otherwise (see [night lighting](night-lighting.md)).
|
|
246
253
|
- Freeways receive wider paved shoulders, longer lane dashes, a yellow left edge on one-way
|
|
247
254
|
carriageways, and white ramp edges. Green overhead boards use mapped route references or
|
|
248
255
|
destinations. At a connected outgoing ramp, an advance gantry and roadside exit board use
|
|
@@ -89,6 +89,42 @@ mesh; this is the same API used in the browser. Existing baked GLBs must be rege
|
|
|
89
89
|
change their lettering. Seven-segment electronic displays can retain their physical segments;
|
|
90
90
|
fixed captions around those displays should use font geometry.
|
|
91
91
|
|
|
92
|
+
## Glyph atlases
|
|
93
|
+
|
|
94
|
+
Storefront names use a second form of the same faces: a `molen/glyph-atlas@1` document of glyph
|
|
95
|
+
metrics and atlas rectangles, beside raw 8-bit pages of signed distances. A name is then two
|
|
96
|
+
triangles a letter, every sign in the world shares one texture, and a face can be an atlas only:
|
|
97
|
+
the Kyoto pack's Japanese face holds the 1,544 letters Kyoto's place names use, where a vector font
|
|
98
|
+
of them would run to tens of megabytes.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { assembleGlyphAtlasPixels, createGlyphAtlasSet } from '@bendyline/molen-materials/text';
|
|
102
|
+
|
|
103
|
+
const set = createGlyphAtlasSet([latinDoc, kyotoDoc]); // metrics only; a worker can hold this
|
|
104
|
+
set.faceFor('大垣書店'); // 'sign.gothic.jp': the first face that holds every letter
|
|
105
|
+
const layout = set.layout('Samir’s Mediterranean Grill', {
|
|
106
|
+
font: 'serif',
|
|
107
|
+
maxWidth: 6,
|
|
108
|
+
maxHeight: 0.8,
|
|
109
|
+
maxLines: 2,
|
|
110
|
+
});
|
|
111
|
+
// layout.quads: x0, y0, x1, y1, u0, v0, u1, v1 per letter; layout.lines: the line break chosen
|
|
112
|
+
const pixels = await assembleGlyphAtlasPixels(set, (doc, path) => readPage(doc, path));
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`createGlyphAtlasSet` stacks the documents' pages into one texture, so every document in a set
|
|
116
|
+
shares one distance range. A name is set in the first candidate face that holds all of it: the
|
|
117
|
+
requested face or role in each document, then each document's default face. Layout is left to
|
|
118
|
+
right, with kerning, uniform fitting, and a second line where it sets the letters a tenth larger,
|
|
119
|
+
broken at a space or, in Japanese and Chinese, between letters (never before a closing mark or a
|
|
120
|
+
small kana). There is no per-letter fallback across faces and no shaping, so Arabic and Indic
|
|
121
|
+
names keep their category sign until a shaping stage exists.
|
|
122
|
+
|
|
123
|
+
In the engine repository, `node scripts/build-fonts.mjs` rasterizes the Earth atlas from the same
|
|
124
|
+
pinned TTFs as the vector fonts, and each region pack (`content/glyphs-*`) from its own pinned
|
|
125
|
+
font and the character set `scripts/build-glyph-charset.mjs` reads from the region's map extract.
|
|
126
|
+
The distance field is plain arithmetic, byte-identical on every machine; `--check` verifies it.
|
|
127
|
+
|
|
92
128
|
## Compiling another face
|
|
93
129
|
|
|
94
130
|
`compileVectorFont(typefaceJson, { id, characters, weight, style, curveSegments, kerning })`
|
|
@@ -370,7 +370,12 @@ Parked cars become simulation entities only within 300 m of the observer passed
|
|
|
370
370
|
approach, board and collide with; farther ones that nobody moved are reclaimed and stay part of
|
|
371
371
|
their tile's merged mesh. Under an aircraft a town's parked cars were otherwise thousands of
|
|
372
372
|
dormant entities, spawned as each tile streamed in and visited every tick. The `vehicles` system
|
|
373
|
-
also passes over a dormant car after one lookup until a write replaces its state.
|
|
373
|
+
also passes over a dormant car after one lookup until a write replaces its state. Height counts
|
|
374
|
+
against that distance: it shrinks to nothing 100 m above or below a car, so an aircraft crossing a
|
|
375
|
+
town at a few hundred meters makes entities of none, and one landing meets them as it comes down.
|
|
376
|
+
`sync` remembers its observer for the passes `EarthVehicles` runs itself (after `enter`, and when
|
|
377
|
+
a model loads), which had no observer and made an entity of every parked car in every loaded tile
|
|
378
|
+
each time a car's model arrived.
|
|
374
379
|
|
|
375
380
|
Passengers use the same mount contract. A `mountable` lists seats with a role: `driver` seats
|
|
376
381
|
drive, `passenger` seats ride. `mountEntity(world, actor, vehicle, 'passenger')` seats someone
|
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.12. 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
|
|
|
@@ -32,6 +32,7 @@ Autogenerated from the schema registry `molen validate` checks against; `molen s
|
|
|
32
32
|
- [Replay fixture](replay.md) — `molen/replay@1`
|
|
33
33
|
- [Scatter rules](scatter.md) — `molen/scatter@1`
|
|
34
34
|
- [Scene manifest](scene.md) — `molen/scene@3`
|
|
35
|
+
- [Storefront sign looks](sign-looks.md) — `molen/sign-looks@1`
|
|
35
36
|
- [Sound bank](soundbank.md) — `molen/soundbank@1`
|
|
36
37
|
- [Logical source bundle](source-bundle.md) — `molen/source-bundle@1`
|
|
37
38
|
- [Runtime structure placements](structure-placement-data.md) — `molen/structure-placement-data@1`
|
|
@@ -12198,6 +12198,47 @@ Required: `style`, `outline`
|
|
|
12198
12198
|
"type": "number",
|
|
12199
12199
|
"exclusiveMinimum": 0,
|
|
12200
12200
|
"maximum": 100
|
|
12201
|
+
},
|
|
12202
|
+
"sign": {
|
|
12203
|
+
"description": "A name set from the batch glyph atlas in place of the sign model text; without an atlas holding every character the sign model shows.",
|
|
12204
|
+
"type": "object",
|
|
12205
|
+
"properties": {
|
|
12206
|
+
"text": {
|
|
12207
|
+
"type": "string",
|
|
12208
|
+
"minLength": 1,
|
|
12209
|
+
"maxLength": 64,
|
|
12210
|
+
"description": "The name as shown; it may break over two lines."
|
|
12211
|
+
},
|
|
12212
|
+
"plate": {
|
|
12213
|
+
"type": "string",
|
|
12214
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
12215
|
+
},
|
|
12216
|
+
"ink": {
|
|
12217
|
+
"type": "string",
|
|
12218
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
12219
|
+
},
|
|
12220
|
+
"stripe": {
|
|
12221
|
+
"type": "string",
|
|
12222
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
12223
|
+
},
|
|
12224
|
+
"font": {
|
|
12225
|
+
"description": "Glyph atlas role or face id.",
|
|
12226
|
+
"type": "string",
|
|
12227
|
+
"minLength": 1,
|
|
12228
|
+
"maxLength": 100
|
|
12229
|
+
},
|
|
12230
|
+
"letterSpacing": {
|
|
12231
|
+
"type": "number",
|
|
12232
|
+
"minimum": -0.1,
|
|
12233
|
+
"maximum": 0.5
|
|
12234
|
+
}
|
|
12235
|
+
},
|
|
12236
|
+
"required": [
|
|
12237
|
+
"text",
|
|
12238
|
+
"plate",
|
|
12239
|
+
"ink"
|
|
12240
|
+
],
|
|
12241
|
+
"additionalProperties": false
|
|
12201
12242
|
}
|
|
12202
12243
|
},
|
|
12203
12244
|
"required": [
|