Table of Contents

Class Cache2dDensity

Namespace
Shard.WorldGen.Nodes
Assembly
Shard.WorldGen.dll

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).

public sealed class Cache2dDensity : Density
Inheritance
Cache2dDensity
Inherited Members

Constructors

Cache2dDensity(Density, int)

public Cache2dDensity(Density child, int capacity)

Parameters

child Density
capacity int

Methods

Process(Context)

public override double Process(Density.Context context)

Parameters

context Density.Context

Returns

double

SetInputs(Density[])

Wire this node's inputs (no-op for leaf nodes).

public override void SetInputs(Density[] inputs)

Parameters

inputs Density[]