Divooka Reference

Texture Blending

5 nodes

On this page 5

Arithmetic

Function

Arithmetic between two textures, pixel by pixel.

Signature
Arithmetic -> Texture
    a: Texture
    b: Texture
    operation: Texture Operation
Texture Arithmetic(
    Texture a,
    Texture b,
    TextureOperation operation = TextureOperation.Add)

Parameters

nametypedefaultdescription
aTexture—The first operand.
bTexture—The second operand.
operationTexture OperationAddWhat to compute.

Returns

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

Arithmetic With Value

Function

Arithmetic between a texture and a number, pixel by pixel.

Signature
ArithmeticWithValue -> Texture
    texture: Texture
    value: Number
    operation: Texture Operation
Texture ArithmeticWithValue(
    Texture texture,
    double value = 0.5,
    TextureOperation operation = TextureOperation.Multiply)

Parameters

nametypedefaultdescription
textureTexture—The first operand.
valueNumber0.5The second operand.
operationTexture OperationMultiplyWhat to compute.

Returns

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

Blend

Function

Lays the foreground over the background by a blend mode, as much as the opacity says and only where the mask is white. With no mask, everywhere.

Signature
Blend -> Texture
    foreground: Texture
    background: Texture
    mode: Blend Mode
    opacity: Number
    mask: Texture
Texture Blend(
    Texture foreground,
    Texture background,
    BlendMode mode = BlendMode.Normal,
    double opacity = 1,
    Texture mask)

Parameters

nametypedefaultdescription
foregroundTexture—What is laid on top.
backgroundTexture—What it is laid on; the result takes its size.
modeBlend ModeNormalHow the two combine.
opacityNumber1How much of the blend shows, 0 to 1.
maskTexture—Where it shows: white fully, black not at all. Optional.

Returns

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

Height Blend

Function

The higher of two heights at each pixel, with a soft seam: how stones sit in mortar, how two layers of rock meet. Also answers which one won, as a mask that is white where the second is on top.

Signature
HeightBlend -> (result: Texture, mask: Texture)
    heightA: Texture
    heightB: Texture
    offset: Number
    contrast: Number
Texture HeightBlend(
    Texture heightA,
    Texture heightB,
    out Texture mask,
    double offset = 0,
    double contrast = 0.9)

Parameters

nametypedefaultdescription
heightATexture—The first height.
heightBTexture—The second height.
offsetNumber0Raises the second height before comparing, -1 to 1.
contrastNumber0.9How sharp the seam is, 0 (a broad mix) to 1 (a hard edge).

Returns

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

Lerp

Function

Mixes from the first texture to the second by the mask: black takes the first, white the second.

Signature
Lerp(first: Texture, second: Texture, mask: Texture) -> Texture
Texture Lerp(Texture first, Texture second, Texture mask)

Parameters

nametypedefaultdescription
firstTexture—Where the mask is black.
secondTexture—Where the mask is white.
maskTexture—The mix at each pixel.

Returns

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