@bendyline/molen-tooling 0.0.14 → 0.0.16

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.
Files changed (46) hide show
  1. package/dist/capture/harness.js +736 -400
  2. package/dist/capture/worldgen-preview.js +409 -298
  3. package/dist/docs-src/guide/3d-art-guidelines.md +5 -2
  4. package/dist/docs-src/guide/adaptive-performance.md +50 -23
  5. package/dist/docs-src/guide/aircraft.md +275 -31
  6. package/dist/docs-src/guide/ambient-life.md +36 -9
  7. package/dist/docs-src/guide/building-interiors.md +92 -8
  8. package/dist/docs-src/guide/determinism.md +1 -1
  9. package/dist/docs-src/guide/dioramas.md +7 -0
  10. package/dist/docs-src/guide/earth-view.md +198 -16
  11. package/dist/docs-src/guide/entities.md +38 -7
  12. package/dist/docs-src/guide/figures.md +32 -4
  13. package/dist/docs-src/guide/graphics-performance.md +62 -19
  14. package/dist/docs-src/guide/livery-catalog.md +137 -1
  15. package/dist/docs-src/guide/livery-gallery.md +136 -1
  16. package/dist/docs-src/guide/medium-fi.md +194 -10
  17. package/dist/docs-src/guide/night-lighting.md +10 -0
  18. package/dist/docs-src/guide/regional-fleets.md +27 -5
  19. package/dist/docs-src/guide/regional-world.md +19 -1
  20. package/dist/docs-src/guide/rendering-backends.md +23 -2
  21. package/dist/docs-src/guide/sky.md +28 -2
  22. package/dist/docs-src/guide/snow.md +231 -0
  23. package/dist/docs-src/guide/surface-rendering.md +324 -9
  24. package/dist/docs-src/guide/terrain.md +84 -9
  25. package/dist/docs-src/guide/vehicle-interiors.md +6 -0
  26. package/dist/docs-src/guide/vehicles.md +368 -45
  27. package/dist/docs-src/guide/weather.md +7 -1
  28. package/dist/docs-src/guide/worldgen.md +82 -3
  29. package/dist/docs-src/llms.txt +3 -2
  30. package/dist/docs-src/schemas/README.md +1 -0
  31. package/dist/docs-src/schemas/components.md +749 -12
  32. package/dist/docs-src/schemas/figure.md +30 -4
  33. package/dist/docs-src/schemas/interior-catalog.md +56 -3
  34. package/dist/docs-src/schemas/map-overrides.md +658 -0
  35. package/dist/docs-src/schemas/structure-placement-data.md +195 -0
  36. package/dist/docs-src/schemas/structure-placements.md +195 -0
  37. package/dist/docs-src/schemas/worldgen-batch.md +54 -0
  38. package/dist/templates/city-courier/gen/molen-types.ts +113 -4
  39. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +112 -3
  40. package/dist/templates/figures-gallery/test/headless.test.ts +3 -2
  41. package/dist/templates/index.json +17 -17
  42. package/dist/templates/skybound/gen/molen-types.ts +113 -4
  43. package/dist/templates/skybound/scripts/molen-scripts.d.ts +112 -3
  44. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +112 -3
  45. package/dist/templates/top-down-arena/src/gen/molen-types.ts +113 -4
  46. package/package.json +12 -12
@@ -346,6 +346,9 @@ independent identity salt, so decorating a lot does not move or re-roll its hous
346
346
  Mapped footprints, occupied landmark extents, other streets, water and incompatible land uses
347
347
  such as parks, farmland, schools and parking exclude the entire parcel, including its approach.
348
348
  Slopes above 0.3 or more than three meters of height variation also exclude it.
349
+ A named neighborhood outline excludes nothing, because it marks a place and not its ground. The
350
+ Protomaps basemap reports one as land use `other`, in place of any residential or industrial use
351
+ mapped on the same outline, so streets inside it are judged like streets without a land-use label.
349
352
 
350
353
  Mapped residential, commercial and retail land-use polygons provide district evidence. Commercial
351
354
  and retail areas select commercial styles and shopfront plans; residential areas select homes.
@@ -426,6 +429,64 @@ uncovered areas of the original outline remain. Related pieces receive a shared
426
429
  for fitting their platform to terrain, and raised parts retain their minimum-height clearance.
427
430
  Containment is a spatial inference because stock Protomaps does not publish parent relation IDs.
428
431
 
432
+ ### Golf courses, cemeteries and sports pitches
433
+
434
+ A map names these places but does not carry what makes them recognizable, so the Earth adapter
435
+ lays that out. `prepareLandSites(tile, geometry)` from `@bendyline/molen-worldgen-earth/kernel`
436
+ returns the tile with extra land cover after its own, and `landSiteProps(tile, geometry)` returns
437
+ point placements. The renderers and the batch adapter call both; a custom pipeline calls them the
438
+ same way. Everything is a visual estimate: it reads as the place from the air and on foot, and is
439
+ not the surveyed course, the real graves or the pitch as it is painted.
440
+
441
+ | Mapped land | What is added | Detail levels |
442
+ | --- | --- | --- |
443
+ | `golf_course` | `golf_fairway`, `golf_green`, `golf_tee` and `golf_bunker` ground | Fairways and greens on the finest three levels, tees and bunkers on the finest two |
444
+ | `cemetery`, `grave_yard` | Headstones: tinted `builtin:box` placements in rows | Finest level |
445
+ | `pitch` | `sports_turf`, `sports_court`, `sports_blacktop` and `sports_dirt` ground, `sports_line` markings | Ground on the finest two levels, lines on the finest |
446
+
447
+ Golf holes sit on a fixed world grid of squares 640 projected meters across. Each square holds
448
+ parallel corridors at least 70 m wide, running east-west in some squares and north-south in
449
+ others, and each corridor holds holes end to end: short, medium and long ones, each with tees, a
450
+ fairway that doglegs a little, a green in a collar of fairway-height turf, and greenside and
451
+ fairway bunkers. The layout is clipped to the mapped course and kept off its mapped water, woods,
452
+ sand and buildings. A green, tee or bunker is drawn whole or not at all; a fairway may end at the
453
+ course boundary. The rough is the course's own grass. Because the grid is anchored to the world,
454
+ not to a tile, every tile, level and visit draws the same holes. A third argument `{ seed }`
455
+ re-rolls them, and the headstones; the built-in renderers use seed 0.
456
+
457
+ Headstones stand in sections 64 projected meters across with grass lanes between, in rows 5 m
458
+ apart, 2.4 m from stone to stone. One section in eight is open lawn and the rest are 30–90%
459
+ occupied. Most stones are upright slabs, a fifth flat markers, a few tall monuments, in five stone
460
+ colors. Stones stay 2.5 m inside the boundary, 1.5 m from buildings and water, and clear of roads,
461
+ drives and paths; they may stand under the cemetery's mapped trees. A tile draws at most 3,000:
462
+ past that, whole sections stay lawn so the others keep their rows. Each stone belongs to the tile
463
+ its base is in, and `ModelPlacementRequest.color` (sRGB red, green and blue in 0–1) carries its tint.
464
+
465
+ A pitch's game is read from the outline's size and shape:
466
+
467
+ | Outline | Read as | Markings |
468
+ | --- | --- | --- |
469
+ | Rectangle 85–130 m long, at least 1.9 times its width | Football field | Boundary and a yard line every ten yards |
470
+ | Other rectangle 45–130 m long | Soccer field | Touchlines, halfway line, center circle, penalty and goal areas |
471
+ | Rectangle 20–45 m long, over 31 m or at least 2.05 times its width | Tennis court | Doubles court, singles sidelines, service boxes, net |
472
+ | Other rectangle 20–45 m long | Basketball court | Boundary, center line and circle, keys, three-point arcs |
473
+ | Rectangle 10–20 m long | Court | Boundary |
474
+ | Near-square fan filling 68–90% of its bounding rectangle | Ball diamond | Skinned infield, foul lines, and from 70 m foul lines a grass infield and mound |
475
+ | Anything else from 45 m long | Field | None |
476
+
477
+ A rectangle under 10 m long, or any other small outline, is left as the map has it.
478
+
479
+ Markings are each sport's standard dimensions, scaled down where the outline is smaller. Home
480
+ plate is where the two long edges of a fan would meet, so a backstop that cuts that corner off
481
+ does not hide it. A pitch the source cut at a tile edge cannot be measured, so both tiles draw
482
+ their piece as turf; the tile that holds a diamond's home plate adds the infield when all of it
483
+ fits inside that tile. A court cut that way is turf too.
484
+
485
+ Palettes name the added classes like any other land cover. `LAND_SITE_COLORS` supplies defaults
486
+ under the pack's and the host's colors: irrigated turf keeps one green in every habitat, so a
487
+ desert course is green fairways in tan rough. Added ground has crisp edges, and no vegetation rule
488
+ plants on it unless a pack names its class.
489
+
429
490
  ## 8. Budgets and quality
430
491
 
431
492
  `worldgenTileBudgetForQuality(quality, levelBelowMax)` caps buildings and vertices per tile. The
@@ -476,8 +537,8 @@ detail level: a tile one level below the finest covers four times the area with
476
537
  the instances, two levels below keeps a sparse hint, and coarser tiles carry no props. Visible
477
538
  cells draw only their active LOD; keep `maxPropModels` small because each model needs a draw per
478
539
  visible cell. The per-tile placement budgets still bound the resident instance data. Balanced quality
479
- allows 6,000 nearby placements, 1,200 one level below, and 250 two levels below. Economy uses
480
- 2,200 / 400 / 0; high uses 9,000 / 1,800 / 350. Ground cover has its own budget on the finest
540
+ allows 6,000 nearby placements, 2,400 one level below, and 800 two levels below. Economy uses
541
+ 2,200 / 800 / 200; high uses 9,000 / 3,600 / 1,200. Ground cover has its own budget on the finest
481
542
  level only: 5,000 placements and 3 models at Balanced, 8,000 and 4 at High, none at Economy.
482
543
  The forest rules fill nearby crowns while
483
544
  understory is limited to the finest tier; parks and yards retain lower densities and all
@@ -529,7 +590,25 @@ scatter material: a shader that can discard switches off hidden-surface removal
529
590
  GPUs, so a distant forest drawn with the card material shaded every layer of crowns behind the
530
591
  first. For the same reason a level drawn with cards hands over to the next at a quarter of the
531
592
  projected error its geometry alone would allow (a crown's cards overlap several deep), and the
532
- distant level neither casts nor receives sun shadows. With `vanishPixels` a batch stops drawing
593
+ distant level neither casts nor receives sun shadows. In place of the shadows it does not
594
+ read, the WebGL scatter material shades a plant's crown as one among its neighbours while the
595
+ sun's shadows are drawn: the top in the sun, the rest in shade, more so the lower the sun. From
596
+ the air the distant level starts a few hundred meters out, and without that the trees near an
597
+ aircraft were a dark disc among bright ones. With the policy's `distantShadows` the distant
598
+ level casts as well (and still receives none; the horizon level below never casts), so the
599
+ ground past the near trees carries tree shadows too. That draws every tree out to the horizon
600
+ level into the shadow map: over a wooded town at High detail 350 more draws and 0.85 million
601
+ more triangles a frame, and 1.9 ms more main thread, so it is off unless a host turns it on.
602
+ `createInstancedPlacementLod` takes an
603
+ optional fourth, horizon model (`ModelLibrary.prepare(ref, 'horizon')`): a conifer's far level
604
+ keeps three plain skirts, so a stand of firs is not a field of cones from a few hundred meters,
605
+ and hands over to the one-cone horizon model where 2.5 m of error fits the budget (about 930 m
606
+ at 2.5 pixels on a 1080-line view). For every other model the horizon model is the far model
607
+ and adds no level. That handover reads the policy's `horizonPixelError` (default
608
+ `maxPixelError`): a host that relaxes `maxPixelError` with camera height, to shed leaf cards,
609
+ keeps `horizonPixelError` at its base value, or every conifer under an aircraft is the cone. A
610
+ batch within a quarter of a handover's distance asks for the material across it, so its shaders
611
+ are built by the time it gets there. With `vanishPixels` a batch stops drawing
533
612
  once its largest instance spans fewer pixels than that from the batch's nearest point (15%
534
613
  hysteresis): the semantic renderers pass 1.5 for street props and signs, which from a few
535
614
  kilometers were a draw each for a pixel or less, but not for plants, as a distant forest is the
@@ -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.10. three.js peer range: >=0.184.0 <0.187.0 (developed against 0.184.0). Node ≥ 22.13, ESM only.
7
+ Engine version: 0.0.11. 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
 
@@ -34,11 +34,12 @@ downloads them into a project and pins them in project.json.
34
34
  - [Input profiles and joysticks](guide/input.md): keyboard/controller remapping, raw axes, walking/driving/flying profiles, analog commands, and optional React controls.
35
35
  - [Camera navigation](guide/navigation.md): orbit, fly, walk (capsule collision against streamed geometry) and follow cameras for `createViewer` hosts; one input model across keys, gamepad, pointer gestures and an on-screen touch stick.
36
36
  - [World markers](guide/markers.md): screen-sized photo pins and labels pinned to world positions, ground-snapped, occluded, faded, budgeted and pickable.
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.
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; `overrides` replace a rectangle of the mapped world (a landmark, a block) with the host's own buildings, models, props, people, vehicles and scene, at mount or while the view runs.
38
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.
39
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
40
  - [Night lighting](guide/night-lighting.md): deterministic occupied windows, streetlamp emission and pavement pools, dusk activation, and light metadata for authored models.
41
41
  - [Weather and physical atmosphere](guide/weather.md): independent clouds (cumulus, stratocumulus, stratus, cumulonimbus, cirrus), precipitation and visibility; profiles, temperature/pressure/wind for simulation and aircraft physics; volumetric cloud, cloud-shadow, rain and snow rendering and cloud quality.
42
+ - [Snow cover](guide/snow.md): `weather.snowCover` lays snow above a snow line (level, transition, depth); ground, roofs and foliage whiten, walkers slow, cars lose grip and get stuck, and `vehicle.spec.runners` slides skis, a snowboard and a snowmobile under gravity; `enableSnowCover`, `setTerrainGroundSnow`, `EarthView.setWeather`, the alpine tree line.
42
43
  - [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.
43
44
  - [Graphics performance](guide/graphics-performance.md): sparse transforms, static instancing, worker preparation, staged uploads, animation/light policy and terrain transitions.
44
45
  - [Terrain and world explorer](guide/terrain.md): fixed-grid and screen-space pyramid streaming,
@@ -19,6 +19,7 @@ Autogenerated from the schema registry `molen validate` checks against; `molen s
19
19
  - [Keyframe snapshot](keyframe.md) — `molen/keyframe@1`
20
20
  - [Landmark model](landmark.md) — `molen/landmark@1`
21
21
  - [Landmark catalog](landmark-catalog.md) — `molen/landmark-catalog@1`
22
+ - [Map overrides](map-overrides.md) — `molen/map-overrides@1`
22
23
  - [Procedural material graph](matgraph.md) — `molen/matgraph@1`
23
24
  - [Content pack manifest](pack.md) — `molen/pack@1`
24
25
  - [Content pack index](pack-index.md) — `molen/pack-index@1`