2d Displace

by Mark Kingsnorth in Materials, Shaders, Textures

It can be difficult to create subtle movement effects in static 2D images or materials like water ripples or clouds.

This is a simple node group that adds 2D distortion effects to your materials in EEVEE or CYCLES.  

Here the effect is applied to a 2D image from the Nebula Generator:

Here, a noise map is applied to a still image of a nebula.

An example of an ocean effect with the node group, real-time in the EEVEE viewport (Example file Included)

The node group contains a small set of parameters to control the distortion.

Features

  • Simple displacement map with Vector (UV Map) and Color (Input image/texture) inputs.
  • Quickly calculates displacement in near real time.
  • Can be used for a variety of effects such as subtle parallax effects,  cloud movements in background shots or ripples in water.
  • Bundles as a Blender Node Group which can be imported into any Blender project.
  • Works in both EEVEE and CYCLES texture set ups.

How does it work?

An example of the Displacement Node at work. On the left is the input displacement map.  Black values push the image horizontally and vertically in one direction, white values push them in another direction.  The amount of maximum push is controlled by the node group.The node distorts the input UV Map (the Vector Input) by the given displacement map.

Displacement is calculated by taking the displacement map's luminance values (in other words, the brightness), and then shifting the UV Map either 'left' or 'right' for brightness values in the displacement map.  Dark values shift colors in one direction and lighter values shift values in the opposite direction.

The output UV Map can then be used to distort a follow on image or node set up.

Any Questions?

Do not hesitate to get in touch with me if you have a question, a new feature suggestion, or an image you'd like to share.  You can contact me through this website or by my Twitter page.