Post-apocalyptic City - Part 2

Duration: 0 minutes 3 seconds








Introduction

Compositing in After Effects is in many ways very similar to working in Photoshop. If you are familiar with layers, masks, blending modes and/or filters, compositing in After Effects should be a breeze.

Click here to go to Part 1

Step 5: Importing Footage

Open After Effects. Press Ctrl+I for Windows or Cmd+I on the Mac to import the render passes. Navigate to correct folder and select all files by pressing Ctrl+A/Cmd+A. Make sure to check the box called Multiple Sequences. Then press Open (Fig.01).

Fig. 01

Fig. 01

After Effects is now going to ask you whether the Targa files are premultiplied or not. As we checked the premultiplied box when outputting the files from 3ds Max, they are indeed. We didn't set any background color in Max and so it should be black, which is the default. As a result, we'll choose Premultiplied - Matted With Color and make sure that colour is set to back which is the default in After Effects (Fig.02).

Fig. 02

Fig. 02

As you are importing four image sequences, you'll be asked the same question four times. Answer Premultiplied - Matted With Color every time.

Step 6: Layers & Blending Modes

Now that the footage has been added, you need to drag it down to the time line. Start with your main pass, in my case "city{0000-0100}" and scrub to a place in the time line where you are able to see both the city and the sky (Fig,03).

Fig. 03

Fig. 03

To add a bit more light and a hint of global illumination, we'll add the occlusion pass next. This pass goes above the main pass (Fig.04).

Fig. 04

Fig. 04

To see the main pass through the occlusion pass, we need to change the blending mode for the occlusion pass from Normal to Soft Light (Fig.05).

Fig. 05

Fig. 05

You might need to press the middle button in the lower left corner to get to the blending mode options (Fig.06).

Fig. 06

Fig. 06

To make the scene less grey and boring-looking, we'll give the scene a yellow tint as if sunlight was illuminating the city. Right-click below the two render passes you added, choose New and then Solid (Fig.07).

Fig. 07

Fig. 07

Then, under Solid Settings, give the solid a light, yellow colour (Fig.08).

Fig. 08

Fig. 08

Change the blending mode for the solid to Multiply (Fig.09).

Fig. 09

Fig. 09

As you can see, this gives us a slight problem as the sky just turned yellow too. This is because unlike the rendered passes, the solid does not come with a built-in alpha. To add one and get rid of the yellowness, first drag the matte render pass into the time line. Drag it to the bottom of the stack (Fig.10).

Fig. 10

Fig. 10

This seemingly cleared up the matter at once as the sky instantly went back to black. However, this only happened because the underlying matte is black in the area representing the sky and that anything (including light yellow) multiplied by black becomes black. To make the sky area of the solid truly transparent, you need to right-click the solid, choose Effect, Channel and then Set Matte (Fig.11).

Fig. 11

Fig. 11

In the Take Matte From Layer drop down, select the matte which will be the fourth option. As the matte doesn't come with an alpha channel, you have to change the Use For Matte option from Alpha Channel to either Red Channel, Green Channel or Blue Channel. As the matte is greyscale, the red, green and blue channel contains the exact same data and it doesn't matter which one you choose (Fig.12).

Fig. 12

Fig. 12

The solid is now transparent. As we'll be needing to apply the matte to other layers later, select the matte in the Effect Controls window and press Ctrl+C/Cmd+C to copy it. Next up is the Z-Depth pass. This can be used for two purposes, but here we'll use it to decrease contrast further back to put some "air" between the foreground and the background. Drag the Z-Depth pass to the top of the time line (Fig.13).

Fig. 13

Fig. 13

As we wish to decrease the contrast more the further away you get, we want the lightest areas in the background. To achieve this, we'll invert the layer by right-clicking it, choosing Effect, Channel and Invert (Fig.14).

Fig. 14

Fig. 14

Then set the blending mode to Add (Fig.15).

Fig. 15

Fig. 15

We have now successfully put some "air" between the foreground and the background, but in reality, this "air" isn't white on a sunny day, but the colour of the sky. We'll apply a colour correction to the Z-Depth pass by right-clicking it again and choosing Effect, Color Correction and Hue/Saturation (Fig.16).

Fig. 16

Fig. 16

Check the box called Colorize and then turn the Colorize Hue knob to somewhere around -160 (Fig.17).

Fig. 17

Fig. 17

Also, the sky has turned white, due to the fact that the Z-Depth pass does not contain an alpha channel. With the Z-Depth pass selected in the time line, highlight the Effect Controls panel above and press Ctrl+V/Cmd+V to paste in the matte from earlier. The Take Matte From Layer drop down resets for some reason, so we have to select our matte layer again (Fig.18).

Fig. 18

Fig. 18

Step 7: Sky Replacement

Now that we have a basic composite for the buildings, we'll proceed with replacing the sky. First step is to find a suitable image. Personally, I went over to CG Textures (http://cgtextures.com/) and downloaded one of their Skies 360 images. Import the image by pressing Ctrl+I/Cmd+I and pointing to it on your hard drive (Fig.19).

Fig. 19

Fig. 19

Next, drag the new sky layer into the composite, directly underneath your main layer (Fig.20).

Fig. 20

Fig. 20

Right away, the sky looks too large and rather boring so we'll try making it a bit more interesting. First, reduce its size by expanding the layer (press the little triangle) and scale it down to around 40% under Transform (Fig.21).

Fig. 21

Fig. 21

In the viewer, drag the sky layer upwards to match the horizon in the cityscape (Fig.22).

Fig. 22

Fig. 22

Select the sky layer and press Ctrl+D/Cmd+D to duplicate it. Rename the layer to something like Sky Flipped. To do this you select the layer on the time line and hit Return on the keyboard to rename it. As you might have figured out by now, we'll be flipping this layer. We're doing this to conceal the fact that we're using the same sky map twice. Expand the layer again, uncheck the little link symbol next to Scale and set the first value to -40% instead of 40%. Then check the link symbol again and, in the viewer, move the sky so the cloud formations don't overlap with the same ones in the layer underneath (Fig.23).

Fig. 23

Fig. 23

Now for the fun part: Still using the Sky Flipped layer, play around with different blending modes until you get a dramatic effect. I ended up with Linear Light. Don't think about matching the colour to the rest of the image yet, we'll look at that next. You now have two sky layers you can animate at different speeds, making it look like some clouds are moving faster than others across the screen. Don't animate anything just yet though (Fig.24).

Fig. 24

Fig. 24

To make the sky and the 3D clash less, we'll create what's called an Adjustment Layer. An Adjustment Layer doesn't contain graphics, but will let you apply effects to it that also applies to all layers below it. To create one, right-click any empty space in the time line and choose New and Adjustment Layer (Fig.25).

Fig. 25

Fig. 25

In this case, we only want the Adjustment Layer to affect the sky, so we will drag it to right above our two sky layers. If you like, you can rename the layer to something like Sky Adjustments. Now that we have the Sky Adjustments layer in place, right-click it, choose Effect, Color Correction and Hue/Saturation (Fig.26).

Fig. 26

Fig. 26

Now, dial Master Hue back to round -10 and Master Saturation to about -50 and the sky and city should begin to match each other (Fig.27).

Fig. 27

Fig. 27

Step 8: Tracking

The sky replacement is now almost finished, but one major thing is missing. While the rendered footage is constantly moving, the sky maps are stationary, making the composite painfully obvious as soon as you hit the play button. In other words, we'll have to animate the sky, making it look like it follows the city horizon. Doing this by hand can be very time consuming and painful, though luckily there is a better way called tracking. When tracking a shot, you're basically making After Effects watch a few selected areas of the image, frame by frame, and recording their movements. You can then apply the same movement to other objects in the scene. Areas used for tracking are preferably points of high contrast that don't deform too much during the clip, making it easy for After Effects to recognize through a long sequence of frames. In this respect, the shot we've just created is rather difficult to track. Nearly every part of the rendered sequence deforms over time. In addition the sky needs to move with the horizon, confining the area of tracking to that fine line which is almost constantly deforming. In other words, tracking this shot, although possible, will probably be difficult and time consuming.

Luckily, we're talking about a 3D render here, and so we have the means to fix this pretty easily. Go back to 3ds Max, create two pyramid shapes and place them close to the horizon, looking through the camera. Make sure to space them a little apart. Now, hide all other geometry in your scene, give the pyramids a white, self-illuminated texture and render the sequence against a black background. Instant tracking markers! (Fig.28)

Fig. 28

Fig. 28

This makes tracking a breeze. Import the pyramid pass and drag it to the bottom of the time line (Fig.29).

Fig. 29

Fig. 29

We also need something to apply the motion to. For this we'll be using what's called a Null Object. Basically an invisible object that can store information about position, rotation and scale. Rather like a Dummy in 3ds Max. To add one, right click an empty spot on the time line, choose New and Null Object (Fig.30).

Fig. 30

Fig. 30

With the Null in place, right-click the pyramid layer and choose Track Motion. A panel named Tracker Controls will appear on the lower right of your screen (Fig.31).

Fig. 31

Fig. 31

For this scene we need to track both Position, Rotation and Scale, so make sure all three boxes are checked. As it's hard to track rotation and scale with only one Track Point, an additional point will appear once you check them
(Fig.32).

Fig. 32

Fig. 32

Click the button called Edit Target and make sure it is set to our Null Object. This will make sure the motion data will be transferred to the Null Object when tracking is finished (Fig.33).

Fig. 33

Fig. 33

Now we need to decide whether we are going to track forwards or backwards. In our case, the tracking points (pyramids) are actually out of frame at the beginning of the clip, so we'll track backwards. That means scrubbing the time slider to the last frame (Fig.34).

Fig. 34

Fig. 34

Having chosen a frame, we need to align the Track Points with the pyramids. Click and drag one to the lowest corner of each pyramid. We're choosing the lowest points as they are the last parts of the pyramids to exit the frame before they disappear completely, which gives us another couple of frames of tracking (Fig.35).

Fig. 35

Fig. 35

Now press the Analyze Backwards button and watch After Effects tracking the scene. As you can see, the pyramids disappear after a while, making the Track Points stop, but after that point we don't see the horizon anymore and as the point here is to track the sky, that's perfectly acceptable (Fig.36 & Fig.37).

Fig. 36

Fig. 36

Fig. 37

Fig. 37

Having finished the tracking, press the Apply button to transfer the position, rotation and scale information to our Null Object. Dimensions should be both X and Y (Fig.38 & Fig.39).

Fig. 38

Fig. 38

Fig. 39

Fig. 39

Try playing the animation to check whether the Null is now fixed to the horizon (Fig.40).

Fig. 40

Fig. 40

The final piece of the tracking puzzle is to scrub to the frame where you aligned the sky horizon with the city horizon and, once there, parent the sky layers to the Null. Parenting in After Effects is similar to linking in 3ds Max, meaning the parented layers will follow their parent. To parent both sky layers to the Null, select them and drag the little spiral icon on one of the layers to the Null Object (Fig.41).

Fig. 41

Fig. 41

Play the animation again and make sure the sky stays within the frame at all times. If it doesn't - move the sky layers around in the viewer until they do. Congratulations! You have successfully tracked a shot in After Effects! You can now go ahead and animate the sky layers if you want.

' '

Step 9: Blur, grain and pre-comps

We're definitely getting somewhere now and to round off the shot we'll add some depth of field, blur and a bit of grain. All three effects helps us to hide the fact that the buildings are a bit low-poly to be in the foreground and that the sky and city don't blend perfectly yet.

Step 9.1: Depth of field

As depth of field is an effect we want applied to the whole image, we'll first create a new Adjustment Layer and make it the top layer. I'll name it Depth of field. We'll also drag in a new Z-Depth layer and make it the bottom layer. Having done that, right-click the newly created Adjustment Layer, choose Effect, Blur & Sharpen and Lens Blur (Fig.42).

Fig. 42

Fig. 42

The image instantly blurs all over. In the Depth Map Layer select the bottom Z-Depth layer. Also check Repeat Edge Pixels to get rid of the dark border surrounding the frame (Fig.43).

Fig. 43

Fig. 43

Use Blur Focal Distance to focus and Iris Radius to control how much blur you apply. In this example I set Blur Focal Distance to 215 and Iris Radius to 25 (Fig.44).

Fig. 44

Fig. 44

This leaves us with one problem though, as the sky gets blurred way too much. To fix this, we have to tweak the Z-Depth layer we just added a little bit. Select the bottom Z-Depth layer and in the menu bar go to Layer and Pre-Compose (Fig.45).

Fig. 45

Fig. 45

This creates a new composition within our main one, meaning we will be able to output the new composition as a new, modified Z-Depth layer. Name the new composition Z, move all attributes to the new composition and open it (Fig.46).

Fig. 46

Fig. 46

As you can see in the new composition, the sky area of the Z-Depth is represented as pitch black, making the Lens Blur effect read the sky as really, really far away and therefore making it really, really blurred. We'll change the colour to something brighter, causing the Lens Blur effect to make the sky less blurred (Fig.47).

Fig. 47

Fig. 47

Create a solid by right-clicking in the timeline and choosing New and Solid. Make the colour light grey this time. In this tutorial, I'm going for #8A8A8A. The solid goes below the Z-Depth layer (Fig.48).

Fig. 48

Fig. 48

Drag in a new matte from the Project tab and make it the bottom layer (Fig.49).

Fig. 49

Fig. 49

Right-click on the Z-Depth layer, choose Effect, Channel and Set Matte. Set Take Matte From Layer to the matte and set User For Matte to Red Channel, Green Channel or Blue Channel. Now we have a z depth map with a lighter background (Fig.50).

Fig. 50

Fig. 50

Back in the main composition, you'll notice the sky is significantly less blurred (Fig.51).

Fig. 51

Fig. 51

Step 9.2: Blur

I would recommend adding a small amount of blur to the composition as 3D renders often get too crisp. To do this, simply add another Adjustment Layer, call it Blur and add the effect called Fast Blur. Set the Blurriness to somewhere between 0,5 and 2 and make sure to Repeat Edge Pixels (Fig.52).

Fig. 52

Fig. 52

Step 9.3: Grain

Finally, if you wish to give the shot a more filmic look, you might consider adding some grain as well. Create yet another Adjustment Layer, call it Grain and add the effect called Add Grain. There are a lot of settings to play with here, but I ended up with the Preset called Eastman EXR 50D (5245) and decreased the Intensity to 0.9. I also set the Viewing Mode to Final Output (Fig.53).

Fig. 53

Fig. 53

I guess this is all for now. I know there are still a ton of things I could have gone into more detail about or explained better, but I had to stop somewhere! If you're stuck, want something explained more clearly or just want to tell me how plain wrong I am, feel free to leave a comment over at: http://thimic.net/about

Click here to go to Part 1

Fetching comments...

Post a comment