CHAPTER 5

image

Working with the 3D Environment

Due to increasingly short postproduction times in film, television, and commercial production, 2D and 3D software package features have begun to overlap. After Effects, which is mainly designed for 2D compositing, nevertheless has a full 3D environment with cameras, lights, materials, and more recently, the ability to render 3D geometry (Figure 5.1). This adds even more power to the compositor as he or she has the option to work in 2D, 2.5D, 3D, or go back and forth between all three spaces. 2.5D refers to 2D layers in a 3D space and is useful for giving depth to otherwise flat matte paintings and similar backdrops.

This chapter includes the following critical information:

Creating and transforming 3D layers, cameras, and lights

Working with 3D layer material properties and shadows

Importing elements from Cinema 4D Lite and other 3D programs

image

FIG  5.1 A glass-like disc is created and rendered in After Effects using 3D layers, an environmental layer, a 3D camera, and the Ray-Trace 3D renderer.

Creating and Transforming 3D Layers

In After Effects, you can convert any layer to a 3D layer by clicking the 3D Layer switch beside the layer name. This carries a small cube for an icon. With the conversion, the layer gains a third dimension for its transforms and a Material Options section. In addition, if the layer is selected, a 3D transform handle is displayed with the handle located at the Anchor Point (Figure 5.2). Like standard 3D programs, the transform handle has three axis arrows, where the green arrow is Y, the red arrow is X, and the blue arrow is Z.

image

FIG  5.2 Left: The Transform section of a 3D layer. Right: The transform handle of a 3D layer, as seen in the Composition view.

The 3D layer’s Anchor Point, Position, and Scale receive a Z field (the field order is X, Y, Z, from left to right). Note that the Z Scale has no effect on the layer as it remains two-dimensional in a 3D space (much like a piece of paper). Rotation is broken into three separate properties—one for each axis. A new property, Orientation, is added. Orientation rotates the layer. However, Orientation does not use revolutions and degrees; instead, Orientation simply offers X, Y, and Z degrees with no upper or lower limit. You can use Rotation, Orientation, or both properties to rotate the layer. You can rotate a 3D layer in three dimensions without a 3D camera.

Using Multiple Viewports

By default, the Composition view panel shows a single view. You have the option to lay out the panel as you would a 3D program, with multiple orthographic and/or perspective viewports. To do this, change the Select View Layout menu to a layout. For example, to mimic the default layout of Autodesk Maya, change the menu to 4 Views. This adds a Top, Front, and Right orthographic viewport along with the original view, which is labeled Active Camera (Figure 5.3). If you haven’t created a 3D camera, the Active Camera viewport shows the standard Composition view. If you’ve created a 3D camera, the Active Camera becomes a perspective view similar to standard 3D programs. To make a particular viewport active, LMB-click within its border. The viewport receives a orange triangle at each corner to indicate that it’s active.

image

FIG  5.3 The Select View Layout menu, indicated by the red box, is set to 4 Views. With this example, the Active Camera viewport is active, as indicated by the orange corner triangles. At this point, there is no 3D camera but there is a green 512×512 3D layer with rotation. The 3D View Popup menu is indicated by a yellow box.

The black field of the perspective viewport indicates the frame that renders. The orthographic viewports also possess these; however, you cannot render orthographic viewports through the Render Queue.

You can adjust the view of any viewport by using one of the camera tools. For example, if you select the Unified Camera tool from the camera tools menu in the main toolbar (Figure 5.4), you can MMB-drag in an active viewport to scroll up/down or left/right (i.e., track XY). You can RMB-drag in an active viewport to dolly in and out (i.e., track Z). If you use the Unified Camera tool in a perspective viewport with a 3D camera, you can LMB-drag to rotate (orbit) the camera.

image

FIG  5.4 The camera tools menu, which sits to the right of the Rotate tool.

You can interactively transform a 3D layer in a viewport. To move a 3D layer, select the layer and use the Selection tool to LMB-drag one of the axis arrows in a positive or negative direction. You can also interactively rotate a 3D layer by selecting the Rotate tool from the main toolbar (Figure 5.4) and LMB-dragging along or over one of the axis arrows.

Creating and Transforming a 3D Camera

The best way to take advantage of the 3D environment is to create a 3D camera. 3D cameras emulate real-world cameras and give you a wide range of looks by selecting different lenses or applying different transforms. To create a 3D camera, choose Layer > New > Camera. The Camera Settings window opens (Figure 5.5).

image

FIG  5.5 The Camera Settings window.

You can choose a lens by selecting a common focal length through the Preset menu. You also have the option to enter a custom focal length through the field below the camera body icon. If you have information pertaining to the angle of view or film size (horizontal aperture) of a real-world camera, you can enter those values into the namesake fields. The default camera style creates a two-node camera with a camera body and a point of interest (each of which has its own transforms). Alternatively, you can set the Type menu to One-Node Camera to prevent the creation of the point of interest. When you press OK, a new camera layer is created and placed at the top of the layer outline.

The camera receives an icon, which is visible in the orthographic viewports (Figure 5.6). If a 3D camera exists, you can move 2D layers closer or farther away from the camera. The After Effects 3D space uses a Y-up system, where positive-X runs right, positive-Z runs towards the camera’s default position, and positive-Y runs up.

image

FIG  5.6 A selected one-node 3D camera, as seen in the Right viewport. The camera is given nondefault rotational values.

Transforming a 3D Camera

There are several ways to transform a 3D camera. You can use the Unified Camera tool to change the view by LMB-, MMB-, or RMB-dragging in the perspective viewport. You also have the option to use the Orbit, Track XY (scroll), and Track Z (dolly) tools (see Figure 5.4 earlier in this chapter); with these, you need only LMB-drag in the perspective viewport.

In addition, you can interactively transform the camera icon. To transform the camera body, select the camera layer, go to a viewport, and LMB-drag one of the three axis arrows in the positive or negative direction. To move the point of interest of a two-node camera, LMB-drag its point in a viewport (it does not receive a transform handle). Moving the point of interest rotates the camera body (Figure 5.7). If the body axis arrows are difficult to see, you can dolly closer to the camera by RMB-dragging with the Unified Camera tool. If your mouse has a middle scroll button, you can use it to dolly in and out. If you are using a one-node camera, you can also interactively rotate it with the Rotate tool.

You can alter the transform values of the camera layer as you would any other layer. The transforms include a Position X, Y, Z, an Orientation X, Y, Z, and separate Rotate properties for each axis (Figure 5.8). If you interactively rotate a one-node camera in a viewport, the Orientation values of the camera body are changed. You can separate Position into three properties by RMB-clicking over the Position name and choosing Separate Dimensions. Two-node cameras also carry a Point Of Interest X, Y, Z.

You can create more than one 3D camera. To choose a camera to look through, select a viewport, and change the 3D View Popup menu to the camera of choice (see Figure 5.3 earlier in this chapter). Similarly, you can change an orthographic viewport to a different view, such as Left or Bottom. You can store a specific custom perspective view by selecting a viewport and changing the 3D View Popup menu to one of the custom bookmarks, named Custom View and numbered 1, 2, and 3.

image

FIG  5.7 A two-node camera, as seen in the Top viewport. The point of interest is moved out in front of the camera’s rectangular image plane.

image

FIG  5.8 The Transform section of a two-node 3D camera layer.

Altering 3D Camera Properties

Each 3D camera layer includes a Camera Options section (Figure 5.9). The Zoom property controls the focal length of the lens. This is represented by a pixel distance value, which indicates the distance the camera lens is from the image plane. The image plane is visible as the rectangle at the end of the camera icon frustum (the pyramid-like structure indicating the camera’s field of view). See Figures 5.6 and 5.7 in the previous sections. If you alter the Zoom value, the horizontal angle of view updates automatically (this value appears in parenthesis to the right of the Zoom property). If you raise the Zoom value, the lens becomes “longer” and the camera “zooms in.” If you lower the value, the lens becomes “shorter” and “zooms out” and the view is widened.

image

FIG  5.9 The Camera Options section of a 3D camera layer.

Because the Zoom pixel distance and the horizontal angle of view values are nonintuitive, you have the option to alter the camera lens by selecting the camera layer and choosing Layer > Camera Settings. In the Camera Settings window, you can select a new focal length preset or enter an mm value into the Focal Length field. Smaller mm values produce a wider lens while larger mm values produce a “long” or telephoto lens.

The remaining properties in the Camera Options section control the depth of field, which is described in the next section. Note that 2D layers remain visible to a 3D camera. However, the 2D layers are fixed to the default, non-3D view.

Working with Depth of Field

Depth of field refers to the “out-of-focusness” of a camera. That is, depth of field indicates the distance range within which objects are in focus. Objects outside of this range are out of focus or blurry. By default the Depth Of Field property is set to Off. If you switch the property to On, the following additional camera properties affect the result:

Focus Distance The pixel distance from the lens to the center of the “in focus” range. This is represented by a second rectangle inserted into the camera icon frustum. If you alter the Focus Distance value, you can see this rectangle move in the viewports. Alter this value so that the rectangle bisects the 3D layer or layers that you want to remain sharply in focus.

Aperture The size of the lens opening in pixels. As with a real-world camera, the larger the aperture value, the smaller the in-focus range.

Blur Level Sets the degree of blurriness in the out-of-focus areas. The higher the value, the greater the blurriness.

Iris Shape Sets the shape of the camera’s bokeh, which is the shape of an out-of-focus point of light. Common real-world lenses produce octagon or other n-sided polygon bokehs.

Iris Rotation, Iris Roundness, and Iris Aspect Ratio These further alter the bokeh shape.

Iris Diffraction Fringe This creates a halo around the bokeh when the value is raised. The halo is visible around small, high-contrast areas.

Highlight Gain, Highlight Threshold, and Highlight Saturation These alter the look of bright areas when Depth Of Field is on.

The camera properties that control depth of field are similar to those carried by Effect > Blur & Sharpen > Camera Lens Blur. You can apply Camera Lens Blur to a 2D layer when no 3D camera is present and therefore emulate a real-world camera by creating realistic bokehs. Depth of field is demonstrated in the following tutorial.

Depth of field mini-tutorial

To practice the creation of depth of field, you can follow these steps:

1. Create three 3D layers in a composition. You can use three unique layers or three copies of the same layer. To better see the eventual depth of field, create layers that are smaller than the composition resolution. For example, import artwork or create a new solid layer with a smaller size. An example piece of artwork is included as drawing.jpg in the ProjectFilesArt directory.

2. Create a new camera by choosing Layer > New > Camera. You can create a one-node or two-node camera. Switch the Select View Layout menu to 4 Views so you have access to the orthographic viewports.

3. Position the layers so they are spread out along the Z-axis. You can interactively LMB-drag the Z-axis handle when a 3D layer is selected. (When you first create the 3D layers, they overlap in the same position in 3D space.)

4. Adjust the camera position and rotation so that the three layers are seen through the Active Camera perspective view (Figure 5.10). Expand the camera layer’s Camera Options section. Switch Depth Of Field to On. Adjust the Focus Distance value. You’ll see the focus distance plane move back and forth in the orthographic views. Line up the Focus Distance plane so that it bisects the central layer (the layer that is midway between the other two layers in 3D space).

image

FIG  5.10 Three 3D layers, seen as horizontal lines in the Top viewport, are spread out along the Z-axis. The camera is rotated and positioned to look at them from the right side. The Focus Distance plane bisects the central 3D layer.

image

FIG  5.11 The resulting depth of field.

5. Slowly raise the Aperture value. The higher the value, the more out of focus the near and far layers become (Figure 5.11). Experiment with different Iris Shape menu settings and other iris properties. Each change alters the bokehs of the out-of-focus points. Alter the Focus Distance value to place the focus area at different points, such as the foreground layer. A sample project is saved as mini_depth.aep in the ProjectFilesaeFilesChapter5 directory.

Setting Up Lights

If no lights are present in an After Effects 3D environment, 3D layers maintain their original pixel brightness. That is, there are no highlights or shadows. You can create a light at any time, however, by choosing Layer > New > Light. In the Light Settings window, you can choose between one of four lights, as set by the Light Type menu (Figure 5.12).

image

FIG  5.12 The Light Settings window.

Descriptions of the light types follow:

Parallel A directional light whose light rays are parallel. Ultimately, the light’s rotation affects the light quality, but its position does not (Figure 5.13).

Spot Emulates a real-world spot light that produces a conical light throw.

Point An omnidirectional light that originates from the light icon. This is similar to a light bulb.

Ambient This light has no position and no light icon, but arrives from all directions.

image

FIG  5.13 Left to Right: Point light, Parallel light, and Spot light.

You can choose a light color, intensity (brightness), and whether the light casts shadows for all the light types. Additionally, Parallel, Spot, and Ambient lights include a Falloff menu. If Falloff is set to Smooth, the light decays (loses intensity) over distance in a linear fashion. The decay starts at the Radius distance and ends at the Falloff Distance. If Falloff is set to Inverse Square Clamped, the light decay is an inverse of the square of the distance from the light, replicating light decay within the Earth’s atmosphere. In this case, the decay starts at the Radius value. Spot lights also include a Cone Angle value, which sets the width of the light cone, and a Cone Feather value, which sets the decay at the cone edge. High Cone Feather values create a softer cone edge, as seen when the spot light strikes a 3D layer.

When you click the OK button in the Light Settings window, the light is created as a new light layer is added to the layer outline. The light layer carries its own set of transforms and a Light Options section, which carries the light properties discussed in this section. You can change the Light Options properties values at any time.

You can interactively transform a light as you would a 3D layer or camera. Parallel lights carry a light icon and a point of interest, each with its own position property. Spot lights possess a point of interest but also include Orientation and Rotation properties for the light icon. You can move the point of interest of a light by LMB-dragging the point in a viewport. Point lights only possess a Position property. Ambient lights lack transforms and are considered to be equally intense everywhere at once. You are free to create as many lights within a composition as you like.

Working with Materials

As soon as a light is present in the After Effects 3D environment, 3D layers gain surface shading qualities controlled by the 3D layer’s Material Options section (Figure 5.14).

image

FIG  5.14 The Material Options section of a 3D layer.

Descriptions of these Material Options properties are laid out in the following sections.

Ambient

This is the ambient shading component, which represents the net sum of all secondary (fill) light reaching the surface. The higher the Ambient value, the brighter the non-lit areas of the layer become.

Diffuse

This represents the diffuse shading component, which controls the brightness or darkness of the surface (that is, how much light the surface reflects back to the camera). The higher the value, the brighter the layer.

Specular Shininess, Specular Intensity, and Metal

Specular Shininess controls the size of the surface’s specular highlight (Figure 5.15). A specular highlight is a focused light reflection that appears as a “hot spot” on the surface. The higher the Specular Shininess value, the smaller the specular highlight, which is similar to smooth surfaces such as glass. The lower the Specular Shininess value, the broader the highlight, which is similar to rough surfaces. If a specular highlight is not visible, it indicates that a surface is diffuse, whereby light is reflected in all directions and in a random manner. (Paper and cardboard are examples of diffuse surfaces.) The Specular Intensity property sets the brightness of the specular highlight. The Metal property determines the color of the specular highlight. Low Metal values favor the color white while high Metal values favor the colors contained within the layer (which emulates some metals, such as copper).

image

FIG  5.15 Three different specular properties for three 3D layers. The layers are lit by a single Spot light. This project is saved as specular.aep in the ProjectFilesaeFilesChapter5 directory.

Light Transmission

This controls the translucence of a layer. If a surface is translucent, light is transmitted through the surface. Real-world translucent surfaces include flesh, wax, soap, and so on. You can see the effect by pressing a flashlight to your hand. You can see the effect in After Effects if the Light Transmission value is high and a light sits behind the 3D layer relative to the rendering camera (Figure 5.16).

Casts Shadows, Accepts Shadows, and Accepts Lights

These are on/off switches that determine their namesake qualities. Note that Cast Shadows is off by default. Each 3D layer can carry its own unique shadow and light settings. If a 3D layer has its Accepts Lights property set to Off, it receives its default pixel values—as if there are no lights in the scene. Note that shadows understand transparency. If a 3D layer casts a shadow and has transparent areas due to an alpha channel, the shadow gains the correct shape (Figure 5.17). (By the same token, you can mask 3D layers, which is discussed in the next section.) The darkness of cast shadows is set by the Shadow Darkness property in the Light Options section of the shadow-casting light. If you use a Point or Spot light, you can soften the shadow edge by raising the Shadow Diffusion value, also found in the Light Options section.

image

FIG  5.16 A Point light sits behind a 3D layer but transmits through the surface thanks to a Light Transmission value of 100 percent.

image

FIG  5.17 A Parallel light casts the shadow of a 3D layer that possesses transparency through its alpha channel. This project is saved as shadow_trans.aep in the ProjectFilesaeFilesChapter5 directory.

By default, shadow map resolution is set to the size of the current composition. You can alter the resolution, however, by choosing Composition > Composition Settings, switching to the Advanced tab of the Composition Settings window, and clicking the Options button. In the Classic 3D Renderer Options window, you can change the Shadow Map Resolution menu to a smaller size. This may be useful for speeding up renders while you are setting up the composition.

Masking 3D Layers

You can apply standard masking and rotoscoping techniques to 3D layers. When you draw a mask, it’s drawn from the perspective of the viewport you’re working in. From that point forward, the mask is “stuck” to the 2D plane of the 3D layer. If you rotate or position the layer, the mask follows and keeps its size and shape relative to the layer. Masking techniques are demonstrated in the following tutorial.

Lighting, shadowing, and masking 3D layers mini-tutorial

Use this tutorial to practice creating and arranging 3D layers and 3D cameras, adjusting layer material properties, and masking 3D layers. Follow these steps:

1. Create a new project. Import the wall2.tif file from the ProjectFilesArt directory.

2. Create a new composition with a resolution of 1920x1080, a frame rate of 24, and a duration of 48. LMB-drag the wall file into the composition.

3. Initially, the wall artwork is larger than the composition. Scale the layer down to 25 percent. Click the 3D Layer switch for the layer. Change the Select View Layout to 4 Views. Proceed to move the artwork layer along the negative Z direction so it recedes from the default camera. You can interactively LMB-drag the Z handle in a view or change the Position values in the layer outline. When the Z value increases, the layer recedes from the camera.

4. Using the Front orthographic viewport, draw a rectangular mask so that a thin vertical portion of the left side of the layer is saved (Figure 5.18). Adjust the layer position in the perspective camera viewport. Note how the mask sticks to the layer and takes on the perspective of the layer.

5. Duplicate the wall layer using Edit > Duplicate. Adjust the mask on the new layer so that it cuts out a right portion of the wall. Rotate and position the new layer so that it forms a right angle with the original layer and thus creates a pillar-like shape. Create a new 3D camera via Layer > New > Camera. Position and rotate the camera so that you can see the 3D layers better (Figure 5.19).

6. Import the rock.tif file from the ProjectFilesArt directory. Place it at the bottom of the layer outline. Convert it to a 3D layer. Rotate it to lie flat (90, 0, 0). Position the layer so it forms a floor below the pillar.

7. Create a Spot light via Layer > New > Light. Position and rotate the light so that it points down towards the pillar and floor. If the scene becomes dark, raise the light’s Falloff Distance. Further raise the light’s Intensity. For example, set the Falloff Distance to 5000 and Intensity to 200 percent. The 3D layers should be visible but not be so bright that their textures become white. Turn the light’s Cast Shadows to On.

image

FIG  5.18 A rectangular mask (orange) cuts out a vertical portion of the wall 3D layer. Note that the transform handle remains at the original Anchor Point.

image

FIG  5.19 A 3D camera is created and positioned to look at the new pillar shape created by placing the two cut out 3D layers at right angles to each other. Note that the mask “sticks” to the 3D layers when they are rotated.

8. Go to each 3D layer and turn the Cast Shadows, Accepts Shadows, and Accepts Lights properties to On. A cast shadow of the pillar appears on the floor. Adjust the light position and rotation to form an interesting shadow shape.

9. Fine-tune each 3D layer’s Diffuse, Specular Intensity, Specular Shininess, and Metal property value. Adjust the light’s Cone Angle and Cone Feather values so that the edge of the light prevents the top of the pillar or the back of the floor from becoming visible (Figure 5.20).

image

FIG  5.20 A Spot light casts light and shadows on the pillar and floor.

Feel free to add additional lights or additional 3D layers to create additional architecture (such as walls or a ceiling). A sample project is saved as mini_3d.aep in the ProjectFilesaeFileChapter5 directory.

Arranging 2D Layers as Visual Effects Cards

In addition to traditional motion graphics, the After Effects 3D environment is often used to create 2.5D scenes. 2.5D, or 2 1/2D, refers to 2D layers arranged within a 3D space, which occurs when you activate a 3D Layer button for a layer in After Effects. These layers are sometimes called cards. 2.5D scenes are useful for adding additional depth and perspective to otherwise flat backgrounds. For example, 2.5D may be used to add more depth to a static matte painting. Matte paintings may come in the form of a painted piece of static art, static art created by combining photograph of real locations, or rendered image sequences produced by a 3D program. To create your own 2.5D matte painting, use the following tutorial.

2.5D matte painting mini-tutorial

For this tutorial, we’ll arrange cards to form a room that will eventually include video footage of an actress. We’ll take the cards from several static Maya 3D renders. You can follow these steps:

1. Open the 2.5_set_start.aep project file located in the ProjectFilesaeFilesChapter5 directory. Examine the contents. Two compositions are set up. Five static renders of a 3D room are imported.

2. Open Comp 1. LMB-drag the static artwork into the composition. Follow this order, from top to bottom: right wall, left wall, ceiling, back wall, and floor. Note that Comp 1 is an extra-large 3000x4000, while the renders are 2400x3000 and 3200x4000. The large resolution will allow a camera to be animated within the final set but maintain a final output resolution of 1920x1080.

3. Double-click the new right wall layer to open it, by itself, in the Layer view. The finished 3D render takes up a portion of the render while much of it is left as a wireframe. Draw a mask to isolate the wall. The black part of the render corresponds with transparent alpha, so you need only draw a rectangular mask (Figure 5.21). You can draw a mask in the Layer view as you normally would in the Composition view.

image

FIG  5.21 Left: Unmasked layer showing the Maya-generated partial render and wireframe. Right: Masked layer that isolates the completed render of right wall.

4. Open the remaining render layers, one at a time, and draw masks to isolate the finished portions while throwing away the wireframe areas. Convert all the layers to 3D layers.

5. Go back to the Composition view. Change the Select View Layout to 4 Views. Use the Unified Camera tool to arrange the orthographic views so you can see the layers. At this point, all of the layers overlap.

6. Go to the floor layer and change X Rotation to −45. The rotation will generate the illusion of parallax shift when a 3D camera is added and animated. This process is similar to creating a forced-perspective miniature. Unlink the Scale property and change the values to 120, 85, 100. This widens the layer.

7. Go to the ceiling layer and change X Rotation to 45. Unlink Scale and change the values to 150, 120, 100. Go to the left wall layer and set the Y Rotation to −45. Unlink the Scale and change the values to 100, 135, 100. Go to the right wall layer and change the Y rotation to 45. Unlink the Scale and set the values to 100, 135, 100. Note that the floor has the opposite rotation of the ceiling. The left wall layer has the opposite rotation of the right wall layer. This will create a box-like shape that widens. At this stage, however, the layers continue to intersect.

8. Move the layers apart so that the corners line up. For example, move the left wall left. Move the right wall right. Move the back wall away from the camera view along Z. Move the ceiling up. Move the floor down. You have several choices when positioning layers. You can interactively LMB-drag the transform axis handles in the viewports when the layer is selected. This alters the layer’s Position values. You can also alter the Position fields in the layer outline. You have the option of changing the Anchor Point values. However, this may move the Anchor Point handle away from the layer. Because this virtual set is intended to be static, altering a combination of Position and Anchor Point values is acceptable. If animation or motion tracking data was to be applied, then it would be better to alter the Position values and leave the Anchor Point with default values so the Anchor Point doesn’t wind up too far from the layer.

image

FIG  5.22 Left: The final arrangement of 3D layers, creating a shallow, forced-perspective room with a floor, ceiling, side walls, and back wall. Right: Right orthographic view showing camera position. The vertical dotted line is the point of interest motion path. The camera starts in a tilted-up position.

9. Continue adjusting the layer positions until you create with a forced-perspective layout that looks similar to Figure 5.22. Create a new two-node camera by choosing Layer > New > Camera. Set the lens to 28 mm. Position the camera so that its view plane intersects the front of the floor layer (Figure 5.22). While on the first frame of the timeline, position the point of view near the top of the back wall layer so that the camera is looking up at the ceiling. Keyframe the point of interest. Go to the last frame. Position the point of interest near the base of the back wall so that the room is centered.

10. Open Comp 2. Comp 1 is already nested inside. Comp 2 is 1920x1080, which is the desired output resolution. Comp 1 overhangs Comp 2 thus creating a usable final frame. Play back the timeline. Note the parallax shift (that is, changing perspective) due to a combination of the wide 3D camera lens and the forced-perspective construction of the room.

Optionally, apply color correction effects, such as Curves, Hue/Saturation, and Color Balance, to adjust the renders to create a more cohesive room. For example, give the overall lighting a dark, purplish-blue look (Figure 5.23). Also, you can return to Comp 1, activate motion blur for the layers, and play back Comp 2 again. A final version of this project is saved as 2.5_set_finished.aep in the ProjectFilesaeFilesChapter5 directory.

image

FIG  5.23 The final assembled room, as seen in Comp 2. The layers carry color correction effects, such as Curves and Color Balance, to make the overall lighting look purplish-blue.

Importing Cameras, Lights, and Geometry

You can import cameras from Autodesk Maya and 3D programs that support the RLA and RPF format. You can import cameras, lights, and geometry from Cinema 4D Lite. Cinema 4D Lite is bundled with After Effects CC. The ability to incorporate 3D scenes from 3D programs adds additional power and flexibility to the compositing process.

Importing Maya Cameras

You can import an Autodesk Maya camera into After Effects as a 3D camera layer. To do so, follow these steps:

1. Export a camera from Maya by selecting the camera and choosing File > Export Selection. Choose the .ma format, which is a text file. An example camera .ma file is included as camera.ma in the ProjectFilesData directory.

2. In After Effects, choose File > Import > File and browse for the .ma file. The camera is imported as a new 3D camera layer within a new composition named after the camera node. Note that 0, 0, 0 in Maya space is lined up with 0, 0 in After Effects screen space. Thus, if the camera is at 0, 0, 0 in Maya, the 3D camera body appears at 0, 0 in the After Effects Front viewport. Nevertheless, if the camera is animated, the animation curves are imported and matching keyframes appear on the timeline. A motion path is also drawn in the viewport. The new composition is the same duration as the duration of the Maya animation. The camera icon inside After Effects does not necessarily correlate to the camera icon inside Maya (in fact, it may appear significantly larger in After Effects relative to its motion path).

3. You are free to copy and paste the 3D camera layer to a different composition. The Zoom property of the 3D camera is converted from the Maya focal length value. Maya one-node cameras become one-node cameras in After Effects. A two-node or three-node Maya camera, however, is imported as a one-node camera but is parented to a new null object layer.

Using the RLA and RPF Formats

If you render an image sequence in the RLA or RPF (Rich Pixel File) format, you can retrieve the contained camera information within After Effects. To do so, import the RLA or RPF image sequence and drop it into a composition. Select the new layer and choose Animation > Keyframe Assistant > RPF Camera Import. A new 3D camera layer is created with keyframed transforms. You can then manipulate the camera as you would any other 3D camera.

At a minimum, the RLA or RPF image sequence must contain a Z-Depth pass so that the camera information is stored. An example RPF image sequence is included in the ProjectFilesDatacamera directory. The image sequence was created with an empty Autodesk 3ds Max scene.

Working with Cinema 4D Lite

After Effects CC can read Maxon Cinema 4D Lite files through the Cineware plug-in. Although it’s beyond the scope of this book to cover Cinema 4D Lite in depth, a tutorial is included here to demonstrate the creation and importation of cameras, lights, and geometry.

Cinema 4D lite mini-tutorial

Follow these steps to create primitive objects, lights, materials, and animation in Cinema 4D Lite and bring those elements into After Effects:

1. Create a new Cinema 4D Lite scene file by choosing File > New > Maxon Cinema 4D File. The file browser window opens. Choose a name and location for the new Cinema 4D scene and click the Save button.

2. Cinema 4D Lite launches as an external program. The program starts with a large perspective viewport (the viewport area is known as an Editor window). You can manipulate the camera through this view by using the Alt/Opt keys and the mouse buttons (the same functionality as Maya). You can choose different viewport panel layouts by choosing Panel > Arrangement > layout from the viewport menu. See Figure 5.24 for an overview of the interface.

image

FIG  5.24 The Cinema 4D Lite program window with key interface components.

3. To create a piece of test geometry, use the Create menu, located in the main menu. For example, choose Create > Object > Cube to place a primitive cube at 0, 0, 0. To transform a primitive, select the transform tools located along the Command Group bar at the top left of the program and LMB-drag the associated axis handle in the viewport.

4. If you wish to alter a primitive object, you can make it editable. To do so, click the Model mode button, click the object in a viewport so it receives an orange outline, and RMB-click over the object and choose Make Editable from the menu. The Model mode button and Object mode button share the second-from-the-top position in the Command Palette. To see both buttons, click and hold the current button. After you make the object editable, you can then select subcomponents by switching to the Points, Edges, or Polygons tools along the Command Palette bar, and LMB-clicking on the object in a viewport. The Points tool selects vertices and the Polygons tool selects faces. When one or more subcomponents are selected (you can additively add selections by Shift+LMB-clicking them), you can transform them using the standard transform tools. Note that polygon modeling tools are not included with Cinema 4D Lite. However, if you have access to a full version of Cinema 4D, you are free to prepare models for importation into After Effects.

5. To assign a material to the object, choose Create > New Material from the Material Manager panel at the bottom left of the program window. This panel is empty by default. A new material, named Mat, is created. The material icon is shown in the panel. If you select the icon, the material attributes appear in the Attribute Manager panel (Figure 5.25). These include attributes common to 3D programs, such as Color, Brightness (diffuse quality), and various specular controls. To map a texture to an attribute, such as Color, click the path bar beside the Texture attribute name in the Color tab and browse for the texture file. If you click the small arrow beside the attribute name, you can select a procedural texture, such as Noise or Gradient, from the menu. To assign a material to an object, LMB-drag the material icon and drop it on top of the object in a viewport. The object updates in the viewport to reveal the assigned material.

image

FIG  5.25 A new material in the Attribute Manager. A bitmap is mapped to the Texture attribute of the Color tab.

6. To animate an object, select it, move the timeline to the specific frame, transform the object, and press the Record Active Objects button (this features a key icon inside a red circle at the right side of the timeline). Repeat this process at different frames. If you are editing the object as a model, reselect it as an object before keyframing it. To do so, click the Object mode button in the Command Palette and click the object in the viewport.

7. To create a light, choose Create > Light > light from the main menu. To alter the basic light attributes, select the light and go to the Attribute Manager. For example, to alter the brightness, adjust the Intensity slider. To activate shadows, choose a shadow type through the Shadow menu. You can use the standard transform tools to position the light in the viewports.

8. To save a Cinema 4D scene, choose File > Save. The file is saved in .c4d format with the name and location selected when you chose File > New > Maxon Cinema 4D File in After Effects. To see the scene in After Effects, LMB-drag the Cinema 4D scene, automatically added to the Project panel, into a composition. You can return to Cinema 4D Lite to update the scene. If you re-save, After Effects automatically detects the changes and updates the associated layer. (Optionally, you can import a different Cinema 4D file by choosing File > Import > File.) The Cinema 4D scene carries a resolution, duration, and frame rate set by the Cinema 4D program. When the scene is added to a composition, the Cinema 4D Lite perspective camera view in shown the Composition view panel (Figure 5.26). The view is shaded and includes wireframes of lights and the XZ axis grid. Imported components include lights, animation curves, materials, and textures. You can play back the timeline to see the animation.

image

FIG  5.26 A Cinema 4D Lite scene is added to a composition and is viewed through the Composition view. With this example, the scene includes an animated polygon meteorite that is textured with a color bitmap and procedural bump map.

9. To see the final render quality, open the Cineware effect, which is added to the Cinema 4D layer (Figure 5.27). Change the Renderer menu to Standard (Final) and play back. The render quality is based on the render settings within Cinema 4D. You can change the render settings before saving the Cinema 4D file—this is described in the next section.

image

FIG  5.27 The Cineware effect properties.

10. Empty space with Cinema 4D Lite becomes transparent inside After Effects. Therefore, you can combine the Cinema 4D footage with standard 2D and 3D layers (Figure 5.28). Note that the Cinema 4D scene is not a 3D layer inside After Effects—it’s treated like a 2D layer.

image

FIG  5.28 Render using Standard (Final) quality. A 2D layer featuring a sky image is placed under the Cinema 4D layer. The wireframe view of objects disappears when the final render quality is chosen.

A sample After Effects project is included as cinema4D.aep in the ProjectFilesaeFilesChapter5 directory. A matching Cinema 4D file is included as meteor.c4d in the ProjectFilesData directory.

Working with Cinema 4D Multi-Passes

When setting up a render in Cinema 4D, you have the option to create multi-passes, which are also known as render passes. Render passes break a single frame into separate shading components. For example, you can render the diffuse, specular, and shadow components of a surface as different image sequences. Using render passes gives you greater control in the composite as you can add unique effects, such as blurs or color corrections, to each shading component layer. When you import a Cinema 4D file into After Effects, you have the option to read the individual multi-passes.

To set up multi-passes in Cinema 4D Lite, you can follow these basic steps:

1. From the main menu, choose Render > Edit Render Settings. In the Output section of the Render Settings window, set common render attributes such as resolution, frame rate, and duration. Note that the Lite version has a resolution size limit of 800x600.

2. To activate multi-passes, click the Multi-Pass check box in the left column (Figure 5.29). To add a render pass, click the Multi-Pass menu button at the left center of the window and select the pass. Common render passes include Diffuse, Specular, Shadow, Ambient Occlusion, and Depth. You can add as many render passes as may be useful. (Render passes are discussed in more detail in Chapter 7.)

3. Close the window and save the Cinema 4D scene.

image

FIG  5.29 Detail of the Cinema 4D Lite Render Settings window with four multi-passes listed. The Multi-Pass menu button is at the bottom of the figure.

To use multi-passes inside After Effects, follow these steps:

1. Follow the basic steps outlined in the “Cinema 4D Lite Mini-Tutorial” section earlier in this chapter to import the Cinema 4D scene into After Effects. A sample scene is saved as multi_pass.c4d in the ProjectFiles Data directory.

2. Place the imported Cinema 4D file into a new composition. Open the Cineware effect in the Effect Controls panel. Change the Renderer menu to Standard (Final). Select the Defined Multi-Passes check box. Click the Add Image Layers button. A new layer is added for each multi-pass. The blending modes menu for each layer is set to a mode commonly associated with the pass. (Blending modes as they pertain to render passes are discussed in more detail in Chapter 7.) The new multi-pass layers are ordered to re-create the original 3D render (Figure 5.30).

3. Go to frame 11. A 3D meteor appears along a falling trajectory. Feel free to solo any layer to examine it in the Composition view. Import the sky.png file from the ProjectFilesArt directory and place it at the bottom of the layer outline.

image

FIG  5.30 Extracted multi-pass layers share the composition with a 2D layer of a sky. Note the preset blending mode menus.

At this stage, the multi-passes occlude any lower 2D layers even though the 3D geometry only takes up a small portion of the frame. As a workaround, you can reorder the layers and use the Track Matte tool to borrow alpha information from a Depth multi-pass render. To do this, follow these steps:

1. Reorder the multi-pass layers by LMB-dragging them up and down. Use the following order, starting at the top and working downwards: Shadow, Specular, Depth, and Diffuse.

2. Hide the Depth layer and original multipass.c4d layer (numbered 5) by clicking the Video eye icons. The Shadow layer blending mode menu is set to Multiply, which blends the shadow pass without need of alpha. The Specular layer blending mode is set to Add. Change the Specular blending mode to Screen (Figure 5.31). Like Add, Screen blends the bright spots of the layer over lower layers; however, Screen prevents superwhite values and allows the specular highlights to look similar to the original render.

image

FIG  5.31 The multi-pass layers are reordered. The Depth layer and original multipass.c4d layer are hidden. The Specular layer’s blending mode is changed to Screen.

3. Change the Diffuse layer’s Track Matte menu to Luma Matte. This converts brightness information of the Depth layer to alpha information for the Diffuse layer. The sky layer appears below the meteorite (Figure 5.32).

image

FIG  5.32 The Diffuse layer gains alpha from the Track Matte tool, allowing it to appear over the sky layer.

A finished project file is included as multi_pass.aep in the ProjectFilesaeFilesChapter5 directory.

Extracting Cinema 4D Scene Elements

You can convert Cinema 4D cameras and lights so they are accessible in the After Effects 3D environment. To do this, click the Cinema 4D Scene Data Extract button, found with the Cineware effect properties. Each light is converted to an equivalent After Effects light, complete with standard transforms and light options. A one-node camera is also created as a new 3D camera layer. You are free to transform, animate, or adjust the lights and cameras.

Initially, the Cinema 4D layer continues to use the internal Cineware Cinema 4D camera. However, you can change the Cineware effect’s Camera menu to Use Comp Camera. With this setting, Cineware renders the Cinema 4D scene with the new, converted 3D camera layer. Unfortunately, the converted lights no longer affect the Cinema 4D layer.

Motion Blurring Cinema 4D Scenes

Motion blur does not carry over from Cinema 4D to After Effects. However, you can add the Pixel Motion Blur effect (Effect > Time > Pixel Motion Blur) to the Cinema 4D layer to emulate the blur. The effect includes the following properties:

Shutter Control determines whether the shutter angle is automatically or manually set.

Shutter Angle sets the length of the motion blur trail. The higher the value, the longer blur trail. 180 degrees matches many film and video cameras (Figure 5.33).

Shutter Sample sets the quality of the blur. A higher value results in smoother blur trails.

Vector Detail determines the number of motion vectors used to track pixels between frames. A value of 100 produces one vector per pixel. The higher the values, the more accurate the blur and the longer the render takes.

image

FIG  5.33 A Cinema 4D scene is given motion blur with the Pixel Motion Blur effect. Shutter Control is set to Manual, Shutter Angle is set to 180, Shutter Sample is set to 64, and Vector Detail is set to 50. A sample project is saved as pixel_motion.aep in the ProjectFilesaeFilesChapter5 directory.

Pixel Motion Blur may not produce perfect results, particularly when objects cross over each other or cross the frame edge. In such situations, it may be necessary to render an image sequence inside Cinema 4D with motion blur and import the sequence into After Effects (thus bypassing the importation of the Cinema 4D scene).

Switching to Ray-Traced 3D

By default, compositions are rendered with the After Effects Classic 3D renderer. However, you have the option to switch to the Ray-Traced 3D renderer by changing the Renderer menu in the Advanced tab of the Composition Settings window. In addition to the general features of the Classic 3D renderer, the Ray-Traced 3D renderer supports reflections, refractions, environment textures, and semitransparent translucency. The renderer is also able to extrude and bevel text and shape layers. The renderer adds a number of extra properties to the Material Options section of 3D layers. The renderer also adds a new Geometry Options section to each 3D layer. The new options included in the Material Options section are described here:

Reflection Intensity and Reflection Sharpness These properties produce reflections on the 3D layer. The higher the Reflection Intensity and Reflection Sharpness, the stronger and sharper the reflection.

Transparency and Index Of Refraction Set the amount of transparency and light distortion as light passes through the 3D layer. An Index Of Refraction set to 1.0 is equivalent to nondistorting air. An Index Of Refraction of 1.33 emulates water. An Index Of Refraction of 1.4 or 1.5 emulates glass.

Reflection Rolloff and Transparency Rolloff These properties determine the Fresnel quality of a 3D layer, whereby the viewing angle affects the transparency or strength of reflection. The higher the values, the less visible the reflection and the more transparent the glass.

Despite the expanded features, Ray-Traced 3D is unable to support blending modes or Track Matte operations. To utilize the Ray-Traced 3D renderer, you can use the following tutorial.

Chapter Tutorial: Rendering Reflections with Ray-Traced 3D

1. Using the 3D layer and 3D camera techniques demonstrated throughout this chapter, rotate and position a 3D layer so that it becomes a floor or ground plane. Position and rotate the camera so that it looks down at the layer. You can use any of the images included in the ProjectFilesArt folder as a source for the 3D layer or use your own artwork.

2. With no layer selected, use the Ellipse tool to draw an oval shape in a viewport. The Ellipse tool is in the shape menu in the main toolbar and is below the Rectangle tool. When you use a shape tool without selecting a layer, a new shape layer is created.

3. Convert the shape layer into a 3D layer. Move the shape layer so it sits above the floor layer. Readjust the camera so that the shape is centered. Rotate the shape so that it is tipped down toward the floor (Figure 5.34).

4. Choose Composition > Composition Settings. Switch to the Advanced tab of the Composition Settings window. Change the Renderer menu to Ray-Traced 3D. As soon as the renderer is switched, the Material Options section gains new ray-tracing and transparency properties (these are described in the previous section).

image

FIG  5.34 A shape layer is cut with an ellipse mask, converted to a 3D layer, and rotated to point down at a second 3D layer serving as a floor.

5. Expand the Contents > Ellipse 1 > Fill 1 subsection of the shape layer. Change the Color to white. Go to the Material Options section for the shape layer and change Reflection Intensity to 100 percent. The renderer takes some time to update the frame. After completion, the solid reflects the floor. If the renderer refresh is too slow, you can temporarily reduce the quality by setting the Resolution/Down Sample Factor Popup menu, in the view panel, to lower quality, such as Quarter.

6. Changing the renderer also adds a Geometry Options section to the shape layer. To emulate a 3D object, you can bevel or extrude the shape. For example, set Bevel Style to Angular and Bevel Depth to 20. A bevel appears on the edge of the shape and also reflects the floor (Figure 5.35). Note that the reflection includes the black of the After Effects empty 3D space.

image

FIG  5.35 The shape is given a bevel and reflectivity by switching the renderer to Ray-Traced 3D.

7. Reduce the shape layer’s Reflection Sharpness to 75 percent to blur the reflection. Reduce the Transparency to 90 percent. Increase the Index Of Refraction to 1.5. Reduce the Reflection Intensity to 15 percent. The resulting render creates a semitransparent, glass-like disc.

8. Create a new Point light and position it between the camera and the shape along the left side of the frame. Set the light’s Intensity to 200 percent, Radius to 1000, Falloff Distance to 5000, and Shadow Diffusion to 25, and turn on Casts Shadows. For each 3D layer, make sure that Casts Shadows, Accepts Shadows, and Accepts Lights is set to On. A semitransparent shadow of the disc is cast on the floor. Set the shape layer’s Specular Intensity to 20 percent and Specular Shininess to 50 percent to create a more glass-like specular highlight.

9. You can fill in the black, empty area of the 3D space by converting a layer to an environmental sphere. To do this, import a still image, image sequence, or movie and drop it on top of the layer outline. For example, use sky.png located in the ProjectFilesArt directory. Select the new layer and choose Layer > Environment Layer. The environment layer replaces the previously empty black space (see Figure 5.1 at the start of this chapter). If the environment layer appears grainy, feel free to add a blur effect, such as Fast Blur, to soften it.

10. To produce a render with the final quality that lacks the wireframe icons of lights, add the composition to the Render Queue. You can choose to render a single frame by clicking the Queue’s Best Settings link (beside Render Settings) and entering a new frame range by clicking the Custom button at the bottom right of the Render Settings window. Before you render, you can increase the render quality by clicking the Options button of the Advanced tab of the Composition Settings window. In the Ray-Traced 3D Renderer Options window, gradually increase the Ray-Tracing Quality. You can also choose more accurate anti-aliasing by changing the Anti-Aliasing Filter menu to Cubic.

Optionally, you can animate the shape layer or light moving and render the entire timeline as a movie or image sequence. You can also add additional lights or 3D layers. Although the Ray-Traced 3D renderer and its associated options are not as robust as similar tools found in dedicated 3D programs, it is able to produce simple surfaces with complex surface qualities. Hence, it may be suitable for creating small props or debris for visual effects shots. A final version of this project is saved as reflection_finished.aep in the ProjectFilesaeFilesChapter5 directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset