Struct CellularSettings
Immutable configuration struct for cellular (Worley) noise generation. Bundles the return type, distance metric, feature-point jitter, base frequency, and optional fractal layering parameters into a single value that can be passed to EvaluateCellular2D(float, float, CellularSettings), EvaluateCellular3D(float, float, float, CellularSettings), FractalCellular2D(float, float, CellularSettings), and FractalCellular3D(float, float, float, CellularSettings).
Inherited Members
Namespace: Scylla.Core.Util.Noise
Assembly: ScyllaCore.dll
Syntax
public readonly struct CellularSettings
Remarks
Cellular noise output ranges differ from gradient noise. With Euclidean distance, F1 returns approximately [0, 1] and F2MinusF1 returns approximately [0, 0.7]. Values are NOT normalized to [-1, 1] like gradient noise algorithms.
This struct is readonly and allocation-free. Use the provided named presets (e.g., Default, Voronoi, Cracks) as starting points and adjust individual parameters through the constructor as needed.
Fractal layering fields (Octaves, Lacunarity, Persistence) are only meaningful when Fractal is not None and Octaves is greater than 1. When single-octave evaluation is desired, set Fractal to None and call EvaluateCellular2D(float, float, CellularSettings) or EvaluateCellular3D(float, float, float, CellularSettings) directly.
Constructors
CellularSettings(CellularReturnType, CellularDistanceType, float, float, FractalType, int, float, float)
Creates a new CellularSettings with fully specified parameters.
All fields are assigned directly; jitter is clamped to [0, 1].
Declaration
public CellularSettings(CellularReturnType returnType, CellularDistanceType distanceType, float jitter, float frequency, FractalType fractal, int octaves, float lacunarity, float persistence)
Parameters
| Type | Name | Description |
|---|---|---|
| CellularReturnType | returnType | Which distance-based quantity to return from each cellular evaluation. See CellularReturnType for the available options and their visual effects. |
| CellularDistanceType | distanceType | The distance metric to apply when computing distances to Voronoi feature points. See CellularDistanceType for the available metrics and their visual effects. |
| float | jitter | How far feature points can deviate from their cell center, in the range [0, 1].
Values outside this range are clamped automatically. |
| float | frequency | Base sampling frequency applied to input coordinates. Higher values produce smaller, more densely packed cells. Typical world-space values are in [0.01, 0.1]. |
| FractalType | fractal | Fractal layering method. Use None for single-octave
evaluation. Any other value activates multi-octave layering controlled by
|
| int | octaves | Number of noise octaves to layer. Ignored when |
| float | lacunarity | Frequency multiplier per octave. Typically |
| float | persistence | Amplitude multiplier per octave. Typically |
Fields
Cells
Biological cell preset: 2-octave FBM with Euclidean F2MinusF1 at frequency 0.06. The F2-F1 edge highlighting combined with FBM layering creates patterns that resemble cell membranes, skin texture, or organic tissue cross-sections.
Declaration
public static readonly CellularSettings Cells
Field Value
| Type | Description |
|---|---|
| CellularSettings |
Cracks
Crack and vein preset: single-octave Euclidean F2MinusF1 at frequency 0.03 with jitter 0.8. The F2-F1 formula isolates the thin Voronoi edge bands, which appear as narrow cracks or veins running between cells. Best suited for cracked earth, dried mud, rock faces, circuit board traces, and leaf vein patterns.
Declaration
public static readonly CellularSettings Cracks
Field Value
| Type | Description |
|---|---|
| CellularSettings |
Default
Default cellular settings: single-octave Euclidean F1 with full jitter at frequency 0.05. Produces standard organic Voronoi cells suitable as a neutral starting point before tuning for a specific use case.
Declaration
public static readonly CellularSettings Default
Field Value
| Type | Description |
|---|---|
| CellularSettings |
DistanceType
The distance metric applied when computing distances to Voronoi feature points. Euclidean gives rounded, natural cells; Manhattan gives rectangular cells; Chebyshev gives diamond-shaped cells.
Declaration
public readonly CellularDistanceType DistanceType
Field Value
| Type | Description |
|---|---|
| CellularDistanceType |
See Also
Fractal
The fractal layering method applied when combining multiple octaves. Set to None (the default for single-octave evaluation) to skip fractal layering entirely. When set to any other value and Octaves is greater than 1, the fractal loop is engaged using Lacunarity and Persistence to scale each octave.
Declaration
public readonly FractalType Fractal
Field Value
| Type | Description |
|---|---|
| FractalType |
See Also
Frequency
Base sampling frequency applied to input coordinates before evaluating cellular noise. Higher values produce smaller, more densely packed Voronoi cells. Lower values produce larger, coarser cells. Typical values for world-space terrain work are in the range [0.01, 0.1]; values near 1.0 are used for texture-space patterns.
Declaration
public readonly float Frequency
Field Value
| Type | Description |
|---|---|
| float |
Jitter
Controls how much each Voronoi feature point deviates from its lattice cell center.
Must be in the range [0, 1]; the constructor clamps this value automatically.
At 0.0 feature points sit exactly at cell centers, producing perfectly
regular hexagonal/rectangular grids. At 1.0 feature points are fully randomized
within their cell, producing the natural organic Voronoi appearance. Values between
0 and 1 produce intermediate levels of regularity.
Declaration
public readonly float Jitter
Field Value
| Type | Description |
|---|---|
| float |
Lacunarity
Frequency multiplier applied to each successive fractal octave. A value of
2.0 (the standard) doubles the sampling frequency per octave, adding
detail at half the spatial scale. Values above 2.0 produce more aggressive
detail layering; values below 2.0 produce subtler layering. Only meaningful
when Fractal is not None and
Octaves is greater than 1.
Declaration
public readonly float Lacunarity
Field Value
| Type | Description |
|---|---|
| float |
Octaves
Number of noise octaves to combine when Fractal is not None. Each additional octave adds a finer layer of detail at the cost of proportionally more evaluations per sample. Typical values are 2-6. Ignored if Fractal is None or if this value is 1 or less.
Declaration
public readonly int Octaves
Field Value
| Type | Description |
|---|---|
| int |
Persistence
Amplitude multiplier applied to each successive fractal octave. A value of
0.5 (the standard) halves the contribution of each octave, so finer
detail layers have progressively less influence. Values above 0.5 give finer
octaves more weight, producing rougher output; values below 0.5 produce
smoother output dominated by the coarsest octave. Only meaningful when
Fractal is not None and
Octaves is greater than 1.
Declaration
public readonly float Persistence
Field Value
| Type | Description |
|---|---|
| float |
ReturnType
Determines which distance-based quantity the cellular noise algorithm returns. F1 returns the nearest-neighbor distance for a classic Voronoi gradient; F2MinusF1 highlights cell edges for crack and vein patterns.
Declaration
public readonly CellularReturnType ReturnType
Field Value
| Type | Description |
|---|---|
| CellularReturnType |
See Also
Stone
Flagstone and cobblestone preset: 3-octave FBM with Manhattan distance F1 at frequency 0.04. Manhattan distance introduces rectangular cell boundaries, and the FBM layering adds fine variation that mimics natural stone irregularities. Best suited for flagstone paths, cobblestone streets, brick-like patterns, and tiled floor textures.
Declaration
public static readonly CellularSettings Stone
Field Value
| Type | Description |
|---|---|
| CellularSettings |
Voronoi
Large-scale Voronoi preset: single-octave Euclidean F1 at low frequency (0.02) with full jitter. Produces broad, smoothly-bounded Voronoi regions well suited for biome boundaries, territory maps, and large-scale zone colouring.
Declaration
public static readonly CellularSettings Voronoi
Field Value
| Type | Description |
|---|---|
| CellularSettings |