@bendyline/molen-tooling 0.0.10 → 0.0.12
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 +610 -271
- package/dist/capture/worldgen-preview.js +396 -298
- package/dist/cli.mjs +2 -2
- package/dist/docs-src/guide/3d-art-guidelines.md +34 -10
- package/dist/docs-src/guide/3d-model-assets.md +40 -2
- package/dist/docs-src/guide/adaptive-performance.md +12 -4
- package/dist/docs-src/guide/aircraft.md +126 -26
- package/dist/docs-src/guide/ambient-life.md +13 -4
- package/dist/docs-src/guide/audio.md +19 -5
- package/dist/docs-src/guide/building-interiors.md +7 -2
- package/dist/docs-src/guide/determinism.md +1 -1
- package/dist/docs-src/guide/dioramas.md +6 -0
- package/dist/docs-src/guide/earth-view.md +121 -20
- package/dist/docs-src/guide/entities.md +84 -5
- package/dist/docs-src/guide/figures.md +31 -7
- package/dist/docs-src/guide/graphics-performance.md +27 -12
- package/dist/docs-src/guide/medium-fi.md +269 -25
- package/dist/docs-src/guide/navigation.md +5 -2
- package/dist/docs-src/guide/project.md +5 -0
- package/dist/docs-src/guide/recognizable-places.md +6 -0
- package/dist/docs-src/guide/regional-fleets.md +94 -0
- package/dist/docs-src/guide/regional-world.md +398 -0
- package/dist/docs-src/guide/sky.md +36 -3
- package/dist/docs-src/guide/structure-library.md +4 -1
- package/dist/docs-src/guide/surface-rendering.md +264 -2
- package/dist/docs-src/guide/terrain.md +5 -0
- package/dist/docs-src/guide/typography.md +105 -0
- package/dist/docs-src/guide/vehicle-interiors.md +169 -9
- package/dist/docs-src/guide/vehicles.md +13 -2
- package/dist/docs-src/guide/weather.md +15 -8
- package/dist/docs-src/guide/worldgen.md +88 -10
- package/dist/docs-src/llms.txt +5 -1
- package/dist/docs-src/schemas/README.md +6 -0
- package/dist/docs-src/schemas/archstyle.md +66 -0
- package/dist/docs-src/schemas/components.md +1087 -66
- package/dist/docs-src/schemas/ecology-atlas.md +236 -0
- package/dist/docs-src/schemas/fleet-catalog.md +113 -0
- package/dist/docs-src/schemas/landmark.md +10 -0
- package/dist/docs-src/schemas/matgraph.md +11 -1
- package/dist/docs-src/schemas/pack-source.md +11 -1
- package/dist/docs-src/schemas/pack.md +1 -1
- package/dist/docs-src/schemas/project.md +1 -1
- package/dist/docs-src/schemas/region-atlas.md +6 -0
- package/dist/docs-src/schemas/regional-catalog.md +1436 -0
- package/dist/docs-src/schemas/scatter.md +110 -4
- package/dist/docs-src/schemas/structure-placement-data.md +662 -0
- package/dist/docs-src/schemas/structure-placement-index.md +87 -0
- package/dist/docs-src/schemas/structure-placements.md +183 -0
- package/dist/docs-src/schemas/terrain-package.md +41 -0
- package/dist/docs-src/schemas/transport-network.md +8 -0
- package/dist/docs-src/schemas/types.md +1 -1
- package/dist/docs-src/schemas/wildlife-ranges.md +251 -0
- package/dist/docs-src/schemas/worldgen-batch.md +61 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{mcp-BbxqqnD1.mjs → mcp-BXaK46X-.mjs} +1 -1
- package/dist/{ops-b4Pag8U-.mjs → ops-Cm7WNvb9.mjs} +55 -22
- package/dist/templates/city-courier/gen/molen-types.ts +138 -17
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/figures-gallery/test/headless.test.ts +2 -1
- package/dist/templates/index.json +17 -17
- package/dist/templates/skybound/gen/molen-types.ts +138 -17
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +138 -17
- package/package.json +13 -13
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
# Regional plants, wildlife, ground, and ordinary buildings
|
|
2
|
+
|
|
3
|
+
Earth content has three independent regional channels. Ecological geography selects vegetation
|
|
4
|
+
and ground palettes. Architectural geography selects building recipes. Wildlife combines ecology,
|
|
5
|
+
native-country limits, and mapped habitat. They share composable content packs and bounded
|
|
6
|
+
quality settings; plants/buildings use deterministic tile generation, while animals use a
|
|
7
|
+
separate deterministic population and movement loop.
|
|
8
|
+
Mapped land cover, building use, footprints, and measurements remain the local evidence.
|
|
9
|
+
|
|
10
|
+
## Content and downloads
|
|
11
|
+
|
|
12
|
+
| Pack | Regional content | Role |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| `molen.ecology` | Ecological atlas, plant presets, habitat profiles | `ecology-atlas`, `regional-catalog` |
|
|
15
|
+
| `molen.wildlife` | Procedural animals, habitat populations, attributed native-country limits | `wildlife-ranges`, `regional-catalog` |
|
|
16
|
+
| `molen.earth` | Architectural region outlines | `atlas` |
|
|
17
|
+
| `molen.worldgen.default` | Architectural profiles, archstyles, shared materials | `regional-catalog`, `stylepack` |
|
|
18
|
+
|
|
19
|
+
`openPacksFromIndex` includes ecology and wildlife among the default Earth pack IDs. Hosts still supply the
|
|
20
|
+
index URL and opened packs; the kernel never fetches data. `loadEarthContent` discovers regional
|
|
21
|
+
catalogs across those packs, validates references, and passes plain documents to the worker.
|
|
22
|
+
An architecture-only catalog works without an ecological atlas. A catalog scoped to a different
|
|
23
|
+
style pack is omitted, so a custom style pack can retain the ecological content.
|
|
24
|
+
|
|
25
|
+
The ecological atlas and catalog total about 169 KB gzip (173 KB as a content pack). Its 264 procedural plant presets need no
|
|
26
|
+
GLB downloads. The architectural atlas is about 313 KB gzip; ordinary regional recipes are small
|
|
27
|
+
JSON files using the default pack's shared material graphs. Authored landmark GLBs continue to
|
|
28
|
+
use the existing geographically sharded, lazy model archives.
|
|
29
|
+
|
|
30
|
+
## Geographic evidence
|
|
31
|
+
|
|
32
|
+
The ecological atlas derives from [RESOLVE Ecoregions 2017](https://developers.google.com/earth-engine/datasets/catalog/RESOLVE_ECOREGIONS_2017)
|
|
33
|
+
under CC-BY-4.0. It uses a quarter-degree grid with run-length encoded rows. Metadata retains 847
|
|
34
|
+
source entries, including rock and ice; 843 appear in the reduced grid. Small islands use
|
|
35
|
+
intersecting land polygons when a cell center misses land. Four very small source regions fall
|
|
36
|
+
below this resolution. This describes potential habitat, not current vegetation or species
|
|
37
|
+
observations. Actual local land cover controls whether a plant can be placed.
|
|
38
|
+
|
|
39
|
+
Architectural envelopes derive from [Natural Earth 1:50m country outlines](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/),
|
|
40
|
+
which are [public domain](https://www.naturalearthdata.com/about/terms-of-use/). Exterior rings are
|
|
41
|
+
simplified at 0.02 degrees and coordinates rounded to 0.001 degrees. The shipped atlas groups 241
|
|
42
|
+
country/territory features into 53 broad envelopes, retaining the Pacific Northwest and US
|
|
43
|
+
Southwest subregions. Exact containment wins; an optional nearest-outline fallback fills
|
|
44
|
+
otherwise unclassified coastal gaps within 2.5 km in local world coordinates. These envelopes
|
|
45
|
+
are visual priors, not building-style surveys or a political boundary service.
|
|
46
|
+
|
|
47
|
+
Ecological lookup uses a separate grid, so a national border does not move a forest. Each plant
|
|
48
|
+
candidate and each building centroid resolves its own profile. Ground meshes sample regional
|
|
49
|
+
palettes at vertices, and worker-generated surfaces use the same samples. Uncovered ecological
|
|
50
|
+
cells are visible in generation diagnostics and do not receive invented wild vegetation.
|
|
51
|
+
|
|
52
|
+
Bare and distant terrain receives the same ecological ground palette before detailed map
|
|
53
|
+
surfaces arrive. `createRegionalGroundColor` supplies the terrain stream's optional
|
|
54
|
+
`surfaceColor` callback; it runs before upload for both worker-prepared and local meshes and
|
|
55
|
+
returns linear RGB. An explicit host `style.ground` palette takes precedence in `mountEarthView`.
|
|
56
|
+
Nature-reserve, national-park and protected-area designations retain their protection metadata,
|
|
57
|
+
but do not paint over the physical habitat beneath them. With no mapped physical cover, sparse
|
|
58
|
+
open-ground planting remains a prior, rather than inferred forest or a wildlife-presence claim.
|
|
59
|
+
|
|
60
|
+
## Composable catalogs
|
|
61
|
+
|
|
62
|
+
`molen/regional-catalog@1` contains `profiles`, `scatters`, optional `plants`, `animals`, `populations`, and exact-version
|
|
63
|
+
`requires`. The `overrides` list names items intentionally replaced from required catalogs.
|
|
64
|
+
Load order has no effect. Missing dependencies, accidental ID collisions, unused overrides,
|
|
65
|
+
missing references, and equal-priority overlapping profiles in the same channel are errors.
|
|
66
|
+
|
|
67
|
+
A profile matches any listed value within a dimension and all specified dimensions together:
|
|
68
|
+
`biomes`, `realms`, `ecoregions`, and architectural atlas `regions`. Higher `priority` wins
|
|
69
|
+
independently for `scatter`, `buildings`, and `wildlife`. A botanical module can refine the vegetation without
|
|
70
|
+
changing buildings; a city architecture module can refine buildings without rearranging plants.
|
|
71
|
+
Architecture catalogs may name `stylePack`, matching the resolved style pack's `name` identity
|
|
72
|
+
(the default is `molen-worldgen-default`, distinct from its content-pack ID).
|
|
73
|
+
|
|
74
|
+
Use the registered schemas through `molen schema get regional-catalog` and
|
|
75
|
+
`molen schema get ecology-atlas`. The low-level API accepts already-loaded data:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import {
|
|
79
|
+
createRegionalEnvironment,
|
|
80
|
+
createRegionalLibrary,
|
|
81
|
+
} from '@bendyline/molen-worldgen-earth/kernel';
|
|
82
|
+
|
|
83
|
+
// Validate dependencies and architectural references against the host's resolved pack.
|
|
84
|
+
const library = createRegionalLibrary(catalogs, pack);
|
|
85
|
+
const environment = createRegionalEnvironment(
|
|
86
|
+
{ atlas: ecologicalAtlas, catalogs: [...library.catalogs] },
|
|
87
|
+
metersPerUnit,
|
|
88
|
+
architecturalRegionResolver,
|
|
89
|
+
);
|
|
90
|
+
const selection = environment.at(worldX, worldZ);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Pass this environment to the Earth tile adapter/renderer; pass its `docs` to the corresponding
|
|
94
|
+
worker bridge. The worker and renderer must use the same documents. `ModelLibrary` accepts the
|
|
95
|
+
environment's `library.plants` as its fourth constructor argument (including any derived seasonal
|
|
96
|
+
variants). Geometry is cached separately by preset
|
|
97
|
+
and LOD, and released when its last consumer drops it. Content hashes include regional documents;
|
|
98
|
+
placement seeds stay tied to individual scatter IDs/versions rather than unrelated catalogs.
|
|
99
|
+
|
|
100
|
+
## Plant and building selection
|
|
101
|
+
|
|
102
|
+
The plant families cover broadleaf, conifer, palm, cactus, succulent, bamboo, banana, grass, fern, reed,
|
|
103
|
+
mangrove, deadwood, shrub, thicket, forb, vine, mat, and fallen-wood silhouettes. Habitats combine canopy, understory, ground cover, open land,
|
|
104
|
+
parks, orchards, and wetlands. Regional refinements keep American cacti out of Old World wild
|
|
105
|
+
desert profiles and avoid applying Australian eucalyptus profiles to New Zealand.
|
|
106
|
+
|
|
107
|
+
Each of the 78 plant forms has a base, spreading, and slender preset, available in
|
|
108
|
+
every applicable habitat and crop rule. Optional `shapeSeed` varies branch/frond arrangements,
|
|
109
|
+
crown contours and stem profiles independently of the placement seed. Dimensions, crown height,
|
|
110
|
+
trunk lean and restrained foliage tones also vary; these are visual forms, not additional taxa.
|
|
111
|
+
All 19 procedural families share the existing near/medium/far triangle limits.
|
|
112
|
+
|
|
113
|
+
### Brush and ground coverage
|
|
114
|
+
|
|
115
|
+
Shrubs and thickets have multiple stems and foliage at several heights. Grass and reed `patch`
|
|
116
|
+
recipes contain five tussocks with seed heads; fern colonies contain three overlapping plants.
|
|
117
|
+
Herb patches, trailing ground vines, low moss/litter mats, fallen trunks and small trees fill the
|
|
118
|
+
space below the canopy. Humid tropical `climber` recipes add vines around their own generated
|
|
119
|
+
trunk and hanging from their branches. They do not attach to arbitrary mapped trees or buildings.
|
|
120
|
+
|
|
121
|
+
Natural forest, wood, scrub and heath receive an `understory` scatter layer. Open grassland and
|
|
122
|
+
savanna receive sparser brush. Cultivated polygons, parks, gardens and residential land do not
|
|
123
|
+
receive wild overgrowth from these rules. Explicit wetland labels permit sedge patches; desert
|
|
124
|
+
profiles retain sparse dry forms and never acquire humid forest plants.
|
|
125
|
+
|
|
126
|
+
The optional clustering `sharedSeed` coordinates broad patches across vegetation layers while
|
|
127
|
+
keeping each rule's placements independent. `detailScale` adds smaller clumps and gaps inside
|
|
128
|
+
those patches. These are deterministic visual density fields, not a simulation of individual
|
|
129
|
+
plants competing for sunlight or measured local occupancy. Low vegetation uses smaller path and
|
|
130
|
+
building clearances than trees; road surfaces, buildings and water remain excluded.
|
|
131
|
+
|
|
132
|
+
Earth tiles reserve `maxUnderstoryInstances` / `maxUnderstoryModels` separately from canopy and
|
|
133
|
+
groundcover. At the finest level, Economy allows 450 brush instances/two models, Balanced
|
|
134
|
+
1,600/three, and High 2,400/four. One coarser level retains 80/250/400 instances respectively;
|
|
135
|
+
coarser levels omit brush. Existing groundcover instance caps stay at 0/5,000/8,000, with
|
|
136
|
+
0/five/seven model slots. Economy keeps simplified shrub masses while omitting fine blades and
|
|
137
|
+
litter. These are per-tile limits, not whole-scene frame-rate guarantees.
|
|
138
|
+
|
|
139
|
+
The brush milestone's 234 recipes produce 324 appearances including deciduous seasons. All geometry
|
|
140
|
+
is generated and shared by recipe and LOD; the brush expansion adds about 25 KB to the compressed
|
|
141
|
+
ecology pack and no GLB downloads. Reproduce comparison captures with
|
|
142
|
+
`node content/ecology/source/preview-regions.mjs --brush` and
|
|
143
|
+
`node content/ecology/source/preview-diversity.mjs --brush` in the engine repository.
|
|
144
|
+
|
|
145
|
+
Scatter populations can supply weighted `variants: [{ model, weight }]`. The parent `model`
|
|
146
|
+
is their interchangeable fallback and its `weight` still controls species proportions. Variant
|
|
147
|
+
selection uses an independent random stream, keeping positions, density, crop rows and ordinary
|
|
148
|
+
quality thinning intact. A tile reserves a base form for each retained species before admitting
|
|
149
|
+
extra variants into spare model slots. Unretained forms use that base instead of disappearing;
|
|
150
|
+
Economy and distant views therefore show fewer forms without increasing draw limits. Variant
|
|
151
|
+
recipes must be suitable for the same habitat and placement-scale bounds as their parent.
|
|
152
|
+
|
|
153
|
+
Mapped trees preserve source `species`, `genus`, `leafType`, `height`, and `crownDiameter` when
|
|
154
|
+
available. Exact species names take precedence over genus names; preset `taxa` names match
|
|
155
|
+
case-insensitively. These choose a representative silhouette, not a botanically exact specimen.
|
|
156
|
+
Observed trees may be planted outside their native habitat. Unknown trees use compatible local
|
|
157
|
+
park-tree populations, with the legacy measured broadleaf/conifer form as a fallback. Crown
|
|
158
|
+
width and height scale independently to source measurements.
|
|
159
|
+
|
|
160
|
+
Observed land-cover `crop`, `trees`, and `irrigated` tags survive semantic decoding. Supported
|
|
161
|
+
crop tags select olive, date palm, coconut, oil palm, coffee, tea, banana, rubber, and grapevine
|
|
162
|
+
forms. Untyped orchards use a regional fruit-tree prior. `rows` on a scatter rule specifies
|
|
163
|
+
between-row `spacing`, along-row `interval`, `angle` in degrees, and bounded `jitter`. Rows share
|
|
164
|
+
the global placement grid across tile boundaries and retain nested quality subsets; density can
|
|
165
|
+
thin the grid but cannot overfill it. The default row bearing is an inferred presentation choice,
|
|
166
|
+
not a surveyed field orientation. Crops are confined to mapped cultivated polygons or explicit
|
|
167
|
+
crop tags; bare desert does not imply an irrigated oasis.
|
|
168
|
+
|
|
169
|
+
Scatter rules may require `nearWater: { maxDistance, classes? }`. This gates placement against
|
|
170
|
+
mapped water at the exclusion raster's resolution; it does not infer groundwater or tides.
|
|
171
|
+
Water polygons preserve dry island holes. Mangroves in an ecological coastal envelope require
|
|
172
|
+
nearby mapped water for generic forest/scrub, or mapped wetland/mangrove land cover. Riparian
|
|
173
|
+
populations use mapped river/lake proximity and gentler slopes. Missing water data can therefore
|
|
174
|
+
underpopulate a real habitat instead of planting wetland trees far inland.
|
|
175
|
+
|
|
176
|
+
## Seasonal appearance
|
|
177
|
+
|
|
178
|
+
`mountEarthView` and `createEarthWorldgen` accept `vegetationMonth: 1..12`. The equivalent low-level
|
|
179
|
+
setting lives in `RegionalEnvironmentDocs` and is passed unchanged to workers and cache keys.
|
|
180
|
+
Omitting it keeps neutral leaf-on appearance. The World Explorer freezes the current UTC month
|
|
181
|
+
for its mount; `?month=1..12` selects a repeatable month and `?month=0` disables the seasonal cycle.
|
|
182
|
+
|
|
183
|
+
Only presets with explicit deciduous `phenology` change. Derived spring and autumn colors and
|
|
184
|
+
bare winter branching keep the same mature dimensions, instance positions, individual variation,
|
|
185
|
+
and placement seeds. The coarse calendar reverses the southern hemisphere and extends dormancy
|
|
186
|
+
at high latitudes. Tropical locations stay leaf-on; evergreen plants do not become bare. This
|
|
187
|
+
does not infer local weather, snow, tropical wet/dry seasons, crop harvest dates, or climate change.
|
|
188
|
+
Remount with another month to change appearance.
|
|
189
|
+
|
|
190
|
+
The ordinary architectural catalog supplies 294 recipes across 14 construction families and seven
|
|
191
|
+
uses: detached homes, attached homes, apartments, commercial, civic, industrial, and farm
|
|
192
|
+
buildings. Mapped use wins over neighborhood inference. Taller measured residential buildings
|
|
193
|
+
select compatible apartment recipes; source footprint, height, and levels still control the
|
|
194
|
+
generated geometry. Named precedents from the 120-entry structure library remain available
|
|
195
|
+
explicitly. Without evidence of age, the ordinary catalog does not randomly assign an iconic
|
|
196
|
+
historic building type to an untyped home.
|
|
197
|
+
Each family/use has three weighted recipes: base, compact facade, and open facade. Stable building
|
|
198
|
+
identity selects their window/bay rhythm, roof weighting, eaves, parapets and supported facade
|
|
199
|
+
details. The facade names do not resize the mapped building. Explicit original recipe IDs remain
|
|
200
|
+
available, and identity-free selection keeps the base recipe.
|
|
201
|
+
|
|
202
|
+
For inferred vacant lots, regional `lotPlans` weights select cottages, L-shaped ranches,
|
|
203
|
+
courtyards, compact homes, attached-garage plans or commercial shopfronts. The US Southwest has
|
|
204
|
+
its own stucco-and-ceramic-tile family; Washington uses the North American siding-and-shingle
|
|
205
|
+
family. Each inferred lot reserves a path or driveway to its frontage street. Mapped land use
|
|
206
|
+
selects residential versus commercial pools; see [building infill](worldgen.md#inferred-buildings-where-outlines-are-missing).
|
|
207
|
+
|
|
208
|
+
Near-detail ordinary facades include a bounded single, double, or service entrance. The inferred
|
|
209
|
+
entrance fits an eligible exterior wall, reserves a ground-floor window bay, and yields to known
|
|
210
|
+
structural openings, open ground floors, and raised buildings. It is a visual entrance; it does
|
|
211
|
+
not create a traversable opening or claim a surveyed door position. Industrial and farm recipes
|
|
212
|
+
also include high windows and larger service doors.
|
|
213
|
+
|
|
214
|
+
## Agricultural land use
|
|
215
|
+
|
|
216
|
+
All 36 habitat profiles supply an independent `agriculture` channel, refined by ten worldwide
|
|
217
|
+
agricultural overrides (including the Corn Belt, Cerrado/Pampas and Indus/Gangetic plains). It activates only on
|
|
218
|
+
mapped or retrieved farmland, cropland, orchards, vineyards, plantations and pasture. Climate
|
|
219
|
+
alone never turns natural habitat into a farm. Ordinary farmland receives agricultural
|
|
220
|
+
appearance from the ecology pack without another download.
|
|
221
|
+
|
|
222
|
+
The 22 crop recipes cover maize, soybean, small cereals, rice, cotton, sugarcane, sunflower,
|
|
223
|
+
rapeseed, root vegetables, sorghum; olive, fruit, date, coconut, oil-palm, coffee, tea, banana,
|
|
224
|
+
rubber and grape cultivation; and pasture/fallow surfaces. Ten annual forms each have three
|
|
225
|
+
procedural variants. The complete catalog now has 264 plant recipes and 474 appearances with
|
|
226
|
+
crop stages and deciduous seasons. Several source tags share a visual recipe: wheat, barley
|
|
227
|
+
and rye use the small-cereal model. Preserve the source `crop` tag when presenting observations;
|
|
228
|
+
`cultivation.crop` identifies a rendering recipe.
|
|
229
|
+
|
|
230
|
+
Selection uses explicit `crop`/`trees` tags first, then a sufficiently confident retrieved crop,
|
|
231
|
+
then a deterministic regional mixture. Iowa's temperate mixture favors maize and soybeans;
|
|
232
|
+
Mediterranean profiles include olives and vines, Asian profiles include rice, and tropical
|
|
233
|
+
profiles include cane and plantation forms. These mixtures are authored visual priors, not
|
|
234
|
+
acreage statistics or a claim about this year's crop. The current Protomaps basemap collapses
|
|
235
|
+
some agricultural classes to farmland and does not generally retain crop tags, so inference
|
|
236
|
+
remains important even where field outlines are mapped.
|
|
237
|
+
|
|
238
|
+
The pure `prepareAgricultureTile` adapter derives matching surface and scatter parameters in
|
|
239
|
+
workers and the renderer. It retains holes, rejects roads/buildings/water and steep slopes,
|
|
240
|
+
reserves headlands, aligns plants to world-anchored rows, and excludes competing wild brush
|
|
241
|
+
inside cultivated fields. Known field identifiers retain their variation across clipping;
|
|
242
|
+
a supplied full-field anchor also stabilizes regional selection. Unnamed polygons are divided
|
|
243
|
+
on a fixed projected grid, clipped to agricultural land. These visual divisions are not surveyed
|
|
244
|
+
parcels. Derived `cultivation` metadata records recipe, `mapped`/`classified`/`inferred` evidence,
|
|
245
|
+
source, observation year where known, growth stage and row angle.
|
|
246
|
+
|
|
247
|
+
Near views instance bounded plant patches and orchard trees. Distant views retain soil/crop
|
|
248
|
+
bands through an antialiased procedural shader without downloading textures or drawing each
|
|
249
|
+
plant. Agriculture has a separate instance/model budget: finest-level Economy 500/2, Balanced
|
|
250
|
+
3,500/5 and High 6,500/8. Annual patches disappear at medium detail; Economy uses their surface
|
|
251
|
+
patterns. Both WebGL and node-material paths consume the same field attributes, including
|
|
252
|
+
worker-built landcover. Custom ground materials must opt into `{ agriculture: true }` and use
|
|
253
|
+
landcover geometry's attributes; use a separate material for bare elevation meshes.
|
|
254
|
+
|
|
255
|
+
An explicit vegetation month selects sown, growing, mature, ripe or stubble appearances; the
|
|
256
|
+
default is mature. Coarse authored calendars shift six months in the southern hemisphere.
|
|
257
|
+
Tropical crops stay mature without a source calendar. Retrieved sowing/harvest months are
|
|
258
|
+
absolute calendar months and override that shift. This is illustrative growth, not a crop
|
|
259
|
+
rotation, weather, irrigation or multiple-cropping simulation. Mapped barns, sheds, stables
|
|
260
|
+
and generic buildings inside mapped farmyards select the regional farm architecture. A field
|
|
261
|
+
never invents a building footprint.
|
|
262
|
+
|
|
263
|
+
### Optional global retrieval
|
|
264
|
+
|
|
265
|
+
A terrain package may declare a compact `agriculture` source:
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"urlTemplate": "https://your-host.example/agriculture/worldcover-2021-v1/{z}/{x}/{y}.json",
|
|
270
|
+
"level": 10,
|
|
271
|
+
"source": "esa-worldcover-2021-v200",
|
|
272
|
+
"year": 2021,
|
|
273
|
+
"maxTileBytes": 131072
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
This is a hosting example, not a deployed release. Earth View and World Explorer consume it
|
|
278
|
+
automatically for geospatial XYZ packages, after overzooming and joining semantic archives.
|
|
279
|
+
They share up to 32 parent-grid requests between visual layers, bound uncompressed responses,
|
|
280
|
+
validate coordinates/provenance and retain the basemap on missing or failed requests. Hydrology
|
|
281
|
+
does not request agricultural data. Add the source's license and attribution to the terrain
|
|
282
|
+
package; large source rasters stay outside ecology content packs.
|
|
283
|
+
|
|
284
|
+
`molen/agriculture-grid@1` uses a small palette and row-major `[count, paletteIndex]` runs.
|
|
285
|
+
Index zero is unknown/non-crop; a positive entry without a crop supplies only agricultural
|
|
286
|
+
extent. Optional crop, source confidence, irrigation and calendar information refine appearance.
|
|
287
|
+
Cells supplement missing land use; mapped surfaces and explicit crops take precedence.
|
|
288
|
+
Area-weighted majority observations refine untagged farmland while retaining mapped outlines.
|
|
289
|
+
At most 256 additional polygons are admitted per semantic tile.
|
|
290
|
+
|
|
291
|
+
The sibling Qualla repository's `pipeline/agriculture/` compiler reads range-addressable
|
|
292
|
+
[ESA WorldCover 2021 v200](https://esa-worldcover.org/en/data-access) COG windows and reduces
|
|
293
|
+
cropland class 40 to conservative sampled-majority cells. Its default is 64×64 cells per level-10
|
|
294
|
+
tile: about 612 projected meters per cell, with smaller ground distances toward the poles.
|
|
295
|
+
It supports every continent and bounded resumable shards. Source URLs, recipe/payload hashes,
|
|
296
|
+
year, attribution and exact covered tile inventory accompany each dataset. A partial shard
|
|
297
|
+
is never advertised as global coverage.
|
|
298
|
+
|
|
299
|
+
Optional categorical COG adapters support global
|
|
300
|
+
[WorldCereal 2021 products](https://esa-worldcereal.org/en/products/global-maps), including maize
|
|
301
|
+
and spring/winter cereals, and regional refinements. WorldCereal's cereal class is not a specific
|
|
302
|
+
wheat observation. Raw classification rasters are required; colored map previews are unsuitable.
|
|
303
|
+
The checked six-continent WorldCover sample is historical extent data, not crop-type evidence.
|
|
304
|
+
Production hosting and larger geographic builds are separate Qualla release operations.
|
|
305
|
+
|
|
306
|
+
`preview-agriculture.mjs` captures controlled six-region farm compositions, growth stages,
|
|
307
|
+
inference, near/far views and shader paths. `preview-diversity.mjs --agriculture` builds real GLB
|
|
308
|
+
review assets and exercises public import, inspection, simulation and capture APIs. Fixtures
|
|
309
|
+
are labeled separately from observations; inspect live terrain before claiming local accuracy.
|
|
310
|
+
|
|
311
|
+
## Wildlife and habitat sound
|
|
312
|
+
|
|
313
|
+
The optional `molen.wildlife` pack adds an independent `wildlife` profile channel, `animals`, and
|
|
314
|
+
`populations` to regional catalogs. It depends on `molen.ecology.regional@1`; opening packs in a
|
|
315
|
+
different order does not change selection. Earth and World Explorer load it by default when it
|
|
316
|
+
is in the host's pack index. `ambient: { wildlife: false }` disables animals in `mountEarthView`;
|
|
317
|
+
World Explorer accepts `?wildlife=0`. Frozen captures retain the existing ambient opt-in rule.
|
|
318
|
+
|
|
319
|
+
The catalog has 90 recipes: three adult body/coat forms for each of 21 named mammal taxa and nine
|
|
320
|
+
functional bird, reptile, fish, and insect groups. These are modest visual variations, not claims
|
|
321
|
+
about sex, age or subspecies. Each trio shares habitat/range/season gates and divides the previous
|
|
322
|
+
visual density equally; total expected abundance and population caps stay unchanged. Mammal country membership comes from Mammal Diversity Database v2.5 under
|
|
323
|
+
CC BY 4.0. A quarter-degree Natural Earth map-unit grid preserves overseas territory distinctions.
|
|
324
|
+
The range document compresses to about 30 KB; the recipe catalog adds about 6 KB (40 KB as a content pack). No animal GLBs
|
|
325
|
+
are downloaded. Source hashes, transformations, licenses, and limitations ship in the pack.
|
|
326
|
+
|
|
327
|
+
Country membership is a coarse limit, not within-country occupancy. Named taxa require an
|
|
328
|
+
attributed range plus compatible biome/realm and actual mapped land cover. Recent introduced
|
|
329
|
+
populations and uncertain country memberships are omitted. Large/rare mammals also require
|
|
330
|
+
explicit mapped conservation habitat, and water-dependent animals require mapped nearby water.
|
|
331
|
+
An uncovered range cell cannot authorize a named mammal. Unnamed functional groups deliberately
|
|
332
|
+
make no precise species claim. These choices and visual densities are authored priors, not a census.
|
|
333
|
+
|
|
334
|
+
Wildlife reads the finest displayed land-cover and human-feature tiles. Unknown terrain, built
|
|
335
|
+
areas, roads, buildings, water inappropriate to the animal, and steep slopes reject placement.
|
|
336
|
+
Island/courtyard holes remain usable. Swimming animals share the rendered water datum; flight
|
|
337
|
+
uses a bounded clearance. The 20 Hz kernel uses stable world-grid candidates, independent seeds,
|
|
338
|
+
plain restorable state, bounded wandering, and path substeps. Population, distance and pose caps
|
|
339
|
+
follow Earth quality. Models share recipe geometry, use one opaque skinned draw per animal, and
|
|
340
|
+
dispose with the terrain stream. Tiny animals disappear at short distances.
|
|
341
|
+
|
|
342
|
+
An explicit vegetation month also suppresses the generic insect/lizard groups in the coarse
|
|
343
|
+
cold season and changes the arctic-fox coat. It does not simulate migration or actual weather.
|
|
344
|
+
Birdsong uses the sound pack's curated regional catalog when present: location, observed habitat,
|
|
345
|
+
the sky's calendar month and local sunlight select the recordings. The initial eight CC0
|
|
346
|
+
recordings cover conservative areas in North America, Europe, Japan, Australia, the Amazon,
|
|
347
|
+
South Africa and Mauritius; uncovered places stay quiet. Monthly gains are authored activity
|
|
348
|
+
priors, not a migration simulation. They are independent of the named visual mammal taxa.
|
|
349
|
+
Crickets still use the generic recording gated by regional habitat and season. Both retain
|
|
350
|
+
weather, height and vehicle suppression. Composing hosts supply `EarthAudioFrame.location`
|
|
351
|
+
and `regionalAmbience` from `EarthWildlife.ambience`; older packs without a birdsong catalog
|
|
352
|
+
retain the generic bird soundscape. See [Sound and music](audio.md).
|
|
353
|
+
|
|
354
|
+
## Authoring and verification in this repository
|
|
355
|
+
|
|
356
|
+
The authoring source is in `content/ecology/source/`. Run `build-catalog.mjs` for plants/habitats
|
|
357
|
+
and `build-architecture.mjs` for regional archstyles and bindings; both support `--check`.
|
|
358
|
+
`packages/worldgen-earth/scripts/generate-structure-atlas.mjs` derives the runtime architectural
|
|
359
|
+
atlas from the checked-in reduced country data and geographic assignments.
|
|
360
|
+
|
|
361
|
+
Large upstream geography stays outside runtime packs. The Python converters under
|
|
362
|
+
`packages/worldgen-earth/scripts/` accept an explicitly supplied source ZIP and use the pinned
|
|
363
|
+
authoring requirements there. Source URLs, hashes, licenses, and reduction methods travel with
|
|
364
|
+
the data or its notice. Regeneration does not require downloading the upstream datasets during
|
|
365
|
+
ordinary builds.
|
|
366
|
+
|
|
367
|
+
`content/wildlife/source/build-catalog.mjs` builds the animal recipes and supports `--check`.
|
|
368
|
+
`build-wildlife-ranges.py` takes explicit, checksum-pinned MDD CSV, metadata CSV and Natural Earth
|
|
369
|
+
map-unit ZIP inputs. `content/wildlife/source/preview-animals.mjs` imports, inspects and captures
|
|
370
|
+
procedural bind poses through the public asset pipeline; it does not verify live animation.
|
|
371
|
+
|
|
372
|
+
`preview-plants.mjs`, `preview-regions.mjs`, and `preview-architecture.mjs` produce local review
|
|
373
|
+
artifacts. Landscape fixtures exercise the real scatter adapter but bake placements for portable
|
|
374
|
+
capture; they do not measure live instancing performance. Review real streamed locations as well
|
|
375
|
+
as fixtures, including camera movement, terrain slopes, boundaries, and quality changes. Follow
|
|
376
|
+
the [medium-fi style guide](medium-fi.md) for geometry, color, and LOD budgets.
|
|
377
|
+
|
|
378
|
+
`preview-live-viewer.mjs` accepts a local terrain package and geographic camera position, captures
|
|
379
|
+
the streamed Explorer in fixed daylight, and records loading failures, draw/geometry counts,
|
|
380
|
+
wildlife counts, and measured frame intervals. `profile-live-tile.mjs` separates scatter and
|
|
381
|
+
building CPU costs on real decoded map tiles. `preview-mounted-viewer.mjs` exercises the public
|
|
382
|
+
`mountEarthView` API through orbit, walking, driving and flight. Browser measurements describe
|
|
383
|
+
the reviewing machine; they are not portable device performance guarantees. The reusable terrain
|
|
384
|
+
extract builder accepts an explicit source release, bounds, package name and snapshot date, so
|
|
385
|
+
these small local QA extracts retain their own provenance.
|
|
386
|
+
|
|
387
|
+
`content/wildlife/source/preview-motion.mjs` captures changing skinned poses from the actual
|
|
388
|
+
wildlife renderer and deterministic movement system. It complements the static asset previews.
|
|
389
|
+
After completing those captures, `content/ecology/source/build-review-gallery.mjs` assembles a
|
|
390
|
+
searchable local gallery at `.artifacts/regional-world/review.html`, with separate live terrain,
|
|
391
|
+
controlled landscapes, building families, wildlife poses, and public API camera modes. It retains
|
|
392
|
+
the known visual limitations beside the evidence rather than treating successful capture as
|
|
393
|
+
art approval.
|
|
394
|
+
|
|
395
|
+
Fine habitat transitions, richer wildlife behavior/body variation, and detailed city/rural
|
|
396
|
+
architectural overrides need finer evidence and additional authored content. The repository's
|
|
397
|
+
`content/ecology/coverage-plan.json` records implementation, acceptance evidence, and these
|
|
398
|
+
remaining fidelity limits.
|
|
@@ -85,7 +85,9 @@ These are client calculations using native floating-point math, outside the kern
|
|
|
85
85
|
|
|
86
86
|
When enabled, sky lighting replaces `environment.ambient` and `environment.sun`. Configure
|
|
87
87
|
`sky.lighting.sunIntensity`, `moonIntensity`, `dayAmbient`, `nightAmbient` and `castShadow`
|
|
88
|
-
instead.
|
|
88
|
+
instead. `skyLightSaturation` (0–1, default 1) sets how saturated the light the sky casts is
|
|
89
|
+
relative to the dome palette; below 1 it moves toward the palette's luminance, so a deep blue
|
|
90
|
+
zenith does not tint every surface in shade blue. The Earth view uses 0.3. Sunlight fades around the horizon; moonlight depends on altitude, phase and darkness.
|
|
89
91
|
Only the Sun casts a sky shadow in phase 1. Shadows also require `environment.shadows` and
|
|
90
92
|
scene geometry that casts/receives shadows; their local frustum follows the camera.
|
|
91
93
|
`renderer.setShadowQuality('off' | 'low' | 'medium' | 'high')` turns sun shadows on or off at a
|
|
@@ -97,6 +99,35 @@ shadow-map texels so edges do not shimmer; `setShadowFocus(undefined)` restores
|
|
|
97
99
|
light intensity to disable illumination. `sun.size` and `moon.size` are visual multipliers;
|
|
98
100
|
the default 1 preserves real angular size. Larger values help stylized scenes and small displays.
|
|
99
101
|
|
|
102
|
+
## Ambient occlusion
|
|
103
|
+
|
|
104
|
+
`renderer.setAmbientOcclusion(true, { radius, strength, reach })` adds screen-space ambient occlusion
|
|
105
|
+
(three's GTAO) on the WebGPU backend; on WebGL it does nothing. Creases, corners, window recesses
|
|
106
|
+
and the ground around building and tree bases darken where indirect light would not reach. The
|
|
107
|
+
frame then draws into an offscreen multisampled target exactly as it would to the canvas (the sky
|
|
108
|
+
scene, then the world, which also writes view normals packed in 8 bits); occlusion is computed
|
|
109
|
+
from that target's depth and normals at half resolution with eight samples, denoised at half
|
|
110
|
+
resolution too by a depth-aware 5×5 box (nine bilinear taps; it cancels GTAO's 5×5 rotation
|
|
111
|
+
pattern at a fraction of three's sixteen-tap denoiser), and multiplied into the image, with tone
|
|
112
|
+
mapping applied once at the end. Sky pixels (the far plane, with either depth convention) are left
|
|
113
|
+
untouched, and GTAO skips them: with a reversed depth buffer the sky reads as depth 1, the value
|
|
114
|
+
GTAO skips, rather than its stored 0. Anything farther than `reach` (default 250 m of view
|
|
115
|
+
distance) is skipped the same way, and the occlusion fades out over the last third of it: past
|
|
116
|
+
that its creases are under a pixel, and skipping them is most of an aerial view. `radius`
|
|
117
|
+
(default 3 m) is the world-space sampling radius and `strength` (0–1, default 0.85) the share
|
|
118
|
+
applied, since the
|
|
119
|
+
multiply also dims direct light. Frames draw directly while the pipeline compiles.
|
|
120
|
+
|
|
121
|
+
Every object's shaders are built for the target it draws into, and the occlusion target (it writes
|
|
122
|
+
normals beside color) is a different one from the canvas. With occlusion on, `prepareObject`
|
|
123
|
+
builds for the occlusion target. To skip the occlusion work for a while, call
|
|
124
|
+
`renderer.suspendAmbientOcclusion(true)` rather than turning it off: the frame keeps drawing into
|
|
125
|
+
the same target and copies the image out unshaded, so nothing is built again. Turning it off and on
|
|
126
|
+
with `setAmbientOcclusion` changes the target, and every object in view builds its shaders again,
|
|
127
|
+
mid-frame. The World Explorer suspends it above 24 m over the ground and resumes below 18 m, where
|
|
128
|
+
its creases are small but its passes still cost a full-screen share of each frame (about 3 ms of
|
|
129
|
+
a 44 ms rooftop frame on an Apple M2 at High); `?ao=0` turns it off for comparison.
|
|
130
|
+
|
|
100
131
|
## Reflections
|
|
101
132
|
|
|
102
133
|
For metal and glass, pass `reflections: true` to `createViewer` or `mountExperience`.
|
|
@@ -144,8 +175,10 @@ authored star list with `direction`, `magnitude`, and optional hex `color`.
|
|
|
144
175
|
Attach its `lights` group to the world scene, call `update(seconds)` and `prepareCamera(camera)`,
|
|
145
176
|
and render its `scene`/`camera` as a background pass before your scene. Dispose it when removed.
|
|
146
177
|
|
|
147
|
-
`palette` also accepts `ground`, `sun`, and `moon`. `
|
|
148
|
-
|
|
178
|
+
`palette` also accepts `ground`, `sun`, and `moon`. `dome.brightness` (default 1) scales only the
|
|
179
|
+
drawn dome, not the sky light or reflections taken from the palette: under filmic tone mapping a
|
|
180
|
+
clear sky lit at the palette's brightness renders pale, and the Earth look draws it at about half
|
|
181
|
+
(`EARTH_SKY_DOME`). `moon.earthshine` controls the dark side's subtle visibility. Stars support `enabled`, `magnitudeLimit` (up to the catalog limit of 6.5),
|
|
149
182
|
`intensity` and visual angular `size`. Stars disappear below the horizon and fade through
|
|
150
183
|
twilight; a bright visible Moon reduces their contrast. Moon disks occlude stars behind them.
|
|
151
184
|
|
|
@@ -92,7 +92,10 @@ priors and do not identify the architecture of an individual mapped building.
|
|
|
92
92
|
`facade.details` adds shutters, balconies, timber framing or pilasters, awnings and verandas.
|
|
93
93
|
Details use the actual facade rhythm, a bounded perimeter allocation, and the existing
|
|
94
94
|
`facade-bands` tier flag. Structural openings, clipped edges and courtyard constraints take
|
|
95
|
-
precedence.
|
|
95
|
+
precedence. Shutters, painted the dark tone of the trim, flank punched windows and, on houses with
|
|
96
|
+
walkable interiors, the structural window openings that replace them. A veranda wraps every
|
|
97
|
+
qualifying wall, so families whose lots sit close to the street leave it out. Dormers use
|
|
98
|
+
`roof.features.dormers` on eligible pitched wings. Simplified budget
|
|
96
99
|
representations omit ornament while retaining their footprint, primary roof and measured envelope.
|
|
97
100
|
|
|
98
101
|
The [standard material catalog](https://github.com/bendyline/molen/blob/main/content/worldgen/materials/README.md)
|