Documentation / Node reference / tex nodes

tex/Builder

Makes a picture, or a 3D texture, from code nodes run once for every pixel.

Builder

The code nodes inside run once for each pixel of the output, and the tex/Output inside says its colour and alpha. code/Globals gives what changes from one pixel to the next: UV, the centre of the pixel being written, from 0 to 1 across the picture. With nothing else wired, a new builder shows a UV gradient.

Up to four pictures can be wired into the builder. Read one with a code/TextureInput: code/TextureTexel reads its pixels exactly, at the pixel being written or next to it, and code/TextureSample2D with a code/Sampler reads it between pixels. code/Globals' InputColor is the picture on input 0 at the pixel being written. A simulation step reads its picture this way, inside a tex/Solver.

With nothing wired into input 0 the builder makes something new, at the size its params say. dimension _2D makes a picture of resolution2D pixels. dimension _3D makes a 3D texture of resolution3D voxels, a block of values you can look at slice by slice in the texture panel: code/Globals then gives uvw, the centre of the voxel being written, from 0 to 1 on each axis, and VoxelPosition, the voxel's whole-number position. A 3D texture is at most 256 voxels on each axis: above that the builder makes it 256 and warns. A 3D output has no mipmaps.

With a picture or a 3D texture wired into input 0, the output takes its dimension and its size, and dimension and both resolutions are greyed out. A 3D input larger than 256 on an axis gives a smaller output, with a warning; the input is read as it is, never resized.

A 3D builder can read 2D pictures on its other inputs, a gradient used as a lookup for example, at the uvw's first two values. A 2D builder cannot read a 3D texture: wiring one into a 2D builder and reading it is refused, with a message naming the input.

Parameters

Name Type What it does
dimension UInt8 UNKNOWN · _1D · _2D · _3D What the builder makes when nothing is wired into input 0. _2D: a picture of resolution2D pixels. _3D: a 3D texture of resolution3D voxels. Greyed out while input 0 is wired, since the output then takes input 0's dimension.
resolution2D Vector2UInt The size of the picture in pixels, width then height, when dimension is _2D. Greyed out while input 0 is wired, since the output then takes input 0's size.
resolution3D Vector3UInt The size of the 3D texture in voxels, on x, y and z, when dimension is _3D. At most 256 on each axis: a larger value is made 256 and the builder warns. Greyed out while input 0 is wired, since the output then takes input 0's size.
outputFormat UInt8 RGBA8Unorm · RGBA16Float · RGBA32Float How each pixel is stored. RGBA8Unorm: 8 bits a channel, for colours to show (the values are clamped to 0 to 1). RGBA16Float: 16-bit floats, for values outside 0 to 1, an environment map or a simulation. RGBA32Float: 32-bit floats, for the most precision; another tex/Builder cannot read it, so convert it to 16-bit floats first.
generateMipmaps Bool Also make the smaller copies of the picture a material reads from a distance. 2D only.
mipmapsFilter UInt8 Box · EnvironmentGGX How the smaller copies are made. Box: each averages four pixels of the one before. EnvironmentGGX: blurred for rougher reflections, for a picture used as an environment map.

Examples

Scenes you can open in the editor that teach this node.

A tex/Builder set to _3D makes a 64 by 64 by 64 texture from code nodes: from code/Globals' UVW, the distance to three centres, softened at each sphere's edge, the largest of the three kept. Open the texture panel to see it slice by slice or raymarched. geo/VolumeFromTexture brings it into the viewer as a volume, rendered as fog on one side and meshed on the other.

tex/Builder code/Globals tex/Output geo/VolumeFromTexture

Materials

A gradient and an ellipse wired into a tex/Builder: inside the ellipse the gradient's colours are inverted, outside they are kept. code/Globals' InputColor reads the gradient pixel for pixel; code/TextureInput gives the ellipse as a texture, which code/TextureSample2D samples.

tex/Builder code/TextureInput code/Globals

Materials

The tex/ReactionDiffusion node grows coral from a few blobs. A map changes the feed and the kill from left to right, so the blobs stay rings and dots on the left and branch into dense coral on the right, and a mask blocks a round rock in the middle, which the coral grows around.

tex/PolyNode tex/Builder code/Noise

Materials Animation

The tex/ReactionDiffusion node grows a pattern in a 64 by 64 by 64 texture: two chemicals spread through the volume and react, and three seeded spheres grow into a maze of folded sheets. The viewer draws them as fog with a mat/Volume, and beside it as a solid with a mat/VolumeSurface, both reading the texture where the GPU wrote it. Open the texture panel to see it slice by slice or raymarched.

tex/PolyNode tex/Solver tex/Builder code/TextureLaplacian mat/Volume mat/VolumeSurface

Materials Animation

See also

This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.