Casting a Shadow on a Moving 2D Element in After Effects
Adding a shadow to a 2D element in After Effects helps sell a 3D effect.
Drop a shadow from a 2D element in After Effects and match it up with the existing shadows of a piece of footage. This trick can give your video a nice cohesiveness and add an easy 3D effect to a flat object.
This effect is best if you use bottom layer footage with well defined shadows, I’ve chose this midday short shadow shot that I will drop a little looping cartoon on top of. Click any of the images below for larger view.
The general concept of this technique is that we are going to setup a virtual light to mimic the sun and a shape layer to accept the shadow, so you’ll first want to add a shape layer, draw a white rectangle with the shape tool and then make sure the layer is in 3D
Then you’ll want to add a new camera. I set my lens to 35mm because thats what I shot the lower layer at.
The goal is for this white rectangle to sit where the ground is and have the cartoon directly on top. I’ve started by rotating my rectangle 90 degrees at the X-axis and then tweaking its placement so it looks like its sitting on top of the ground.
I need to make sure my animation is directly on top of the rectangle and has 3D mode turned on as we fine tune it’s placement. Flipping camera modes to top and side lets you place the element right against the rectangle at a 90 degree angle.
Once everything looks lined up, change the blending mode on the rectangle to multiply.
Next you will add your light. Before you move it around, change a couple of settings on the shape and animation layer.
You want your shape layer to accept shadows but not lights and you want the animation layer to cast shadows and accept lights.
The next step is to move around the light in 3D space until your shadow starts to mimic the shadows from the video.
Switching to different camera views is a good way to get a better feel of your light’s position and length of the shadow.
Here I didn’t notice that my image was accepting lights until I moved the light in front of it.
Here’s a gif of my final video, I added some color and motion tracking because the base footage wasn’t shot with a tripod.