Snowline Pass: Alpine Mountains and Pine Forest to Walk, with a Mountain Builder
README.md
ConiferGen
Deterministic generator for the alpineProps conifers: Norway spruce, Scots pine, silver fir, European larch, Swiss stone pine and dwarf mountain pine at four ages (sapling, young, mature, veteran), plus a dead spruce snag, wind-bent krummholz, a treeline windbent pine and a fallen spruce. ConiferGen.generate(kind, age, variant) returns Geo geometries for three levels of detail; ConiferBake turns them into the package's baked .mesh assets. Tool-time code: nothing loads it at runtime.
How each tree is grown:
- Excurrent conifers (spruce, fir, larch, stone pine, young Scots pine): one leader with whorls of primary branches every annual shoot (plus interwhorl branches), lengths cut by a per-species crown profile (narrow cone, blunt stork's-nest top for old fir, rounded column for stone pine, egg for young pine). Spruce droops and turns its tips up and an old spruce hangs curtains of twigs; fir lies flat in tiers; larch hangs long twigs; old stone pine forks into several tops. Dead stubs on the bare bole below the crown.
- Pine form (mature/old Scots pine, windbent pine): a clear bole with orange upper bark into big upturned limbs, sub-branches and twigs whose ends carry clumped needle tufts under a flat or wind-flagged crown (windward limbs reduced to dead stubs).
- Multi-stem (mountain pine): sprawling stems curving up from one base into a dome.
- Krummholz: silver stems bent leeward (+X), branches only on the lee side, a low skirt, flat-topped by the wind.
- Dead / fallen: silver snag with a snapped top and drooping dead branches; a fallen trunk along +X with branch stubs, a snapped top and torn roots.
Parts per LOD: bark (tapered tubes, flare and lobes, world-scale bark UVs), leaf (alpha-cut needle spray cards: UV 0..1 per card, vertex alpha = wind weight 0 base to 1 tip, RGB = shade/tint), snow (opaque pillowed pads on the upper sides of branch layers and foliage clumps, or ridges along bare branches; far: sloping tier bands), toon (stacked jagged cone tiers or clumped blobs, LOD0) and tsnow (snow caps on the toon shapes), barkw (larch's bare-winter far bark). LOD1 is ~30% of LOD0; LOD2 is at most 600 triangles including snow, built from enlarged cards where the near cards are so the silhouette and colour hold at 300 m. Budgets (LOD0 bark + needles): sapling 1.4k, young 5k, mature 11.5k, veteran 19.5k.
Tune a species in G.config (cfgFor), then rebake with require("alpineProps.ConiferBake").bakeKind(kind) and .writeIndex().