All Articles After Effects
Displacement Mapping in After Effects: The Basics
Richard Lainhart on Wed, October 12th 1 comments
Displacement Mapping might sound like a concept from a Sci-Fi novel, but in After Effects you can use it to create interesting distortion techniques right now! Richard Lainhart maps out the basics.

Displacement mapping is one of the lesser-known techniques in Adobe After Effects that can create all sorts of fascinating and practical distortion effects with your footage. In this tutorial, we're going to introduce to the basics of displacement mapping and show you how to get started with it.

Step 1 - Set Up the Composition 

We're going to be working with two simple elements: our logo and some stock footage of rippling pool water. The idea here is to create the illusion of the logo painted on the bottom of the pool and being distorted by the motion of the water, just as it would be in real life. So, after importing the logo and footage files into a new project, begin by creating a new composition the size and length of the pool footage by just dragging the water footage clip onto the 'Create A New Composition' button at the bottom of the Project window:

the 'Create A New Composition' button

Step 2 - Add the Logo

Next we want to just drop the logo (which I've prepared with an alpha channel so it has a transparent background) on top of the water layer in the Pool composition and center it, either by dragging it directly into the Comp window, or into the Layer window in the Timeline.

mPV logo on top of the water layer

Step 3 - Apply a Blending Mode to the Logo

At this point, the logo doesn't look like it's underwater, but rather floating on the water's surface. So, next we're going to apply a Blending Mode to the logo so it interacts with the water image and looks like it's at the bottom of the pool. When you apply a Blending Mode to a layer, the pixels in that layer interact with the pixels in the layer immediately below it to create new colors and transparencies in the pixels in the upper layer. There are many different Blending Modes, and many different ways the two layers can interact with each other. For now, all you need to know is that a Blending Mode will help us integrate the logo layer with the water in such a way that the logo will appear to be below the water's surface, while still remaining visible.

So, to apply the Blending Mode, click the 'Toggle Switches/Modes' button at the bottom of the Layer window to display the Modes column, then click the 'Blending Modes' popup menu next to the Logo layer to show the various Modes. The ones we're interested in are in the Additive category, the third group in the list, and specifically we're going to choose Color Dodge:

Color Dodge from Blending Menu

The Additive modes tend to make the brighter pixels of the two layers visible, while retaining the color of the upper layer to varying degrees. In this case, Color Dodge seems to maintain the original color of the logo well, while allowing the brighter pixels of the water ripples to show through, creating the illusion of the logo being below the water surface. Of course, you should try the other Additive modes, and even modes in other categories, both just to see what they look like and to determine if one of them might work better with your particular logo. Here's what the Color Dodge mode looks like.

Color Dodge blending mode in action

Step 4 - Apply the Displacement Map Effect

Now that we have our logo in place and properly blended, we're going to displace it so it look like the water ripples are distorting the image. Displacement mapping works by taking the brightness (or luminance) values of the pixels in one layer'"called the displacement map'"and using those values to physically shift, or displace, the position of the pixels in the affected layer. Greater luminance values create a greater shift than lower values, as you'd expect. In our case, we want to use the luminance of the water layer to distort the logo layer: as the water moves, the shifting luminance values will make the logo appear as if it's being distorted by the water, as it would in reality.

So, with the logo layer selected, choose Effect > Distort > Displacement Map. By default, the Displacement Map effect uses the layer to which it's applied as the Map layer, which doesn't do us much good. Instead, we want to use the water layer, so click on the Displacement Map Layer menu in the 'Effect Controls' window and choose the water layer. We also want to set the water layer's luminance for both the Horizontal and Vertical displacement, and we want to increase the maximum displacement to 20 or so, for a little greater distortion (you should of course tweak all these settings to see how they affect the final image). Your Displacement Map effect settings should look like this:

Displacement map effect settings

Your logo movie should look something like this:

And that's basically how it works. Now, as you can see, this is a pretty cool effect, but the logo itself is rather rough-edged, and doesn't much look like it's underwater. That's because the water layer has a lot of contrast and abrupt transitions between its bright and dark pixels, which tends to create that roughness in the displaced image. There's an easy way to fix that though, which we'll do next.

Step 5 - Duplicate the Water Layer

To fix the rough edges, we need to use a softer version of the water layer as our displacement map, which we'll do by blurring it. But we don't want to blur the visible water layer, so we'll blur a copy and use that for our map instead. Duplicate the water layer in the Timeline by selecting it and typing Command-D

Step 6 - Blur the Duplicated Layer

Next, select the upper of the two existing water layers in the Layer window and choose Effect > Blur & Sharpen > Gaussian Blur. Set the Blurriness to 20 or so to soften the water nicely.

Step 7 - Pre-compose the Blurred Layer

Now at this point if we use this blurred layer as the displacement map, we won't actually see any difference in the final image. That's because the blurred layer needs to be pre-composed, or virtually rendered, before the Displacement Map effect will "see" the blur. So, select the blurred layer, and choose Layer > Pre-compose. In the Pre-compose dialog, call the new composition WaterDisplaceMap (or anything appropriate to distinguish it from the original water layer), and choose the option to 'Move all attributes into the new composition'.

'Move all attributes into the new composition'

Step 8 - Apply the Blurred Map

Now, we don't actually want to see the blurred image, so turn off its visibility by clicking the eyeball button next to its name in the Layer window; as long as it's pre-composed, it doesn't have to be visible for the Displacement Map effect to use it. Then select the logo layer again and set the WaterDisplaceMap layer as the Displacement Map Layer in the Effect Controls window. You'll see a much smoother and more realistic distortion effect on the logo that follows the water ripples:

And there you have it. Experiment with reducing the opacity of the logo layer a little to make it look a little more underwater, try different Blending Modes on the logo, or apply a little blur to defocus the logo slightly. And as always, have fun!

Learn more about After Effects in these excellent tutorials.

Related Videos
Comments (1)

You must be logged in to comment.

  • Martin
    A watery MPV Logo .. I love it!!! Nice one Richard :)
    • 9 years ago
    • By: Martin
Quick Start Guide
Studio One 5 101
Dream It. Do It.
Do you want to learn Quick Start Guide?
Yes, I want to learn!
No Thanks, I just want to read the article.
Course Advisor
Don't Know Where To Start?
Ask A Course Advisor
Ask Us!
Copy the link below and paste it into an email, forum, or Facebook to share this with your friends.
Make money when you share our links
Become a Affiliate!
The current affiliate rate is: 50%
Classes Start Next Week!
Live 8-week Online Certification Classes for: