Divooka Reference

Terrain Erosion Masks

6 nodes

On this page 6

Blur

Function

Gaussian blur with a radius (sigma) in cells, clamped at the borders.

Signature
Blur(map: Scalar Field, sigmaCells: Number) -> Scalar Field
ScalarField2D Blur(ScalarField2D map, double sigmaCells = 1)

Parameters

nametypedefaultdescription
mapScalar Field—Map to blur.
sigmaCellsNumber1Gaussian sigma in cells.

Returns

resultScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Terrain Erosion Masks
Package
Procedural Generation

Exponential Mask

Function

Saturating ramp for thicknesses (wear, deposition, debris): 1 − exp(−value / scale), so the mask reaches 0.63 at one scale and 0.95 at three.

Signature
ExponentialMask -> Scalar Field
    map: Scalar Field
    scale: Number
    blurCells: Number
ScalarField2D ExponentialMask(
    ScalarField2D map,
    double scale = 0.5,
    double blurCells = 0.5)

Parameters

nametypedefaultdescription
mapScalar Field—Raw map, metres.
scaleNumber0.5Thickness, metres, at which the mask reaches 0.63.
blurCellsNumber0.5Gaussian blur radius (sigma) in cells applied afterwards; 0 for none.

Returns

resultScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Terrain Erosion Masks
Package
Procedural Generation

Linear Mask

Function

Linear ramp: 0 at or below Low, 1 at or above High.

Signature
LinearMask -> Scalar Field
    map: Scalar Field
    low: Number
    high: Number
    blurCells: Number
ScalarField2D LinearMask(
    ScalarField2D map,
    double low = 0,
    double high = 1,
    double blurCells = 0.5)

Parameters

nametypedefaultdescription
mapScalar Field—Raw map.
lowNumber0Value that maps to 0.
highNumber1Value that maps to 1.
blurCellsNumber0.5Gaussian blur radius (sigma) in cells applied afterwards; 0 for none.

Returns

resultScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Terrain Erosion Masks
Package
Procedural Generation

Logarithmic Mask

Function

Logarithmic ramp for quantities spanning orders of magnitude (drainage area, sediment flux): 0 at or below Low, 1 at or above High.

Signature
LogarithmicMask -> Scalar Field
    map: Scalar Field
    low: Number
    high: Number
    blurCells: Number
ScalarField2D LogarithmicMask(
    ScalarField2D map,
    double low = 1000,
    double high = 10000000,
    double blurCells = 0.5)

Parameters

nametypedefaultdescription
mapScalar Field—Raw map with positive values.
lowNumber1000Value that maps to 0.
highNumber10000000Value that maps to 1.
blurCellsNumber0.5Gaussian blur radius (sigma) in cells applied afterwards; 0 for none.

Returns

resultScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Terrain Erosion Masks
Package
Procedural Generation

Percentile Mask

Function

Ramp between two percentiles of the map itself. This adapts to the terrain, so the same value can mean different things on different maps; prefer the fixed conversions for anything that must stay consistent.

Signature
PercentileMask -> Scalar Field
    map: Scalar Field
    lowPercentile: Number
    highPercentile: Number
    logarithmic: Truth
    blurCells: Number
ScalarField2D PercentileMask(
    ScalarField2D map,
    double lowPercentile = 0.02,
    double highPercentile = 0.98,
    bool logarithmic = false,
    double blurCells = 0.5)

Parameters

nametypedefaultdescription
mapScalar Field—Raw map.
lowPercentileNumber0.02Percentile (0..1) that maps to 0.
highPercentileNumber0.98Percentile (0..1) that maps to 1.
logarithmicTruthFalseRamp in log space, for area and flux maps.
blurCellsNumber0.5Gaussian blur radius (sigma) in cells applied afterwards; 0 for none.

Returns

resultScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Terrain Erosion Masks
Package
Procedural Generation

Signed Mask

Function

Diverging ramp for signed maps (height change): 0.5 at zero, 0 at −Range and 1 at +Range.

Signature
SignedMask -> Scalar Field
    map: Scalar Field
    range: Number
    blurCells: Number
ScalarField2D SignedMask(
    ScalarField2D map,
    double range = 10,
    double blurCells = 0.5)

Parameters

nametypedefaultdescription
mapScalar Field—Raw signed map.
rangeNumber10Magnitude that maps to 0 or 1.
blurCellsNumber0.5Gaussian blur radius (sigma) in cells applied afterwards; 0 for none.

Returns

resultScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Terrain Erosion Masks
Package
Procedural Generation