Camera used for LOD; can be swapped any time.
ReadonlyframeThe frame the city is laid out in.
ReadonlylocalChild of object in frame-local coordinates: add props here at positions from City.data.
ReadonlyobjectRoot object: positioned at the centre on the world surface, y along the local up.
Resolved settings. Change them with City.set / City.reset.
The generated plan (roads, lots, buildings), or null while generating.
ReadonlystatsLive counters.
ReadonlyuniformsShader uniforms (night, window grids, weather, road look).
Arterial centre line colour.
Bridge concrete colour.
Window frame colour.
Window glass colour.
Kerb colour.
Lit window brightness.
Lane marking colour.
1 = paint markings, 0 = none.
0 = day, 1 = night: lit windows glow.
Pattern size multiplier (bricks, planks, tiles).
Road base colour per surface (asphalt, cobblestone, gravel, dirt).
Road weather: wetness, snow, burn, damage.
Roof weather: wetness, snow, burn, damage.
Sidewalk colour.
Wall weather: wetness, snow, burn, damage.
Road wear 0..1.
Per building style: bay width, window width, window height, sill.
Per building style: frame width, lit share, floor height, unused.
Lit window colour.
ReadonlyworldThe world.
Buildings (empty while generating).
The road graph (for navigation), or null while generating.
Plain-data snapshot for props, vehicles and crowds (frame-local coordinates), or null while generating.
Removes the city, its terrain modifiers and its GPU resources.
Throws away the current settlement and generates it again (e.g. after editing the world by hand).
Replaces all settings (anything not given goes back to its default).
Changes settings, merging into the current input. Looks are instant; layout changes regenerate.
Overrides weather for one building (0..1 each; the larger of this and options.weather.walls/roofs applies).
Advances progressive generation (within budget ms) and updates level of detail. Called
automatically when a scene was given (and by <City>); otherwise call it once per frame.
StaticcreateCreates a city and (unless progressive) generates it completely.
A procedural settlement on a threejs-biomes
World: roads grown along a tensor field, blocks, lots and buildings in a fewBatchedMeshdraw calls with procedural facades, terrain flattened under roads and buildings. Everything derives from the options and the world.Example