# Gradients, texture and wear

Experienced builders call gradients the single most important detailing technique. A gradient
is a controlled change of block along a surface. It makes a flat colour read as a material
with a past: weathered, stained, sun-bleached, overgrown. It also directs the eye.

## The method

1. **Build a ramp.** Pick three to five blocks and order them from light to dark. Shade comes
   first, then colour and undertone, then texture. A ramp is only as good as the weakest
   step: if one block is much darker than its neighbour in the ramp, you get a hard edge.
2. **Place by cause.** Wear has reasons. Water runs down from ledges, sills and eaves, and
   collects at the base. Sun bleaches ridges and south faces. Moss grows where it is damp and
   shaded. Soot gathers over doors and chimneys. A pattern with a cause looks real. A pattern
   without one looks like noise.
3. **Centre clusters on a spot.** Put the strongest change at a focus (a window, a crack, a
   corner, a base) and step through the ramp as you move outward, with ragged edges.
4. **Vary the clusters.** Different sizes, spacing and strength. Never in a regular grid.

## The three mistakes to avoid

Builders have names for the usual failures:

- **Splattering:** jumping over steps in the ramp, so a dark block sits next to a light one.
  Follow the ramp in order.
- **Smallpox:** isolated single cells of a second block from a ramp with too few steps, so the
  wall looks spotty and rushed. Use more steps, and clusters rather than dots.
- **Sandwiching:** layers in even horizontal bands, like sediment. It draws a hard line at the
  top of each band. Make boundaries ragged and irregular, not ruled.

Beyond those: do not scatter at an even 50/50. A handful of variant blocks sprinkled in
reads as detail; an even mix reads as a mess. Start light (roughly one cell in six to ten),
and add where the cause is.

## In Voxyl: variation is a sibling role

The data stores intent. The way to mix blocks and keep that true is to give each ramp step its
own role in the same family, and let the palette decide what they are:

```call
palette_edit {"palette": "Main", "semantics": [
  {"semantic": "Wall Light", "tint": "#c4bcae"},
  {"semantic": "Wall Dark", "tint": "#8f877a"},
  {"semantic": "Wall Mossy", "tint": "#7c8a5f"}
]}
```

Because the pattern is in the cells and the materials are in the palette, you can later swap
the whole ramp (stone to brick to timber) and the weathering stays where you put it. Name the
steps for the effect (`Wall Damp`, `Roof Bleached`, `Base Mossy`), not for the block.

### Paint a facade with text layers

`build` with `axis: "z"` lets you draw an elevation as text: each layer is one slice at a depth,
each row a height from the top down, and each character a cell. `origin.y` is the height of
the first, top row, and later rows step down from it. This is the best way to place noise and
patterns by hand. Draw clusters, with ragged edges. Here an 8-row wall whose base is at y = 0:

```call
build {"origin": [0, 7, 0], "axis": "z", "legend": {"W": "Wall", "L": "Wall Light", "D": "Wall Dark", "M": "Wall Mossy"}, "layers": [[
  "WWWLWWWWWWWLWWWWWWWW",
  "WWWWWWWWWWWWWWWWWWWW",
  "WWLWWWWWWWWWWWWWWLWW",
  "WWWWWWWWWWWWWWWWWWWW",
  "WWWWWWWWWDDWWWWWWWWW",
  "WWWWWWWWDDDDWWWWWWWW",
  "WWWWWWWDDDMDDWWWWWWW",
  "WWWWDDDDMMMMMDDWWWWW"
]]}
```

The darkening and moss thicken toward the foot of the wall, where damp collects. Read a build
back the same way with `inspect` `view: "layers"` `axis: "z"` to check what you drew.

### Wear around openings and edges with a region

You can aim a replacement at the cells next to something. `grow` steps a set outward by n
cells, face to face (put `"corners": true` inside the region to step diagonally too), and `all`
intersects. This darkens the wall cells that touch glass, as if rain ran off the windows:

```call
fill {"where": {"box": [0, 0, 0, 8, 6, 1]}, "semantic": "Wall"}
fill {"where": {"box": [3, 2, 0, 4, 3, 0]}, "semantic": "Glass"}
replace {"from": "Wall", "to": "Wall Dark", "where": {"all": [{"semantic": "Wall"}, {"grow": 1, "of": {"semantic": "Glass"}}]}}
```

A uniform one-cell ring looks mechanical (and it also takes the wall cells behind the glass),
so treat the result as a base. Weight it downward, below the sills, where water runs, and rough
up the edge by hand with `place` or text layers. Other useful aims: the lowest two layers of
a wall (`{"all": [{"semantic": "Wall"}, {"box": [x0, y0, z0, x1, y1, z1]}]}`), cells at the
corners, cells under a ledge. After a pass, check in `intent` mode that the pattern has the
structure you meant.

### Scatter

There is no random-scatter tool. When you want a loose sprinkle, work out positions yourself
with a seeded rule (a hash of x, y, z that you can repeat) and pass them as `at` to `place`, or
write them into text layers. Keep the seed, so a redo gives the same result. Make the density
change with a cause (more near the ground), not a constant.

## Where to put wear

| Place | Effect |
| --- | --- |
| Foot of a wall | Darkest and most mossy: damp and splash |
| Under sills, ledges, eaves, below gutters | Vertical dark streaks |
| Around windows and doors | Soot, stain, a darker border |
| Corners and edges | Chipped, lighter or cracked blocks |
| Ridges and south faces | Bleached lighter |
| North and shaded faces | Mossier and darker |
| Above chimneys and doorways | Soot |
| Roofs | A second block (a lighter or darker tone) in patches. Wood, slate and thatch weather differently |

## Age is a design choice

Decide how old the build is, and keep to it: crisp and new (clean steps, low variation), lived
in (some wear at the base and openings), ancient or ruined (heavy wear, missing blocks).
Ruins need *missing* cells as well as discoloured ones: broken corners and cornices, holes in
a roof showing the rafters, fallen blocks as stairs and slabs scattered near the base, vines
and grass growing over the break.

## Texture without colour change

Within one shade, variation in surface still adds richness: a rough block next to a smooth
one of the same value; polished trim around a cobble wall. Use it for:

- Bands: a string course in a smoother block.
- Panels: a field of one surface inside a frame of another.
- Breaking up very long runs.

## Ramps worth knowing

Common ramps use families that exist in most libraries: plain, cracked, mossy and chiseled
variants of the same stone; the same wood in planks, logs and stripped logs; sand, sandstone and
cut sandstone; dirt, coarse dirt, podzol and gravel for ground. In newer game versions
copper has its own built-in ramp (fresh, exposed, weathered, oxidized). Check the libraries the
user has with `find_blocks`; decorative mods often offer many shades.
