Struct WarpSettings
Immutable configuration struct for domain warping, defining the displacement field that distorts the input coordinates of a noise function before evaluation. Domain warping produces organic, fluid-like patterns that cannot be achieved with fractal layering alone - effects such as lava flow, river erosion, and swirling clouds.
Inherited Members
Namespace: Scylla.Core.Util.Noise
Assembly: ScyllaCore.dll
Syntax
public readonly struct WarpSettings
Remarks
Domain warping works by evaluating a secondary noise field at the sample position (offset by decorrelation constants per axis), multiplying the result by Strength, and adding the displacement to the original coordinates. The main noise function is then evaluated at the displaced coordinates.
The decorrelation offsets (OffsetX, OffsetY, OffsetZ) are critical for visual quality: they ensure that the displacement sampled for each axis comes from a different region of the noise field, preventing the X and Y displacements from being correlated with each other. Correlated displacements produce a uniform directional bias; decorrelated offsets give each axis an independent, organic displacement character. The standard Quilez offsets (5.2, 1.3, 8.3) are provided in all built-in presets.
This struct is consumed by Warp2D(float, float, NoiseSettings, WarpSettings), Warp3D(float, float, float, NoiseSettings, WarpSettings), WarpDouble2D(float, float, NoiseSettings, WarpSettings, WarpSettings), WarpDouble3D(float, float, float, NoiseSettings, WarpSettings, WarpSettings), WarpFractal2D(float, float, NoiseSettings, WarpSettings, NoiseSettings), and WarpFractal3D(float, float, float, NoiseSettings, WarpSettings, NoiseSettings).
This struct is readonly and allocation-free. The built-in presets (Default, Subtle, Extreme) use the standard Quilez decorrelation offsets and differ only in strength and frequency.
Constructors
WarpSettings(float, float, float, float, float, NoiseAlgorithm)
Creates a new WarpSettings with fully specified parameters. All fields are assigned directly without clamping or validation.
Declaration
public WarpSettings(float strength, float frequency, float offsetX, float offsetY, float offsetZ, NoiseAlgorithm algorithm)
Parameters
| Type | Name | Description |
|---|---|---|
| float | strength | Warp displacement magnitude. The noise displacement value (in [-1, 1]) is multiplied by this before being added to input coordinates. Higher values produce stronger distortion. Typical range is [10, 150] for world-space terrain. |
| float | frequency | Sampling frequency of the warp displacement noise field. Controls the spatial scale of the displacement pattern. Typical values are in [0.002, 0.02] for terrain work. |
| float | offsetX | Decorrelation offset applied when sampling the X-axis displacement channel. The standard Quilez value is 5.2. |
| float | offsetY | Decorrelation offset applied when sampling the Y-axis displacement channel. The standard Quilez value is 1.3. |
| float | offsetZ | Decorrelation offset applied when sampling the Z-axis displacement channel. Only used by 3D warp methods. The standard Quilez value is 8.3. |
| NoiseAlgorithm | algorithm | The coherent noise algorithm used to evaluate the displacement field. May differ from the algorithm used for the main noise. See NoiseAlgorithm for the available options and their performance characteristics. |
Fields
Algorithm
The coherent noise algorithm used to evaluate the warp displacement field. Can differ from the algorithm used for the main noise evaluation, allowing e.g. fast Value noise for the displacement field and higher-quality OpenSimplex2 for the main noise. All built-in presets use OpenSimplex2.
Declaration
public readonly NoiseAlgorithm Algorithm
Field Value
| Type | Description |
|---|---|
| NoiseAlgorithm |
See Also
Default
Default warp settings: strength 50, frequency 0.005, standard Quilez decorrelation offsets (5.2, 1.3, 8.3), OpenSimplex2 algorithm. Produces a moderate, clearly visible distortion suitable as a general-purpose starting point for organic terrain features such as river bends, erosion channels, and cloud swirls.
Declaration
public static readonly WarpSettings Default
Field Value
| Type | Description |
|---|---|
| WarpSettings |
Extreme
Extreme warp: strength 150, frequency 0.003, standard Quilez decorrelation offsets, OpenSimplex2. Produces dramatic, large-scale distortion with sweeping displacement curves. Suitable for lava flow simulations, heavily eroded canyon systems, violent storm cloud shapes, and other effects where extreme organic distortion is desired.
Declaration
public static readonly WarpSettings Extreme
Field Value
| Type | Description |
|---|---|
| WarpSettings |
Frequency
Sampling frequency of the warp displacement noise field. Controls the spatial scale of the displacement pattern: higher values produce tighter, more rapidly varying displacement; lower values produce broader, smoother displacement. This frequency is applied independently of the main noise frequency set in Frequency. Typical values are in [0.002, 0.02] for large world-space terrain features.
Declaration
public readonly float Frequency
Field Value
| Type | Description |
|---|---|
| float |
OffsetX
Decorrelation offset added to the X coordinate when sampling the displacement field for the X-axis warp component. This Quilez-style offset ensures that the X-axis displacement noise is sampled from a different region of the noise field than the Y-axis and Z-axis displacement noise, preventing directional correlation artefacts. The standard value (5.2) is used by all built-in presets.
Declaration
public readonly float OffsetX
Field Value
| Type | Description |
|---|---|
| float |
OffsetY
Decorrelation offset added to the X coordinate when sampling the displacement field for the Y-axis warp component. Ensures the Y-axis displacement noise is drawn from a different region than the X-axis and Z-axis channels. The standard value (1.3) is used by all built-in presets.
Declaration
public readonly float OffsetY
Field Value
| Type | Description |
|---|---|
| float |
OffsetZ
Decorrelation offset added to the X coordinate when sampling the displacement field for the Z-axis warp component. Only used by 3D warp methods (Warp3D(float, float, float, NoiseSettings, WarpSettings), WarpDouble3D(float, float, float, NoiseSettings, WarpSettings, WarpSettings), WarpFractal3D(float, float, float, NoiseSettings, WarpSettings, NoiseSettings)); ignored in 2D variants. The standard value (8.3) is used by all built-in presets.
Declaration
public readonly float OffsetZ
Field Value
| Type | Description |
|---|---|
| float |
Strength
Warp displacement magnitude, in world-space units. The noise value sampled for each
displacement channel (in [-1, 1]) is multiplied by this value before being added to
the input coordinate. Higher values produce stronger, more visible distortion. Typical
values are in [10, 100] for world-space terrain coordinates and smaller for
texture-space patterns. At 0.0 the warp has no effect.
Declaration
public readonly float Strength
Field Value
| Type | Description |
|---|---|
| float |
Subtle
Subtle warp: strength 20, frequency 0.008, standard Quilez decorrelation offsets, OpenSimplex2. Produces a gentle, barely-perceptible distortion that adds organic variation without dramatically altering the underlying noise pattern. Suitable for breaking up regularity in terrain or texture without a strong warp signature.
Declaration
public static readonly WarpSettings Subtle
Field Value
| Type | Description |
|---|---|
| WarpSettings |