Table of Contents

Namespace Shard.WorldGen.Nodes

Classes

AbsDensity

Absolute value of the input node.

AmplitudeConstantDensity

Multiplies the input node by a constant amplitude.

AmplitudeDensity

Multiplies the input node by a height-dependent amplitude (a function of Y); zero amplitude skips the input.

AnchorDensity

Re-centers the input node on the context's density anchor (subtract the anchor, or add it when reversed). With no anchor, the input is evaluated unchanged. Allocates a per-call child context.

AxisDensity

Leaf: distance from the perpendicular to an axis (line through origin), run through a curve.

BaseHeightDensity

Leaf: the biome's base height. In "distance" mode returns the signed distance to the base plane (position.Y - baseHeight, so >0 above / <0 below); otherwise the constant base height. The baseHeight is resolved at load time from a named Framework decimal constant (e.g. "Base"). Mirrors the v2 generator's BaseHeightDensity.

Cache2dDensity

Memoizes a purely horizontal (x,z-dependent) child density per column, so a 2D noise isn't recomputed for every Y in a column. Stands in for the v2 generator's MultiCache+YOverride(0) wrap around 2D noise — sized for Shard's y-innermost generation loop. Caches are thread-local so chunk generation can run in parallel across worker threads (each thread keeps its own last-key fast path + bounded dictionary).

CeilingDensity

Caps the input node at an upper limit (hard min with the limit).

CellWallDistanceDensity

Leaf: the context's distance-from-cell-wall (set by upstream cell stages).

ClampDensity

Clamps the input node between two walls (given in either order).

ConstantValueDensity

Leaf: a constant density value.

CubeDensity

Leaf: a cube/box field — Chebyshev distance from the origin run through a falloff function.

CurveMapperDensity

Maps the input node's value through a curve function (e.g. Evaluate(double)).

CylinderDensity

Leaf: a cylinder field — product of an axial curve (over Y) and a radial curve (over the x/z radius).

DistanceDensity

Leaf: a spherical field — Euclidean distance from the origin run through a falloff function.

DistanceToBiomeEdgeDensity

Leaf: the context's distance-to-biome-edge (set by upstream biome stages).

FastGradientWarpDensity

Domain warp driven by a self-contained FastNoiseLite (OpenSimplex2, progressive fractal): displaces the sample position before evaluating the input. FNL is used directly (no NoiseField wrapper) since it is the warp engine, not a graph noise source. The FNL instance is read-only at runtime, so concurrent evaluation is safe; only a per-call child context is allocated.

FloorDensity

Raises the input node to a lower limit (hard max with the limit).

FunctionDensity

Applies an arbitrary function to the input node's value (0 when no input).

GradientDensity

Measures the slope of the input field: finite-difference gradient over a step, reported as the angle (in degrees, 0-90) between that gradient direction and a reference axis. Allocates per-call contexts.

GradientWarpDensity

Domain warp: displaces the sample position along the gradient of a warp field (finite-difference over a step, scaled by warpFactor) before evaluating the input. Allocates per-call child contexts.

InverterDensity

Negates the input node.

MaxDensity

Maximum across all input nodes (0 when empty).

MinDensity

Minimum across all input nodes (0 when empty).

MixDensity

Blends between two nodes by a third "influence" node: influence ≤ 0 → A, ≥ 1 → B, linear in between.

MultiMixDensity

Blends across an ordered set of keyed nodes by a single influence input: the influence value selects the surrounding two keys and linearly interpolates between their densities. Below/above the range returns the first/last key. Requires at least two keys with unique values.

MultiplierDensity

Product of all input nodes (0 when empty), short-circuiting at zero.

Noise2dDensity

Leaf: samples a NoiseField in 2D over the horizontal plane (x, z).

Noise3dDensity

Leaf: samples a NoiseField in 3D at the sample position.

NormalizerDensity

Linearly remaps the input node from [fromMin, fromMax] onto [toMin, toMax].

OffsetConstantDensity

Adds a constant to the input node.

OffsetDensity

Adds a height-dependent offset (a function of Y) to the input node.

PlaneDensity

Leaf: distance to a plane through the origin with a given normal, run through a curve. A horizontal plane uses the signed Y directly; anchored mode measures from the context's density anchor.

PowDensity

Raises the input node to an exponent, preserving sign (odd-like behavior for negatives).

ScaleDensity

Scales the sample coordinates (by the reciprocal of the given factors) before evaluating the input. Unlike upstream, this allocates a per-call child context rather than reusing an instance scratch buffer, so it is safe to evaluate from multiple threads.

SelectorDensity

Remaps the input node onto [toMin, toMax] and clamps it there (hard or smooth at the edges).

ShellDensity

Leaf: a spherical shell modulated by angle to an axis — radial distance drives an amplitude curve, scaled by an angle curve (optionally mirrored about the equator).

SliderDensity

Translates the sample coordinates by a fixed offset before evaluating the input (thread-safe child context).

SmoothCeilingDensity

Soft upper cap: smooth minimum of the input node with a limit.

SmoothClampDensity

Clamps the input node to [min, max] with smooth (soft) transitions over a blend range.

SmoothFloorDensity

Soft lower limit: smooth maximum of the input node with a limit.

SmoothMaxDensity

Smooth maximum of two inputs over a blend range.

SmoothMinDensity

Smooth minimum of two inputs over a blend range.

SqrtDensity

Square root of the input node, preserving sign.

SumDensity

Sum of all input nodes (0 when empty).

SwitchDensity

Routes to the input whose registered switch state matches the context's switch state (0 if none).

SwitchStateDensity

Evaluates the input node with the context's switch state overridden to a fixed value. Allocates a per-call child context (thread-safe) rather than reusing an instance scratch buffer like upstream.

VectorWarpDensity

Domain warp: displaces the sample position along a fixed direction by a warp field's value (scaled by warpFactor) before evaluating the input. Allocates a per-call child context.

WhiteNoiseDensity

Per-cell white noise in [-1, 1]: an uncorrelated hashed value for each integer lattice cell. Upstream used an RngField + a fast LCG; Shard hashes (seed, ⌊x⌋, ⌊y⌋, ⌊z⌋) with splitmix64 mixing for a clean, self-contained, higher-quality result.

XOverrideDensity

Evaluates the input node with the X coordinate replaced by a fixed value.

XValueDensity

Leaf: the sample position's X coordinate.

YOverrideDensity

Evaluates the input node with the Y coordinate replaced by a fixed value.

YValueDensity

Leaf: the sample position's Y coordinate (height).

ZOverrideDensity

Evaluates the input node with the Z coordinate replaced by a fixed value.

ZValueDensity

Leaf: the sample position's Z coordinate.

Structs

MultiMixDensity.Key