Class NoiseDomainWarper
Applies domain warping to noise functions, distorting input coordinates using a secondary noise field to create organic, fluid-like patterns.
Inherited Members
Namespace: Scylla.Core.Util.Noise
Assembly: ScyllaCore.dll
Syntax
public sealed class NoiseDomainWarper
Remarks
Domain warping displaces the sampling coordinates of a noise function using another noise evaluation, producing effects like lava flow, erosion, clouds, and other organic distortions impossible with standard fractal noise alone.
Uses Quilez-style decorrelation offsets to ensure the X and Y displacement channels are uncorrelated, preventing directional bias.
Performance: single warp costs 3x a standard noise evaluation (2 warp + 1 main). Double warp costs 5x (2 + 2 + 1). When using fractal noise for warping, the cost multiplies with the number of octaves.
Constructors
NoiseDomainWarper(NoiseGenerator)
Creates a new NoiseDomainWarper bound to the specified noise generator.
Declaration
public NoiseDomainWarper(NoiseGenerator generator)
Parameters
| Type | Name | Description |
|---|---|---|
| NoiseGenerator | generator | The noise generator to use for both warp and main evaluations. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
Methods
Warp2D(float, float, NoiseSettings, WarpSettings)
Applies single-layer domain warping to 2D noise. Two independent noise evaluations produce displacement values for the X and Y channels (decorrelated via OffsetX and OffsetY), which are then scaled by Strength and added to the original coordinates before the main noise evaluation.
Declaration
public float Warp2D(float x, float y, NoiseSettings noiseSettings, WarpSettings warpSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X coordinate. |
| float | y | Y coordinate. |
| NoiseSettings | noiseSettings | Settings for the final (main) noise evaluation. |
| WarpSettings | warpSettings | Settings for the warp displacement field, controlling algorithm, frequency, strength, and the decorrelation offsets used to produce independent X and Y displacements. |
Returns
| Type | Description |
|---|---|
| float | Warped noise value. Range follows Fractal2D(float, float, NoiseSettings) output ranges for the chosen Fractal type (approximately [-1, 1] for FBM). |
Warp3D(float, float, float, NoiseSettings, WarpSettings)
Applies single-layer domain warping to 3D noise. Three independent noise evaluations produce displacement values for the X, Y, and Z channels (decorrelated via OffsetX, OffsetY, and OffsetZ), which are scaled by Strength and added to the original coordinates before the main noise evaluation.
Declaration
public float Warp3D(float x, float y, float z, NoiseSettings noiseSettings, WarpSettings warpSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X coordinate. |
| float | y | Y coordinate. |
| float | z | Z coordinate. |
| NoiseSettings | noiseSettings | Settings for the final (main) noise evaluation. |
| WarpSettings | warpSettings | Settings for the warp displacement field, controlling algorithm, frequency, strength, and the decorrelation offsets used to produce independent X, Y, and Z displacements. |
Returns
| Type | Description |
|---|---|
| float | Warped noise value. Range follows Fractal3D(float, float, float, NoiseSettings) output ranges for the chosen Fractal type (approximately [-1, 1] for FBM). |
WarpDouble2D(float, float, NoiseSettings, WarpSettings, WarpSettings)
Applies Quilez-style double domain warping to 2D noise. The first warp layer displaces the sampling coordinates; the displaced coordinates are then passed to the second warp layer, which displaces them further before the final main noise evaluation. This two-stage chaining creates highly organic, self-similar patterns such as lava flows, erosion channels, and detailed cloud structures.
Declaration
public float WarpDouble2D(float x, float y, NoiseSettings noiseSettings, WarpSettings warp1, WarpSettings warp2)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X coordinate. |
| float | y | Y coordinate. |
| NoiseSettings | noiseSettings | Settings for the final (main) noise evaluation. |
| WarpSettings | warp1 | Settings for the first (outer) warp layer. Its displacement is applied to the
original |
| WarpSettings | warp2 | Settings for the second (inner) warp layer. Its displacement is computed from the
intermediate position produced by |
Returns
| Type | Description |
|---|---|
| float | Double-warped noise value. Range follows Fractal2D(float, float, NoiseSettings) output ranges for the chosen fractal type (approximately [-1, 1] for FBM). |
See Also
WarpDouble3D(float, float, float, NoiseSettings, WarpSettings, WarpSettings)
Applies Quilez-style double domain warping to 3D noise. The first warp layer displaces the sampling coordinates; the displaced coordinates are then passed to the second warp layer, which displaces them further before the final main noise evaluation. Produces highly organic, volumetric patterns suitable for 3D textures, fog, fluid simulations, and volumetric terrain features.
Declaration
public float WarpDouble3D(float x, float y, float z, NoiseSettings noiseSettings, WarpSettings warp1, WarpSettings warp2)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X coordinate. |
| float | y | Y coordinate. |
| float | z | Z coordinate. |
| NoiseSettings | noiseSettings | Settings for the final (main) noise evaluation. |
| WarpSettings | warp1 | Settings for the first (outer) warp layer. Its displacement is applied to the
original |
| WarpSettings | warp2 | Settings for the second (inner) warp layer. Its displacement is computed from the
intermediate position produced by |
Returns
| Type | Description |
|---|---|
| float | Double-warped noise value. Range follows Fractal3D(float, float, float, NoiseSettings) output ranges for the chosen fractal type (approximately [-1, 1] for FBM). |
See Also
WarpFractal2D(float, float, NoiseSettings, WarpSettings, NoiseSettings)
Applies domain warping to 2D noise using a full fractal noise field for the
displacement. Unlike Warp2D(float, float, NoiseSettings, WarpSettings), which uses single-octave noise for the
displacement, this method calls Fractal2D(float, float, NoiseSettings) with
warpNoiseSettings to produce a multi-octave displacement field,
yielding richer, more detailed distortion patterns.
Declaration
public float WarpFractal2D(float x, float y, NoiseSettings noiseSettings, WarpSettings warpSettings, NoiseSettings warpNoiseSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X coordinate. |
| float | y | Y coordinate. |
| NoiseSettings | noiseSettings | Settings for the final (main) noise evaluation. |
| WarpSettings | warpSettings | Controls displacement magnitude (Strength), the frequency at which the displacement field is sampled (Frequency), and the decorrelation offsets for the X and Y displacement channels. |
| NoiseSettings | warpNoiseSettings | Fractal noise settings used to evaluate the displacement field itself. Increasing the octave count here adds fine detail to the warp displacement pattern. |
Returns
| Type | Description |
|---|---|
| float | Warped noise value. Range follows Fractal2D(float, float, NoiseSettings) output ranges
for the fractal type specified in |
Remarks
Performance note: with N warp octaves and M main octaves, this method
performs 2 * N + M base noise evaluations per sample.
See Also
WarpFractal3D(float, float, float, NoiseSettings, WarpSettings, NoiseSettings)
Applies domain warping to 3D noise using a full fractal noise field for the
displacement. Unlike Warp3D(float, float, float, NoiseSettings, WarpSettings), which uses single-octave noise for the
displacement, this method calls Fractal3D(float, float, float, NoiseSettings) with
warpNoiseSettings to produce a multi-octave displacement field,
yielding richer, more detailed distortion patterns in all three dimensions.
Declaration
public float WarpFractal3D(float x, float y, float z, NoiseSettings noiseSettings, WarpSettings warpSettings, NoiseSettings warpNoiseSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | X coordinate. |
| float | y | Y coordinate. |
| float | z | Z coordinate. |
| NoiseSettings | noiseSettings | Settings for the final (main) noise evaluation. |
| WarpSettings | warpSettings | Controls displacement magnitude (Strength), the frequency at which the displacement field is sampled (Frequency), and the decorrelation offsets for the X, Y, and Z displacement channels. |
| NoiseSettings | warpNoiseSettings | Fractal noise settings used to evaluate the displacement field itself. Increasing the octave count here adds fine detail to the warp displacement pattern. |
Returns
| Type | Description |
|---|---|
| float | Warped noise value. Range follows Fractal3D(float, float, float, NoiseSettings) output ranges
for the fractal type specified in |
Remarks
Performance note: with N warp octaves and M main octaves, this method
performs 3 * N + M base noise evaluations per sample.