Heightmap Filters
7 nodes
On this page 7
Distort
FunctionWarps a field by two displacement fields, one for each axis, with a maximum displacement in metres.
Distort -> Scalar Field
source: Scalar Field
displacementX: Scalar Field
displacementY: Scalar Field
amplitudeMetres: Number
centredAtHalf: TruthScalarField2D Distort(
ScalarField2D source,
ScalarField2D displacementX,
ScalarField2D displacementY,
double amplitudeMetres = 20,
bool centredAtHalf = true)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Field to warp. |
| displacementX | Scalar Field | — | Displacement along X (columns), the same size as the source. |
| displacementY | Scalar Field | — | Displacement along Y (rows), the same size as the source. |
| amplitudeMetres | Number | 20 | Distance in metres a displacement value of 1 moves the sample. |
| centredAtHalf | Truth | True | True for displacement fields in 0..1 (masks, normalised noise), where 0.5 means no movement and 0 and 1 move by minus and plus the amplitude; false when the fields are already signed, centred on zero. |
Returns
| result | Scalar Field |
Remarks
Each output cell reads the source at its own position plus (dx, dy) × amplitude, bilinearly, clamped at the border. Distorting a selector mask by a noise or by the terrain itself removes the grid-straight edges thresholds leave behind; use HeightmapFilters.DistortByNoise when no displacement fields are at hand.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Filters
- Package
- Procedural Generation
Distort By Noise
FunctionWarps a field by a smooth fractal noise, with the noise's feature size and the warp's reach in metres.
DistortByNoise -> Scalar Field
source: Scalar Field
amplitudeMetres: Number
featureSizeMetres: Number
seed: Integer
octaves: IntegerScalarField2D DistortByNoise(
ScalarField2D source,
double amplitudeMetres = 20,
double featureSizeMetres = 200,
int seed = 1337,
int octaves = 3)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Field to warp. |
| amplitudeMetres | Number | 20 | Largest distance in metres a sample moves. |
| featureSizeMetres | Number | 200 | Size in metres of the noise's largest features; small values fray edges, large values bend them. |
| seed | Integer | 1337 | Noise seed. |
| octaves | Integer | 3 | Fractal octaves; more adds finer fraying. |
Returns
| result | Scalar Field |
Remarks
The noise is evaluated in world metres, so a 2k and a 1k copy of the same terrain are warped alike. The X and Y displacements use independent seeds.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Filters
- Package
- Procedural Generation
Expand
FunctionGrows or shrinks the bright parts of a mask (or the high parts of a heightmap) by a radius in metres, with a round footprint.
Expand -> Scalar Field
source: Scalar Field
radiusMetres: Number
mode: Heightmap Expander Mode
softnessMetres: NumberScalarField2D Expand(
ScalarField2D source,
double radiusMetres = 10,
HeightmapExpanderMode mode = HeightmapExpanderMode.Grow,
double softnessMetres = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Mask or field to expand. |
| radiusMetres | Number | 10 | Radius of the disc in metres. Below half a cell the source is returned unchanged. |
| mode | Heightmap Expander Mode | Grow | Grow (maximum) or Shrink (minimum). |
| softnessMetres | Number | 0 | Optional Gaussian blur in metres applied afterwards, so the new edge fades instead of stepping; 0 keeps the edge hard. |
Returns
| result | Scalar Field |
Remarks
Grow takes the maximum within a disc around each cell (morphological dilation), Shrink the minimum (erosion); grey values are kept, so a soft mask stays soft. Typical uses: spread a rock mask a few metres onto the scree below it, pull grass back from cliff edges, close small holes (grow then shrink) or remove specks (shrink then grow).
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Filters
- Package
- Procedural Generation
Flip
FunctionMirrors a field left-right, top-bottom, or both.
Flip -> Scalar Field
source: Scalar Field
horizontal: Truth
vertical: TruthScalarField2D Flip(
ScalarField2D source,
bool horizontal = true,
bool vertical = false)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Field to mirror. |
| horizontal | Truth | True | Mirror left-right (reverse each row). |
| vertical | Truth | False | Mirror top-bottom (reverse the order of rows). |
Returns
| result | Scalar Field |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Filters
- Package
- Procedural Generation
Gaussian Blur
FunctionSmooths a field with a Gaussian whose standard deviation is given in metres.
GaussianBlur -> Scalar Field
source: Scalar Field
sigmaMetres: NumberScalarField2D GaussianBlur(
ScalarField2D source,
double sigmaMetres = 10)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Field to blur. |
| sigmaMetres | Number | 10 | Standard deviation of the Gaussian in metres. Features much smaller than this disappear; zero returns a copy. |
Returns
| result | Scalar Field |
Remarks
Unlike HeightmapOperations.Smooth (a box of a radius in cells) this is round, has no blocky ringing, and keeps its size in metres when the resolution changes. The kernel reaches three standard deviations.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Filters
- Package
- Procedural Generation
High Pass
FunctionKeeps only the detail smaller than a size in metres: the field minus its Gaussian blur.
HighPass -> Scalar Field
source: Scalar Field
sigmaMetres: NumberScalarField2D HighPass(
ScalarField2D source,
double sigmaMetres = 20)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Field to filter. |
| sigmaMetres | Number | 20 | Standard deviation in metres of the blur that is subtracted; larger keeps broader features. |
Returns
| result | Scalar Field |
Remarks
The result is centred on zero and in the source's units (metres for a heightmap): positive on bumps and crests narrower than about the given size, negative in dips. Feed it to HeightmapOperations.Normalize or a selector to make a mask.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Filters
- Package
- Procedural Generation
Sharpen
FunctionExaggerates detail smaller than a size in metres (unsharp masking): source + amount × high-pass.
Sharpen -> Scalar Field
source: Scalar Field
sigmaMetres: Number
amount: NumberScalarField2D Sharpen(
ScalarField2D source,
double sigmaMetres = 20,
double amount = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Field to sharpen. |
| sigmaMetres | Number | 20 | Standard deviation in metres separating detail from form. |
| amount | Number | 1 | How much of the detail to add again; 0 returns the source, 1 doubles the detail, negative values soften. |
Returns
| result | Scalar Field |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Filters
- Package
- Procedural Generation