Texture Fields
9 nodes
On this page 9
Bevel
FunctionRaises 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.
Bevel -> Texture
mask: Texture
distance: Number
profile: Bevel Profile
threshold: NumberTexture Bevel(
Texture mask,
double distance = 12,
BevelProfile profile = BevelProfile.Round,
double threshold = 0.5)Parameters
| name | type | default | description |
|---|---|---|---|
| mask | Texture | — | The shape: white is inside. |
| distance | Number | 12 | How far in the bevel reaches, in pixels of a 1024-pixel texture. |
| profile | Bevel Profile | Round | The bevel's cross-section. |
| threshold | Number | 0.5 | The value above which the mask counts as inside. |
Returns
| result | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Texture Fields
- Package
- Image Processing
Distance Field
FunctionHow 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.
DistanceField -> Texture
mask: Texture
maximumDistance: Number
threshold: NumberTexture DistanceField(
Texture mask,
double maximumDistance = 32,
double threshold = 0.5)Parameters
| name | type | default | description |
|---|---|---|---|
| mask | Texture | — | The shape: white (above the threshold) is inside. |
| maximumDistance | Number | 32 | The distance that reads as 1, in pixels of a 1024-pixel texture. |
| threshold | Number | 0.5 | The value above which the mask counts as inside. |
Returns
| result | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Texture Fields
- Package
- Image Processing
Flood Fill
FunctionFinds 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.
FloodFill(mask: Texture, threshold: Number) -> Flood Fill
FloodFillMap FloodFill(Texture mask, double threshold = 0.5)
Parameters
| name | type | default | description |
|---|---|---|---|
| mask | Texture | — | The shapes, white on black. |
| threshold | Number | 0.5 | The value above which a pixel belongs to a shape. |
Returns
| result | Flood Fill |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Texture Fields
- Package
- Image Processing
Flood Fill Count
FunctionHow many separate shapes a flood fill found.
FloodFillCount(fill: Flood Fill) -> Integer
int FloodFillCount(FloodFillMap fill)
Parameters
| name | type | default | description |
|---|---|---|---|
| fill | Flood Fill | — | The flood fill. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Texture Fields
- Package
- Image Processing
Flood Fill To Gradient
FunctionA 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.
FloodFillToGradient -> Texture
fill: Flood Fill
angle: Number
angleRandomness: Number
seed: IntegerTexture FloodFillToGradient(
FloodFillMap fill,
double angle = 0,
double angleRandomness = 1,
int seed = 0)Parameters
| name | type | default | description |
|---|---|---|---|
| fill | Flood Fill | — | The flood fill. |
| angle | Number | 0 | The gradient's direction in degrees before the randomness. |
| angleRandomness | Number | 1 | How far each shape's direction strays, 0 (all the same) to 1 (any direction). |
| seed | Integer | 0 | Which random angles. |
Returns
| result | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Texture Fields
- Package
- Image Processing
Flood Fill To Position
FunctionEach 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.
FloodFillToPosition(fill: Flood Fill) -> Texture
Texture FloodFillToPosition(FloodFillMap fill)
Parameters
| name | type | default | description |
|---|---|---|---|
| fill | Flood Fill | — | The flood fill. |
Returns
| result | Texture |
- 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
FunctionA random colour for each shape a flood fill found; black between shapes. For telling shapes apart, or as a material ID.
FloodFillToRandomColor -> Texture
fill: Flood Fill
seed: IntegerTexture FloodFillToRandomColor(FloodFillMap fill, int seed = 0)
Parameters
| name | type | default | description |
|---|---|---|---|
| fill | Flood Fill | — | The flood fill. |
| seed | Integer | 0 | Which random colours. |
Returns
| result | Texture |
- 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
FunctionA 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.
FloodFillToRandomGrey -> Texture
fill: Flood Fill
seed: IntegerTexture FloodFillToRandomGrey(FloodFillMap fill, int seed = 0)
Parameters
| name | type | default | description |
|---|---|---|---|
| fill | Flood Fill | — | The flood fill. |
| seed | Integer | 0 | Which random values. |
Returns
| result | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Texture Fields
- Package
- Image Processing
Flood Fill To Size
FunctionEach 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.
FloodFillToSize(fill: Flood Fill) -> Texture
Texture FloodFillToSize(FloodFillMap fill)
Parameters
| name | type | default | description |
|---|---|---|---|
| fill | Flood Fill | — | The flood fill. |
Returns
| result | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Texture Fields
- Package
- Image Processing