Displacement Map & Glitch Transition | Effects of After Effects

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] the displacement map effect is one of the most versatile effects in after effects and it's one of those effects that i think everyone should have a very good grasp on and at the same time i think it's an effect that very many users of after effects are very confused and intimidated by my goal with this video is to show you exactly what this effect is doing and how you can control it so that you can use it in your own workflow without any confusion let's go to the distort category and grab the displacement map effect and i'm going to apply it to this epic looking photo of the moon and i'm just going to shut off my green background for a second so that we have transparent pixels showing up around the outside edges now why are we seeing those transparent pixels well it's because this effect is displacing the pixels of whatever we've applied it to but what does displacement mean well it simply means shifting the pixels around i'm going to turn that off for a second and just add the offset effect which is also under the distort category and show you that if i just change the shift center to property it's going to move these pixels around within the contents of the layer another word for shift is displace this is literally all the displacement map is doing it's shifting the pixels around which makes offset a displacement effect it's just doing it 100 uniformly i'm displacing the pixels horizontally and vertically i'll get rid of that offset effect and turn displacement map back on and this is going to do exactly the same thing just with a lot more control of how every pixel is actually being displaced or shifted around horizontally or vertically so let's take a look at the controls first of all the displacement map layer is what drives the displacement or the shifting of these pixels around by default it's set to the layer that you've applied the effect to which is rarely what you want to actually use as your displacement map generally you're using a separate layer to displace the pixels of another layer but let's just leave it at the default for now the next option is used for horizontal displacement so what do we want to drive the horizontal shifting of pixels in this image by default it's set to the red channel underneath this menu we can change it to a lot of different options red green and blue even the alpha channel luminance hue lightness saturation full half or off 99.99999 of the time luminance is what i use i drive my displacements based on brightness values of pixels rather than a specific color channel or alpha channel or any of these others but here's the thing about that the red green and blue channels all have values assigned to their luminance and let me show you what i mean if i just bring up a color picker i'm working in 8 bits per channel which means that there are 255 levels of brightness in each color channel in the red green and blue so a value of pure white assigns a value of 255 to the red green and blue channels combined to make that white color if i only wanted say red then i would take out all of the green and all of the blue and i'd be left with pure red and at this point i could move this slider up or down to shift that value from 0 at the base all the way to 255 at the top combining all three of these channels into white puts them all back up to 255. so currently i'm driving the horizontal displacement using the red channel of the source layer the layer we've applied the effect to but what that means is that it doesn't matter what color this is all it's going to look at is whatever value the red channel currently has and then base the horizontal displacement on that value but how exactly is this effect taking that value into account well let's just actually just switch it to grayscale okay so all three of these numbers are exactly the same white being 255 black being zero and right in the middle at 50 gray we have a value of 128. this effect is going to convert this scale from 0 to 255 to a scale of negative 1 to 1 and then multiply that by whatever you set in the max horizontal and max vertical displacement meaning that a value of 255 will give us 5 pixels of horizontal displacement positively a black value of 0 will give us negative 5 pixels of horizontal displacement and right in the middle at 128 we will get no displacement at all because it's a value of zero times this factor of five pixels okay that was a lot of talk but let me give you a very clear visual example of what all that means i'm going to make a new solid layer and call this displacement map and i'll make it the comp size and click ok then i'm going to fill this with a ramp a gradient ramp effect and i want it to go from left to right so i'm going to set this up to be perfectly linear across black on the left side white on the right side next i want to add a posterize effect to break up that gradient into much fewer blocks of color in fact i only want three colors so this is actually going to give me pure black 50 gray and 100 white with all that done i can actually shut off my displacement map because i don't need to see it i just need it to be in this comp and i'm going to change the displacement map layer to my displacement map and make sure that i'm choosing the effects and masks under this menu so that it's actually looking at the effects i just applied to it next i'm going to turn down the horizontal displacement to zero so that we are not displacing any pixels horizontally i only want to displace things vertically so if i increase this value the pixels corresponding to the displacement map that we selected are now being shifted based on the values of those colors so remember my displacement map had black on the left white on the right and gray in the middle so it's going to take that black value of zero and convert it to a negative one multiply it by 274 pixels and shift all the pixels that are underneath that black section of the displacement map negative 274 pixels and the opposite is true for the white section of the displacement map it's converted that color value of 255 into a scale of one and multiplied that by 274 pixels positively shifting those upwards on the vertical axis and leaving these gray values right in the middle now if you look really close you can see there's a transparent pixel and that's just because the way these effects are working this is actually generating a value of 127 rather than 128 but you get the point i'm not that worried about it it's just slightly shifting those pixels around now if i go back to my displacement map effect and turn a vertical displacement all the way down and turn horizontal displacement up you can see how that affects things it's shifting the black pixels to the right the white pixels to the left or if i go to a negative number it'll go in the opposite direction and i can continue going all the way to the edges of that layer and i want to point out that my channels are still set to red and green but because i'm using a grayscale image the values for all three channels are identical so this is no different than if i were to change this channel to green or to blue or even just luminance i could change both of these to luminance and it won't change anything now i can combine the horizontal and vertical displacements so it can be shifting those pixels around on two axes and if i go back into my displacement map and maybe turn that posterize off so i have a smooth gradient going from black to white and remember because i'm working in 8 bits per channel there are only a maximum of 256 values starting at 0 and going to 255 that can be assigned to this black and white gradient so it's going to take all of those values and remap them to a displacement through this displacement map and so now i'm getting a much more gradual shift let me actually just turn the horizontal displacement all the way back down and show you that this is basically just slanting my image now if i go really extreme and zoom in here you can see all of those individual slices that are being generated from all of those individual levels of that ramp all right so that's the basics of how the displacement map functions let's take a look at the other controls really quickly the displacement map behavior gives us three options center map stretch map to fit and tile map now these are really set for when your displacement map is not the same size as your displacement layer in this case they are exactly the same size but if i were to change my solid to be say 600 by 600 now it's not the same size and if i turn it off my displacement is not really working the way that i want it to it's constrained to the size of the source layer but if i change that from center map to stretch map to fit it's going to just take this map and basically just scale it up to be the same size as the destination layer and then apply the displacement i could also change this to tile map and it will do just that tile the map before applying the displacement i'm going to undo going back to where we were because that's how i had it set up and we'll leave it on center map next up we have edge behavior and our only option is to check on wrap pixels around this is actually pretty self-evident if i just turn it on the pixels that are displaced are being shifted all the way around the comp and just looped back around just like the offset effect but it's being driven by the displacement map rather than just linearly and then finally we have expand output again we're not going to see anything if i turn this offer back on because the layer is the size of my comp but if i scale this down and uncheck expand output it makes more sense it's going to show the unaffected part of the layer outside the boundaries of the layer but that's only going to be evident if you're actually pushing pixels outside of that boundary so if i had wrap pixels around turned off this really isn't going to make any difference but with it on i could turn expand output off to show you that it's cropping it to the layer or with it checked expanding it beyond so those are all the controls of this effect and hopefully you understand how they're working now and i realize this isn't the greatest example of this effect but it is very powerful because you can literally use anything for a displacement map i'm going to set this back to the size of the comping right clicking going to transform and saying fit to comp and then just reset this effect for a second let me change the source back to my displacement map with the effects and masks and then let's change what our displacement map looks like i could change this from a linear ramp to a radial ramp and then maybe put the start of the ramp in the center of the comp so that we have a dark spot in middle and bright spots around the outside and then i'll go back to my displacement map and increase this to get something that looks a lot more curved and just has a very unique distortion to it that's a very smooth distortion but what if i change the displacement map to the photo itself to the layer i have it applied to well because i still have this set to default it's looking at the red channel for the horizontal displacement and the green channel for the vertical displacement but i could change the horizontal displacement just to say the saturation and i'll turn the vertical displacement all the way down for a second and now it's taking the saturation level from all of the pixels and mapping the distortion to that or i could change it to the luminance and then it's the brightness pixels that will be driving the distortion again i realize this doesn't produce flattering results but the displacement map effect is great for making glitch effects and glitchy transitions so just shifting this around and combining it with vertical displacement can create very unique looks let's change the source back to the displacement map and maybe turn off that smooth gradient and we'll add a turbulent noise effect instead which will give us a much more random texture that we can work with so i'll increase the contrast maybe the brightness turn the scale up a little bit and then shut that off now our displacement map is giving us something very unique i'll just change both channels to luminance and then just shift this around now where this gets really powerful is that the displacement map doesn't have to be a static image this could be animated so if i went in my evolution options and just added a keyframe and then increased the value forward in time a little bit and played this back my displacement map is now animated and i could combine this with keyframes on the actual displacement so if at the start of my timeline i set keyframes for both the horizontal and vertical displacement and then turn it down to zero at this point then we're going to use this as a way to just transition from one state to the other i'll easy ease those keyframes and play it back and there we go something that's very liquidy is now transitioning into the unaffected state let me get rid of those keyframes and bring up the displacement map one more time and i want to change how this turbulent noise looks for a second let me get rid of those keyframes actually just reset the whole thing back down to defaults and change this noise type from soft linear to block so everything is much more pixelated change the transform so that it's not scaling uniformly and just increase the width so we have very wide short blocks and then maybe increase the contrast change the overflow to wrap black and we'll leave it at that for now let's turn off the displacement map and increase the horizontal displacement to show what's going on it's shifting all these pixels around in a very digital way and maybe the scale is a little bit too small i'll go back into that turbulent noise turn up the scale height a bit and turn up that scale width quite a bit and you know what i can even make this a little bit more clear if i add a mosaic effect on top of that turbulent noise and enable the sharp colors checkbox so now i really have crunchy blocks to work with in my displacement map and i'll even turn the vertical blocks up so that they're much shorter and turn that displacement off once more so our displacement map is going to shift those pixels around based on that displacement map just like always but now it's giving us a much more digital look but let's say i only want it to displace off to the left side i don't want any of the pixels moving to the right well remember pixels brighter than 50 gray are going to shift off in a positive direction if i want them all to move negatively or at least not move positively then i need to make sure none of my values are above that value of 128 and i can do that really easily just by using the tint effect so i'm going to bring that out and change my map white to from pure white down to 50 gray so now my max brightness shifted from 100 white down to 50 percent gray if i turn this off and go into my displacement map now these pixels are only going to move in one direction now some of these pixels even if i crank this really far are staying right where they were and that's because remember that 50 percent gray value is going to produce no displacement so if i go back to my displacement map and change that map white value down to a darker gray that's shifting all those pixels further off to the left so why don't we just go down to say 30 gray as our max brightness and click ok and now i can adjust this to where all of the pixels are off screen i'll set a keyframe on that max horizontal displacement go forward maybe 12 frames which is half a second at 24 frames per second and set this back down to zero let's play this back and see what it looks like now i kind of have this glitchy transition in and it's a little quick at the end so maybe i want to ease into that a bit with my graph editor and now it's going to be much more fluid and maybe it's too fast i could increase the speed to be one second instead and it's going to come in more slowly on top of all this again i could animate the evolution of my turbulent noise so i'll go into that add a keyframe at the start go forward to where the transition is done and just increase this to a higher value and now it's going to have even more glitchiness as that comes in i could even take this another step further if i open up my displacement map and duplicate my turbulent noise effect controller command d on a mac and i'll just move this below the mosaic effect expand it out and then go to the blending mode which is set to normal and change it to overlay so it's now adding a second level of detail on top of all of those solid blocks if i turn that back off now my distortion is going to have even more detail in it so just using a handful of controls and being smart about how you're combining effects and adjusting values you can completely shape the way that this displacement map is working for you and here's a really cool trick if you want this to come in at an angle rather than just horizontally or vertically we can sandwich our effects between two instances of transform to do just that what i'll do is go to the layer we're applying the displacement map to and add that transform effect before the displacement map duplicate it with controller command d and then drag that down below the displacement map i'll give myself a little bit more room and what we want to do is actually rotate the layer by a certain number of degrees so let's say 32 degrees then we apply the displacement map and then we have another instance of transform and we're going to rotate it back in the equal but opposite direction so negative 32 degrees we're back where we started but watch what happens when i scrub through the effect now my displacement is happening at that 32 degrees now we do have the issue of being able to see the boundary but that can actually be fixed just by changing the size of my displacement map so if i have that solid selected press control shift y or command shift y and expand the width and the height out far enough then it's going to expand beyond the edges of my comp and will eliminate that problem now every time that i want to change that angle i'm going to have to mess with two values unless i tie these two together with expressions so with that layer selected i'll just type in rotation grab the second rotation and add an expression by alter option clicking on it and just start by typing a minus sign grab my expression pick whip and select the first rotation and then click off now whatever value this is set to the second instance will be the opposite value so i could put this at any angle that i want and it will animate in at that angle it looks like i need to expand that layer out just a little bit more on the edges so control or command shift y expand that height out just a little bit more and click ok and now i have a completely custom transition just using a bunch of layers of effects the possibilities here are literally endless you can come up with so many different distortions from this one effect just by changing the way that the displacement map looks i hope that i helped break down some walls with this effect and that you now have a pretty good grasp on what all the controls do and how you might use them to shape your own displacement there are so many things you can do with this effect once you understand exactly what's going on but that is the displacement map effect hey thanks for watching if you enjoyed this tutorial then check out the other ones here on my youtube channel and if you like my teaching style then definitely check out my longer form content on skillshare and school of motion and if you want to support more tutorials like this one check out my patreon you can find links for all that stuff in the description of this video [Music]
Info
Channel: Jake In Motion
Views: 7,734
Rating: undefined out of 5
Keywords: After Effects, Animation, Motion Graphics, Mograph, Motion Design, Tutorial, Adobe, Adobe After Effects
Id: 4N2xvjYoLTM
Channel Id: undefined
Length: 19min 20sec (1160 seconds)
Published: Tue Oct 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.