Join Eran Stern for an in-depth discussion in this video Light warp, part of After Effects Tips and Techniques: Compositing and Effects.
- When you're composing elements, you must pay attention to the direction of light. This can be the difference between a convincing shot that looks real, and one which looks like an obvious CG fake. So I urge you not to stop after you generate a clean key, but also work on matching the colors between the foreground and the background, as well as compensate for the light spill from the background onto the foreground. I'm going to discuss few more methods of color matching in the next chapter, but what we got out of the KeyLight effect in the previous chapter will work great for this shot.
Let's concentrate on creating a Light Warp effect in this movie. In case you don't know, the light warp creates the illusion that light from the background image is reflected onto the foreground image. This creates a more convincing composite by making it appear as if the images were shot in the same environment. I have a simple recipe that I want to share with you. We'll build it, actually, from scratch. Then I'm going to also show you an automatic free script that you can use, and we'll even match the results to see which one works best in this scenario.
So let's get started. The sun that we can see behind them should cast some obvious spill around their bodies. Let's see how we can achieve this. First, I'm going to select the Power Couple clip, and remember that this clip already have the KeyLight and the Noise HLS Auto effect, which is auto animate. We need to actually pre-compose it in order to use its pixels. I'm going to select it in the timeline and duplicate the shot by pressing command + d, or control + d on the PC.
Then I'm going to go to the Layer menu and pre-compose it. Now, you can call it however you like. I'm just going to call this Power Couple Comp, and I'm going to move all the attributes into the new composition. We don't need to either adjust the composition or open it. Just click Okay. Now we have the outcome, the result of it. We can add more effect, and it will actually look at the pixels coming out of this composition. Let's start by searching couple of effects.
I want to start with Color Link. Just dive down Color Link and double-click in order to apply the effect. This is a compound effect. We're actually going to explore it even further in the next chapter. But for now, let's just choose for it a source layer. I'm going to go with the Desert_Background. This should sample the average colors from the background. Now, I'm also going to change the Blending Mode here to Add, and I'm going to use the Stencil Original Alpha option over here.
Just so we'll see what we are working on, I'm going to solo this clip. Let's return to the Effects and Presets panel and search for the Fast Blur effect, double-click in order to apply, and let's start with the value of 30, and also tick the Repeat Edge Pixels so the effect will be able to calculate beyond the boundaries of the layer. The next effect that we are going to add to this layer is the Invert. Double-click on the Invert effect, and from the Channel pull-down, I'm going to choose Alpha.
Now, these almost work. We do get a hole inside, so we actually need to bring back some of the original and use it as a stencil alpha. The effect for that is CC Composite. Double-click, or just drag it, and then, instead of composit the original, let's choose from the Options list over here, to composit a stencil alpha version of the original, which will actually cut the hole inside and will create just this thin border of colors, which is being calculated or driven using the Color Link effect, which actually samples our background layer, in this case, the desert BG.
Okay, not let's see how this works. This is with all those effects, and this is without. The difference is quite obvious, and we can see that we are light warping the pixels underneath on top of our previous foreground. This makes it much more believable. Now, you can save this as an animation preset, just by selecting all of those guys and go under the Animation and choose Save Animation Preset, so next time you want to use this technique, it will be much more quicker.
However, there is another option, and this is actually based on a free script from AE Scripts. In order to demonstrate it and to compare it to our result, I'm going to go back to the Project panel and I'm going to duplicate this comp. I'm going to select it and press command + d in order to duplicate another instance. Then I'm just going to double-click on it. Then, let's just remove what we did by deleting it from the list.
We are back to the starting point. We have a foreground layer and a background layer. This is what you need in order to make this effect work. Now, before I'm going to move forward, I just want to show you where you can get this effect. Go to aescripts.com/rd-studio-techniques, and you can download this, it's free of charge. Then you need to install it in your After Effects Scripts folder.
I've already done this in my case, so I'm going to select the foreground layer and then I'm going to go to the File menu, and from the Scripts, I'm going to run the rd_LightWrap. This is an automatic script which will basically do the same stuff. You can compare between what we did and what this effect created. By the way, you can always return to what we created using those four effects.
If you want to make it a little bit more obvious, you can change the whole blending mode of the layer to maybe an Additive blending mode. This result will be more similar to what we've got using the LightWarp free script. Also know that this script is fully 32-bits-per-channel compatible, while we are actually using an 8-bit effect. If this is something that you are worrying about, then go ahead and use this script. But I have to say that, actually, I think that our version is much better.
You need to also examine the rest of the pixels over here, so just make sure to scrub or to create a ram preview. You can also adjust the contamination over here by using these sliders. If you want more or less, you can do it from here. If you want to achieve the same using the effects that we used, you can return to the stack of the effects and play with the blur. The blurriness option over here will create the same stuff.
There you go, two free options to create a light warp effect. There are also couple of third-party plugins that will help you to achieve a similar result, so you've got plenty of options to choose from. Just remember not to skip this step if the background clip calls for it.
- Compositing tricks
- Handling tricky keys
- Matching shutter phase
- Removing banding
- Matching color
- Adding an illusion of depth
- Watermarking shots