Terrain

Density Cache

Caches a bounded density input for repeated sampling.

density.cache

Density CacheCapacity1InputOutput

What it does

Keep the same terrain while avoiding repeated work at positions you have just read. A cache is useful when several branches ask for the same density at exactly the same place.

Put the shared density into Input, then use Output in those branches. Try this around a costly shape that is read repeatedly; a field read only once at each position has little to gain.

Inputs and outputs

NameTypeDefaultWhat it changes
Inputs
InputDensityThe density to remember at recently read positions.
CapacityIntegerrequired · 1–64Higher values remember more recent positions.
Output
OutputDensityThe exact input values, with no smoothing or change of shape.

Good to know

Follow the shared wires

Place the cache before the branches separate. Moving or warping coordinates can make those branches read different positions and miss the cache.

See also