2.5D Parallax Scrolling

This one of the 11 x 2hr technical workshops that I created for the module Med 107 Motion Graphics as part of the BSc Interactive Media degree. These workshops were designed to provide first-year students with an introduction to animation tools and techniques using Adobe After Effects. This lesson focussed on 2.5 D or parallax animation. I used an image we had previous created in a previous module and animated it using 3D animation techniques (lights, cameras, z axis).
 
 

Workshop Overview

So far we have been animating flat 2D images. After Effects is also capable of animating 3D objects. When we animate 2D layers in 3D space we get 2.5D. 

We can use the 3D animation techniques (lights, cameras, z axis) to animate 2D objects, to create depth and move move through a static image.

This is called 2.5d or parallax animation, this Nike ad uses this technique to animate photographs of sports personalities:

We are going to take an image in Photoshop and create a parallax animation of a spooky graveyard using 3D animation techniques (lights, cameras, z axis). You will split the 2D image in Photoshop into layers, import it into After Effects, add lights and camera layers.


There’s 5 steps to creating a 2.5D animation:

  • prep image in photoshop,
  • position elements on z-axis,
  • add lights,
  • add a camera,
  • and animate 

Getting Started

We are using the spooky abbey Photoshop file we created in Med109 as a basis of our animation:  greyabbey_ae_week8.psd

We will separate our image into a fore-, mid- and back-ground layers which will be animated at different rates across each other.

1. Resample your Photoshop image

Our image was designed for print and is in CYMK, 300dpi and 2000+px wide, we need to resample our image so it’s suitable for screen.

  • Change the dpi to 72, the colour mode to RGB and the dimensions: 1600x2000px

2. Separate the layers

  • Rename the milky way layer: ‘background’, rename the abbey layer: ‘mid-ground’ and apply the layer mask
  • Scale down the abbey-midground to 95% so the full width and height of the graveyard image is revealed

Note that the smoke layer – has a blending mode – Lighten Colour on the mid-ground abbey – we will carry this through to After Effects

3. Create a foreground

  • To create our foreground, we use the Pen tool [P] (no fill) to draw around the graves. Take the time to create as much detail as possible.
  • When you have completed your outline, select the Marquee tool [M] set feather to 1px. Command click the thumbnail of the shape layer – this will automatically create a marquee around the object you have just created.
  • Select the mid-ground layer. On your keyboard, press Command/Control + X to cut the graves out
  • Press Command/Control + V to paste the graves into the new layer call this foreground -graves move the graves back into their original position.

    4. Filling in the mid-ground

    We need to fill the area of the mid-ground that contains the graves

    • Hold Command/Control + click on the thumbnail window of the new ‘foreground-graves’ layer in the Layers panel to reveal the marquee (dotted outline).
    • Turn the layer off using the Eye Icon, and select your midground layer;
    • Go to Select > Modify > Expand. Set the Mask Expansion to 10, depending on how much of your background you want to sample, then hit OK.

    • With the midground-abbey layer still selected, go to Edit > content aware Fill. Your mid-ground layer will turn green. This is the area Photoshop wants to use as a reference for the Content fill
    • Use the preview window to work out the best sampling option. You can use the default auto setting, or chose custom and use the brush to select the areas to resample.
    • Press Apply and OK

    NB The content aware fill works better on natural elements like trees and grass

    5. Refining up the mid-ground with the clone tool

    Here we will need to use the clone tool to make the mid-ground appear more realistic:

    • Zoom in on your image, select the mid-ground layer, make the foreground invisible and make the shape layer visible. 
    • Then select the clone tool [S], and select a soft brush at about 33px.
    • Then Option/Alt + click the area of the image you want to clone, select an area of the building, then move the cursor directly down to continue the vertical lines of the building. Also use the eraser tool to delete unnecessary areas on the right [E].

    You want to make sure the 50 px around the shape outline is realistically filled so that the foreground can move across with out any major visual errors.

     

    When you have created all of your layers. Save your Photoshop file. Now you are ready to bring the file into After Effects

    Turn on 3D and position on Z-axis

    1. Import photoshop file to After Effects

    • Create a new project –call it ‘Spooky-abbey’, select Create Composition from footage, select your Photoshop file, ensuring you have selected Composition – Retain Layer sizes selected. Then select Merge Layer styles

    NB The content aware fill works better on natural elements like trees and grass

    • Double click to open the ‘greyabbbey-graveyard’ comp. You will see each layer of your image in the timeline.
    • Remove any surplus layers.
    • Place the Background layer above the Supermoon layer, set the Opacity [T] of the Background layer to 30% and the Blending mode to Screen

    2. Switch on 3D for the layers

    • Click the 3D switch for each layer so you can move it in 3 dimensions.

    The coloured multi-dimensional axis appears to show you that you can move your objects along 3 planes. When you switch a layer to 3D, you’ll see two new layer property sub-folders: Geometry and Material options

    • Click on the Views drop-down and go to 2 views, select ‘Top‘ for the second view – this allows us to look down on how the layers are arranged 

    2. Positioning and scaling the layers

    As we are working in 3D, our layers now have an additional plane, the z-axis. Each element will now have a z-co-ordinate or z-index in their Position value. The layers start with the z-index of 0 so they all exist on same plane (in the example above), we want to separate our layers out along the z-axis to create greater depth. 

    NB When we start to move the elements along the z-axis, they are affected by perspective, you may need to scale the elements to ensure the image appears as before.

    In the example below I have used the following settings [P] for z-co-ordinate position, [S] for Scale

    • Foreground-graves –  z co-ordinate: -200, Scale: 130%
    • Smoke – z co-ordinate -100, scale: 100%
    • Midground-abbey – z co-ordinate: 0, 110%
    • Background – z-co-ordinate: 398, scale:150%
    • Supermoon background – z co-ordinate: 400, scale: 110%

    3. Duplicate Smoke layers.

    • Set the Smoke layer Opacity [T] to 75%. Blending mode should be set to Lighten
    • Cmd/Ctrl + D the smoke layer twice to create 3 smoke layers in total. 
    • Position two smoke layers in front of the foreground at z-index position at  -250 and -300.
    • Flip one of these smoke layers along y-axis by setting its x scale to -100%
    • Place the third smoke layer between fore and mid ground at z-index -100

    Add a Camera Layer

    To add a camera we need to add a camera layer. 

     We have a number of setting we can play around with

    • Type: One-Node Camera or Two-Node Camera. A one-node camera orients around itself, whereas a two-node camera has a point of interest and orients around that point.
    • Preset/focal length: The presets are named according to focal lengths. Each preset is meant to represent the behavior of a 35mm camera with a lens of a certain focal length. Therefore, the preset also sets the Angle Of View, Zoom, Focus Distance, Focal Length, and Aperture values. The default preset is 50mm which is closest to replicating human vision. A smaller focal length eg 20mm will create a wider angle lens and a larger focal length eg 135mm will create a more ‘zoomed’ or ‘telephoto’ lens.
    • Enable depth of field – Depth of Field is an optical effect that blurs out your foreground and background. 
    • Aperture: Similar to a camera in real-life Aperture adjusts how shallow your depth of field is. The larger the Aperture the more shallow the in-focus area will be. Blur Level: Blur Level allows you to adjust how much blur is applied to your out of focus areas. 
    • Film-size – just keep at 36mm
    • Angle of view – the wider the angle of view the wider your camera. You’ll notice how your zoom and focal length will also be adjusted as you change the angle of view

    See more at School of motion cameras – explainer

    1. Add a Camera layer with the following settings

    We can also set camera options in the Camera Options Layer properties:

    NB if you enable Depth of Field you’ll need to be aware of the Focal Distance and how that effects you animation.

    If you want to keep a particular layer in focus throughout the animation make sure your Focus Distance is focused by selecting the camera and target layer  eg the midground and right- clicking and selecting the Camera > Set Focus Distance to Layer.

    If you are animating the layer that you want to keep in focus select Link Focus Distance to Layer it will tie your focus distance to the selected layer for the entire composition. This means as the layer moves your focus distance will move as well

    • Animate the camera by moving it forward through the scene

    In the example, the camera is animated between 0 and 10s moving from Position 600, 800 and -2000 to 775, 930, -1400

    Animate 2D layers

    1. Animate smoke layers

    We want to animate the Opacity [T] and Position [P] of the smoke layer along the x and y axis between the first and final frames.

    • Reduce the Opacity [T] of the smoke layers from 75% to 30% between 0 and 10s
    • Animate the position [P] of the forward-most smoke layer left and down between 0 and 10s

    2. Add warp to the smoke layers

    We can use the Wave Warp effect on the smoke layers to create a more realistic, drifting movement

    • Add the Warp Effect and reduce wave height to 5, increase wave width to around 150, lower the wave speed to 0.3 and change the direction to a more vertical angle

    3. Animate foreground, midground background layers

    Animate the Scale [S] and Position [P] of the following layers between 0 and 10 s

    • Foreground, scale up to 180% and move left
    • Mid-ground, scale up to 130 % and move right
    • Background, scales up to 130%
    • Supermoon, scale to 90% and move left and down

    Add Lights

    Lights are a type of layer in After Effects. There are four to choose from:

    • Parallel light has a continuous direction, without any spread, like a laser.
    • Spot light is a directional light with spread, softness, and falloff like a stage spotlight.
    • Point light is an omnidirectional light with softness and falloff like a bare lightbulb.
    • Ambient light is a light with no position or fall off that controls the overall brightness of a scene, so it cannot cast shadows. 

    You can set and animate options such as intensity, orientation and colour as well as the position of your lights. With spotlights you can use and animate a Point of Interest to focus the light. You can really bring creativity and atmosphere to your animation using lights. In the example I have used one point light and two spot lights.

    1. Add Lights

    • Add a Point light, red in colour with the Intensity of 26%, this will be used to tint the moon.
    • Place it behind the the midground abbey layer, with a z index of 100

    In the example the Point light is positioned at 650, 750, 80

    • Add a Spotlight to light up the mid-ground abbey position it with a z index of  -360

    In the example the spotlight1 is positioned at 680, 1010, -360 with an orientation of 300,358, 355

    • Add another Spotlight to light up the foreground graves position it with a z index of -525

    In the example spotlight2 is positioned at 110, 2020, -525 with an orientation of 30, 310, 10

    2. Animate Lights

    This is your opportunity to get creative, use the values in the example as a a guide and play around with different lights and settings

    • Animate the Intensity of the Point light between 0 and 10s, increasing from 26% to 100%
    • Animate the Position [P] and Orientation of Spotlight1 between 0 and 10s. In the example Spotlight 1 has been animated:
      • From Position of  680, 1010, -360 to 680, 1200, -355
      • From Orientation of 300,358, 355 to 300 180, 355
    • Animate the Position [P] of spotlight2 between 0 and 10s. In the example Spotlight 2 has been animated:
      • From Position of 110, 2020, -525  to  335, 1220, -680
      • From Orientation of 30, 310, 10 to 30, 280, 10
    Material Options

    3D layers have Material Options properties, which determine how a 3D layer interacts with light and shadow.

    • Casts Shadows Specifies whether a layer casts shadows on other layers.
    • Light Transmission The percentage of light that shines through the layer, casting the colors of the layer on other layers as a shadow. 0% specifies that no light passes through the layer, casting a black shadow. 100% specifies that the full values of the colors of the shadow-casting layer are projected onto the layer accepting the shadow.
    • Accepts Shadows Specifies whether the layer shows shadows cast on it by other layers. There is an “Only” option in the Accepts Shadows for when you want to render only a shadow on a layer.
    • Accepts Lights Specifies whether the light reaching it affects the color of a layer.
    • Ambient Ambient (nondirectional) reflectivity of the layer. 100% specifies the most reflectivity
    • Diffuse Diffuse (omnidirectional) reflectivity of the layer. Applying diffuse reflectivity to a layer is like draping a dull, plastic sheet over it. 100% specifies the most reflectivity;
    • Specular Specular (directional) reflectivity of the layer. Specular light reflects from the layer as if from a mirror. 100% specifies the most reflectivity
    • Shininess Determines the size of the specular highlight. This value is active only if the Specular setting is greater than zero. 
    • Metal The contribution of the layer color to the color of the specular highlight. 100% specifies that the highlight color is the color of the layer. 

    3. Set Material Options for our Layer

    Now we have created our lights we can go into our layers and change how each layer reacts to the light using our Material options.

    • Select the fore, mid, backgrounds, moon and smoke layers and press AA. This will reveal the Material options

    For our current example use the default except for the following settings for Material Options

    • Foreground-graves- Cast shadows: On, Accepts shadows On
    • Midground-abbey – Cast shadows: Off , Accepts Shadows: On
    • Smoke- Cast shadows: On, Accepts shadows: On,  Light Transmission between 50% and 75%
    • Background – Cast shadows Off, Light transmission: 0%, Accepts Shadows: Off, Accept Lights: Off
    • Supermoon – Cast shadows Off, Light transmission: 25%, Accepts Shadows: Off

    4. Render your video

    Export your video to the Media Encoder using H.264 

    NB If there are problems rendering with the smoke layer, try After Effects internal Render Engine