Displace
Shifts the pixels of a texture by the values of another texture.
Outputs
| Name | Type | Description |
|---|---|---|
| Output | Texture | The distorted texture, with the size of the input. |
Inputs
| Name | Type | Description |
|---|---|---|
| Input | Texture | The texture to distort. |
| Displace Map | Texture | How far to move each pixel, stretched over the whole output. With nothing connected the texture passes through unchanged. |
| Mask | Texture | Where 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
| Name | Type | Description |
|---|---|---|
| Mode | Enum | How the displace map is read.Choices: Offset, Polar, Slope |
| Displace Channels | Swizzle | Which channels of the displace map are read, two in Offset and Polar mode and one in Slope mode. |
| Strength | Vector 2 | How 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 Point | Vector 2 | The displace value that means no movement, one for each of the two channels read. Not present in Slope mode. |
| Center | Vector 2 | The 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 X | Enum | What 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 Y | Enum | What 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 |
| Filteradvanced | Enum | How 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 Filteradvanced | Enum | How 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 Channeladvanced | Swizzle | Which channel of the mask is read. Pick A to mask with the shape of a cut-out picture. |
| Mask Filteradvanced | Enum | How 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 |
| Formatadvanced | Enum | The 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.
Keywords: distort, warp, refraction, ripple, heat haze, offset, bump, bulge, pinch, twirl, lens, glass