Displace

Shifts the pixels of a texture by the values of another texture.

Outputs

NameTypeDescription
Texture OutputTextureThe distorted texture.

Inputs

NameTypeDescription
Texture InputTextureThe texture to distort.
Displace InputTextureThe texture that says how far to shift each pixel.

Parameters

NameTypeDescription
Output FormatEnumWhether the output takes the size and type of the texture input, of the displace input, or of the settings below.Choices: Copy Input A, Copy Input B, Manual
Texture TypeEnumThe channels of the output texture. Follows an input unless the output format is Manual.Choices: R (u8), RG (u8), RGBA (u8)
Texture SizeVector 2 IntThe size of the output texture in pixels. Follows an input unless the output format is Manual.
Displace ChannelsStringRearranges the channels of the displace input, as four letters from R, G, B, A, 0 and 1. The first two are used for the shift across and down.
StrengthFloatHow far the pixels move. At 1 a displace value of 0 or 1 shifts by half the texture.
Mid PointVector 2The displace value that means no shift, for across and down.

Displace bends a texture by pushing its pixels around, the way heat haze or rippling water bends what is behind it. For every pixel it reads the displace input and moves that far to fetch the color from the texture input. Where the displace input is flat the texture is unchanged, and where it varies the texture stretches and squashes.

The first two channels of the displace input give the shift across and down. Red shifts across and green shifts down, unless the channels are rearranged. A value equal to the mid point means no shift, so with the mid point at 0.5 a darker value pulls one way and a lighter value the other. Strength scales the whole effect. A gray texture such as Noise as the displace input gives a wobbly, watery distortion, and animating the noise makes it flow.

Pixels pushed past the edge of the texture come back in from the opposite side.

Keywords: distort, warp, refraction, ripple, heat haze, offset, bump