Displace

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

Outputs

NameTypeDescription
OutputTextureThe distorted texture, with the size of the input.

Inputs

NameTypeDescription
InputTextureThe texture to distort.
Displace MapTextureHow far to move each pixel, stretched over the whole output. With nothing connected the texture passes through unchanged.
MaskTextureWhere the pixels move, from black for not at all to white for the full strength, stretched over the whole output. With nothing connected the whole picture is displaced.

Parameters

NameTypeDescription
ModeEnumHow the displace map is read.Choices: Offset, Polar, Slope
Displace ChannelsSwizzleWhich channels of the displace map are read, two in Offset and Polar mode and one in Slope mode.
StrengthVector 2How far the pixels move, in pixels, for a value one above the mid point, or in Slope mode for a slope of 1. A negative value moves them the other way.
Mid PointVector 2The displace value that means no movement, one for each of the two channels read. Not present in Slope mode.
CenterVector 2The point the pixels move away from and around, in pixels from the middle of the texture, with up as positive. Only present in Polar mode.
Tiling XEnumWhat is read where a pixel is pushed past the left or right edge. None is transparent, Repeat comes back in from the other side, Mirror reads the texture flipped and Clamp repeats the edge pixels.Choices: None, Repeat, Mirror, Clamp
Tiling YEnumWhat is read where a pixel is pushed past the top or bottom edge, with the same choices as Tiling X.Choices: None, Repeat, Mirror, Clamp
FilteradvancedEnumHow the texture is read between its pixels when it is moved. Nearest keeps hard pixels, and Linear Nice keeps edges next to transparency clean.Choices: Nearest, Linear Fast, Linear Nice
Displace FilteradvancedEnumHow the displace map is read between its pixels when it has another size than the input. Nearest moves whole blocks of pixels by the same amount, and both Linear choices blend them.Choices: Nearest, Linear Fast, Linear Nice
Mask ChanneladvancedSwizzleWhich channel of the mask is read. Pick A to mask with the shape of a cut-out picture.
Mask FilteradvancedEnumHow the mask is read between its pixels when it has another size than the input. Nearest keeps hard pixels, and both Linear choices blend them.Choices: Nearest, Linear Fast, Linear Nice
FormatadvancedEnumThe pixel format of the output. Auto keeps the format of the input.

The Displace operator bends a texture by pushing its pixels around, the way heat haze or rippling water bends what is behind it. Where the displace map is flat the picture is unchanged, and where it varies the picture stretches and squashes.

In Offset mode, red moves the picture across and green moves it up and down. A value above the mid point moves it right and up, and one below moves it left and down. A gray Noise gives a wobbly, watery distortion, and animating the noise makes it flow.

In Polar mode, red moves the picture away from the center and green turns it around the center, counterclockwise. A soft light blob over the center bulges the picture outward, and a dark one pinches it inward. A Wave with its Shape set to Concentric makes ripples that spread as its phase rises.

In Slope mode, the map is a height and the picture moves along its slope, toward the brighter side. A flat area moves nothing however bright it is, so there is no mid point. A soft gray Noise gives a refraction like glass or water, where Offset mode would smear. A slope of 1 is a rise from 0 to 1 over a tenth of the width of the map, and a hard edge is so steep that it moves the picture many times the strength.

An 8 bit map holds only 256 values, so at a high strength the movement comes in steps. Set the Format of the operator that makes the map to a 16 or 32 bit float format for a smooth result.

See also UV Lookup, Noise, Wave.

Keywords: distort, warp, refraction, ripple, heat haze, offset, bump, bulge, pinch, twirl, lens, glass