Divooka Reference

Heightmap Texture Sampler

13 nodes

On this page 13

Apply Tiled Texture

Function

Applies a tiled texture over an existing base layer.

Signature
ApplyTiledTexture -> Pixel Image
    baseLayer: Pixel Image
    textureSample: Pixel Image
    transform: Image Transform
    mask: Scalar Field
PixelImage ApplyTiledTexture(
    PixelImage baseLayer,
    PixelImage textureSample,
    ImageTransform transform,
    ScalarField2D mask)

Parameters

nametypedefaultdescription
baseLayerPixel Image—Base layer. Its dimensions decide the final output size.
textureSamplePixel Image—The source texture sample to tile over Base Layer.
transformImage Transform—Texture-placement transform applied in destination pixel space.
maskScalar Field—Optional opacity mask. Must match Base Layer size.

Returns

resultPixel Image

Remarks

Base Layer decides the final output size. Texture Sample is tiled to fit
that size, then composited over Base Layer using normal source-over alpha composition.

With ImageTransform.Identity, one source texture pixel maps to one destination pixel. If the base
layer is larger than Texture Sample, the texture repeats automatically through wrapped sampling.

ImageTransform.Scale controls the visual size of each repeated tile. A scale of (2, 2) makes
each tile twice as large in destination pixels, producing fewer visible repetitions. A scale of (0.5, 0.5)
makes each tile half as large, producing more visible repetitions.

If Mask is provided, it must have the same dimensions as Base Layer.
The mask controls the opacity of the tiled texture before it is composited over the base layer: 0 means no
texture effect, 1 means full tiled texture opacity. If the mask is not already normalized to 0..1, it is
interpreted by rescaling its current elevation range to 0..1.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Heightmap Texture Sampler
Package
Procedural Generation

Quick Texture

Function

Textures a terrain in one step and answers its colour: Divooka's library materials laid by height or by the land's shape, at their true size, baked at a resolution of its own. For the normal, roughness and height maps as well, use Bake Terrain Surface; for materials of your own, give a Terrain Palette.

Signature
AutoLayering -> Pixel Image
    heightField: Scalar Field
    mask: Scalar Field
    scheme: Quick Color Scheme
    palette: Terrain Palette
    bakeSize: Integer
    water: Scalar Field
PixelImage AutoLayering(
    ScalarField2D heightField,
    ScalarField2D mask,
    HeightmapTextureSampler.QuickColorScheme scheme = QuickColorScheme.Height,
    TerrainPalette palette,
    int bakeSize = 2048,
    ScalarField2D water)

Parameters

nametypedefaultdescription
heightFieldScalar Field—Heights in metres; its PhysicalScale must be metres per cell.
maskScalar Field—Not used; kept so that documents saved with it still open.
schemeQuick Color SchemeHeightBy height bands, by the land's shape, or in flat colours.
paletteTerrain Palette—The materials by role; Divooka's default palette when omitted.
bakeSizeInteger2048Pixels across the result; the depth follows the terrain's shape.
waterScalar Field—The water surface in metres, NaN on dry ground, as Terrain Water's Fill gives it in Surface Elevation; give the same to the viewer, which lays it level. Without it there is no water.

Returns

TexturePixel Image

Remarks

Scale is what decides whether this looks convincing or plainly wrong. Each material covers a known width of ground (two metres of forest floor, ninety of rock seen from the air) and the terrain's PhysicalScale says how much ground a cell covers, so the materials are laid at their true size, and each is filtered down to the bake's pixel size before it is sampled. A bake no finer than the terrain shows little but each material's average colour; a bake at twice its width or more lets the textures show.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Heightmap Texture Sampler
Package
Procedural Generation

Composite

Function

Blends two solid images by mask.

Signature
Composite -> Pixel Image
    baseLayer: Pixel Image
    addition: Pixel Image
    mask: Scalar Field
PixelImage Composite(
    PixelImage baseLayer,
    PixelImage addition,
    ScalarField2D mask)

Parameters

nametypedefaultdescription
baseLayerPixel Image—
additionPixel Image—
maskScalar Field—Will use normalized.

Returns

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

Create Tiled Texture

Function

Creates a tiled texture that fits the target pixel size.

Signature
CreateTiledTexture -> Pixel Image
    width: Integer
    height: Integer
    textureSample: Pixel Image
    transform: Image Transform
    mask: Scalar Field
PixelImage CreateTiledTexture(
    int width,
    int height,
    PixelImage textureSample,
    ImageTransform transform,
    ScalarField2D mask)

Parameters

nametypedefaultdescription
widthInteger—The destination width in pixels.
heightInteger—The destination height in pixels.
textureSamplePixel Image—The source texture sample to tile.
transformImage Transform—Texture-placement transform applied in destination pixel space.
maskScalar Field—Optional opacity mask. Must match the destination size.

Returns

resultPixel Image

Remarks

The destination size is authoritative. Repetition is determined automatically from the destination size,
the source texture size, and Transform.

With ImageTransform.Identity, one source pixel maps to one destination pixel. If the destination
is larger than Texture Sample, the texture repeats automatically through wrapped sampling.

ImageTransform.Scale controls the visual size of each repeated tile. A scale of (2, 2) makes
each tile twice as large in destination pixels, producing fewer visible repetitions. A scale of (0.5, 0.5)
makes each tile half as large, producing more visible repetitions.

ImageTransform.Translation is measured in destination pixels.
ImageTransform.Rotation is measured in degrees.
ImageTransform.Pivot is measured in source texture UV space, where (0.5, 0.5) is the center of
one source texture tile.

If Mask is provided, it must have the same dimensions as the destination. The mask is used as
opacity for the tiled texture: 0 means fully transparent, 1 means fully opaque according to the tiled texture's
own alpha. If the mask is not already normalized to 0..1, it is interpreted by rescaling its current elevation
range to 0..1.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Heightmap Texture Sampler
Package
Procedural Generation

Get Beach Texture

Function

This node carries no documentation.

Signature
BeachTexture() -> Pixel Image
PixelImage BeachTexture()

Returns

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

Get Cliff Texture

Function

This node carries no documentation.

Signature
CliffTexture() -> Pixel Image
PixelImage CliffTexture()

Returns

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

Get Deep Water Texture

Function

This node carries no documentation.

Signature
DeepWaterTexture() -> Pixel Image
PixelImage DeepWaterTexture()

Returns

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

Get Dirt Texture

Function

This node carries no documentation.

Signature
DirtTexture() -> Pixel Image
PixelImage DirtTexture()

Returns

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

Get Grassland Texture

Function

This node carries no documentation.

Signature
GrasslandTexture() -> Pixel Image
PixelImage GrasslandTexture()

Returns

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

Get Mountain Texture

Function

This node carries no documentation.

Signature
MountainTexture() -> Pixel Image
PixelImage MountainTexture()

Returns

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

Get Rock Texture

Function

This node carries no documentation.

Signature
RockTexture() -> Pixel Image
PixelImage RockTexture()

Returns

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

Get Shallow Water Texture

Function

This node carries no documentation.

Signature
ShallowWaterTexture() -> Pixel Image
PixelImage ShallowWaterTexture()

Returns

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

Get Snow Texture

Function

This node carries no documentation.

Signature
SnowTexture() -> Pixel Image
PixelImage SnowTexture()

Returns

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