Divooka Reference

Texture Fields

9 nodes

On this page 9

Bevel

Function

Raises a flat shape into a bevelled one: at the edge it is 0, climbing over the bevel's distance to 1 across its top. The profile sets the bevel's cross-section. How bricks, tiles and panels get their rounded edges.

Signature
Bevel -> Texture
    mask: Texture
    distance: Number
    profile: Bevel Profile
    threshold: Number
Texture Bevel(
    Texture mask,
    double distance = 12,
    BevelProfile profile = BevelProfile.Round,
    double threshold = 0.5)

Parameters

nametypedefaultdescription
maskTexture—The shape: white is inside.
distanceNumber12How far in the bevel reaches, in pixels of a 1024-pixel texture.
profileBevel ProfileRoundThe bevel's cross-section.
thresholdNumber0.5The value above which the mask counts as inside.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Distance Field

Function

How far each pixel is from the nearest white pixel of a mask, measured across the tile's edges: 0 on the shape, rising to 1 at the maximum distance. Grows outlines, glows and spreads.

Signature
DistanceField -> Texture
    mask: Texture
    maximumDistance: Number
    threshold: Number
Texture DistanceField(
    Texture mask,
    double maximumDistance = 32,
    double threshold = 0.5)

Parameters

nametypedefaultdescription
maskTexture—The shape: white (above the threshold) is inside.
maximumDistanceNumber32The distance that reads as 1, in pixels of a 1024-pixel texture.
thresholdNumber0.5The value above which the mask counts as inside.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Flood Fill

Function

Finds every separate white shape in a mask - each brick, each stone, each tile - so each can be given its own colour, tilt or height. Shapes that run off one edge and back on the other are one shape.

Signature
FloodFill(mask: Texture, threshold: Number) -> Flood Fill
FloodFillMap FloodFill(Texture mask, double threshold = 0.5)

Parameters

nametypedefaultdescription
maskTexture—The shapes, white on black.
thresholdNumber0.5The value above which a pixel belongs to a shape.

Returns

resultFlood Fill
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Flood Fill Count

Function

How many separate shapes a flood fill found.

Signature
FloodFillCount(fill: Flood Fill) -> Integer
int FloodFillCount(FloodFillMap fill)

Parameters

nametypedefaultdescription
fillFlood Fill—The flood fill.

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Flood Fill To Gradient

Function

A gradient across each shape a flood fill found, each at its own random angle: lifts one side of every brick, stone or plank, so they no longer lie flat in the same plane.

Signature
FloodFillToGradient -> Texture
    fill: Flood Fill
    angle: Number
    angleRandomness: Number
    seed: Integer
Texture FloodFillToGradient(
    FloodFillMap fill,
    double angle = 0,
    double angleRandomness = 1,
    int seed = 0)

Parameters

nametypedefaultdescription
fillFlood Fill—The flood fill.
angleNumber0The gradient's direction in degrees before the randomness.
angleRandomnessNumber1How far each shape's direction strays, 0 (all the same) to 1 (any direction).
seedInteger0Which random angles.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Flood Fill To Position

Function

Each shape's centre as a colour: red is how far across, green how far down, so a texture can be sampled once per shape at its centre.

Signature
FloodFillToPosition(fill: Flood Fill) -> Texture
Texture FloodFillToPosition(FloodFillMap fill)

Parameters

nametypedefaultdescription
fillFlood Fill—The flood fill.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Flood Fill To Random Color

Function

A random colour for each shape a flood fill found; black between shapes. For telling shapes apart, or as a material ID.

Signature
FloodFillToRandomColor -> Texture
    fill: Flood Fill
    seed: Integer
Texture FloodFillToRandomColor(FloodFillMap fill, int seed = 0)

Parameters

nametypedefaultdescription
fillFlood Fill—The flood fill.
seedInteger0Which random colours.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Flood Fill To Random Grey

Function

A random grey for each shape a flood fill found, the same over the whole shape; black between shapes. Per-brick variation of height, colour or roughness.

Signature
FloodFillToRandomGrey -> Texture
    fill: Flood Fill
    seed: Integer
Texture FloodFillToRandomGrey(FloodFillMap fill, int seed = 0)

Parameters

nametypedefaultdescription
fillFlood Fill—The flood fill.
seedInteger0Which random values.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing

Flood Fill To Size

Function

Each shape's size: the larger side of its bounding box as a share of the texture. Small shapes dark, large ones bright; for treating pebbles and boulders differently.

Signature
FloodFillToSize(fill: Flood Fill) -> Texture
Texture FloodFillToSize(FloodFillMap fill)

Parameters

nametypedefaultdescription
fillFlood Fill—The flood fill.

Returns

resultTexture
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Texture Fields
Package
Image Processing