Divooka Reference

Texture Sources

8 nodes

On this page 8

Image As Color

Function

A picture as a colour texture: an 8-bit picture decoded from sRGB to linear light, an HDR picture taken as it is. For a picture of colour - a photograph, a hand-painted texture.

Signature
ImageAsColor -> Texture
    image: I Pixel Image Sampler
    size: Integer
Texture ImageAsColor(IPixelImageSampler image, int size = 0)

Parameters

nametypedefaultdescription
imageI Pixel Image Sampler—The picture.
sizeInteger0Resampled to this size; 0 keeps the picture's own size.

Returns

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

Image As Data

Function

A picture as data: its grey values taken as numbers from 0 to 1 with no decoding. For a picture of a height, a mask or a roughness map.

Signature
ImageAsData -> Texture
    image: I Pixel Image Sampler
    size: Integer
Texture ImageAsData(IPixelImageSampler image, int size = 0)

Parameters

nametypedefaultdescription
imageI Pixel Image Sampler—The picture.
sizeInteger0Resampled to this size; 0 keeps the picture's own size.

Returns

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

Image As Normal

Function

A normal map picture as a normal texture: its colours taken as the vector's components with no decoding.

Signature
ImageAsNormal(image: Pixel Image, directX: Truth) -> Texture
Texture ImageAsNormal(PixelImage image, bool directX = false)

Parameters

nametypedefaultdescription
imagePixel Image—The normal map.
directXTruthFalseWhether the picture follows DirectX's convention (green pointing down), which is flipped here to the OpenGL convention glTF uses.

Returns

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

Linear Gradient

Function

A ramp from 0 to 1 across the texture, repeating a whole number of times so it tiles; mirrored, it rises and falls back instead of jumping.

Signature
LinearGradient -> Texture
    direction: Gradient Direction
    repeats: Integer
    mirrored: Truth
    size: Integer
Texture LinearGradient(
    GradientDirection direction = GradientDirection.Horizontal,
    int repeats = 1,
    bool mirrored = false,
    int size = 1024)

Parameters

nametypedefaultdescription
directionGradient DirectionHorizontalWhich way the ramp runs.
repeatsInteger1How many times the ramp repeats across the texture.
mirroredTruthFalseRise and fall (a triangle) rather than rise and jump back (a saw).
sizeInteger1024Width and height in pixels.

Returns

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

Radial Gradient

Function

A round gradient: 1 at the centre falling to 0 at the radius, measured across the tile's edges so it tiles.

Signature
RadialGradient -> Texture
    centerX: Number
    centerY: Number
    radius: Number
    size: Integer
Texture RadialGradient(
    double centerX = 0.5,
    double centerY = 0.5,
    double radius = 0.5,
    int size = 1024)

Parameters

nametypedefaultdescription
centerXNumber0.5The centre across, 0 to 1.
centerYNumber0.5The centre down, 0 to 1.
radiusNumber0.5Where it reaches 0, as a share of the texture's width.
sizeInteger1024Width and height in pixels.

Returns

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

To Picture

Function

A texture as an ordinary 8-bit picture, for saving or for nodes that take pictures: colour encoded to sRGB, data written as it is.

Signature
ToPicture(texture: Texture) -> Pixel Image
PixelImage ToPicture(Texture texture)

Parameters

nametypedefaultdescription
textureTexture—The texture.

Returns

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

Uniform Color

Function

A colour texture of one colour everywhere. The colour is given as it looks on screen (sRGB) and held in linear light.

Signature
UniformColor(color: Color, size: Integer) -> Texture
Texture UniformColor(ColorElement color, int size = 1024)

Parameters

nametypedefaultdescription
colorColor—The colour.
sizeInteger1024Width and height in pixels.

Returns

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

Uniform Value

Function

A greyscale texture of one value everywhere: a flat height, a constant roughness.

Signature
UniformValue(value: Number, size: Integer) -> Texture
Texture UniformValue(double value = 0.5, int size = 1024)

Parameters

nametypedefaultdescription
valueNumber0.5The value, usually between 0 and 1.
sizeInteger1024Width and height in pixels.

Returns

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