Displace
Shifts the pixels of a texture by the values of another texture.
Outputs
| Name | Type | Description |
|---|---|---|
| Texture Output | Texture | The distorted texture. |
Inputs
Parameters
| Name | Type | Description |
|---|---|---|
| Output Format | Enum | Whether 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 Type | Enum | The channels of the output texture. Follows an input unless the output format is Manual.Choices: R (u8), RG (u8), RGBA (u8) |
| Texture Size | Vector 2 Int | The size of the output texture in pixels. Follows an input unless the output format is Manual. |
| Displace Channels | String | Rearranges 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. |
| Strength | Float | How far the pixels move. At 1 a displace value of 0 or 1 shifts by half the texture. |
| Mid Point | Vector 2 | The 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