@bendyline/molen-tooling 0.0.15 → 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 (45) 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 +263 -29
  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/earth-view.md +198 -16
  10. package/dist/docs-src/guide/entities.md +38 -7
  11. package/dist/docs-src/guide/figures.md +32 -4
  12. package/dist/docs-src/guide/graphics-performance.md +44 -12
  13. package/dist/docs-src/guide/livery-catalog.md +137 -1
  14. package/dist/docs-src/guide/livery-gallery.md +136 -1
  15. package/dist/docs-src/guide/medium-fi.md +194 -10
  16. package/dist/docs-src/guide/night-lighting.md +10 -0
  17. package/dist/docs-src/guide/regional-fleets.md +27 -5
  18. package/dist/docs-src/guide/regional-world.md +19 -1
  19. package/dist/docs-src/guide/rendering-backends.md +23 -2
  20. package/dist/docs-src/guide/sky.md +28 -2
  21. package/dist/docs-src/guide/snow.md +231 -0
  22. package/dist/docs-src/guide/surface-rendering.md +324 -9
  23. package/dist/docs-src/guide/terrain.md +74 -5
  24. package/dist/docs-src/guide/vehicle-interiors.md +6 -0
  25. package/dist/docs-src/guide/vehicles.md +368 -45
  26. package/dist/docs-src/guide/weather.md +7 -1
  27. package/dist/docs-src/guide/worldgen.md +82 -3
  28. package/dist/docs-src/llms.txt +3 -2
  29. package/dist/docs-src/schemas/README.md +1 -0
  30. package/dist/docs-src/schemas/components.md +749 -12
  31. package/dist/docs-src/schemas/figure.md +30 -4
  32. package/dist/docs-src/schemas/interior-catalog.md +56 -3
  33. package/dist/docs-src/schemas/map-overrides.md +658 -0
  34. package/dist/docs-src/schemas/structure-placement-data.md +195 -0
  35. package/dist/docs-src/schemas/structure-placements.md +195 -0
  36. package/dist/docs-src/schemas/worldgen-batch.md +54 -0
  37. package/dist/templates/city-courier/gen/molen-types.ts +113 -4
  38. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +112 -3
  39. package/dist/templates/figures-gallery/test/headless.test.ts +3 -2
  40. package/dist/templates/index.json +17 -17
  41. package/dist/templates/skybound/gen/molen-types.ts +113 -4
  42. package/dist/templates/skybound/scripts/molen-scripts.d.ts +112 -3
  43. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +112 -3
  44. package/dist/templates/top-down-arena/src/gen/molen-types.ts +113 -4
  45. package/package.json +12 -12
@@ -3,7 +3,8 @@
3
3
  Molen's Earth view draws the real planet at full scale in a browser, with thousands of buildings,
4
4
  trees, vehicles and landmarks on screen at once. Its look is **medium-fi**: a bright, polygonal
5
5
  model-railroad version of the world. This page sets the standard for every model, building
6
- style, palette and prop made for it, and ends with the review an agent runs before submitting one.
6
+ style, palette and prop made for it and for the picture they add up to, and ends with the
7
+ reviews an agent runs before submitting either.
7
8
 
8
9
  Medium-fi sits between two looks it avoids. It is not low-fi, meaning voxels, pixel art or bare
9
10
  grey boxes. It is not high-fi either: photoreal surfaces, or even the most detail the engine can
@@ -12,6 +13,11 @@ City. Proportions are realistic, faces are visibly polygonal, and shared texture
12
13
  a strong sun. Every object reads clearly, the whole frame is coherent, and it holds 60 frames per
13
14
  second on ordinary laptops.
14
15
 
16
+ The technique is that era's; the mood is a model railway layout on a sunny afternoon. Someone
17
+ who opens the Earth view should feel they have found a trainset of the whole world that is
18
+ theirs to play with: true to the place, tidy, warm, legible from any height, and busy with small
19
+ things that move. When a choice is unclear, make the one the layout's builder would have made.
20
+
15
21
  ## Why medium-fi
16
22
 
17
23
  Three constraints decide the style, and every rule below follows from one of them:
@@ -44,6 +50,45 @@ Three constraints decide the style, and every rule below follows from one of the
44
50
  [Rendering modes](#rendering-modes)) change resolution, shadows and level of detail. They
45
51
  never change the palette or the style, so every mode looks like the same world.
46
52
 
53
+ ## The picture
54
+
55
+ The five rules govern an asset. These nine govern the frame the assets add up to, at street
56
+ level, from a rooftop and from an airliner. They bind the engine and its content packs as much
57
+ as a model: where the Earth view falls short of one, that is a defect to fix, not something to
58
+ work around inside an asset. A change to light, palette, ground, weather, a distribution or a
59
+ level-of-detail rule is reviewed against them (see [Scene review](#scene-review)).
60
+
61
+ 1. **Three values, and no black.** Squint at a daylight frame. It holds light (sky, roofs,
62
+ paving), middle (ground, walls, water) and dark (foliage in shade, glass, cast shadow), each
63
+ in clear shapes. Nothing larger than a car is darker than 8% on screen at noon, and shaded
64
+ ground keeps 40–50% of its sunlit value, so shade still has color.
65
+ 2. **Natural hues stay natural.** Watered turf is yellow-green (HSL hue 75–115°), broadleaf
66
+ foliage 85–135°, conifers 115–150°, and sea and lake water 185–215°. Dry grass runs to straw
67
+ and a silted river to olive or brown. No teal lawn, blue-black forest or emerald sea.
68
+ 3. **Palettes are albedo.** A color measured from a photograph already holds the shadows of
69
+ everything standing there, the haze above it and the camera's cast, and the engine adds its
70
+ own shadows, haze and tone curve. Convert a measurement to the surface's own color in open
71
+ sun before it becomes a palette entry, and judge it at eye level as well as from above.
72
+ 4. **Air gives depth.** Anything deeper than a few hundred meters shows aerial perspective:
73
+ farther is lighter, cooler and lower in contrast, warmer toward the sun, and the horizon
74
+ dissolves into the sky. A skyline never reads as a cut-out.
75
+ 5. **One hand.** Sky, clouds, water and weather are drawn in the same simplified, sculpted way
76
+ as the ground. A cumulus has a flat base, a lit top and a shaded side; water is dark below
77
+ the viewer and takes the sky toward the horizon.
78
+ 6. **No dead ground.** No surface larger than a hectare is one flat color. A lot has stalls and
79
+ cars, a field has rows, a yard has stacks, a plaza has pavers, and open water has a sky
80
+ gradient and a shore.
81
+ 7. **Life within fifty meters.** At street level any view holds a tree, a parked or moving
82
+ vehicle, a piece of street furniture and something with a sign on it. From the air, lots and
83
+ curbs hold cars, water holds boats and rail yards hold trains.
84
+ 8. **Distance reads as mass.** Far forest is a canopy, far city is roofs and streets, far fields
85
+ are a patchwork. Separate instances never become speckle. Every level of detail of an object
86
+ has the same average color, so nothing changes value as it comes closer, and a level change
87
+ is cross-faded or happens below notice.
88
+ 9. **One calendar, one exposure.** Sun, sky, foliage, lights and weather follow one date and
89
+ time. Exposure follows the light as a camera would: a low sun or an overcast sky gives a
90
+ softer frame, not a darker one. Only twilight and night are dark, and night keeps its shapes.
91
+
47
92
  ## The look the engine provides
48
93
 
49
94
  Author against the lighting the Earth view actually uses. Both Earth hosts share one rig:
@@ -61,13 +106,16 @@ exported from `@bendyline/molen-earth/client` as `EARTH_SKY_PALETTE`, `EARTH_LIG
61
106
  | Haze | The sky's own horizon color, from about 2 km | Distant ground dissolves into the horizon; do not add a fog color of your own |
62
107
  | Water | Deep teal `#1b4450` with a soft sky reflection; hosts may tint it per region (Puget Sound near-black navy, Sydney Harbour green-teal) | Water absorbs most light: from above it is far darker than land. Keep ripples legible nearby; fade small wave detail at airplane distance |
63
108
 
64
- Two consequences matter for authoring:
109
+ Three consequences matter for authoring:
65
110
 
66
111
  - **Walls receive less light than roofs.** Under a high sun a vertical wall gets about half the
67
112
  light a roof gets. A wall palette therefore needs to be lighter than the color you want to see.
68
113
  - **Shadows do the grounding.** A building, tree or car is seated by its cast shadow. Never fake
69
114
  contact shading with a dark gradient or soot band at the base of a model; a foundation is its
70
115
  own material, not a shadow.
116
+ - **The sky is part of a smooth material.** Glass, water, wet paving and polished metal show the
117
+ sky dome through the environment map. Give them enough reflectance to carry it: a pane or a
118
+ water surface that relies on its base color alone renders as a dark slab.
71
119
 
72
120
  ### Color spaces
73
121
 
@@ -103,16 +151,21 @@ where real buildings have it. Avoid both grey-on-grey and candy color.
103
151
  | Flat roof (membrane, gravel) | 45–90% | 0–12% | white membrane `#e6e6e2`, pale grey `#d3d4d0`, gravel `#b0a693`, dark membrane `#74777b`; mostly pale, a few dark |
104
152
  | Trim and frames | 85–95% or 22–30% | 0–30% | white `#f4f1ea`, dark frame `#3b3e42` |
105
153
  | Untextured window glass | 35–45% | 20–30% | blue-grey pane `#4d6178` |
154
+ | Glazed facade, as seen in sun | 40–60% | 10–30% | takes the sky: pale blue-grey by day, gold at sunset |
106
155
  | Lawn and residential ground | 45–55% | 25–35% | lawn `#8aa065`, grass `#7fa258`, park `#6c9a55` |
107
- | Paved and commercial ground | 60–70% | 5–12% | paving `#aaa59a` |
156
+ | Paved and commercial ground | 60–70% | 5–12% | paving `#aaa59a`; sidewalks in this band, curbs up to 75% |
108
157
  | Forest floor and conifers | 30–40% | 25–35% | forest `#3c6a3f`, fir `#3e7052` |
109
158
  | Asphalt | 35–42% | 0–10% | road `#646766` (near neutral and weathered: from the air streets read mid grey; a bluer gray turns navy in shade, a darker one crushes to black), with markings `#eee9d4` and `#e8bd57` |
159
+ | Open water, below the viewer | 18–35% | 25–50% | deep teal `#1b4450`; lighter near a shore, sky-bright toward the horizon |
110
160
  | Identity and wayfinding accents | 35–60% | 55–90% | signal red `#b81d18`, chrome yellow `#e7b52a` |
111
161
 
112
- Regional ground palettes in the `molen.ecology` pack depart from the generic bands on purpose:
113
- they are calibrated against matched orthophotos of real cities. Desert and dry soil sits near
114
- 45–50% lightness as a warm mid brown, not pale sand; Pacific Northwest lawns and woodland floor
115
- read darker and bluer under their conifer canopy; dense blocks pave over their unmapped ground.
162
+ Regional ground palettes in the `molen.ecology` pack are tuned against orthophotos of real
163
+ cities. They move hue and saturation and choose where in a band a surface sits; they do not
164
+ leave the band. Desert and dry soil sits near 45–50% lightness as a warm mid brown, not pale
165
+ sand; Pacific Northwest turf and woodland are deeper and cooler than the generic lawn, at the
166
+ low end of their bands; dense blocks pave over their unmapped ground. An orthophoto is a
167
+ measurement to convert, not a swatch to copy (rule 3 of [the picture](#the-picture)): its
168
+ pixels hold the shadow of every tree and wall, and often a color cast.
116
169
 
117
170
  Palette rules:
118
171
 
@@ -126,7 +179,12 @@ Palette rules:
126
179
  about a tenth of an urban style's weight. Dark red and brown towers read as heavy blocks across
127
180
  a whole skyline.
128
181
  - **No black and no white on large surfaces.** Large surfaces stay between 22% and 94% lightness.
129
- A near-black roof reads as a hole in the frame, and a pure white wall blooms in sun.
182
+ A near-black roof reads as a hole in the frame, and a pure white wall blooms in sun. This holds
183
+ for forest, turf, glass and regional ground as much as for walls and roofs; open deep water
184
+ alone may sit at 18%.
185
+ - **Values step in order.** From the air, lightest to darkest: flat roofs and concrete, paving
186
+ and sidewalks, walls, bare ground and turf, pitched roofs, asphalt, foliage, water. Paving is
187
+ never the lightest thing in a frame, and nothing in sun is darker than a cast shadow.
130
188
  - **Roofs are darker than walls; flat commercial roofs are lighter.** Pitched roofs sit 15–35
131
189
  lightness points below their walls, so a neighborhood seen from above reads as roofs. Large
132
190
  flat roofs are light membranes and gravel, as they are in reality. A pitched style declares
@@ -286,9 +344,17 @@ For an identified real vehicle, the review must compare the actual geometry with
286
344
  mast, wing roots, glazing corners, roof breaks, intakes and tail junctions. Distinguish
287
345
  body length from overall length including rotors, propellers or appendages. Record the
288
346
  measurements and discrepancies; do not claim an overlay comparison if none was made.
347
+ Printed drawings are rarely one scale: calibrate each axis from its own dimension bar, trust
348
+ an annotated dimension over a drawn one, and settle a conflict with a matched photograph
349
+ whose camera is solved from landmarks other than the ones being tested.
289
350
  3. Correct the silhouette, cross sections, openings and major panel shapes before adding
290
351
  rivets, lettering or small controls. Shared generators may supply construction utilities;
291
352
  a generic body scaled to published dimensions is not an aircraft-specific airframe.
353
+ Matching length, width and height proves nothing about shape: judge the hood height, belt
354
+ line, roof end, forebody depth and canopy against the body they sit on, in a true-scale
355
+ side-on line-up of the whole class. In the engine repository,
356
+ `packages/entities/scripts/lineup-fleet.mjs` draws one. A part that looks oversized is often
357
+ correct on a body that is undersized, so measure both before changing either.
292
358
  4. Compare the operator view and wide cabin with the correct variant's references. Aim for
293
359
  overlays of the panel face and cabin sections where drawings exist, and matched-camera
294
360
  overlays for photographs. Verify panel outline, depth and tilt, instrument positions and
@@ -376,6 +442,25 @@ A style is a set of rules applied to arbitrary outlines, so its parts must survi
376
442
  - **Declare the LOD tiers.** Each style lists which feature groups survive at tiers 0, 1 and 2,
377
443
  so distant buildings keep their roof shape and window rhythm after trim and props drop.
378
444
 
445
+ A style cannot do all of it. A generated street is also held to these:
446
+
447
+ - **Glass takes the sky.** A glazed facade reads as a sky-colored middle value, never as a dark
448
+ slab. Panes reflect the sky dome, and the flat levels used at distance carry the pane's
449
+ on-screen average rather than its base color, so a tower holds its value at every distance.
450
+ - **Tops are finished.** A tower ends in a parapet and a plant enclosure or crown and steps back
451
+ where its style declares setbacks. A skyline shows more than one facade rhythm and more than
452
+ one glass tint. A straight extrusion with a bare top is a stand-in.
453
+ - **A row is houses.** A long, narrow residential footprint is divided at its party walls, each
454
+ unit with its own roof, color and chimney, not roofed as one shed.
455
+ - **Mapped appearance wins.** Where the map records a roof shape, a wall or roof color or a
456
+ material, use it, clamped to the palette bands.
457
+ - **A building has a plot.** A house sits in a yard with an edge (fence, wall or hedge, by
458
+ region), a way in and something growing. A shop sits on paving with parking; a warehouse has a
459
+ yard and loading doors. Seeded buildings take their density from their mapped neighbors.
460
+ - **Kinds are told apart.** A place of worship, a school, a fuel station, a greenhouse, a
461
+ stadium and a building site each read as what they are from the air. A windowless box is a
462
+ shed or a failure.
463
+
379
464
  The [worldgen guide](worldgen.md) and the
380
465
  [structure library](structure-library.md) cover the archstyle format and the 120 shipped styles.
381
466
 
@@ -471,6 +556,60 @@ instead of ending on a ruled line: grass blades and tufts of lawn over cast pavi
471
556
  10 cm edge on dirt and gravel. See
472
557
  [surface rendering](surface-rendering.md).
473
558
 
559
+ Variation is felt, not seen. Patch edges are gradual and patch contrast stays within about ±6%,
560
+ so ground detail never reads as camouflage, craters or stripes from a few hundred meters up.
561
+
562
+ ## Streets, lots and yards
563
+
564
+ Roads, parking and the ground around buildings cover more of a city than its buildings do, so
565
+ they carry the trainset as much as any model.
566
+
567
+ - **A street has a section.** From the centerline out: lanes, a curb, a planting strip with
568
+ trees where the region plants them, a sidewalk, then a yard edge or a building front.
569
+ Arterials carry lane paint; residential streets carry parked cars instead.
570
+ - **Paving is quiet.** Sidewalks sit at 62–70% lightness and curbs no higher than 75%, so roofs,
571
+ not paving, are the lightest things from the air. Markings appear at the size they are painted
572
+ and fade before they fall under a pixel. Distant streets stay asphalt grey.
573
+ - **A lot is used.** Stall paint, cars at an occupancy that fits the use and the hour, end
574
+ islands with a tree, and lamp standards. Beyond a few hundred meters cars become color
575
+ patches, never nothing.
576
+ - **Land shows its use.** A container terminal has stacks and cranes, an industrial yard has
577
+ trailers, a field has rows in the direction it is worked, a pitch has its lines and a cemetery
578
+ its stones.
579
+ - **Shores are built or natural.** Sand with a foam line, a capped seawall, or a bank with rock
580
+ or reeds; never a cut edge.
581
+ - **Pavement sits on its ground.** On a slope, bands follow one smoothed surface and stay joined
582
+ at their edges. A gap that shows soil, or a sidewalk that tilts away from its curb, is a defect
583
+ at any distance a walker can reach.
584
+
585
+ ## Sky, haze and water
586
+
587
+ - **Haze** starts within a few hundred meters and thickens smoothly: a few percent at 500 m,
588
+ about 15% at 2 km and half at 8 km on a clear day, thinner with height so ridges stand above
589
+ valleys. It takes the sky's color in the direction of view, warmer toward the sun. Weather
590
+ shortens it.
591
+ - **Clouds** are sculpted: flat bases at one altitude, billowed tops, grey beneath and bright
592
+ where the sun strikes. They shade the ground where the mode allows, and look as deliberate
593
+ from above as from below. A smooth lens or a white pad is unfinished.
594
+ - **Water** is the largest surface in most famous views. Under the viewer it is deep and clear
595
+ in its regional color. Toward the horizon it takes the sky, and at sunset the sunset. Within a
596
+ few meters of a shore it lightens, and ocean beaches carry a foam line. Ponds, moats and
597
+ pools are lighter than open water. Ripples never show their repeat, and the sun's path is a
598
+ soft lobe, not sparkle.
599
+
600
+ ## Night and weather
601
+
602
+ - **Night keeps its shapes.** The sky's floor is a deep blue that leaves roofs, roads and water
603
+ readable as dark shapes. Lights are warm and stay below white. Windows light pane by pane,
604
+ street lamps throw soft pools, and every lit street in view is a string of points, so a city
605
+ seen from the air is its grid.
606
+ - **Overcast is soft, not dim.** Exposure holds and shadows go.
607
+ - **Rain wets the ground.** Paving darkens and smooths, so lamps and signals streak on it.
608
+ - **Snow settles.** Up-facing ground, roofs and crowns whiten; ploughed roads stay darker.
609
+ - **Fog** shortens the haze and greys it. It makes a frame quieter, never emptier.
610
+
611
+ A rain or snow frame is recognizable with its particles turned off.
612
+
474
613
  ## Vehicles, aircraft, trees and figures
475
614
 
476
615
  - **Controllable vehicles require close detail.** Follow the close-view vehicle standard above:
@@ -539,14 +678,20 @@ modes. Every mode keeps the same palette and style; only cost changes.
539
678
  | High | High, Ultra | 100–125% scale, ≤ 4 megapixels | High | Full detail, 1.5–2 px error | Discrete GPUs and capture |
540
679
 
541
680
  Economy has no cast shadows, so it must still look good without them. That is one more reason to
542
- keep roofs darker than walls and to avoid baked shading. Hosts choose a fixed mode with
681
+ keep roofs darker than walls and to avoid baked shading. The reverse holds too: High, with its
682
+ shadows, is never harder to read than Economy.
683
+
684
+ Every mode shows the same things. Parked cars, street trees, lot paint and night lights step
685
+ down to cheaper forms with the mode; they do not disappear. A lot that holds cars at High holds
686
+ color patches at Economy. Hosts choose a fixed mode with
543
687
  `quality: 'economy' | 'balanced' | 'high'`, or let `'auto'` adapt; see
544
688
  [adaptive rendering performance](adaptive-performance.md).
545
689
 
546
690
  ## Review before submitting
547
691
 
548
692
  Run this review for every new or changed model, style or palette. A successful build is not a
549
- visual approval.
693
+ visual approval. A change that touches the scene as a whole also runs the
694
+ [scene review](#scene-review).
550
695
 
551
696
  Perform these checks during the same continuous pass that builds the model. Reuse the brief,
552
697
  reference pictures and map fit already established; do not restart research in a separate
@@ -581,6 +726,45 @@ npx molen figure preview --preset human.adult --angles review --out figure.png
581
726
  In the engine repository, the World Explorer is the reference scene. Its structure sheet renders
582
727
  all 120 styles under the same light, `node examples/world-explorer/scripts/capture-structure-sheet.mjs`.
583
728
 
729
+ ### Scene review
730
+
731
+ Run this for a change to light, exposure, haze, sky, water or weather, to a ground or regional
732
+ palette, to a distribution (trees, cars, seeded buildings) or to a level-of-detail rule. It
733
+ judges whole frames against [the picture](#the-picture), in every region the host ships, and it
734
+ compares the same poses before and after.
735
+
736
+ | View | Height above ground | What it tests |
737
+ | --- | --- | --- |
738
+ | Street | Eye level, on a sidewalk | Life within fifty meters, shade, glass, paving |
739
+ | Rooftop | 100–200 m, along a street | Tower tops, lots, street trees, level changes |
740
+ | Low aerial | 300–500 m, looking 20–30° down | Values, dead ground, yards, water and shore |
741
+ | Airliner | 5–8 km | Distance as mass, haze, clouds from above |
742
+
743
+ Take each view at clear noon. Take the low aerial also an hour after sunrise, at sunset, at
744
+ midnight, and under overcast, rain and snow. Take the street and the low aerial at Economy as
745
+ well as High. Wait until nothing is still loading: an incomplete frame is a failed capture, not
746
+ evidence.
747
+
748
+ 1. **Squint.** Blur the frame or view it 320 pixels wide. Three values in clear shapes, nothing
749
+ black, and the subject still obvious.
750
+ 2. **Grey.** In greyscale, roofs, ground, foliage and water are still told apart.
751
+ 3. **Floor and ceiling.** Sample the darkest and lightest large regions: none under 8% or over
752
+ 94% on screen at noon.
753
+ 4. **Hue.** Sample sunlit turf, a conifer, a broadleaf crown and open water against the ranges
754
+ in rule 2.
755
+ 5. **Depth.** The farthest third of the frame is lighter and lower in contrast than the nearest.
756
+ 6. **Dead ground.** Find the largest flat, single-color surface. Over a hectare, it fails.
757
+ 7. **Life.** In the street view, find a tree, a vehicle, a piece of furniture and a sign.
758
+ 8. **Levels.** Fly the rooftop pose toward its subject. No object changes value, and no level
759
+ change draws the eye.
760
+ 9. **Light.** The morning, overcast and noon frames have the same overall brightness. The night
761
+ frame shows the street grid, the shoreline and the skyline.
762
+ 10. **Cost.** Record draws, triangles and resident geometry on the same pose before and after,
763
+ in each mode. A visual gain is not paid for with a slower mode.
764
+
765
+ A region passes on its own frames. A palette that scores well against an orthophoto and fails
766
+ the street view has not passed.
767
+
584
768
  ## Read next
585
769
 
586
770
  - [3D art guidelines](3d-art-guidelines.md): scale, pivots, the material library and review captures
@@ -69,6 +69,16 @@ Each beam starts at its headlight lens and softly lights the road immediately ah
69
69
  Their beams illuminate pavement, walls and vehicles ahead. Parked, unoccupied cars keep their
70
70
  lamps off and receive light from their surroundings. Hidden/despawned traffic loses its lights.
71
71
 
72
+ A driven vehicle whose type has a `headlights` actuator (**L** in the Earth view and World
73
+ Explorer) lights its beams only while that switch is on, and then also at dusk and by day, at a
74
+ little over a third of their night strength. Its own model shows the lit lenses. A driven vehicle
75
+ without that actuator, such as a bicycle, lights up at dusk like traffic.
76
+
77
+ Lenses and beams come from `vehicle.spec.headlamps` when a type gives it: model-space lens
78
+ centres, at most two, so a single-lamp auto-rickshaw or scooter casts one beam from its real lamp.
79
+ An empty list (a skateboard) lights nothing. Without it, a pair is placed from the body's width,
80
+ height and length.
81
+
72
82
  Traffic lenses are two instanced batches, capped at 512 cars, and all artificial lighting fades
73
83
  out at dawn. No light changes the deterministic simulation.
74
84
 
@@ -1,10 +1,12 @@
1
1
  # Regional vehicle fleets
2
2
 
3
3
  Earth traffic and parked cars share a small fleet catalog. It assigns relative weights to existing
4
- vehicle type IDs and contains no models. China, Japan, Korea, several European, South American and
5
- African markets, and North America have separate mixtures. These are visual approximations, not
6
- sales or registration statistics. Unknown areas use a global fallback. Aircraft and ships keep
7
- their independent global pools.
4
+ vehicle type IDs and contains no models. China, Japan, Korea, South Asia, mainland and maritime
5
+ Southeast Asia, the Philippines, Taiwan, several European, South American and African markets,
6
+ and North America have separate mixtures, including motorcycles, scooters, mopeds and
7
+ auto-rickshaws where they are common. These are visual approximations, not sales or registration
8
+ statistics. Unknown areas use a global fallback. Aircraft and ships keep their independent global
9
+ pools.
8
10
 
9
11
  ## Content and selection
10
12
 
@@ -50,6 +52,24 @@ Existing traffic changes naturally through despawning, without replacing a car b
50
52
  `fleet.parkedAt` as the third argument of `createTerrainSurfaceRenderer`. Hosts without fleet
51
53
  content retain their original behavior.
52
54
 
55
+ ## Two- and three-wheelers
56
+
57
+ Motor two-wheelers and the auto-rickshaw are region-only: their `ambientRole` has a `weight` of 0,
58
+ so default traffic never picks them and the default parked list (`EarthContent.parkedVehicles`,
59
+ also used for garages) leaves them out. A fleet profile that weights them brings them in. Build
60
+ the fleet from `EarthContent.fleetParkedVehicles`, which adds seated motor two-wheelers and
61
+ region-only types to the parked candidates; `mountEarthView` does. Bicycles, kick scooters and
62
+ skateboards are never parked or in traffic: players ride them by choice.
63
+
64
+ Parked two-wheelers stand two or three to a car's bay, side by side and a little staggered, each
65
+ its own pick from the region's two-wheelers; an auto-rickshaw takes a bay like a car. At a
66
+ distance they draw as their own silhouettes, not as small cars. In traffic, a two- or
67
+ three-wheeler's driver is drawn on the saddle with the shared riding pose (hands on the bars,
68
+ which turn with the bend), and two-wheelers lean into turns up to their `cycle.maxLean`.
69
+ `ambientContentFromTypes` finds these riders (`EarthAmbientContent.riders`); custom hosts pass
70
+ them to `createAmbientRenderer` as `riders`. Riders share the skinned-figure budget with
71
+ pedestrians, so beyond it a two-wheeler draws riderless.
72
+
53
73
  ## Downloads and residency
54
74
 
55
75
  World Explorer builds an entity archive for distribution and a versioned directory manifest for
@@ -85,7 +105,9 @@ exceptions, owned until removal. Aircraft keep their existing budget.
85
105
  ## Coverage and authoring
86
106
 
87
107
  The initial expansion adds 24 shared models, predominantly 2024 plus the 2025 four-door Wuling
88
- Hongguang MINI EV. Profiles also reuse older and US-market models. Country-specific trim,
108
+ Hongguang MINI EV. Profiles also reuse older and US-market models. Generic two- and three-wheelers
109
+ (an underbone moped, an electric moped, the motor scooter and standard motorcycle, and an
110
+ auto-rickshaw) stand in for each region's many local makes. Country-specific trim,
89
111
  steering variants, fleet age distributions and local commercial coverage remain approximate.
90
112
  The atlas groups the Korean peninsula; that fleet profile primarily represents South Korea.
91
113
  Some shared models use export-market bodies or steering layouts. Road driving side comes from
@@ -58,6 +58,9 @@ returns linear RGB. An explicit host `style.ground` palette takes precedence in
58
58
  Nature-reserve, national-park and protected-area designations retain their protection metadata,
59
59
  but do not paint over the physical habitat beneath them. With no mapped physical cover, sparse
60
60
  open-ground planting remains a prior, rather than inferred forest or a wildlife-presence claim.
61
+ A named neighborhood outline is read the same way. The Protomaps basemap reports one as land use
62
+ `other`, in place of any land use mapped on the same outline, so it paints nothing and labels no
63
+ ground. Unlike a protection boundary it also leaves yard trees and inferred homes alone.
61
64
 
62
65
  ## Composable catalogs
63
66
 
@@ -191,7 +194,22 @@ bare winter branching keep the same mature dimensions, instance positions, indiv
191
194
  and placement seeds. The coarse calendar reverses the southern hemisphere and extends dormancy
192
195
  at high latitudes. Tropical locations stay leaf-on; evergreen plants do not become bare. This
193
196
  does not infer local weather, snow, tropical wet/dry seasons, crop harvest dates, or climate change.
194
- Remount with another month to change appearance.
197
+ Remount with another month to change appearance. Snow on the ground is the weather's `snowCover`,
198
+ set and changed without a remount and independent of the month; it dusts every plant above its
199
+ snow line, leafless or not ([Snow cover](snow.md)).
200
+
201
+ ### Alpine tree line
202
+
203
+ Mountain forest gives out with height. The Earth tile adapter gives scatter a tree line by
204
+ latitude, about 3,900 m in the tropics, 2,400 m at 45° N and 800 m at 65° N, and lower in the
205
+ southern hemisphere outside the tropics (1,300 m at 45° S). Trees and brush (the canopy and
206
+ understory layers) thin from full density to none over the 350 m below it, so closed forest opens
207
+ into scattered trees before it stops, and glaciers and summits stay bare. Ground cover and crops
208
+ are not limited, and individually mapped trees stay where the map puts them. It is a coarse
209
+ climatic prior, as the plant calendar is: no aspect, continentality or local species. The arctic
210
+ tree line at sea level comes from the ecological atlas's tundra, not from this. A scatter rule's
211
+ own `altitude` limits still apply; pass `treeline` to the worldgen kernel's scatter sampler to
212
+ use the mechanism elsewhere.
195
213
 
196
214
  The ordinary architectural catalog supplies 294 recipes across 14 construction families and seven
197
215
  uses: detached homes, attached homes, apartments, commercial, civic, industrial, and farm
@@ -167,6 +167,26 @@ Time-based node materials still receive Three's per-frame node updates.
167
167
 
168
168
  The world explorer also accepts `gpuOptimizations=0` for an uncached WebGPU comparison.
169
169
 
170
+ ## What differs between the backends
171
+
172
+ The same scene is not pixel-identical on the two. Sky and haze match to within a level or two of
173
+ 255, and from the air the ground and far water come out a few levels brighter on WebGPU. The
174
+ differences with a known cause:
175
+
176
+ | | WebGL | WebGPU |
177
+ | --- | --- | --- |
178
+ | Far sun shadows (`setFarShadowCasters`) | A second, wider shadow map | None: scenery past the focused map stays sunlit |
179
+ | Sun shadow filter | PCF | Soft PCF, except at the low shadow quality |
180
+ | Ambient occlusion | None | `setAmbientOcclusion`, off by default |
181
+ | Cloud deck haze | Mixed in after tone mapping | Mixed in before it, so distant clouds are brighter |
182
+ | Earth view scene | Compact: half the plant scatter, and at High under half the building vertices | Full |
183
+
184
+ In World Explorer the main-thread work of a frame is higher on WebGPU for the same scene, and the
185
+ GPU time equal or lower: on one Windows laptop with an NVIDIA GPU at Balanced, about 9 ms against
186
+ 13 to 15 ms a frame for a settled view from the air. About a quarter of the WebGPU frame is the
187
+ command-state check described under [WebGPU performance](#webgpu-performance), and
188
+ `gpuOptimizations=0` measures the same.
189
+
170
190
  ## Testing the world explorer
171
191
 
172
192
  Open [World Explorer](https://molen.dev/play/world-explorer/), then compare the same location
@@ -174,8 +194,9 @@ and settings using [`?backend=webgpu`](https://molen.dev/play/world-explorer/?ba
174
194
  [`?backend=webgl`](https://molen.dev/play/world-explorer/?backend=webgl). World Explorer defaults
175
195
  to WebGL, as the embedded Earth view does: WebGPU currently builds node state for every new
176
196
  instanced mesh, which can leave terrain preparation behind a fast aircraft despite low GPU draw
177
- times. Explicit `?backend=auto` still negotiates WebGPU with fallback; `?backend=webgpu` pins it
178
- and enables its screen-space ambient occlusion. The general client/viewer default remains `auto`.
197
+ times. Explicit `?backend=auto` still negotiates WebGPU with fallback; `?backend=webgpu` pins it.
198
+ Screen-space [ambient occlusion](sky.md#ambient-occlusion) exists only on WebGPU and stays off
199
+ unless `?ao=1` is added. The general client/viewer default remains `auto`.
179
200
  The performance HUD displays
180
201
  the backend that actually rendered and any automatic fallback reason; its
181
202
  `#performance-status` element also exposes `data-backend` and `data-fallback-reason` for tests.
@@ -95,9 +95,25 @@ map resolution without rebuilding the environment, and `renderer.setShadowFocus(
95
95
  radius })` aims them at a point in absolute world coordinates covering ±`radius` meters — for a
96
96
  large world, what the camera frames rather than the camera itself. The box moves in whole
97
97
  shadow-map texels so edges do not shimmer; `setShadowFocus(undefined)` restores the default.
98
+ A focused map sized for what is close ends close: over a city it stops a few hundred meters
99
+ out, and buildings gain their shadows as it reaches them. On WebGL a focus can name a second,
100
+ wider square, `far: { center, radius }`, drawn from the scenery a host passes to
101
+ `renderer.setFarShadowCasters(root)` (a terrain stream's object: ground, buildings, trees).
102
+ Surfaces past the focused map then read the far one, which fades out toward its own edge. Only
103
+ what is under `root` casts into it, because it is not drawn every frame: it is redrawn when its
104
+ center has moved an eighth of its radius, when the sun has moved, and once a second for scenery
105
+ that has arrived, so a moving caster would leave its shadow behind. It is at most 2048 texels
106
+ across (meters a texel: a house's shadow, not a chimney's) and costs under a millisecond of
107
+ main thread each time it is drawn. `renderer.farShadowInfo` reports its radius, how often it has
108
+ been drawn and how long the last drawing took.
109
+ `renderer.shadowTexelSize` reports the meters one texel covers as of the last frame (`undefined`
110
+ while sun shadows are off), for hosts that keep a subject the map cannot resolve out of the
111
+ shadow pass (see `AircraftVisual.updateShadows` in the aircraft guide).
98
112
  `sun.visible`/`moon.visible` control the disks independently of lighting. Use the corresponding
99
113
  light intensity to disable illumination. `sun.size` and `moon.size` are visual multipliers;
100
114
  the default 1 preserves real angular size. Larger values help stylized scenes and small displays.
115
+ A soft glare surrounds the Sun disk, so it reads as a bright source at that real size; `sun.visible`
116
+ and `sun.size` apply to it as well.
101
117
 
102
118
  ## Ambient occlusion
103
119
 
@@ -126,7 +142,15 @@ the same target and copies the image out unshaded, so nothing is built again. Tu
126
142
  with `setAmbientOcclusion` changes the target, and every object in view builds its shaders again,
127
143
  mid-frame. The World Explorer suspends it above 24 m over the ground and resumes below 18 m, where
128
144
  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.
145
+ a 44 ms rooftop frame on an Apple M2 at High).
146
+
147
+ > [!WARNING]
148
+ > With occlusion on, World Explorer's nearby buildings draw without their facade textures (blank
149
+ > walls, no windows) while their shaders are warmed through `prepareObject` and
150
+ > `prepareMaterialChange`; with occlusion off, or without the warm-up, they draw as they should.
151
+ > The cause is not found. The explorer keeps occlusion off unless `?ao=1` asks for it. Before
152
+ > turning it on in a host that warms shaders, look at materials that gain their textures after
153
+ > they are first drawn.
130
154
 
131
155
  ## Reflections
132
156
 
@@ -178,7 +202,9 @@ and render its `scene`/`camera` as a background pass before your scene. Dispose
178
202
  `palette` also accepts `ground`, `sun`, and `moon`. `dome.brightness` (default 1) scales only the
179
203
  drawn dome, not the sky light or reflections taken from the palette: under filmic tone mapping a
180
204
  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),
205
+ (`EARTH_SKY_DOME`). `moon.earthshine` controls the dark side's subtle visibility at night. By day
206
+ the Moon's light adds to the sky in front of it, so its unlit side matches the sky around it while
207
+ the disk still covers the Sun. Stars support `enabled`, `magnitudeLimit` (up to the catalog limit of 6.5),
182
208
  `intensity` and visual angular `size`. Stars disappear below the horizon and fade through
183
209
  twilight; a bright visible Moon reduces their contrast. Moon disks occlude stars behind them.
184
210