# Pois
The route's points of interest: `keepClear(plan)` (where nothing may grow) and `build(plan, site, opts)` which stands the trailhead board, signposts with destinations and walking times, waymarks, cabin, bench, footbridge, lookout, cairns and summit cross as alpineProps props, marked for footsteps. Called by MountainBuilder.
# Backdrop
The far ranges around a mountain: an 8 km square of snowy peaks at 16 m a cell, cooked once per seed, size and season and saved beside the mountain's ground, standing with no collision so it costs one draw. Called by MountainBuilder.
# LakeSurface
The lake's water surface as a mesh of its own. `build(plan, height, { parent, material })` floods a 1 m grid from the lake's centre at `plan.lake.level`, using `height(x, z)` for the ground, and stands the water on a child entity with a `Model`. A point the lake covers sits at exactly the lake level; every other point sits at least `SINK` metres (0.6) under both the ground and the level, so the surface can never rise above the lake over a bank, a gully or the trail beside it. Answers `{ entity, mesh, cells, verts }`, or nil when the plan has no lake.
Called by MountainBuilder, which turns the terrain's built-in water sheet off. That sheet tucks dry points only a quarter of a cell under the ground, so far from the camera it could bridge across a cutting as a flat sheet of water standing in the air.
```luau
local LakeSurface = require("alpineKit.LakeSurface")
local lake = LakeSurface.build(plan, function(x, z) return terrain:heightAt(x, z) end, { parent = root, material = lakeMaterial })
```
# AlpineRules
The scatter rules: `place(site, mix, opts)` fills a mountain in layers by height above the valley floor, steepness, wetness and distance to the trail and lake: forest, understory and deadwood, treeline krummholz, rocks and scree, shrubs, flowers and grass (thick along the trail and shore, sparse elsewhere); optional cliff props. Pure: the same site, mix and options give the same list. `count(instances)` tallies kinds.
# AlpineProps
The alpineProps registry: every alpine kind (58 of them: conifers, dead trees, shrubs, grasses, flowers, rocks, cliffs, huts and trail props) is registered here, and through it also in forestProps' `Props`, so forestKit's `ForestRender` draws and collides alpine props the same way it does forest ones. The `AlpineProp`, `Cabin`, `Signpost` and `PropGallery` components and the catalogs call it, and game code calls it to list kinds or get draws.
```luau
local AP = require("alpineProps.AlpineProps")
for _, k in AP.kinds() do print(k, AP.info(k).category) end
local parts = AP.parts("spruce", { age = "veteran", season = "summer", snow = true, lod = 0 }) -- { { mesh, material, part } }
```
- `AP.kinds()` lists every kind in registration order; `AP.kindsOf(category)` those of one category (`tree`, `deadtree`, `log`, `bush`, `grass`, `flower`, `rock`, `cliff`, `structure`).
- `AP.info(kind)` returns the catalog entry: `category`, `variants`, `radius`, `height`, `collider`, `surface`, and for trees `ages` and `byAge`.
- `AP.parts(kind, opts)` returns the draws. Opts are `age`, `season`, `look`, `variant`, `lod` (0-2), `seed` and `snow`; `snow` defaults to `season == "winter"`, and `age = "old"` reads as `"veteran"`.
- `AP.normalize(kind, opts)` returns forestProps-normalised opts plus `snow`. `AP.register(entry, partsFn)` adds or replaces a kind, which is how the catalogs (`ConiferCatalog`, `FloraCatalog`, `RockCatalog`, `StructureCatalog`) plug in; they load on first use.
- `AP.AGES`, `AP.SEASONS` and `AP.LOOKS` hold the accepted values.
# MountainShape
Cooks a mountain's ground on the engine's terrain system: fbm, peak cones, ridges, crags on the heights, droplet and thermal erosion, then the lake, the stream channel, level pads, the graded trail bed and the painted surfaces, saved as a terrainData asset in the world. `plan(opts)` cooks the bare shape and lays out the route; `write(plan, folder)` cooks and saves the ground. Every cook's GPU memory is released when it ends. Called by MountainBuilder.
# ForestMixes
The forest mixes a mountain grows: spruceForest, pineLarch, mixedMontane, stonePineLarch, each with forest, treeline, shrub and understory weights. `get`, `names`, and `define(name, mix)` for your own.
# AlpineMaterials
The front of alpineMaterials. It resolves every Snowline Pass alpine surface by name to a material, for the looks `real`, `painted` and `toon` and the seasons `spring`, `summer`, `autumn` and `winter`, and never answers nil. Props, trees, cabins and terrain code call it:
- `AM.get(surface, { season?, look? })` returns a material AssetRef or a runtime handle, ready for a Model or an instanced draw.
- `AM.terrainLayer(name, look?)` returns `{ albedo, normal, mask, tint, tiling, color }`, a TerrainStream layer record for the six terrain surfaces, with textures named by asset identity and tiling in metres per repeat.
- `AM.leafless(surface, season)` tells you which surfaces have nothing to draw: larch in winter, flowers in autumn and winter.
- `AM.ATLAS[surface]` gives the cell grid of the flower and shrub atlases.
- `AM.surfaces()`, `AM.group`, `AM.source`, `AM.tileSize` and `AM.refresh` round out the API.
Seasons and stylised looks are built at runtime from the base recipes, once per machine. They are cached in module state, so a reload never releases a handle a Model still holds.
# MountainSite
Answers questions about a built mountain's ground: height, slope, downhill direction, distance to the trail, the lake and the stream, wetness, water, the painted surface and the footstep surface at any point. `Site.active()` is the mountain the footsteps and ambience ask.
# alpineKit
A whole walkable alpine mountain for your world, in one component. Pine and spruce forest at the bottom that thins into stunted trees and alpine meadow, then cliffs and scree, then snow above a snow line; a cold blue lake in a basin with an inflow stream; snowy ranges on the horizon; and a signposted hiking trail from a forest trailhead past a cabin, along the lake, over a footbridge, up to a lookout and across the scree by cairns to a summit cross. It comes with dawn, midday, dusk and night lighting, snowfall, a colour grade, valley haze, wind, forest, lake and night ambience that follow the time and where you stand, and footsteps that sound like needles, meadow, scree, rock, snow, gravel, wood or water. Size, snow line, density and seed are each one setting, and every player builds exactly the same mountain from the same seed.
## Drop a mountain into your world
Paste this into an empty world (the editor's run box, or inside `content()` of a scene's `build.luau`):
```luau
entity.spawn("Mountain").component.add("alpineKit.Mountain", {
size = 640, snowLine = 0, density = "normal", seed = 7,
mountainType = "lakeValley", forestMix = "spruceForest", season = "summer", look = "real",
})
entity.spawnSynced("WorldClock").component.add("WorldClock", { dayLengthMinutes = 30, startHour = 10.5, skyMode = "engine" })
entity.spawn("AlpineAtmosphere").component.add("alpineKit.AlpineAtmosphere", {})
entity.spawn("Sky").component.add("ProceduralSky", { exposure = 1.6, turbidity = 2.4, syncSunToLight = false })
```
The first build of a new setting shapes, erodes and paints the ground on the engine's terrain system (half a minute to a minute in the editor) and saves it into your world under `alpineMountains/`, with its plan (trail, lake, bands) beside it. After that every machine loads those saved files, so build it in the editor before you publish. A machine places the forest only once the saved ground answers its own heights (it waits for it, and tries again if it is not there within a minute), so a slow load never puts the trees on flat ground. Press play: a player who lands below the ground is set on top of it. To start players at the trailhead, see the guide **How to make mountains for my game**.
## What you set
| Setting | Values | What it does |
|---|---|---|
| `size` | 192-1536 (m) | the side of the square mountain |
| `snowLine` | metres above the valley floor, 0 = the type's own | where the snow starts |
| `density` | sparse, light, normal, dense, lush | how thick the forest, shrubs, rocks and flowers grow |
| `seed` | any whole number | each seed is a different mountain, the same seed always the same one |
| `mountainType` | lakeValley, craggyRidge, glacierPeak, roundedFell, forestedValley | the shape |
| `forestMix` | spruceForest, pineLarch, mixedMontane, stonePineLarch | which conifers grow |
| `season` | summer, autumn, winter, spring | autumn turns larches gold, winter snows everything |
| `look` | real, painted, toon | realistic or stylised surfaces and props |
| `lake`, `trail`, `backdrop` | true/false | the lake and stream, the route and its props, the far ranges |
| `cabinStyle` | logHut, stoneHut, aFrame | the cabin by the lake |
| `quality` | 0.3-1 | draw distance (nothing moves or stops colliding) |
## What is inside
- **Mountain** (component) and **MountainBuilder** (module): build, update and tear down a mountain; `MountainBuilder.build(opts)` from code.
- **MountainShape**, **MountainTypes**, **Layout**, **Surfaces**, **Backdrop**: the ground cook, the five mountain recipes, the trail planner and height bands, the painted surfaces (with ochre and rust strata across the faces), the far ranges that carry on from the mountain's own edge into forested foothills.
- The trail planner searches by grade and by heading: the path climbs at a hiking grade, turns at most 30 degrees per 4 m (a hairpin is a wide arc), pays for every hairpin so the legs run long and stand well apart, never doubles back at a stop, and lines up with the footbridge. `Layout.TURN_COST` and `Layout.MAX_TURN` tune it. Where the very top is a spire no hiking path can reach, the route ends on the highest walkable ground near it (a fore-summit) and the summit cross stands there; the bed is only held above the lake's water along the lake itself; and the lookout is a level landing beside the trail, so a sharp turn there is on flat ground.
- **AlpineRules**, **ForestMixes**, **MountainSite**: the scatter rules by height and steepness, the forest mixes, the questions you can ask the ground (height, slope, surface, footstep surface, distance to the trail and the lake).
- **Pois**: the trailhead board, signposts with walking times, waymarks, cabin, bench, footbridge, lookout, cairns and summit cross, each standing clear of the trail bed.
- **TrailWalker** (component): walks a player's body up the trail by itself and reports stalls, drops below the ground and strays from the path. Use it to check a new mountain end to end, alone or with several players at once. It drives only a body this machine owns: on the other players' machines the walker that rides along on your body stays silent, so each player's walk steers only their own character.
- **AlpineAtmosphere** (component), **Atmos**, **Ambience**, **Footsteps**: lighting and sky presets on worldClockKit's shared clock, the ambience presets on soundstage, and the mountain's footstep surfaces.
- Guides: **How to make mountains for my game** and **Snowy mountain level with a lake**. Tests: `tests/alpineKit.testSuite`.
It installs **alpineProps** (the conifers, shrubs, flowers, rocks and cabin), **alpineMaterials** (the alpine surfaces) and **forestKit** (which brings forestProps, the material collections, worldClockKit and soundstage).
## Time of day, weather and sound
```luau
local Atmos = require("alpineKit.Atmos")
Atmos.setTime("dawn") -- dawn | midday | dusk | night, for every player
Atmos.setWeather("snow") -- clear | cloudy | snow | blizzard
```
## Every player, the same mountain
The ground is one saved terrain file and one plan file; the props are placed from the plan by a pure function of the seed, so two players see the same trees in the same places and bump into the same trunks and boulders. `mountain.stats.fingerprint` is a short hash of every placement: equal fingerprints on two machines mean equal mountains. Time and weather are worldClockKit's shared clock; footsteps are soundstage's, heard from every walker. alpineKit adds two ground sounds of its own (pine needles and scree, recorded for the kit) and answers only for the mountain's own colliders: the ground, the lake, trunks, stones and the trail's props. Every other floor, even one standing on the mountain, is left to soundstage and to other kits (forestKit's forest ground, a floor named "Cabin Floor Planks"), so they sound exactly as they do without alpineKit and their own checks keep passing beside it.
## Known limits
- The first cook of a new setting needs a GPU that can run compute, and is meant to happen in the editor.
- Steep rock faces show stretched texture (#23596): the engine's terrain paints its layers from straight above and has no side projection, so a 60-degree face stretches its texture about twice over. The trail itself never crosses such ground.
- In a web browser the saved ground never draws, so the mountain does not build there (#23597). Build and play it in the desktop editor.
- The stream is carved into the ground; it has no flowing water surface yet. The lake is drawn by the kit (`LakeSurface`), not by the terrain's own water sheet, which could stand above the trail in cuttings by the shore.
- In snow and blizzard the kit draws its own sky: an overcast cloud deck that fades in with the snowfall and darkens toward night (`Atmos.OVERCAST` sets its colour and density). Falling flakes show in motion only, not in a still capture. Snowfall does not whiten a summer mountain: snow lies on the ground and the branches with `season = "winter"`.
- There are no clouds yet. The engine's cloud layer can be switched on with `Atmos.configure({ clouds = true })`, but it currently draws its own dark slate sky behind the clouds, so it is off by default. The fiery clouded dusk sky of the reference is the gap that leaves.
- On a peak whose top is a spire, the summit cross stands on the highest walkable ground below it (on the showcase, 120 m under the 380 m top), not on the very tip.
- The default walking character sometimes draws a second, cone-shaped body at the player (#23010).
- Frame time is set by how many pixels the graphics card fills (alpha-cut needle cards, the painted ground, shadows), not by scripts, which take about 2 ms a frame. Measured in the editor's play mode with two players walking, on an integrated Intel GPU running a development build of the engine: about 70 ms a frame in a 1280 x 720 window and about 360 ms in a 3200 x 1756 one.
- Installing pulls in forestKit with its kits (about 19,500 files in all), which takes about a minute (#21420).
## 1.0.15 (first sent as 1.0.14, changed on review in PR #3)
- `keepClear` on the Mountain component: extra circles `{ x, z, r }` in world metres that the forest, shrubs and rocks keep empty, beside the trail's own points of interest. A course, a camp or buildings a scene stands on the mountain get no tree growing through them (and no trunk collider inside them). Changing it rebuilds the props like any other setting (the saved ground is not re-made). A tree only keeps its trunk out of a circle, and its crown can reach about half its width inside: make `r` the space you need plus a crown (5 to 6 m for the big spruces). Entries that are not tables with finite numbers and `r` above 0 are left out. Example: `keepClear = { { x = -32, z = -94, r = 7 } }`.
# alpineProps
High-mountain props for walkable alpine worlds: 58 kinds, from 30 cm gentians to 34 m veteran spruces, a dry-stone hut and a footbridge. Each one is placed with a single component and comes in three looks (real, painted, toon), all four seasons, and with or without snow. They have three baked levels of detail, colliders where a player needs them, and footstep surfaces. Every kind also registers with forestProps' `Props`, so forestKit's `Forest` / `ForestRender` can scatter and draw them instanced. Materials come from alpineMaterials. Works installed in any world (it finds its own files, wherever it sits).
## Quick start
```luau
-- an old Norway spruce with snow on its branches
entity.spawn("tree").component.add("alpineProps.AlpineProp", { kind = "spruce", age = "veteran", snow = "on" })
-- a winter A-frame hut (door faces the entity's +Z), and a lettered trail sign
entity.spawn("hut").component.add("alpineProps.CabinHut", { style = "aFrame", season = "winter" })
entity.spawn("sign").component.add("alpineProps.Signpost", { arm1 = "Bergsee 20 min", dir1 = 0, arm2 = "Gipfelkreuz 2 h", dir2 = 150 })
-- every kind side by side, in labelled rows
entity.spawn("gallery").component.add("alpineProps.PropGallery", {})
```
From code: `require("alpineProps.AlpineProps")` lists kinds (`kinds()`, `kindsOf("rock")`), describes one (`info(kind)`) and returns its draws (`parts(kind, { age, season, look, variant, lod, snow })` → `{ { mesh, material } }`). `require("alpineProps.Cabin").build(style, opts)` and `require("alpineProps.Signs").make(parent, opts)` place huts and signs.
## Components
| Component | What it places | Key fields |
|---|---|---|
| `AlpineProp` | any one kind | `kind`, `age` (sapling, young, mature, veteran; "old" = veteran), `season`, `look`, `variant`, `seed` (non-zero picks variant and yaw), `detail` (auto, near, mid, far), `collide`, `snow` (auto, on, off) |
| `Cabin` | a whole hut: `logHut`, `stoneHut`, `aFrame` | `style`, `season`, `look`, `snow`, `seed` |
| `Signpost` | a post with up to four lettered arms | `arm1..4` text, `dir1..4` degrees, `season`, `look`, `snow` |
| `PropGallery` | every kind in labelled rows | `sections`, `look`, `summerSeason`, `detail`, `labels`, `gap` |
All of them build temporary children from synced fields, so every player sees the same prop and a reload rebuilds it.
## Kinds
Triangle counts are read from the `Baked*` tables: real look, snow excluded, the range over variants.
### Conifers (category `tree`, four ages)
| Kind | Variants per age | LOD0 sapling | LOD0 young | LOD0 mature | LOD0 veteran | LOD1 mature | LOD2 mature |
|---|---|---|---|---|---|---|---|
| `spruce` | 3 | 1398-1400 | 4996-5000 | 11499 | 19496-19499 | 3447-3449 | 490 |
| `scotsPine` | 3 | 1396-1398 | 5000 | 11496-11500 | 19496-19498 | 2773-2835 | 490 |
| `fir` | 3 | 1396-1400 | 4996-4998 | 11496 | 19500 | 3447-3448 | 490 |
| `larch` | 3 | 1396-1398 | 4996-4998 | 11497-11500 | 19499-19500 | 3446 | 490 |
| `stonePine` | 3 | 1400 | 4998 | 11496 | 19496-19500 | 3444-3446 | 490 |
| `mugoPine` | 3 | 1122-1196 | 2910-3056 | 6616-7262 | 10652-10998 | 1806-1860 | 490 |
Norway spruce, Scots pine, silver fir, European larch (gold in autumn, bare in winter), Swiss stone pine and mugo (dwarf mountain) pine. Sizes run from about 1.4 m saplings to 34 m veterans (mugo: 0.6-3 m).
### Dead and odd trees, shrubs, grasses, flowers
| Kind | Category | Variants | LOD0 | LOD1 | LOD2 |
|---|---|---|---|---|---|
| `deadSpruce` | deadtree | 3 | 3190-3198 | 1020 | 488 |
| `krummholz` | deadtree | 2 | 7304-7996 | 2100-2377 | 489-490 |
| `windbentPine` | deadtree | 2 | 7068-8040 | 1944-2013 | 490 |
| `fallenSpruce` | log | 2 | 1421-1468 | 450-462 | 322-367 |
| `arnica` | flower | 3 | 60 | 12 | - |
| `alpenrose` | bush | 3 | 1444-1636 | 438-510 | 24 |
| `edelweiss` | flower | 3 | 48-84 | 8-16 | - |
| `juniper` | bush | 3 | 1144-1336 | 312-368 | 16 |
| `alpineAster` | flower | 3 | 72-84 | 12-16 | - |
| `greenAlder` | bush | 3 | 2388-2708 | 594-686 | 104-122 |
| `gentian` | flower | 3 | 96-120 | 16-20 | - |
| `dwarfWillow` | bush | 3 | 784-1084 | 282-398 | 14 |
| `saxifrage` | flower | 3 | 102-114 | 20 | - |
| `campanula` | flower | 3 | 60-96 | 12-16 | - |
| `globeflower` | flower | 3 | 54-72 | 12 | - |
| `cottonGrass` | grass | 3 | 156-204 | 36-48 | - |
| `alpineTussock` | grass | 4 | 84-90 | 24-28 | - |
Flowers and grasses have no LOD2 (-): they drop out at distance.
### Rocks and cliffs
| Kind | Category | Variants | LOD0 | LOD1 | LOD2 |
|---|---|---|---|---|---|
| `cliffSpire` | cliff | 3 | 3864-4512 | 988-1112 | 168-196 |
| `cliffFace` | cliff | 3 | 4176-4584 | 980-1112 | 280-292 |
| `graniteBoulder` | rock | 4 | 1440-1944 | 360-456 | 44-96 |
| `rockOutcrop` | rock | 3 | 1368-2280 | 488-556 | 144-148 |
| `screeStone` | rock | 3 | 240-288 | 36-44 | 28-32 |
| `screePatch` | rock | 3 | 2564-2652 | 608-636 | 236-272 |
| `flatSlab` | rock | 3 | 336-1152 | 240-336 | 32-36 |
| `cairn` | rock | 3 | 1852-1984 | 572-872 | 272-292 |
### Trail props
| Kind | Category | Variants | LOD0 | LOD1 | LOD2 |
|---|---|---|---|---|---|
| `bench` | structure | 1 | 168 | 126 | 120 |
| `woodpile` | structure | 1 | 3224 | 2320 | 72 |
| `waterTrough` | structure | 1 | 234 | 137 | 122 |
| `signpost` | structure | 4 | 324-5836 | 86-198 | 16-128 |
| `signArm` | structure | 1 | 64 | 28 | 28 |
| `waymarkPost` | structure | 1 | 260 | 90 | 40 |
| `footbridge` | structure | 1 | 11780 | 3122 | 776 |
| `summitCross` | structure | 1 | 3924 | 1812 | 58 |
| `lookout` | structure | 1 | 1732 | 866 | 722 |
| `trailSteps` | structure | 1 | 840 | 144 | 144 |
| `fenceRail` | structure | 2 | 175-210 | 49-74 | 52-72 |
| `infoBoard` | structure | 1 | 5085 | 391 | 146 |
The footbridge deck, lookout stairs and platform and trail-step treads carry walkable box colliders.
### Hut parts (what `Cabin` assembles; usable alone)
| Kind | Category | Variants | LOD0 | LOD1 | LOD2 |
|---|---|---|---|---|---|
| `logWallSection` | structure | 2 | 756-812 | 132-144 | 12 |
| `logCorner` | structure | 2 | 1306 | 378 | 24 |
| `stoneWallSection` | structure | 3 | 892-1640 | 212-402 | 24 |
| `timberWallSection` | structure | 1 | 144 | 96 | 24 |
| `wallWindow` | structure | 4 | 628-1808 | 364-522 | 124-172 |
| `wallDoor` | structure | 4 | 502-1078 | 228-500 | 128-164 |
| `gableLog` | structure | 1 | 1348 | 248 | 8 |
| `gableStone` | structure | 1 | 2298 | 460 | 16 |
| `gableTimber` | structure | 2 | 492-616 | 492-616 | 10 |
| `roofShingle` | structure | 1 | 7078 | 338 | 60 |
| `roofSlate` | structure | 1 | 3298 | 310 | 60 |
| `aFrameRoof` | structure | 1 | 9970 | 394 | 60 |
| `chimneyStone` | structure | 2 | 218-5700 | 140-1284 | 88-96 |
| `porchDeck` | structure | 5 | 224-488 | 190-262 | 190-262 |
| `stoneFoundation` | structure | 1 | 1068 | 222 | 24 |
Wall parts sit on a 0.5 m grid (`StructureGen.DIM`), run along local X with the outside at +Z.
## Looks, seasons and snow
- **Looks**: `real` (photoreal PBR), `painted` (hand-painted stylised), `toon` (cartoon; conifers swap to dedicated toon needle meshes up close).
- **Seasons**: `spring`, `summer`, `autumn`, `winter`. Larch turns gold in autumn and is bare in winter; grasses go to straw; materials follow alpineMaterials' seasonal variants.
- **Snow**: `snow = "auto"` draws snow loads on branches, roofs, rails and rocks in winter only. Use `"on"` or `"off"` to force it in any season.
## Gallery
`PropGallery.component` lays out every kind: each conifer species at all four ages without and with snow, then dead and odd trees, shrubs, grasses and flowers (as small patches), rocks and cairn, cliffs, the three hut styles, trail props and hut parts. A last row catches any kind added later. `PropGallery.scene` frames it with a meadow ground, a sun and ambient light, a procedural sky and a camera. Check shots: `design/checks/props/gallery_overview.jpg` and `gallery_conifers.jpg` in the Snowline Pass world.
## Known limits
- Flowers are true to scale (10-40 cm), so they read only up close or in drifts; scatter them in numbers.
- Destroying an entity whose AlpineProp parts carry `MeshLod` logs one harmless "component this proxy names was removed" error per part from the engine's MeshLod `onDestroy` (reported upstream). Changing fields to rebuild does not.
- A structure part with no bake falls back to building its mesh at runtime once per session.
- `AlpineProp` places one prop per entity. For forests and boulder fields use forestKit's `Forest`/`ForestRender` (instanced) with these kinds.
- Bakers (`ConiferBake`, `FloraBake`, `StructureBake`) are authoring tools. Re-baking writes hundreds of meshes, so run one kind at a time.
## Tests
`tests/conifers`, `tests/flora` and `tests/structures` (`tools.use("tests", "run", { suite = "conifers" })`) cover registration, every kind × age × season × look × variant × LOD resolving to baked meshes, snow switching, triangle budgets, colliders a player walks on, and the components.
# alpineMaterials
The surfaces of a walkable alpine mountain, at real scale: forest floor, scree, meadow, granite, wind-rippled snow, trail and wet lake shingle for the ground; granite with snow lying on its tops for boulders and outcrops; conifer needle cards, grass, flower and shrub atlases for the plants; conifer barks; log-cabin walls, shingles, slate, a snow-covered roof and wrought iron for the huts; and a still glacial lake. Every surface answers in three looks (`real`, `painted`, `toon`) and four seasons from one call, and never answers nil.
The package **ships 27 materials no installed collection has** and **borrows 8 more by their collection names** (fresh snow, forest floor and cliff rock under those names, plus snow on branches, Scots pine bark, deadwood, rough timber and dry-stone wall) from Terra Firma (`groundMaterials`), Heartwood (`woodsMaterials`) and Bedrock (`stoneMaterials`), so nothing is duplicated. It draws with forestMaterials' foliage, solid and stylised shaders, Terra Firma's `groundSurface`, animatedMaterials' `animWater`, and one shader of its own, `alpineSnowCap` (snow by world normal).
```luau
local AM = require("alpineMaterials.AlpineMaterials")
-- a material for a Model or an instanced draw
part.material = AM.get("scree") -- summer, real
part.material = AM.get("needlesLarch", { season = "autumn" }) -- golden larch
part.material = AM.get("logWall", { look = "toon" }) -- stylised cabin wall
part.material = AM.get("snowDustedRock") -- boulder with snow on its top
part.material = AM.get("snowRoof", { season = "winter" }) -- the cabin roof in winter
part.material = AM.get("freshSnow") -- Terra Firma's fresh snow, by its own name
if AM.leafless("needlesLarch", season) then --[[ draw no needles ]] end
-- TerrainStream layers: { albedo, normal, mask, tint, tiling, color }
local layers = {}
for _, name in AM.TERRAIN do layers[name] = AM.terrainLayer(name) end -- or AM.terrainLayer(name, "toon")
layers.shore = AM.terrainLayer("lakeShingle")
-- atlas cells: card UVs (0..1) map to u' = (col + u) / cols, v' = (row + v) / rows, row 0 = top
local gentian = AM.ATLAS.alpineFlowers.cells.gentian -- { 0, 0 } in a 3 x 3 sheet
```
## Surfaces
`AM.surfaces()` lists all 35 names below and every one resolves to the material it names, in every look and season (the tests check both this table and `AM.surfaces()`). `AM.group(surface)` answers terrain, rock, needles, snow, bark, flora, building or water; `AM.tileSize(surface)` gives the metres per repeat of a shipped tile; `AM.source(surface, opts)` says where an answer came from (`own:`, `runtime:`, `installed:`).
| Surface | What it is | Shipped or borrowed |
|---|---|---|
| `needleLitter` | conifer forest floor: rust needles (a few cm), cones, twigs, moss and lichen on dark humus | **shipped** terrain tile, 1 m repeat |
| `scree` | loose angular grey granite and rust-ochre gneiss, stones 5-30 cm in grey and ochre grit | **shipped** terrain tile, 2.4 m |
| `alpineMeadow` | short dense alpine turf with gentians, buttercups and white star flowers | **shipped** terrain tile, 1.8 m |
| `lichenGranite` | grey speckled granite bedrock with green, yellow and orange map lichen | **shipped** terrain tile, 2.5 m |
| `windSnow` | wind-rippled snow, faint blue in the troughs; the ripples keep their heading | **shipped** terrain tile, 3 m |
| `alpineTrail` | worn path of packed grey-brown grit and small stones | **shipped** terrain tile, 2.4 m |
| `lakeShingle` | wet lake shore: water-rounded grey and grey-brown pebbles 2-12 cm in damp grit, darker and glossier than scree (roughness ~0.25 on the pebble tops) | **shipped** terrain tile, 1.5 m |
| `snowDustedRock` | lichen granite with fine powder snow on its up-facing parts: full on flat tops, none on steep faces | **shipped** rock material on `alpineSnowCap`, rock 2.5 m, snow 1.5 m |
| `needlesSpruce` `needlesFir` `needlesPine` `needlesStonePine` `needlesMugo` | conifer spray cards, alpha cut, sway by vertex alpha | **shipped** foliage cards, 1024 px |
| `needlesLarch` | soft larch tufts: fresh green spring, green summer, gold autumn, bare winter | **shipped** card + 3 seasonal albedos |
| `alpineGrass` | grass and sedge tussock: spring, summer, straw autumn, bleached winter | **shipped** card + 3 seasons, 512 px |
| `alpineFlowers` | 3×3 atlas: gentian, edelweiss, arnica / alpenrose, saxifrage, cottonGrass / campanula, globeflower, alpineAster | **shipped** atlas, 1536 px |
| `alpineShrubs` | 2×2 atlas: alpenrose, juniper / dwarfWillow, greenAlder (bottom row yellows in autumn) | **shipped** atlas + autumn and winter |
| `barkSpruce` `barkFir` `barkLarch` `barkStonePine` | conifer barks | **shipped** solid tiles, 0.5-0.7 m |
| `logWall` | weathered horizontal round logs with chinking, 5 logs per repeat | **shipped** solid tile, 1.6 m |
| `woodShingles` | split larch shakes in overlapping rows | **shipped** solid tile, 1 m |
| `slateRoof` | overlapping hand-split dark slates | **shipped** solid tile, 1.2 m |
| `snowRoof` | snow lying on every row of larch shingles, the dark lower edge of each row still showing | **shipped** solid tile, 1 m (rows along U) |
| `ironWrought` | dark forged iron; rust spots are non-metal | **shipped** solid tile, 0.3 m (512 px) |
| `mountainLake` | still glacial lake: pale turquoise shallows deepening to dark teal, the rock-flour turquoise of a glacial lake in the deep water, slow ripples, fresnel sky | **shipped** material on `animWater` (no textures) |
| `freshSnow` | fresh snow ground (toon: `toonSnow`) | borrowed: Terra Firma `groundMaterials.materials.freshSnow` |
| `forestFloor` | broadleaf/mixed forest floor (toon: `toonDirt`) | borrowed: Terra Firma `groundMaterials.materials.forestFloor` |
| `cliffRock` | cliff rock faces (toon: `toonRock`) | borrowed: Bedrock `stoneMaterials.materials.cliffRock` |
| `snowLoad` | opaque snow on branches and roofs | borrowed: Terra Firma `freshSnow` (toon: `toonSnow`) |
| `barkPine` | Scots pine bark | borrowed: Heartwood `woodsMaterials.materials.pineBark` |
| `deadwoodSilver` | sun-bleached silver deadwood | borrowed: Heartwood `woodsMaterials.materials.driftwood` |
| `roughTimber` | rough weathered timber | borrowed: Heartwood `woodsMaterials.materials.weatheredPlanks` |
| `stoneWall` | dry-stone wall | borrowed: Bedrock `stoneMaterials.materials.dryStoneWall` |
Borrowed surfaces answer the collection's own material in the real look, the collection's toon material in the toon look, and a `forestStylised` build from the collection's albedo and normal in the painted look.
**Every collection material by name.** Beyond the surfaces above, `AM.get` answers any material of Terra Firma, Bedrock and Heartwood by its own name, the same three ways: `AM.get("packedSnow")`, `"ice"`, `"gravel"`, `"moss"`, `"granite"`, `"riverPebbles"`, `"cliffRockTriplanar"`, `"pineBark"`, `"pineBoard"`, `"basalt"` and the rest. Plain words work too: `slate` (cleft slate), `pineBoards`, `pebbles`, `triplanarCliffRock`, `needles` (needleLitter), `stillWater` or `water` (mountainLake), `snow`, `rock`, `meadow`, `trail`, `shingle` (`AM.ALIASES` lists them). `AM.source(name)` says where an answer came from; only a name nothing knows answers the granite fallback.
## Terrain layers
The seven terrain tiles (`AM.TERRAIN`: needleLitter, scree, alpineMeadow, lichenGranite, windSnow, alpineTrail, lakeShingle) use Terra Firma's `groundSurface`, which places texture by object-space metres, so mesh UVs don't matter and one repeat covers the tile size above, hex-tiled so no repeat shows. Paint them straight onto rocks and ground meshes with `AM.get`.
For a TerrainStream (or forestKit's Ground), `AM.terrainLayer(name, look?)` returns `{ albedo, normal, mask, tint, tiling, color }`: texture identities, the colour multiplier the material uses, metres per repeat, and a flat mean colour for renderers that draw a layer without maps. It answers for the seven tiles and for the borrowed Terra Firma ground `freshSnow` and `forestFloor`. The mask follows the engine's terrain layout (R metallic, G occlusion, B height, A smoothness); lakeShingle's high smoothness is what makes it read wet. The `toon` look gives the collections' flat toon ground, albedo only.
`snowDustedRock` and `cliffRock` are rock materials, not terrain layers: a terrain already chooses rock and snow by slope itself (paint `lichenGranite` on steep ground and `windSnow` or `freshSnow` on flat ground). Put `snowDustedRock` on boulder and outcrop meshes.
Each tile was checked on a 6 × 6 m plane and a boulder at 1.7 m eye height and from 10 m against `design/references/alpine/ground.png`. The tint and tiling in `AlpineMaterials.RECIPES` hold its mean albedo to real ground (forest floor ~0.1, meadow ~0.1, wet shingle ~0.085, scree and trail ~0.2, granite ~0.22, fresh snow ~0.8).
## Snow by slope: `alpineSnowCap`
`snowDustedRock` draws with the package's own shader `alpineSnowCap` (no installed collection or engine shader blends by world normal; the engine's `pbr_layered` blends by a mask texture only). Both layers are projected from three sides in the object's own space in metres, so a boulder needs no UVs, and the snow follows the **world** normal, so it stays on top whichever way the boulder is turned: full cover on flat tops, thinning over the shoulders, none on faces steeper than about 60°. The rock's height map fills hollows first and a slow noise breaks the snow line. `snow_amount` (0 bare … 1 snow far down the slopes, default 0.6), `snow_soft`, `height_bias`, `breakup` and `breakup_scale` are material properties; the painted and toon looks flatten and posterise the same maps (`flatten`, `posterise`) and harden the snow line.
## Channel views
Colour, albedo, roughness and normal of every shipped material, on a sphere (cards on an upright plane), one sheet per group:
- [terrain tiles](docs/terrain_channels.jpg): needleLitter, scree, alpineMeadow, lichenGranite, windSnow, alpineTrail
- [foliage cards and atlases](docs/cards_channels.jpg): the six needle cards, alpineGrass, alpineFlowers, alpineShrubs
- [solids and water](docs/solids_channels.jpg): the four barks, logWall, woodShingles, slateRoof, ironWrought, mountainLake (animWater lights itself, so its albedo and roughness views read empty)
- [new surfaces](docs/new_channels.jpg): snowDustedRock, lakeShingle, snowRoof
## Texture memory
**70.1 MB** of GPU texture memory (UASTC, mips included; `AlpineBuild.textureMemory()` measures it). That is the terrain tiles at 1024 px albedo and normal plus a 512 px mask, solids at 1024 px plus a 512 px ORM (iron at 512 px), needle cards at 1024 px with 512 px normals, alpine grass at 512 px, flowers at 1536 px and shrubs at 1024 px. lakeShingle, snowRoof and snowDustedRock's snow layer add 3 MB each; snowDustedRock reuses lichenGranite's maps for its rock. The collection records each material's share as `textureKB`.
## Looks and seasons
- **Real, summer** is the material asset in `materials/` for every shipped surface.
- **Seasons** recolour cards: larch, alpine grass and shrubs have their own seasonal albedos on `forestFoliage`, with translucency tinted by season. Ground, rock, bark and building surfaces don't change by season: for winter, use `snowDustedRock` for boulders, `snowRoof` for roofs, and `windSnow` or `freshSnow` for ground.
- **Painted and toon** tiles and cards are built on forestMaterials' `forestStylised` from the same textures. Toon terrain uses Terra Firma's and Bedrock's toon ground, painted meadow uses `handPaintedGrass`, snowDustedRock uses `alpineSnowCap` flattened and posterised, and the lake uses `animWater`'s toon bands in glacial colours.
- **Leafless:** `needlesLarch` is bare in winter and `alpineFlowers` in autumn and winter (`AM.leafless`). Nothing else is ever bare.
Runtime looks are built once per machine and cached in module state, so a module reload never releases a handle a Model still holds.
## Known limits
- The terrain normal, height and AO maps are derived from albedo luminance, not scanned: stones and needles have depth, but no true parallax or silhouette. Put rock and plant meshes on top for relief.
- `lichenGranite` (and so the rock of `snowDustedRock`) is a fine-grained surface without large joints or fractures. Cliff faces and slabs read best when the mesh carries the big forms.
- `snowDustedRock` reads cover from the mesh's normals: a very low-poly boulder gets a faceted snow line. The snow adds no thickness to the silhouette.
- `snowRoof` is a texture of snow on shingles; it does not drift off the roof edge or hang over it. Model a snow lip on the mesh if the eaves need one.
- Cards are single sprays on a full frame. Build branches from several cards; one card isn't a tree.
- The lake is a surface shader, not a volume: depth colour comes from the material's `depth` and `absorb_distance` and doesn't see the real lake bed.
## Making and changing it
The source pictures were generated with image_gen (prompts in `AlpineRecipes.PROMPTS`) and baked by `AlpineBaker`. Tiles are made seamless (minimum-error cuts) and de-lit, height is read from luminance, and normal plus AO or mask are derived. Cards were generated on a magenta or cyan screen and keyed into alpha. To regenerate, put the source pictures in `<world source>/local/alpineSources/` and run `require("alpineMaterials.AlpineRecipes").bakeAll()` inside a task (`snowDustedRock_snow` is the snow layer of snowDustedRock). To change tiling, tint or roughness, edit `AlpineMaterials.RECIPES` and run `require("alpineMaterials.AlpineBuild").all()`, which rewrites the materials, the collection and the resolve table. Tests are in `tests/alpineMaterials.testSuite`.
Dependencies: forestMaterials (shaders), groundMaterials, woodsMaterials, stoneMaterials, animatedMaterials and materialLibraryKit (the `materialCollection` type), all addressed by package name. Every asset is resolved through the generated literal table `AlpineMaterialsTable`, and no code names an absolute path, so the package works wherever it is installed, including under another world's `deps/`.