Heightmap Selectors
14 nodes
On this page 14
Heightmap Data Usage Token Ambient Occlusion
FunctionUsage of an ambient occlusion (sky visibility) field.
HeightmapDataUsageTokenAmbientOcclusion() -> Text
string HeightmapDataUsageTokenAmbientOcclusion()
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Heightmap Data Usage Token Aspect Degrees
FunctionUsage of an aspect field, in compass degrees.
HeightmapDataUsageTokenAspectDegrees() -> Text
string HeightmapDataUsageTokenAspectDegrees()
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Heightmap Data Usage Token Convexity
FunctionUsage of a raw convexity field, in metres above the local mean.
HeightmapDataUsageTokenConvexity() -> Text
string HeightmapDataUsageTokenConvexity()
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Heightmap Data Usage Token Curvature
FunctionUsage of a raw curvature field, in 1/metre.
HeightmapDataUsageTokenCurvature() -> Text
string HeightmapDataUsageTokenCurvature()
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Heightmap Data Usage Token Distance
FunctionUsage of a distance field, in metres.
HeightmapDataUsageTokenDistance() -> Text
string HeightmapDataUsageTokenDistance()
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Calculate Ambient Occlusion
FunctionMeasures how much of the sky each cell sees, by marching the horizon in several directions: 1 in the open, darker in valleys, gorges and at the foot of cliffs.
CalculateAmbientOcclusion -> Scalar Field
source: Scalar Field
radiusMetres: Number
directions: Integer
steps: Integer
strength: NumberScalarField2D CalculateAmbientOcclusion(
ScalarField2D source,
double radiusMetres = 300,
int directions = 16,
int steps = 16,
double strength = 1)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Heightmap in metres. |
| radiusMetres | Number | 300 | How far in metres to look for occluders; larger lets whole mountains shade a valley. |
| directions | Integer | 16 | Number of horizon directions (8 to 32). |
| steps | Integer | 16 | Samples per direction (8 to 32), spaced geometrically so near ground is sampled densely. |
| strength | Number | 1 | Scales the darkening: 1 is physical, above 1 deepens it. |
Returns
| result | Scalar Field |
Remarks
For each direction, samples at geometrically spaced distances (from one cell out to Radius Metres) find the highest elevation angle θ of the horizon; the visibility is 1 − mean(sin θ). The result drives dirt, moss and darkening; invert it for a cavity mask. Beyond the map border the edge cells are taken to continue outward. Cost grows with directions × steps.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Calculate Aspect Degrees
FunctionGives the compass direction each slope faces (its downhill direction), in degrees clockwise from north.
CalculateAspectDegrees -> Scalar Field
source: Scalar Field
heightmapYPointsNorth: TruthScalarField2D CalculateAspectDegrees(
ScalarField2D source,
bool heightmapYPointsNorth = true)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Heightmap in metres. |
| heightmapYPointsNorth | Truth | True | True when increasing row index points north; false for north-up images. |
Returns
| result | Scalar Field |
Remarks
0 faces north, 90 east, 180 south, 270 west; flat cells, which face nowhere, read -1. East is +X (increasing column). By default north is +Y (increasing row), the convention ToHillshade and BakeShadowMap use, so a slope whose aspect equals a hillshade's azimuth is the one that hillshade lights; for an ordinary north-up raster image, where row 0 is the northern edge, set Heightmap Y Points North to false.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Calculate Convexity
FunctionMeasures how far each cell stands above (positive) or below (negative) the Gaussian-weighted mean height around it, in metres.
CalculateConvexity -> Scalar Field
source: Scalar Field
radiusMetres: NumberScalarField2D CalculateConvexity(
ScalarField2D source,
double radiusMetres = 50)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Heightmap in metres. |
| radiusMetres | Number | 50 | Standard deviation in metres of the neighbourhood the height is compared with; it sets the size of feature selected. |
Returns
| result | Scalar Field |
Remarks
This is the difference between the height and a blur of it, the classic convexity selector: crests, ridges and knobs come out positive, gullies, channels and valley floors negative. Unlike curvature it needs no differentiation, so it is robust on quantised imports.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Calculate Curvature
FunctionMeasures the surface curvature of a heightmap in 1/metre, positive on convex ground and negative on concave ground.
CalculateCurvature -> Scalar Field
source: Scalar Field
type: Terrain Curvature Type
scaleMetres: NumberScalarField2D CalculateCurvature(
ScalarField2D source,
TerrainCurvatureType type = TerrainCurvatureType.Mean,
double scaleMetres = 20)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Heightmap in metres. |
| type | Terrain Curvature Type | Mean | Profile (down the slope), Plan (across it) or Mean. |
| scaleMetres | Number | 20 | Standard deviation in metres of a Gaussian applied before differentiating; 0 uses the raw cells. |
Returns
| result | Scalar Field |
Remarks
Second derivatives come from the 3×3 neighbourhood (Evans–Young / Zevenbergen–Thorne) with the cell size in metres. Imported heightmaps are quantised (a 16-bit file over 2.6 km of relief steps in 4 cm), and second derivatives amplify that into noise, so smooth first: Scale Metres sets the size of landform the curvature describes, from rocks (a few metres) to whole ridges (hundreds). Profile and plan curvature are undefined on perfectly flat ground and read 0 there.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Calculate Distance
FunctionMeasures the exact straight-line distance in metres from every cell to the nearest cell of a mask.
CalculateDistance -> Scalar Field
mask: Scalar Field
threshold: Number
signed: TruthScalarField2D CalculateDistance(
ScalarField2D mask,
double threshold = 0.5,
bool signed = false)Parameters
| name | type | default | description |
|---|---|---|---|
| mask | Scalar Field | — | Mask to measure from, such as water, roads or rock. |
| threshold | Number | 0.5 | Value at or above which a cell belongs to the mask. |
| signed | Truth | False | If true, distances inside the mask are negative distances to its edge. |
Returns
| result | Scalar Field |
Remarks
Cells at or above Threshold belong to the mask. The transform is exact Euclidean (Felzenszwalb–Huttenlocher), so distances grow in circles, not diamonds or octagons. Unsigned, mask cells read 0 and the cells beside them one cell width (distances run between cell centres). Signed, the mask's inside is negative and both sides are measured from the boundary halfway between cells, so the field is continuous across it. With no mask cells at all, every cell reads the map's diagonal.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Select Aspect
FunctionSelects slopes facing a compass direction: a 0..1 mask, for north-facing snow, sun-facing dry grass, moss on shaded sides.
SelectAspect -> Scalar Field
source: Scalar Field
headingDegrees: Number
spreadDegrees: Number
falloffDegrees: Number
minSlopeDegrees: Number
slopeFalloffDegrees: Number
heightmapYPointsNorth: TruthScalarField2D SelectAspect(
ScalarField2D source,
double headingDegrees = 0,
double spreadDegrees = 45,
double falloffDegrees = 30,
double minSlopeDegrees = 3,
double slopeFalloffDegrees = 5,
bool heightmapYPointsNorth = true)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Heightmap in metres. |
| headingDegrees | Number | 0 | Direction the selected slopes face, degrees clockwise from north. |
| spreadDegrees | Number | 45 | Half-width in degrees of the fully selected sector. |
| falloffDegrees | Number | 30 | Degrees beyond the spread over which the mask fades to 0. |
| minSlopeDegrees | Number | 3 | Steepness in degrees below which ground counts as flat and is not selected. |
| slopeFalloffDegrees | Number | 5 | Degrees above the minimum slope over which the selection fades in. |
| heightmapYPointsNorth | Truth | True | True when increasing row index points north; false for north-up images. |
Returns
| result | Scalar Field |
Remarks
A slope scores 1 when its aspect is within Spread Degrees of the heading, fading to 0 over a further Falloff Degrees. Flat ground has no meaningful aspect, so the score is also faded in with steepness, from Min Slope Degrees over Slope Falloff Degrees. See HeightmapSelectors.CalculateAspectDegrees for the axis convention.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Select Convexity
FunctionSelects ridges or gullies by convexity: a 0..1 mask that lights crests and darkens channels (Signed), or keeps one side only.
SelectConvexity -> Scalar Field
source: Scalar Field
radiusMetres: Number
polarity: Heightmap Selector Polarity
contrast: Number
referenceMetres: NumberScalarField2D SelectConvexity(
ScalarField2D source,
double radiusMetres = 50,
HeightmapSelectorPolarity polarity = HeightmapSelectorPolarity.Signed,
double contrast = 1,
double referenceMetres = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Heightmap in metres. |
| radiusMetres | Number | 50 | Size of feature to respond to: standard deviation in metres of the neighbourhood. |
| polarity | Heightmap Selector Polarity | Signed | Convex, Concave, or Signed (0.5 is neither). |
| contrast | Number | 1 | Multiplier before saturation; higher makes the mask harder. |
| referenceMetres | Number | 0 | Height above the local mean that maps to tanh(1) ≈ 0.76; 0 picks it from the field. |
Returns
| result | Scalar Field |
Remarks
The convexity (metres above the local mean) is divided by a reference height and passed through tanh. With the reference left at 0 it is the field's own 90th percentile of |convexity|; give it in metres (e.g. 5) when separate tiles must agree.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Select Curvature
FunctionSelects convex or concave ground by its curvature: a 0..1 mask.
SelectCurvature -> Scalar Field
source: Scalar Field
type: Terrain Curvature Type
scaleMetres: Number
polarity: Heightmap Selector Polarity
contrast: Number
referenceCurvature: NumberScalarField2D SelectCurvature(
ScalarField2D source,
TerrainCurvatureType type = TerrainCurvatureType.Mean,
double scaleMetres = 20,
HeightmapSelectorPolarity polarity = HeightmapSelectorPolarity.Convex,
double contrast = 1,
double referenceCurvature = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| source | Scalar Field | — | Heightmap in metres. |
| type | Terrain Curvature Type | Mean | Profile, Plan or Mean curvature. |
| scaleMetres | Number | 20 | Size of landform to respond to: standard deviation in metres of the smoothing applied first. |
| polarity | Heightmap Selector Polarity | Convex | Convex, Concave, or Signed (0.5 is flat). |
| contrast | Number | 1 | Multiplier before saturation; higher makes the mask harder and wider. |
| referenceCurvature | Number | 0 | Curvature in 1/metre that maps to tanh(1) ≈ 0.76 (Convex/Concave); 0 picks it from the field. |
Returns
| result | Scalar Field |
Remarks
The curvature is divided by a reference curvature and passed through tanh, so the mask saturates smoothly instead of clipping. With the reference left at 0 it is the field's own 90th percentile of |curvature|, which adapts to any terrain but differs between tiles; give an explicit reference (in 1/metre, e.g. 0.002 for a 500 m bending radius) when tiles must match.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation
Select Distance Band
FunctionSelects a band of ground at a distance range from a mask: shore strips beside water, riverbank sediment, verges along roads, scree aprons below rock.
SelectDistanceBand -> Scalar Field
mask: Scalar Field
minMetres: Number
maxMetres: Number
falloffMetres: Number
threshold: NumberScalarField2D SelectDistanceBand(
ScalarField2D mask,
double minMetres = 0,
double maxMetres = 30,
double falloffMetres = 10,
double threshold = 0.5)Parameters
| name | type | default | description |
|---|---|---|---|
| mask | Scalar Field | — | Mask to measure from. |
| minMetres | Number | 0 | Inner edge of the band, metres from the mask. |
| maxMetres | Number | 30 | Outer edge of the band, metres from the mask. |
| falloffMetres | Number | 10 | Width in metres of the fade on each side. |
| threshold | Number | 0.5 | Value at or above which a cell belongs to the mask. |
Returns
| result | Scalar Field |
Remarks
Built on HeightmapSelectors.CalculateDistance. The band is fully selected between Min Metres and Max Metres from the mask and fades over Falloff Metres on each side; with a minimum of 0 the mask itself is included and only the outer edge fades.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Heightmap Selectors
- Package
- Procedural Generation