After EffectsTutorials

Animate Rain Shadows in After Effects


Changing the look, feel, atmosphere, temperature, and mood in an After Effects 3D scene can make all the difference to your animation. Lighting and color go a long way to achieving this but using some little-known techniques and tricks can really take your scene to the next level of reality. In this tutorial, we’re going to animate rain shadows in a hallway being cast from an outside light source.

[If you’d like to preview the final effect, click here. All files are for personal use only.]

To begin, you’ll need a 3D scene with a camera in After Effects. The best way to do this is to use the wonderful Vanishing Point Exchange (VPE) feature between Photoshop CS3 Extended and After Effects CS3, which was the subject of my “Two-Dee Three-Dee” tutorial (see Layers magazine, Nov/Dec 2007, p. 94). You can also build one yourself by using solids or imported, texture images. For this tutorial, I’ve created a VPE from a still image of a long corridor, imported it into AE, and opened its composition.


In your Timeline, double-click the Camera icon to bring up its settings dialog and make any changes to enhance your scene. In this case, we chose 35mm from the Preset menu. Make sure that the Enable Depth of Field checkbox is disabled and click OK. Then go to Layer>Transform>Auto Orient, click the Off radio button, and click OK. Now hit the P key to reveal the camera’s Position property in the Timeline, and drag on the X, Y, and Z values to position your camera to a more interesting angle in your scene.

At 0 seconds along the Timeline, go to Layer>New>Light. In the Light Settings dialog, select Spot from the Light Type option, set Intensity to 100%, Cone Angle to 90°, and Cone Feather to 50%. Check the Casts Shadows box on, with 100% Darkness and 0 pixels Diffusion. Most importantly, click the Color swatch, set the color to a very light cream—a more accurate simulation of daylight, as light is not pure white—and click OK to close the Color Picker. Click OK to add the light, and it’ll appear in the scene, which is suddenly very dark!

With the light selected, hit P to show its Position property, and place it centrally on X and Y, but further back on the Z axis, behind the camera (as the camera would be inside the “room”). The corridor is slightly lit, but overly bright at the end. Select all the layers that make up your walls, ceiling, floor, etc., and press AA to reveal their 3D Material properties. Change Diffuse to 0%, Specular to 30%, and Shininess to 0% for all of the 3D layers. This sets us up for the all-important ambient light.

Still at 0 seconds on the Timeline, go to Layer>New>Light, and from the dialog choose Ambient for the Light Type. Set the Intensity to 70% and check that the same off-white (daylight) color has been selected from the Color swatch. Click OK, and the scene is now additionally lit with ambient light, making it much more pleasing and realistic. Note: If you hit P, Ambient lights don’t contain position values: They add light to all parts of a scene, regardless of position or orientation.

Now we’ll create the window shape through which our spotlight will shine from outside. The best way to do this is in Adobe Illustrator, using a solid black shape with a “hole” shape(s) created on top, and then turned into a Compound Path using the Pathfinder function. You can also do this in After Effects by creating a solid (Layer>New>Solid), using the rectangular mask tools to create the hole areas, then setting the mask modes to Subtract; however, Illustrator is more accurate and can create more intricate shapes.

In After Effects, double-click in the Project panel to locate and then import the Illustrator file from Step 6. Drag it from the Project panel into the Timeline, click the 3D Layer switch in the Switches panel, hit S to reveal its Scale value, and adjust (if necessary) to fit across your room. Now reveal the Position property, and position the “window” back along the Z axis to sit in front of the spotlight (Light 1). In the Composition window, click on Active Camera, and switch to Custom View 1 to check the relative positions.

Switch back to Active Camera in the Composition window. Now you might ask two questions: “Why is the scene black?” and “Where are the shadows from the window?” The scene is black (in this case) because the black window image is sitting right in front of our camera—but making it transparent wouldn’t allow shadows to be cast. So, with the window layer selected, hit AA to reveal the 3D properties, and next to Casts Shadows, click on Off twice to choose Only. Very cool indeed!

To add outside elements, it’s best to use animated clips such as rain, snow, leaves, etc. For rain, I’ve imported a clip (UW124) from the Ultra Water collection by Artbeats. For a moment, set the Casts Shadows option on the window layer back to Off, then drag the “weather” clip into the Timeline, and once again click its 3D Layer switch. Access its Position property, position it just a shade outside the window layer, then hit S, and scale it down to just larger than the hole area of the window.

Go to Effect>Color Adjustment and choose Hue/Saturation. In the Effect Controls panel, drag the Master Saturation value to –100. Go back to the same Effect menu and choose Levels. Then in the Histogram section of the Effect Controls panel, drag the black, mid, and white points closer and more centrally to “crush” the levels, making the rain as white as possible on a black background, with as little grey detail as possible. This will make the raindrops more solid, casting better shadows.

Finally, go to Effects>Channel>Shift Channels, and choose Luminance from the Take Alpha From menu to make the raindrops appear on a transparent background. Now, select both the rain and window layers, hit AA to reveal the 3D properties, and set both of their Casts Shadows options to Only (clicking Off twice). Now if you hit 0 on the keypad to do a RAM Preview, you’ll see animated rain shadows in your room being cast from a light outside! Very cool, but we’re not done yet….

Depending on the speed of your rain clip, it might look like snow instead. If this is the case, hit the {} icon in the lower-left corner of the Timeline to show the Time Stretch options, and adjust the Stretch value of your clip accordingly—in our example, 50% faster. Hit T to reveal the Opacity options, and change it to around 50%. Finally, to make the rain taller, show the Scale property, uncheck the link icon next to the values, and adjust the Y value (height) to around 500%. Much better!

To give the scene a little less accuracy, let’s tilt the window shadow slightly to give it an interesting angle. Close the Time Stretch options, then Control-click (PC: Right-click) in the top of the Switches panel and choose Columns>Parent. Under the Parent panel for the rain layer, click the Pickwhip icon and drag it onto the name of the window layer to link them together. Now select the window layer, hit R to show its rotation values, and drag the value in either direction to rotate both the window and rain together!

A few more things can be done to enhance this scene. Select the spotlight, and move it on the X, Y, or Z position to adjust the angles and size of the shadows being cast into the room. You can go to Layer>New>Adjustment Layer, then add effects such as Hue/Saturation and Levels to adjust the color and contrast of the whole scene—even easier if you have Look Suite from Magic Bullet (thank you, Red Giant!). And, you can animate the camera through your incredibly realistic scene. Enjoy!!