Northlight Tundra
README.md
arcticMaterials
Every surface a high-Arctic tundra and ice world needs, in five looks, behind one call: snow, wind crust and sastrugi, glacier ice, layered shelf ice, clear black lake ice you see down through, cracked white lake ice, sea ice and open sea water, frost-shattered rock, tundra moss and scrub, boot-trodden path snow, shore slush and frozen gravel for the ground; lichen rock, snow-capped rock, serac ice, driftwood, bone, a red research hut (panels, roof, lit window), a rusty fuel drum, mast steel, sled wood, canvas and rope for objects; dwarf willow, cottongrass, arctic flowers, moss cushions and sedge for plants. Every look of every surface is a material this package ships, and every one multiplies vertex colour into its albedo, so props can bake tint, rust and strata per vertex.
local AM = require("arcticMaterials.ArcticMaterials")
local lake = entity.spawn("black ice")
lake.component.add("Model", { model = "cube", material = AM.get("blackIce") })
lake.localScale = { 12, 0.2, 12 }
local boulder = entity.spawn("lichen boulder")
boulder.component.add("Model", { model = "sphere", material = AM.get("lichenRock") })
boulder.localPosition = { 2, 1.2, 0 }
boulder.localScale = { 2.4, 1.8, 2.2 }
local serac = entity.spawn("serac")
serac.component.add("Model", { model = "cube", material = AM.get("iceSerac", { look = "cartoon" }) })
serac.localPosition = { -3, 1.5, -2 }
serac.localScale = { 1.5, 3, 1.5 }
To drop a whole tundra (terrain painted with these surfaces, props, sky and weather), install arcticKit and use its one-liner:
entity.spawn("Tundra").component.add("arcticKit.Tundra", { size = 512, seed = 7 })
API
local AM = require("arcticMaterials.ArcticMaterials")
AM.LOOKS -- { "realistic", "painted", "cartoon", "lowpoly", "pixel" }
AM.surfaces() -- every surface name
AM.get(surface, { look? }) -- a material, never nil; no look = the world look
AM.terrainLayer(surface, look?) -- { albedo, normal, mask, tint, tiling, color } for TerrainStream `layers`
AM.TERRAIN -- the ground surfaces a terrain paints
AM.footstep(surface) -- "freshSnow" | "crust" | "ice" | "rock" | "scrub" (troddenSnow crust, slush freshSnow, frozenGravel rock)
AM.ATLAS.arcticFlowers -- { cols = 2, rows = 2, cells = { purpleSaxifrage = {0,0}, arcticPoppy = {1,0}, mossCampion = {0,1}, mountainAvens = {1,1} } }
AM.color(surface), AM.group(surface), AM.tileSize(surface), AM.usesUV(surface), AM.source(surface, opts)
local Look = require("arcticMaterials.ArcticLook")
Look.get() -- the world look, "realistic" until someone sets another
Look.set("pixel") -- every player sees it, late joiners too
local stop = Look.onChanged(function(look) end); stop()
The world look lives on one synced entity (arcticMaterials look, an ArcticLookState component), created on demand by the first set. A player who does not own it asks the owner over a message channel, so a set on any peer reaches all of them.
Atlas cells: a mesh's 0..1 UVs map into a cell as u' = (col + u) / cols, v' = (row + v) / rows, row 0 at the top. Each cell is opaque petal colour filling the whole cell (the plants are small opaque parts, not alpha cards).
Placement: ground, rock, ice and object surfaces place their maps by world position in metres (triplanar; image-up is world +Y on the sides, so firn strata stay level on any cliff), so prop UVs do not matter. willowLeaves, cottongrass, arcticFlowers and sedge read the mesh's UVs (AM.usesUV), and sway in the wind by vertex alpha.
Surfaces
Shipped = baked here from a generated picture. Borrowed = the maps come from an installed collection, drawn through this package's shader (so the vertex colour contract holds in every look).
Ground (16): what the tundra is made of, and what TerrainStream can draw
| Surface | Group | Maps | What it is |
|---|---|---|---|
freshPowder | ground | borrowed: Terra Firma freshSnow | soft new powder snow |
windCrust | ground | shipped | hard wind slab with scallops |
sastrugi | ground | shipped | wind-carved snow ridges, blue grooves |
blueIce | ground | shipped | cyan glacier ice with bubble streaks |
firnLayers | ground | shipped | ice shelf face, level white and cyan strata |
blackIce | ground | shipped (+ lakeBed seen below) | clear black lake ice, stones and bubbles below |
whiteIce | ground | shipped | white lake ice with branching cracks |
seaIce | ground | shipped | snow-covered pack ice |
seaWater | ground | shipped (procedural) | dark cold sea water, slow drifting ripples |
frostRock | ground | shipped | felsenmeer: angular frost-split slabs and grit |
tundraMoss | ground | shipped | olive and rust moss, reindeer lichen |
tundraScrub | ground | shipped | dwarf willow, sedge, crowberry, gravel |
lakeBed | ground | shipped | dark stones in silt |
troddenSnow | ground | shipped | packed grey-blue path snow, overlapping boot prints, sled runner marks |
slush | ground | shipped | wet half-melted grey-blue snow, glossy, meltwater standing in the hollows |
frozenGravel | ground | shipped | frost-heaved grey and brown gravel and pebbles locked in ice, snow dust |
Objects (14): rock and ice for props, and the materials the camp props are built from
The hut, drums, mast, sled, tent, rope, window and outline ink are prop materials, listed here because the props use them in every look; they are not ground choices.
| Surface | Group | Maps | What it is |
|---|---|---|---|
lichenRock | object | shipped | granite with orange and pale green lichen |
snowCapRock | object | shipped (frostRock maps) | rock with snow on every up-facing part |
iceSerac | object | shipped (blueIce maps) | serac and pressure-block ice, snow on top |
driftwood | object | borrowed: Heartwood driftwood | sea-bleached wood |
bone | object | borrowed: Scale and Feather bone | weathered whale bone, antler |
hutPanel | object | shipped | red painted insulated panels |
hutRoof | object | shipped | grey corrugated steel |
drumSteel | object | shipped | faded red fuel drum, rust streaks |
mastSteel | object | shipped | galvanised steel |
sledWood | object | borrowed: Heartwood oakBoard | oiled oak slats |
canvas | object | shipped | khaki canvas |
rope | object | shipped | hemp rope |
hutWindow | object | none (flat) | warm lit window glass, glows |
ink | object | none (flat, unlit) | near-black outline ink for inverted hulls |
Plants (5)
| Surface | Group | Maps | What it is |
|---|---|---|---|
willowLeaves | plant | shipped | dwarf willow leaves |
cottongrass | plant | shipped | white seed-head fluff |
arcticFlowers | plant | shipped (2 x 2 atlas) | saxifrage, poppy, moss campion, mountain avens |
mossCushion | plant | shipped (tundraMoss maps) | green moss hummock |
sedge | plant | shipped | olive to straw sedge blades |
In the shared material library
arctic.materialCollection files every surface in every look with materialLibraryKit, and it is written to sit beside the other packs without touching them:
- Every id carries the
arctic_prefix (arctic_bone,arctic_driftwood_lowpoly,arctic_troddenSnow_painted). The library hands a bare id to the first collection that names it, sobonestays the organic pack's anddriftwoodthe woods pack's. - Styles are the library's own: realistic as
realistic, painted and lowpoly asstylised, cartoon astoon, pixel aspixel. The look's own name stays in each entry's tags, sotag = "lowpoly"still finds the low-poly set. - Every entry is filed under its own category,
arctic, the way the forest and animated packs keep theirs, so the sharedgroundandorganicrings of the swatch gallery stay the ground and organic packs' own. Whether a surface is ground, an object or a plant is in its tags:Materials.list({ category = "arctic", tag = "ground" }). - The arcticMaterials test suite checks it: no library problem from or caused by the arctic collection, every id prefixed, every style allowed, no bare id taken over.
Looks
All five looks of a surface draw with the package's one shader, arcticSurface, from the same maps, so a stylised world costs no extra texture memory on Models:
- realistic: physically based, with the engine's lighting. Black ice adds a fake-depth layer: the lake bed is drawn 1.2 m below along the refracted view ray, absorbed by the ice it crosses, with bubbles hanging at a third of the depth, under a glossy surface.
- painted: the colour read softened into brush patches, saturation lifted, tones gently stepped, light wrapped round the form with cool shadows.
- cartoon: hard flat tones, light cut into two bands, a pale rim.
- lowpoly: one flat colour per surface (the mean of its albedo,
AM.color), faceted by each triangle's own normal. - pixel: the maps point-sampled at 32 texels per repeat (16 on plant parts), banded light, a stepped palette.
Terrain layers are shaded by TerrainStream itself, so for the ground the looks are baked: realistic and painted paint the surface's own maps, cartoon and pixel paint a baked toon (<surface>_toon_albedo) or pixel (<surface>_pixel_albedo) albedo over the same normal and mask, and lowpoly paints the flat colour.
The ArcticSurfaces scene in this package shows every surface in every look, a row per surface.
Texture memory
110 textures, all UASTC with mips (BC7 on the GPU, about 1 byte per texel): 72 at 1024 px and 38 at 512 px. Everything resident is about 114 MB. A world in the realistic look loads about 70 MB (albedo and normal 1024, mask 512 per surface; small objects and plant parts at 512); the cartoon or pixel terrain adds about 22 MB of baked terrain albedos for that look only. Every terrain layer, in every look, is 1024 px albedo and normal and 512 px mask, because TerrainStream packs all layers into one texture array whose slices must share a size and format.
Making and changing
ArcticRecipes holds every surface's data (maps, scale in metres, colour, roughness, snow, ice depth, glow, sway) and how each look reads the maps. ArcticBuild.buildAll() writes the 175 material files, ArcticMaterialsTable and the arctic.materialCollection list from it. ArcticBaker.bake(name, spec) turns a generated picture (kept on the baking machine in local/arcticSources/) into albedo, normal and mask maps; bakeLooks makes the terrain's toon and pixel albedos; bakeWater makes the sea water procedurally. The source picture prompts are PROMPT_LEAD plus a top-down, evenly lit, seamless ground description; trodden snow, slush and frozen gravel (baked 2026-11-07) used: trodden snow "packed, slightly grey-blue path snow covered in many overlapping boot footprints with crisp tread patterns, a pair of faint shallow sled runner grooves, small kicked-up lumps of loose snow"; slush "grey-blue water-soaked snow breaking down into translucent icy slush, shallow pools of standing meltwater in the hollows with a glossy wet sheen, soft lumps of wet snow and thin floating ice crusts"; frozen gravel "mixed grey and brown angular gravel and rounded pebbles from one to six centimetres, clear and milky ice filling the gaps, a light dusting of dry snow in the hollows, small frost cracks". Tests: tests/arcticMaterials.testSuite.
Known limits
- Black ice depth is a fake, not a refraction of the scene: the deep layer assumes a level surface, fades out on steep faces and is drawn in the realistic look only (the stylised looks show dark glossy ice).
- Solid surfaces are placed by world position, so a prop that moves at runtime would slide through its texture. Everything in arcticProps stands still; use a plant surface (mesh UVs) for anything that has to move with its texture.
- TerrainStream shades terrain layers with its own shader: painted, cartoon and pixel ground are baked albedos, not the live stylised lighting the same surface gets on a Model, and lowpoly ground is a flat tint without facets.
- Material colour properties written into
mat.yamlby hand did not reach the material (scalars did):renderer.material.describereported the shader's default[1, 1, 1, 1]. The files are written throughasset.create, which works, so rebuild withArcticBuild.buildAll()rather than editing them by hand.