2
The 3D Channel Effects

We’re going to start out by looking at the 3D Channel effects. Not for any reason, other than they come first alphabetically, and we’re covering these effects in the same order they appear in After Effects.

The 3D Channel effects serve a very unique purpose in After Effects. All of them deal with files output from dedicated 3D applications such as Maya, 3DS Max, or Cinema 4D. Note that the 3D Channel effects do not aid in creating 3D objects. Unless you have access to 3D applications like the ones previously mentioned, or files made from such, you may want to skip this chapter.

Most 3D applications can export 2D image sequences using special types of image files that contain additional 3D information, stored in the file almost like metadata is—beneath the surface. This “additional 3D information” can record important details such as how far away from the camera the objects are (the Z depth), information about the objects (such as their object ID), information about their materials (material ID), and so on. The After Effects in the 3D Channel category can access and use this data to do anything from create 3D fog, created a shallow depth of field (blur), isolate individual objects for color correction or mattes, and much more. For example, we’ll look at examples in this chapter where it was set up in the 3D file to record the 3D depth of the image. We can then selectively blur (or rack focus) objects that are farther away or closer to the camera; all in a flat 2D layer!

Beware of Uneditable Images

fig00017.jpg One of the challenges of working with 2D images with 3D data is that Photoshop cannot read, edit, or save them. Because you don’t have the luxury of doing any retouching (at least in Photoshop), you’ll need to make sure that the render from your 3D application is perfect, or else you’re stuck making adjustments to the image in After Effects. With its extensive color correction tools as well as its brushes and clone stamp tool, After Effects is actually pretty good at that kind of thing, but it’s certainly something to be aware of.

Note that this data is not automatically built into all image renders from 3D applications. Only certain file formats (such as .RPF) can store this type of information, and your 3D program must be set up to render this information.

So, what types of 2D files with 3D data does After Effects understand? To be used in the 3D Channel effects in After Effects, they must be exported in your 3D program. You can store data in RLA, RPF, Softimage PIC/ZPIC files, and in Electric Image EI/EIZ formats. When importing 3D channel data from Softimage and Electric Image, note that you still import only the PIC or EI files, respectively. The ZPIC and EIZ files store the depth information, but they cannot be imported into After Effects. However, After Effects will be able to read the 3D data if the ZPIC file is in the same folder as the imported PIC file. The same holds true for EIZ and EI files. Consult the help documentation of your 3D program to learn how to export 3D channel data in the above file formats.

Using the Info Panel

fig00018.jpg The Info panel is absolutely critical to working well with 3D channel data. It can tell you the Z depth (and other 3D channel information) while your cursor hovers over your image with the effect selected.

Be aware that some 3D channels are unavailable in certain file formats. And I should also point out that all of the above file formats are still image files. Currently, there aren’t any video file formats in After Effects that can store 3D channel data. If you do need to extract data for a series of frames, use an image sequence.

In this chapter, we’re going to be using an RPF file created in 3DS Max by a very talented 3D modeler, Kymnbel Bywater from spilledinkanimation.com. Kymnbel meticulously set up this 3D garage scene so that it contains the Z depth of the objects, as well as object IDs, surface normals, and more.

Figure 2.1 The 3D garage scene created by Kymnbel Bywater that we’ll be using throughout this chapter.

Figure 2.1 The 3D garage scene created by Kymnbel Bywater that we’ll be using throughout this chapter.

More on 3D in After Effects

You can also import Maya’s MA scene format type. Cinema 4D can even output its own type of After Effect project files (AEC files) so that 3D elements in the 3D environment, such as lights and cameras, can be animated and adjusted in After Effects. After Effects CS6 introduced the ability to create truly three dimensional objects, but it still cannot import 3D objects. Using the Trapcode plugin Form (version 2 and later), you can import a 3D object for use with that effect. In this chapter, we’ll be looking at how to use 3D data contained within special 2D files.

The 3D Channel Extract Effect

The 3D Channel Extract effect helps you to extract 3D data from a 3D channel. These results are then used in conjunction with another effect.

Let’s open up the 3D.aep project I’ve created as an example for these 3D channel effects. Apply the 3D Channel Extract effect to this layer. The layer is then turned to shades of gray. These shades of gray represent the levels of depth in the 3D file.

Figure 2.2 After applying the 3D Channel Extract effect, the image is changed to shades of gray that represent the depth of the 3D objects.

Figure 2.2 After applying the 3D Channel Extract effect, the image is changed to shades of gray that represent the depth of the 3D objects.

Using the default values, it’s difficult to see what’s going on here. But these grayscale values are supposed to represent the 3D depth of each object, with the objects closest to the camera in white, and the objects furthest from the camera in black. But right now, everything is just gray. Let’s fix that.

In the options for the 3D Channel Extract effect in the Effect Controls panel, we have three options. First is the 3D Channel drop down, which specifies which channel from the 3D file to extract. The default setting is Z-depth (i.e., 3D depth), and we’ll leave it here for a moment. Next we come to the Black Point and White Point values, which determine the furthest and closest 3D points in this image, respectively. These numbers represent the distance in pixels the 3D objects are from the virtual camera.

But how do we know how exactly how far away they are? The answer is simple—use the Info panel. With the 3D Channel Extract effect active and selected in the Effect Controls panel, click on the spot where the table is on the right hand side of the image. This table is the object closest to the camera. Once you click in this image in the Composition panel, its Z depth information will show up at the bottom of the Info panel.

Figure 2.3 After clicking on a 3D object in the Composition panel with the 3D Channel Extract effect selected in the Effect Controls panel, the Info panel tells us the approximate distance the 3D object is away from the camera.

Figure 2.3 After clicking on a 3D object in the Composition panel with the 3D Channel Extract effect selected in the Effect Controls panel, the Info panel tells us the approximate distance the 3D object is away from the camera.

Now we know that we need to set the White Point value to about –89. And although we don’t have the shadow information corrected yet, we have more contrast in our depth map.

Figure 2.4 The results of changing the White Point level to –89.

Figure 2.4 The results of changing the White Point level to –89.

Next, let’s repeat the same procedure, but we’ll use the background this time. With the 3D Channel Extract effect still selected in the Effect Controls panel, click on the darkest point of this image in the Composition panel. Then look in the Effect Controls panel to discover its Z depth.

Figure 2.5 The Info panel displays the distance from the camera to the background.

Figure 2.5 The Info panel displays the distance from the camera to the background.

The Info panel tells us that the background is about –4125 pixels in relation to the camera. Use this value for the Black Point property to complete the settings of this depth map.

Our depth map looks great. But what do we use it for? We can now use this effect as a luma matte for other effects, such as blurs. Or we could use it as a map to control other effects, such as Displacement Map. You can also use this effect to find out the Z depth values of objects throughout this image for use in other effects in this chapter, such as the Depth Matte and Depth of Field effects.

Figure 2.6 The corrected depth map.

Figure 2.6 The corrected depth map.

All of the work we’ve done so far with this effect has been to create a great map of the Z depth in this image. But this is only one of the many channels that we can extract with this effect. In the 3D Channel drop down, change the value to Object ID. Now, when you click on one of the 3D objects in this scene (such as the car or the table), the Info panel will display the Object ID of that object.

Object IDs are identifying numbers assigned to objects by a 3D program. If you did not assign Object IDs in your 3D program, or if you did not export your file with those Object IDs, or if your file format does not support them, this feature will not work. Later on in this chapter, when we cover the ID Matte effect, we’ll use these Object ID numbers to quickly isolate different objects in our 3D scene.

Figure 2.7 With the 3D Channel drop down set to Object ID, the Info panel will now display the Object ID of objects in the Composition panel that you click on.

Figure 2.7 With the 3D Channel drop down set to Object ID, the Info panel will now display the Object ID of objects in the Composition panel that you click on.

Now change the 3D Channel drop down to Surface Normals. Surface normals display a color value for the direction that each polygon is facing. This may seem like a bunch of random colors at first glance. But when we cover the Shift Channels effect in Chapter 5, we’ll use this data to add a new light in this scene as if we had added it in the original 3D scene.

There are several other settings besides the ones that we’ve covered. But the above listed options in the 3D Channel effect are the most common and helpful, from my experience. Just remember that this effect isn’t supposed to do anything visually interesting. But it does extract the key data that you need to control other properties in other effects to help you make the most out of the 3D data in your files. The other effects in this chapter would not be as useful without knowing the Z-depth information in your layer, as extracted by the 3D Channel Extract effect. Note that you do not always need to keep the 3D Channel Extract effect applied to your layer unless you need its results to be used with other effects. In some cases, you might apply this effect to learn what you need about your 3D channels, and then delete it.

The Depth Matte Effect

The Depth Matte effect can mask out (remove) objects in your 3D scene, based on their Z depth, or distance from the camera. This is helpful in an infinite amount of circumstances. Let’s say that we want to remove the background added by the 3D artist, and replace it with a matte painting from another artist. Because it’s the background, it will have the largest Z depth, making it easy to remove with the Depth Matte effect.

Another trick with the Depth Matte effect, and one that we’re actually going use here, is to composite a 2D layer into a 3D scene. This is a great skill to master. You’ll probably want to follow along with this exercise, so open up the Depth Matte.aep project from the Chapter 2 folder of the exercise files. This project contains a comp with the 3D garage scene, and a video of my buddy, Paavo (creator of www.malachyte.net) riding a unicycle. I’ve already keyed out (removed) the background for you. We want to make Paavo look like he’s jumping around behind the table, and in front of the garage door.

Figure 2.8 The Depth Matte.aep project.

Figure 2.8 The Depth Matte.aep project.

It might seem like the next step is to apply the Depth Matte effect. But we first need to rearrange the stacking order of these layers. Drag the paavo balancing.mov layer below the garage_ zoom0170.rpf layer. Now we can apply the Depth Matte effect to the garage_zoom0170.rpf layer.

When we first apply the Depth Matte effect in this project, the results are completely black, or in other words, completely masked out. This is because the default Depth value is such that the entire image is removed. Remember from our previous look at this file (when we covered the 3D Channel Extract effect) that the object that is closest to the camera is –89 pixels away. So a value of 0 was high enough to mask out everything. Just so we can see what’s going on here, take the Depth value to –250. All depth values farther away than this will be removed.

You can also increase the Feather value to create a smooth transition to transparency. Unfortunately, feathering will not get rid of the undesirable blockiness along the edges of 3D mattes. Besides, only the edges at the exact depth specified in the Depth parameter are affected. In Chapter 11, we’ll look at a few ways to clean these edges up a little.

I’m actually going to take my Feather value back to 0. Now we need to find the point in 3D where we want Paavo to be. We want him behind the table but in front of the garage wall. To find this depth range, select the Depth Matte effect in the Effect Controls panel.

Figure 2.9 Taking the Depth value to –250 removes all pixels farther away than this.

Figure 2.9 Taking the Depth value to –250 removes all pixels farther away than this.

Figure 2.10 Increasing the Feather value feathers the edges of the exact bit depth. Notice that the edges of the other depths are still hard.

Figure 2.10 Increasing the Feather value feathers the edges of the exact bit depth. Notice that the edges of the other depths are still hard.

Then click on the back of the table; the part of the table that is farthest away from you. The Info panel will display a value that should be around –170. Then, click on the garage wall behind Paavo. The Info panel should display a value of about –445.

From this, we learn that our depth value needs to be set to a value between –170 and –445. Thankfully, our example value of –250 fits the bill, but anything safely in this range should work just as well.

The next step is to select the garage layer in the Timeline panel, and press Ctrl+D(Win)/Cmd+D(Mac) to duplicate this layer. Then drag the duplicate below the paavo balancing layer. When you’re done, you should have a paavo sandwich, with a garage layer on top of the paavo balancing layer, and another garage layer beneath it.

Figure 2.11 It’s important to have your layers set up like this in order for this technique to work.

Figure 2.11 It’s important to have your layers set up like this in order for this technique to work.

So far, there’s no change in the Composition panel. What we need to do to finish this project off is to select the garage layer at the bottom of the layer stack. Then, in the Depth Matte effect controls, select the Invert checkbox. This causes everything that was hidden to be revealed and vice versa. Now, Paavo appears to be right in between the table and the back wall, right where we want him. If this had been a regular still image, this job would have been much more challenging and time-consuming.

Figure 2.12 Because of the depth mattes we’ve created, Paavo is now in between the table and garage wall.

Figure 2.12 Because of the depth mattes we’ve created, Paavo is now in between the table and garage wall.

The Depth of Field Effect

Depth of field is a beautiful thing. It is a blur effect created by a camera lens at different depths. It might as well have been called “depth blur.” Depth of field is used to focus a viewer’s attention on a subject, by blurring out details they should be ignoring.

Figure 2.13 A photo showing depth of field. The branch and snow are in focus, while everything in the background is out of focus. This focuses our attention immediately on the branch. Photo courtesy of Heather Perkins.

Figure 2.13 A photo showing depth of field. The branch and snow are in focus, while everything in the background is out of focus. This focuses our attention immediately on the branch. Photo courtesy of Heather Perkins.

Depth of field is a very natural effect because our eyes essentially do the same thing. Focus your eyes on something that is close to you—perhaps this book. Everything behind seems to blur away and recede into the distance. Now focus on something far away. The book seems to become blurry.

Depth of field is also beneficial because it helps make video look more like film. If you look at video footage, it will often have a complete lack of depth of field with all depth levels in perfect focus. This doesn’t seem as natural because it’s not the way our eyes work, and it’s not what we’re accustomed to seeing in film.

The Depth of Field effect here in After Effects attempts to recreate a natural depth of field by using the depth information in the 3D channel data. To see this in action, open up the 3D.aep project from the Chapter 2 folder of the exercise files. Apply the Depth of Field effect to the layer of this garage scene. The default settings don’t create a blur right off the bat. We need to do some setup first. First, let’s change the Maximum Radius value to 3. Maximum Radius determines the amount of blur. Its default value is 0, which is why we don’t see any blurring when this effect is first applied. Note that a little blur goes a long way in this effect. Small values like this are usually all you need.

Figure 2.14 The result of increasing the Maximum Radius (blur amount) to 3.

Figure 2.14 The result of increasing the Maximum Radius (blur amount) to 3.

The next thing I do with this effect is to adjust the Focal Plane Thickness value. For this value, I usually input the amount of depth in the entire scene. This basically tells After Effects how big my virtual world is, in terms of 3D depth. Earlier, when we looked at the 3D Channel Extract effect, we saw that the closest object to the camera was the table on the right (with a depth value of –89), and the object farthest away from the camera was the background (with a depth value of about –4100). So the total amount of distance from the front to the back is about 4000. Change the Focal Plane Thickness value to 4000.

The blur disappears, but that’s okay. We now need to specify where we want the blur in terms of 3D depth. We adjust that with the Focal Plane property. If we take this to 4000, it will blur the background. But we start to see a little problem here. As we blur the background, the rest of the image starts to blur a little as well.

What we need to do now is to adjust the Focal Bias parameter. When using depth of field on a real camera, the width of the aperture determines how shallow or deep the depth of field is. Let’s say that we only wanted the wrench of the table in focus, and everything else closer or farther away out of focus. That is a small object, so we would need a more open aperture to produce a more shallow depth of field. We can simulate a narrower depth of field by adjusting the Focal Bias property.

I’m going to take the Focal Bias value to 0. Adjusting Focal Bias throws off your blur a little, so now I need to fix my Focal Plane value. I’ll take the Focal Plane value to 3600. We now have the entire background blurred, but the blur stops right at the garage door.

Figure 2.15 The result of adjusting the Focal Plane Thickness and Focal Plane properties.

Figure 2.15 The result of adjusting the Focal Plane Thickness and Focal Plane properties.

The plant right outside the garage door is blurry while the garage door itself is sharp because of our narrow depth of field.

Figure 2.16 The result of adjusting the Focal Bias and Focal Plane values.

Figure 2.16 The result of adjusting the Focal Bias and Focal Plane values.

What if we wanted to make our viewers focus their attention on what was happening outside? That might be challenging because there’s a table in our way, and a really sexy yellow car, too. Simply change the Focal Plane value to –4800 to make the foreground blurry and the background sharp. It may sound weird, but viewers will ignore everything else close to them, instead focusing on the objects in focus.

Figure 2.17 The eyes are naturally drawn to objects in focus, even if those objects are in the distance.

Figure 2.17 The eyes are naturally drawn to objects in focus, even if those objects are in the distance.

This illustrates one of the great advantages of using the 3D channel information with the Depth of Field effect, rather than trying to recreate this look with masks and other blur effects. With the Depth of Field effect, we can animate the Focal Plane property to shift viewer focus. You can’t do that with masks. Depth of field is a really powerful storytelling tool in video. It makes this effect one of the best reasons to use 3D files with 3D channel data.

The EXtractoR Effect

Several years ago, the famed visual arts studio, Industrial Light and Magic (ILM) created a file format called OpenEXR. OpenEXR is a still image file format that can store 32 bit HDR data, and is akin to the powerful 3D file types mentioned at the beginning of this chapter. The biggest difference, perhaps, is that OpenEXR can store many more layers or channels of 3D data.

Many 3D software programs—such as Cinema 4D, Blender, Lightwave and others—support OpenEXR, as well as Photoshop (since version CS2) and the Mac OS (since 10.4). After Effects has been able to import OpenEXR files since After Effects 7, but it has never been able to access all the various layers of data that can be stored in them. Since CS4, After Effects has included two new effects, the EXtractoR effect (did you catch the capitalized EXR in there?) and the Identifier effect, which can take advantage of layered OpenEXR files.

After applying the EXtractoR effect, click anywhere in the Channel Info area in the Effect Controls panel to open a dialog box that will allow you to choose which channel of data that you would like to use for each color channel and the alpha channel.

Figure 2.18 The EXtractoR dialog box can display all the layers stored in multi-layered OpenEXR files. You can choose which layer to use for which color channel.

Figure 2.18 The EXtractoR dialog box can display all the layers stored in multi-layered OpenEXR files. You can choose which layer to use for which color channel.

The OpenEXR format is constantly being improved and developed. Currently, it can store up to 49 channels of data. There are so many in Figure 2.18, that they don’t even fit on screen at the same time. Perhaps by the time you read this, it will be able to contain even more. For more information on the EXtractoR and IDentifier effects, visit the website of the developer, www.fnordware.com. On this site, they not only have documentation, but downloadable sample OpenEXR files that contain many channels that you can practice with.

The Fog 3D Effect

The Fog 3D effect creates fog that traverses through a scene in 3D space. Again, this effect uses the Z depth information stored in a file to determine where to put the fog. This effect works well at enhancing the realism of a 3D scene, but the lack of quality in the method used to create the fog is a little disappointing.

To see what this puppy does, open up the Fog 3D.aep project from the Chapter 2 folder. Apply the Fog 3D effect to the garage_zoom0170.rpf layer. The default results turn our entire layer white. To see what the Fog 3D effect is trying to do, adjust the Fog Start Depth value to about –150, and the Fog End Depth value to about –300. This sets the range of fog, and everything behind this is also covered in fog. As with other depth-based effects in this chapter, when this effect is selected in the Effect Controls panel, you can click in the Composition panel to have the Z depth of an object displayed in the Info panel.

The default results really aren’t very foggy. The only thing I can imagine using this effect for is for an apocalyptic nuclear explosion.

Figure 2.19 The Fog 3D effect after adjusting the fog starting and ending points.

Figure 2.19 The Fog 3D effect after adjusting the fog starting and ending points.

Thankfully, the Fog 3D allows you to use another layer as a gradient for the 3D fog. We’re going to use the other layer in this comp, which is a layer of precomposed fractal fog, created with the Fractal Noise effect. It’s important that it is precomposed or the Fog 3D effect will not be able to use the textures generated by the Fractal Noise effect.

Figure 2.20 The fog pattern created with the Fractal Noise effect.

Figure 2.20 The fog pattern created with the Fractal Noise effect.

To use this fractal fog layer as the pattern for our 3D fog, select the PRECOMP fractal noise layer from the Gradient Layer drop down in the Fog 3D effect options in the Effect Controls panel. Make sure the visibility of the fractal fog layer itself is turned off. To blend the layer selected in the Gradient Layer drop down into our for in the Fog 3D effect, increase the Layer Contribution value. I took the Layer Contribution value to 60.

Figure 2.21 After selecting the fractal fog pattern in the Gradient Layer and increasing the Layer Contribution value to 60, we have more believable fog.

Figure 2.21 After selecting the fractal fog pattern in the Gradient Layer and increasing the Layer Contribution value to 60, we have more believable fog.

One of the things that is making this fog seem so fake is its density. Let’s reduce the Fog Opacity value to 25%. This will create a smoky area in the back of the garage, and will look a little more

Figure 2.22 After reducing the Fog Opacity value to 25%, the results are much more believable.

Figure 2.22 After reducing the Fog Opacity value to 25%, the results are much more believable.

believable than what we’ve seen with this effect so far. We can also lower the Scattering Density value to make the fog less thick.

The real benefit of the Fog 3D effect is that we can adjust the Z depth of the fog with the Fog Start Depth and Fog End Depth parameters. These properties can also be animated to create the effect of fog rolling in.

Figure 2.23 Here, the Fog Start Depth and Fog End Depth properties have been adjusted to isolate the fog to the outdoors. This would look a lot cooler if we didn’t have a bright blue sky in the background, but you get the idea.

Figure 2.23 Here, the Fog Start Depth and Fog End Depth properties have been adjusted to isolate the fog to the outdoors. This would look a lot cooler if we didn’t have a bright blue sky in the background, but you get the idea.

The ID Matte Effect

The ID Matte effect can use either object IDs or material IDs to isolate objects, or to remove them. This is helpful if you would like to use one element from an entire scene. In this case, we’re going to isolate the car on the left hand side using its object ID. It’s quick. It’s easy. It beats the heck out of rotoscoping.

Open the 3D.aep project from the Chapter 2 folder. Apply the ID Matte effect to the 3D garage scene. Since this scene was not set up with material IDs (and it was meticulously set up with object IDs), we’ll leave the Aux Channel drop down set to Object ID.

With the ID Matte effect selected in the Effect Controls panel, you can click on different objects to isolate them. Or, if you’ve used the 3D Channel Extract effect to find out an object’s ID, you can just type the object ID number into the ID Selection value. I’m going to type in a value of 2, which is the object ID for the yellow car in the front. This isolates the car and removes all other objects.

Figure 2.24 Using the ID Matte effect we can isolate objects, such as this car.

Figure 2.24 Using the ID Matte effect we can isolate objects, such as this car.

If you wanted to keep the entire garage scene and create a hole where the car is, you can select its object ID, and then select Invert.

Figure 2.25 Selecting Invert will keep the garage scene and remove the car.

Figure 2.25 Selecting Invert will keep the garage scene and remove the car.

You might have noticed some rough edges also. You can increase the Feather value to smooth those out. However, this usually doesn’t do the job completely. You’ll probably also want to apply an effect like the Simple Choker effect (discussed in Chapter 11) to finish cleaning up those edges.

Figure 2.26 The matte is slightly cleaner with a little bit of edge feathering. Here, I took the Feather value to a modest 1. The results are slightly improved, but nowhere near perfect.

Figure 2.26 The matte is slightly cleaner with a little bit of edge feathering. Here, I took the Feather value to a modest 1. The results are slightly improved, but nowhere near perfect.

Isolating objects is a great feature of not only the ID Matte effect, but of 3D channels in general. In Figure 2.27, I added some red solids with Gradient Overlay layer styles as a background, painted a shadow, duplicated the car layer to use it as its own reflection, and warped the reflection into place with the Bezier Warp effect (discussed in Chapter 7).

Figure 2.27 Isolating the car allows us to use it as an independent object.

Figure 2.27 Isolating the car allows us to use it as an independent object.

The IDentifier Effect

The IDentifier effect is another effect created by Fnord included in After Effects to work with layered OpenEXR files. For more information on this, refer back to the EXtractoR effect, covered earlier in this chapter. The IDentifier effect has a similar purpose (and even functions similarly) to the EXtractoR effect. However, while the EXtractoR effect extracts visual data (such as reflection and specularity channels), the IDentifier effect extracts nonvisual data, such as material ID and object ID.

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

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