Divooka Reference

Scalar Field

61 nodes

On this page 61

Physical Scale

Function

Meters per unit cell.
This applies only to width and "height" of the heightmap grid, not physical height.

Signature
PhysicalScale(Scalar Field: Scalar Field) -> Number
double PhysicalScale(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber

Remarks

Recommended range for large scale terrain work: 1m/px to 10m/px.
As a reference, a 2K heightmap representing 4km square landscape should use a ScalarField2D.PhysicalScale of 2, aka. 2 meters per unit cell.

Use lower value (e.g. 0.5) if we wish to represent dense details on smaller regions.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Make Scalar Field

Function

Overload 1 of 2

Signature
ScalarField2D(width: Integer, height: Integer) -> Scalar Field
ScalarField2D ScalarField2D(int width, int height)

Initializes a new instance of the Heightmap class with the specified dimensions.

Parameters

nametypedefaultdescription
widthInteger—The width (number of columns) of the heightmap.
heightInteger—The height (number of rows) of the heightmap.

Returns

resultScalar Field

Overload 2 of 2

Signature
ScalarField2D(initialData: Number Array Array) -> Scalar Field
ScalarField2D ScalarField2D(double[][] initialData)

Initializes a new instance of the Heightmap class with the specified data.

Parameters

nametypedefaultdescription
initialDataNumber Array Array—A jagged array of doubles representing the heightmap data.

Returns

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

Add

Function

Adds another heightmap to this heightmap, element-wise.

Signature
Add(Scalar Field: Scalar Field, other: Scalar Field)
void Add(ScalarField2D Scalar Field, ScalarField2D other)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
otherScalar Field—The other heightmap to add.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Apply

Function

Applies a custom transformation function to each height value in the heightmap.

Overload 1 of 2

Signature
Apply
    Scalar Field: Scalar Field
    transform: Func<Number, Number>
void Apply(
    ScalarField2D Scalar Field,
    Func<double, double> transform)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
transformFunc<Number, Number>—The function to apply to each height value.

Overload 2 of 2

Signature
Apply
    Scalar Field: Scalar Field
    transform: Func<Integer, Integer, Number, Number>
void Apply(
    ScalarField2D Scalar Field,
    Func<int, int, double, double> transform)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
transformFunc<Integer, Integer, Number, Number>—The function to apply to each height value.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Clone

Function

Clones the heightmap, creating a deep copy.

Signature
Clone(Scalar Field: Scalar Field) -> Scalar Field
ScalarField2D Clone(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

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

Create Template

Function

Creates a heightmap with same dimensions and attributes but initialized with fresh empty data.

Signature
CreateTemplate -> Scalar Field
    Scalar Field: Scalar Field
    newUsage: Text
ScalarField2D CreateTemplate(
    ScalarField2D Scalar Field,
    string newUsage)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
newUsageText—

Returns

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

Crop

Function

Crops the heightmap to the specified rectangular region.

Signature
Crop -> Scalar Field
    Scalar Field: Scalar Field
    startX: Integer
    startY: Integer
    cropWidth: Integer
    cropHeight: Integer
ScalarField2D Crop(
    ScalarField2D Scalar Field,
    int startX,
    int startY,
    int cropWidth,
    int cropHeight)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
startXInteger—The starting x-coordinate (column index).
startYInteger—The starting y-coordinate (row index).
cropWidthInteger—The width of the cropped region.
cropHeightInteger—The height of the cropped region.

Returns

resultScalar Field
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Erode Brush

Function

Overload 1 of 2

Signature
ErodeBrush
    Scalar Field: Scalar Field
    centerX: Integer
    centerY: Integer
    radius: Integer
    falloff: Number
    brushShape: ScalarField2D.PaintbrushShape
void ErodeBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Simple erosion

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
centerXInteger—
centerYInteger—
radiusInteger—
falloffNumber—
brushShapeScalarField2D.PaintbrushShapeCircle

Overload 2 of 2

Signature
ErodeBrush
    Scalar Field: Scalar Field
    centerX: Integer
    centerY: Integer
    radius: Integer
    falloff: Number
    iterations: Integer
    talusAngle: Number
    erosionFactor: Number
    brushShape: ScalarField2D.PaintbrushShape
void ErodeBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    int iterations,
    double talusAngle,
    double erosionFactor,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Applies thermal erosion within a brush area.

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
centerXInteger—The x-coordinate of the brush center.
centerYInteger—The y-coordinate of the brush center.
radiusInteger—The radius of the brush.
falloffNumber—The fall-off parameter (0 to 1).
iterationsInteger—The number of erosion iterations to perform.
talusAngleNumber—The maximum stable slope (in height units).
erosionFactorNumber—Controls how much material moves per iteration (0 to 1).
brushShapeScalarField2D.PaintbrushShapeCircleThe shape of the brush ("circle" or "rectangle").
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Flatten Brush

Function

Flattens the terrain within a brush area to a target height.

Signature
FlattenBrush
    Scalar Field: Scalar Field
    centerX: Integer
    centerY: Integer
    radius: Integer
    falloff: Number
    targetHeight: Number
    brushShape: ScalarField2D.PaintbrushShape
void FlattenBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    double targetHeight,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
centerXInteger—The x-coordinate of the brush center.
centerYInteger—The y-coordinate of the brush center.
radiusInteger—The radius of the brush.
falloffNumber—The fall-off parameter (0 to 1).
targetHeightNumber—The target height to flatten to.
brushShapeScalarField2D.PaintbrushShapeCircleThe shape of the brush ("circle" or "rectangle").
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Columns

Function

Gets the width of the heightmap (number of columns).

Signature
Columns(Scalar Field: Scalar Field) -> Integer
int Columns(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Data

Function

Row-major: height (y), width (x).

Signature
Data(Scalar Field: Scalar Field) -> Number Array Array
double[][] Data(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber Array Array

Remarks

Every read of the values goes through here, the field's own members' included, so a field whose values are kept elsewhere - on the graphics card, where a GPU kernel left them (round 26) - brings them here the first time anything reads it, and from then on is an ordinary field.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Elevations

Function

This node carries no documentation.

Signature
Elevations(Scalar Field: Scalar Field) -> ScalarField2D.ElevationRange
ScalarField2D.ElevationRange Elevations(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultScalarField2D.ElevationRange
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Is Normalized

Function

Gets whether all values in this scalar field are valid normalized values in the inclusive 0..1 range.

Signature
IsNormalized(Scalar Field: Scalar Field) -> Truth
bool IsNormalized(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultTruth

Remarks

This does not require the field minimum to be exactly 0 or the maximum to be exactly 1.
A constant mask value such as 0.5 is considered normalized because it is already directly usable as opacity.

Non-finite values are never considered normalized.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Is Square

Function

Occassionally useful due to output engine requirements - some usage scenarios require square maps.

Signature
IsSquare(Scalar Field: Scalar Field) -> Truth
bool IsSquare(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Item

Function

Gets or sets the height value at the specified (x, y) coordinate.

Signature
Item -> Number
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
double Item(ScalarField2D Scalar Field, int x, int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—The x-coordinate (column index).
yInteger—The y-coordinate (row index).

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Rows

Function

Gets the height of the heightmap (number of rows).

Signature
Rows(Scalar Field: Scalar Field) -> Integer
int Rows(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Usage

Function

An indicator what this heightmap is used for.
Some valid values: Height, Mask, Slope/Steepness, Wetness, etc.

Signature
Usage(Scalar Field: Scalar Field) -> Text
string Usage(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultText

Remarks

Currently only for display purpose; No functional distinction.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get World Depth

Function

This node carries no documentation.

Signature
WorldDepth(Scalar Field: Scalar Field) -> Number
double WorldDepth(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get World Width

Function

This node carries no documentation.

Signature
WorldWidth(Scalar Field: Scalar Field) -> Number
double WorldWidth(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Angle Degree

Function

Calculates the slope angle in degrees based on the gradient at a given point.

Signature
GetAngleDegree -> Number
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
double GetAngleDegree(ScalarField2D Scalar Field, int x, int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—The x-coordinate (column index).
yInteger—The y-coordinate (row index).

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Average Height

Function

Gets the average height value of the heightmap.

Signature
GetAverageHeight(Scalar Field: Scalar Field) -> Number
double GetAverageHeight(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Color

Function

This node carries no documentation.

Signature
GetColor -> Color
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
ColorElement GetColor(ScalarField2D Scalar Field, int x, int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—
yInteger—

Returns

resultColor
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Data As Arrays

Function

Gets a copy of data.

Signature
GetDataAsArrays(Scalar Field: Scalar Field) -> Number Array Array
double[][] GetDataAsArrays(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber Array Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Data As Arrays LD

Function

Gets a copy of data in floats.

Signature
GetDataAsArraysLD(Scalar Field: Scalar Field) -> Low Accuracy Number Array Array
float[][] GetDataAsArraysLD(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultLow Accuracy Number Array Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Float Value

Function

This is very slow!

Signature
GetFloatValue -> Low Accuracy Number
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
float GetFloatValue(ScalarField2D Scalar Field, int x, int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—
yInteger—

Returns

resultLow Accuracy Number

Remarks

Currently this is very slow, e.g. when used with `PixelImageSampling.GetGrayClamped` on `ImageFilter.DirectionalGradientSmudge`. It's recommended to conver the Topology.ScalarField2D to a grayscale image first.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Gradient

Function

Gets the gradient (partial derivatives) at the specified (x, y) coordinate.

Signature
GetGradient -> (Number, Number)
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
    usePhysicalScale: Truth
(double, double) GetGradient(
    ScalarField2D Scalar Field,
    int x,
    int y,
    bool usePhysicalScale = true)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—The x-coordinate (column index).
yInteger—The y-coordinate (row index).
usePhysicalScaleTruthTrue

Returns

result(Number, Number)
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Gradient Magnitude

Function

This node carries no documentation.

Signature
GetGradientMagnitude -> Number
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
    usePhysicalScale: Truth
double GetGradientMagnitude(
    ScalarField2D Scalar Field,
    int x,
    int y,
    bool usePhysicalScale)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—
yInteger—
usePhysicalScaleTruth—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Gray Byte

Function

This node carries no documentation.

Signature
GetGrayByte -> Byte
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
byte GetGrayByte(ScalarField2D Scalar Field, int x, int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—
yInteger—

Returns

resultByte
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Height Change

Function

This node carries no documentation.

Signature
GetHeightChange -> Number
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
double GetHeightChange(ScalarField2D Scalar Field, int x, int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—
yInteger—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Max Height

Function

Gets the maximum height value in the heightmap.

Signature
GetMaxHeight(Scalar Field: Scalar Field) -> Number
double GetMaxHeight(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber

Remarks

Consider using ScalarField2D.Elevations

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Min Height

Function

Gets the minimum height value in the heightmap.

Signature
GetMinHeight(Scalar Field: Scalar Field) -> Number
double GetMinHeight(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber

Remarks

Consider using ScalarField2D.Elevations

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Normal

Function

Overload 1 of 2

Signature
GetNormal -> (Number, Number, Number)
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
(double, double, double) GetNormal(
    ScalarField2D Scalar Field,
    int x,
    int y)

Gets the normal vector at the specified (x, y) coordinate.

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—The x-coordinate (column index).
yInteger—The y-coordinate (row index).

Returns

result(Number, Number, Number)

Overload 2 of 2

Signature
GetNormal -> Vector3dhd
    Scalar Field: Scalar Field
    p1: Vector3dhd
    p2: Vector3dhd
    p3: Vector3dhd
Vector3DHD GetNormal(
    ScalarField2D Scalar Field,
    Vector3DHD p1,
    Vector3DHD p2,
    Vector3DHD p3)

Computes the normal vector of a triangle defined by three 3D points.
Points should be specified in counter-clockwise order to ensure the normal points outward (right-hand rule).

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
p1Vector3dhd—
p2Vector3dhd—
p3Vector3dhd—

Returns

resultVector3dhd
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Physical Height Change

Function

This node carries no documentation.

Signature
GetPhysicalHeightChange -> Number
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
double GetPhysicalHeightChange(
    ScalarField2D Scalar Field,
    int x,
    int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—
yInteger—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Value

Function

Gets the height value at the specified (x, y) coordinate.

Signature
GetValue -> Number
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
double GetValue(ScalarField2D Scalar Field, int x, int y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—The x-coordinate (column index).
yInteger—The y-coordinate (row index).

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Z

Function

This node carries no documentation.

Signature
GetZ -> Low Accuracy Number
    Scalar Field: Scalar Field
    x: Low Accuracy Number
    y: Low Accuracy Number
float GetZ(ScalarField2D Scalar Field, float x, float y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xLow Accuracy Number—
yLow Accuracy Number—

Returns

resultLow Accuracy Number
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Interpolate Height

Function

Interpolates the height value at the specified (x, y) coordinate using bilinear interpolation.

Signature
InterpolateHeight -> Number
    Scalar Field: Scalar Field
    x: Number
    y: Number
double InterpolateHeight(
    ScalarField2D Scalar Field,
    double x,
    double y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xNumber—The x-coordinate (can be fractional).
yNumber—The y-coordinate (can be fractional).

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Noise Brush

Function

This node carries no documentation.

Signature
NoiseBrush
    Scalar Field: Scalar Field
    centerX: Integer
    centerY: Integer
    radius: Integer
    falloff: Number
    noiseAmplitude: Number
    brushShape: ScalarField2D.PaintbrushShape
void NoiseBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    double noiseAmplitude,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
centerXInteger—
centerYInteger—
radiusInteger—
falloffNumber—
noiseAmplitudeNumber—
brushShapeScalarField2D.PaintbrushShapeCircle
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Normalize In Place With Clamp

Function

Normalizes every value in _heightData in place so the result is between 0.0 and 1.0 (as specified by Max Value).
For data values smaller than zero, it becomes 0.

Signature
NormalizeInPlaceWithClamp
    Scalar Field: Scalar Field
    maxValue: Number
void NormalizeInPlaceWithClamp(
    ScalarField2D Scalar Field,
    double maxValue)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
maxValueNumber—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Raise Lower Brush

Function

Raises or lowers the terrain within a brush area.

Signature
RaiseLowerBrush
    Scalar Field: Scalar Field
    centerX: Integer
    centerY: Integer
    radius: Integer
    falloff: Number
    deltaHeight: Number
    brushShape: ScalarField2D.PaintbrushShape
void RaiseLowerBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    double deltaHeight,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
centerXInteger—The x-coordinate of the brush center.
centerYInteger—The y-coordinate of the brush center.
radiusInteger—The radius of the brush.
falloffNumber—The fall-off parameter (0 to 1).
deltaHeightNumber—The amount to raise or lower the height.
brushShapeScalarField2D.PaintbrushShapeCircleThe shape of the brush ("circle" or "rectangle").
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Resize

Function

Overload 1 of 2

Signature
Resize
    Scalar Field: Scalar Field
    newWidth: Integer
    newHeight: Integer
void Resize(
    ScalarField2D Scalar Field,
    int newWidth,
    int newHeight)

Resizes the heightmap to the specified dimensions using nearest neighbor scaling.

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
newWidthInteger—The new width (number of columns).
newHeightInteger—The new height (number of rows).

Overload 2 of 2

Signature
Resize
    Scalar Field: Scalar Field
    newWidth: Integer
    newHeight: Integer
    interpolation: ScalarField2D.HeightmapResizeInterpolation
    preserveElevationRange: Truth
void Resize(
    ScalarField2D Scalar Field,
    int newWidth,
    int newHeight,
    ScalarField2D.HeightmapResizeInterpolation interpolation = HeightmapResizeInterpolation.Bilinear,
    bool preserveElevationRange = false)

Resizes the heightmap to the specified dimensions.

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
newWidthInteger—The new width (number of columns).
newHeightInteger—The new height (number of rows).
interpolationScalarField2D.HeightmapResizeInterpolationBilinearInterpolation method.
preserveElevationRangeTruthFalsePrescales result so original min/max elevation remains unchanged. Only neeed as a post to ensure exact min/max elevations, otherwise matters not.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Rotate CCW

Function

Rotates the heightmap data 90 degrees counterclockwise.

Signature
RotateCCW(Scalar Field: Scalar Field)
void RotateCCW(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Rotate CW

Function

Rotates the heightmap data 90 degrees clockwise.

Signature
RotateCW(Scalar Field: Scalar Field)
void RotateCW(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Sample Bilinear Clamped

Function

Bilinearly samples the field using grid coordinates and clamps samples at the outer border.

Signature
SampleBilinearClamped -> Number
    Scalar Field: Scalar Field
    x: Number
    y: Number
double SampleBilinearClamped(
    ScalarField2D Scalar Field,
    double x,
    double y)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xNumber—
yNumber—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Sample World Bilinear Clamped

Function

Bilinearly samples the field using physical world coordinates.
Cell values are treated as samples located at cell centres.

Signature
SampleWorldBilinearClamped -> Number
    Scalar Field: Scalar Field
    worldX: Number
    worldY: Number
double SampleWorldBilinearClamped(
    ScalarField2D Scalar Field,
    double worldX,
    double worldY)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
worldXNumber—
worldYNumber—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Scale Heights

Function

Scales the heightmap vertically by the specified factor.

Signature
ScaleHeights(Scalar Field: Scalar Field, scale: Number)
void ScaleHeights(ScalarField2D Scalar Field, double scale)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
scaleNumber—The scale factor to apply.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Set Value

Function

Sets the height value at the specified (x, y) coordinate.

Signature
SetValue
    Scalar Field: Scalar Field
    x: Integer
    y: Integer
    value: Number
void SetValue(
    ScalarField2D Scalar Field,
    int x,
    int y,
    double value)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
xInteger—The x-coordinate (column index).
yInteger—The y-coordinate (row index).
valueNumber—The height value to set.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Smooth

Function

Smooths the heightmap using a simple averaging filter.

Signature
Smooth(Scalar Field: Scalar Field)
void Smooth(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Smooth Brush

Function

Applies a smoothing operation within a brush area.

Signature
SmoothBrush
    Scalar Field: Scalar Field
    centerX: Integer
    centerY: Integer
    radius: Integer
    falloff: Number
    brushShape: ScalarField2D.PaintbrushShape
void SmoothBrush(
    ScalarField2D Scalar Field,
    int centerX,
    int centerY,
    int radius,
    double falloff,
    ScalarField2D.PaintbrushShape brushShape = PaintbrushShape.Circle)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
centerXInteger—The x-coordinate of the brush center.
centerYInteger—The y-coordinate of the brush center.
radiusInteger—The radius of the brush.
falloffNumber—The fall-off parameter (0 to 1).
brushShapeScalarField2D.PaintbrushShapeCircleThe shape of the brush ("Circle" or "Rectangle").
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Subdivide

Function

Subdivides each heightmap cell into a finer grid while preserving the overall physical dimensions.

Signature
Subdivide
    Scalar Field: Scalar Field
    factor: Integer
    interpolation: ScalarField2D.HeightmapResizeInterpolation
    preserveElevationRange: Truth
void Subdivide(
    ScalarField2D Scalar Field,
    int factor = 2,
    ScalarField2D.HeightmapResizeInterpolation interpolation = HeightmapResizeInterpolation.Bilinear,
    bool preserveElevationRange = false)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
factorInteger2Number of cells created along each axis for every existing cell. Must be greater than or equal to 1.
interpolationScalarField2D.HeightmapResizeInterpolationBilinearInterpolation method used to generate the additional samples.
preserveElevationRangeTruthFalseRescales the result so the original minimum and maximum elevations remain unchanged.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Summarize

Function

Returns a technical summary of the heightmap, one parameter per line.

Signature
Summarize(Scalar Field: Scalar Field) -> Text
string Summarize(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

To Flatten Array

Function

Flattened array.

Signature
ToFlattenArray(Scalar Field: Scalar Field) -> Number Array
double[] ToFlattenArray(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultNumber Array

Remarks

Used for high-performance purposes.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

To Flatten Array LD

Function

Flattened array.

Signature
ToFlattenArrayLD(Scalar Field: Scalar Field) -> Low Accuracy Number Array
float[] ToFlattenArrayLD(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultLow Accuracy Number Array

Remarks

Used for high-performance purposes.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

To Pixel Image

Function

This node carries no documentation.

Signature
ToPixelImage(Scalar Field: Scalar Field) -> Pixel Image
PixelImage ToPixelImage(ScalarField2D Scalar Field)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Modify as Color Data

Function

This node carries no documentation.

Signature
UpdateColorData
    Scalar Field: Scalar Field
    updater: Func<Color Array Array, Color Array Array>
void UpdateColorData(
    ScalarField2D Scalar Field,
    Func<ColorElement[][], ColorElement[][]> updater)

Parameters

nametypedefaultdescription
Scalar FieldScalar Field—
updaterFunc<Color Array Array, Color Array Array>—

Remarks

Converts the current heightmap into a grayscale image, lets caller-provided code modify that image, then writes the modified grayscale values back into the heightmap as heights.
Per IPixelImageSampler.UpdateColorData.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Create Derived Map

Function

This node carries no documentation.

Signature
CreateDerivedMap -> Scalar Field
    source: Scalar Field
    usage: Text
ScalarField2D CreateDerivedMap(
    ScalarField2D source,
    string usage)

Parameters

nametypedefaultdescription
sourceScalar Field—
usageText—

Returns

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

From Arrays

Function

This node carries no documentation.

Signature
FromArrays -> Scalar Field
    initialData: Low Accuracy Number Array Array
    usage: Text
    physicalScale: Number
ScalarField2D FromArrays(
    float[][] initialData,
    string usage = "Height",
    double physicalScale = 1)

Parameters

nametypedefaultdescription
initialDataLow Accuracy Number Array Array—
usageTextHeight
physicalScaleNumber1

Returns

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

Generate Biome Texture

Function

This node carries no documentation.

Signature
GenerateBiomeTexture(heightmap: Scalar Field) -> Pixel Image
PixelImage GenerateBiomeTexture(ScalarField2D heightmap)

Parameters

nametypedefaultdescription
heightmapScalar Field—

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Generate Biome Texture Gradient

Function

This node carries no documentation.

Signature
GenerateBiomeTextureGradient(heightmap: Scalar Field) -> Pixel Image
PixelImage GenerateBiomeTextureGradient(ScalarField2D heightmap)

Parameters

nametypedefaultdescription
heightmapScalar Field—

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Get Slope Map Usage Token

Function

Returns the canonical usage/term string for a slope map type.

Signature
GetSlopeMapUsageToken(slopeMapType: Slope Map Type) -> Text
string GetSlopeMapUsageToken(ScalarField2D.SlopeMapType slopeMapType)

Parameters

nametypedefaultdescription
slopeMapTypeSlope Map Type—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

To Grayscale Pixel Image

Function

This node carries no documentation.

Signature
ToGrayscalePixelImage(heightmap: Scalar Field) -> Pixel Image
PixelImage ToGrayscalePixelImage(ScalarField2D heightmap)

Parameters

nametypedefaultdescription
heightmapScalar Field—

Returns

resultPixel Image
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation

Validate Physical Scale

Function

This node carries no documentation.

Signature
ValidatePhysicalScale
    source: Scalar Field
    usePhysicalScale: Truth
void ValidatePhysicalScale(
    ScalarField2D source,
    bool usePhysicalScale)

Parameters

nametypedefaultdescription
sourceScalar Field—
usePhysicalScaleTruth—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Scalar Field
Package
Procedural Generation