introduction to compositing - amazon s3 · • compositing: learn the process of creating a...

13
35 CHAPTER 5 Introduction to Compositing Significant productivity gains can be realized by using a technique called compositing of 2D images. Layers and elements above the background image must have alpha channel transparency to composite effectively. Each layer or element can have multiple Composite tools applied to it for a high degree of editing flexibility and special or digital effects. One of the most flexible 3ds Max file types to work with in Autodesk’s ® Composite is OpenEXR. OpenEXR files have alpha channel transparency, of course, but can also contain information from the Render Elements that you learned about in Chapter 34. These elements can be extracted in Composite and the tools and special effects can be applied directly to them. Some of the topics covered in this chapter are as follows: Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. Color correction: Edit colors of objects in a rendered image without rerendering the 3D scene. Depth of field: Add the special effect Depth of Field (distance blurring) in a 2D rendered image. Your client would like to be able to quickly change the color of a tram car in a street scene, but they need to experiment because they don’t know what color would work best. Your

Upload: others

Post on 12-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

35

CHAPTER 5

Introduction to Compositing

Signifi cant productivity gains can be realized by using a technique called compositing of 2D images. Layers and elements above the background image must have alpha channel transparency to composite eff ectively. Each layer or element can have multiple Composite tools applied to it for a high degree of editing fl exibility and special or digital eff ects.

One of the most fl exible 3ds Max fi le types to work with in Autodesk’s ® Composite is OpenEXR. OpenEXR fi les have alpha channel transparency, of course, but can also contain information from the Render Elements that you learned about in Chapter 34 . These elements can be extracted in Composite and the tools and special eff ects can be applied directly to them.

Some of the topics covered in this chapter are as follows:

• Compositing : Learn the process of creating a composition and then blend two image layers using alpha channel.

• Color correction : Edit colors of objects in a rendered image without rerendering the 3D scene.

• Depth of fi eld : Add the special eff ect Depth of Field (distance blurring) in a 2D rendered image.

Your client would like to be able to quickly change the color of a tram car in a street scene, but they need to experiment because they don’t know what color would work best. Your

Page 2: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Getting Started in 3D with 3ds Max

36

task is to establish a workfl ow for maximum fl exibility. The client had also mentioned that it would help draw the attention of the viewer to the tram car if selective “depth of fi eld” blur could be applied to blur out the background buildings slightly.

In this chapter, you will learn to create a Composite composition and then import a number of pre-rendered OpenEXR image fi les known as “footage” into the composition fi le.

You’ll then composite a background image, which is the entire street scene shown on the cover of this book and a rendering of just the mid-ground tram against a black (transparent) background. The tool to composite the two images is called Blend & Comp and you’ll learn to “wire” the images into the tool as background and mid-ground layers.

Then you’ll use a color correction tool in Composite on the tram image layer to adjust the colors in real time. However, bushes that were rendered in the background image are obscured by the tram even though the bushes are in front of the tram in the 3D scene. You will learn to apply a mask of just the rendered bushes and manipulate the alpha channel to make the bushes appear to be in front of the tram, as in the original scene.

Finally, you will apply the Blur tool and create a selective blurring by using a modulation image, that is an eff ect called Z Depth, generated by a render element saved in the OpenEXR fi le during rendering in 3ds Max. A Z Depth image is a grayscale image where objects in the foreground are represented by white pixels and objects receding from the camera position are rendered in progressively darker pixels. This image then modulates the amount of blurriness based on the whiteness values in the Z Depth image.

Flexibility and effi ciency are achieved with real-time editing and very short render times of the fi nal image because everything is in 2D.

Although this chapter uses Autodesk’s ® Composite software, the workfl ow would also be useful for anyone using Adobe’s ® After Eff ects or Adobe’s ® Photoshop for still images only.

Let’s start by creating a new composition fi le in Composite.

5.1 Compositing The Composite workfl ow with nodes arranged in a schematic layout is similar to the Slate Material Editor in 3ds Max. You wire images and tools together to layer the images and eff ects into a fi nal Output node.

The basic Composite interface has a Menu Bar at the top of the display, viewports (Schematic and Player, by default), a Tool UI, and a Taskbar at the bottom of the display (see  Figure 5-1 ).

Note

The 3ds Max installation also includes Autodesk Composite, but does not place a shortcut on the desktop. To open Composite, you need to navigate to C:\Program Files\Autodesk\Composite 2013\program folder and double-click on the Composite application fi le (you can also create a shortcut and move it to the desktop).

AQ1

Page 3: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Introduction to Compositing

37

Let’s begin a new Composite composition and import the footage from the website.

FIG 5-1 The default Composite user interface.

Exercise 5-1-1 Create a Composition

1. Open Composite and then in the File pull-down menu, choose New. Navigate to an appropriate folder on your hard drive and name the fi le Exercise 5-1-1_Composite01. Click the Create button. You should now have an Output node in the Schematic viewport. In the Tool UI, Composition, click on the Format drop-down list and choose HD 720p (see Figure 5-2 ). This resolution conforms to the footage rendered for this chapter in 3ds Max. The Output node is necessary to display any import in the Player viewport.

FIG 5-2 Start a new composition with an Output node in composite.

Page 4: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Getting Started in 3D with 3ds Max

38

2. In the File pull-down menu, choose Import. Navigate to the Max_fi les folder for Chapter 5 on the website. In the File Browser dialog, use the Ctrl key to highlight the three exr fi les (see Figure 5-3 ). Click the Import button and then close the File Browser dialog. The footage will appear as three selected nodes.

FIG 5-3 The “footage” fi les all have the exr fi le type and are still images.

3. Right-click over one of the images in the Schematic viewport and then choose Layout All to align all nodes vertically. Left-click in an empty area of the Schematic viewport to deselect everything and then click each of the image nodes independently to display them in the Player viewport. One image contains the entire scene, one image has just the tram, and the other image has just the bushes. Select the image with the entire scene and then right-click on the Player viewport and choose Fit to Player (see Figure 5-4 ). This zooms the Player viewport to display the entire image. The checker pattern in the sky is the result of viewing the image with alpha channel transparency.

FIG 5-4 The Player viewport displays the selected image.

4. In the Tool UI, Options tab, Channel Groups drop-down list, choose Colors to disable the alpha channel and display the sky in the rendered image (see Figure 5-5 ).

Page 5: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Introduction to Compositing

39

In Exercise 5-1-2 , you will learn to “wire” footage fi les to the Output node and then use the Blend & Comp tool to composite the tram image on top of the background street scene image. The output in the Player viewport won’t look any diff erent because the tram image is superimposed on top of the tram in the background. However, you’ll also learn to add a CC Basics tool to the tram image to change the colors of just the tram.

FIG 5-5 Disable the alpha channel by displaying only Colors for the background image.

5. In the Files pull-down menu, choose Save As. In the Save Composition As dialog, rename the fi le Exercise 5-1-1_Composite02 and then click the Save button. You now have a new composition with three still image “footage” fi les that were rendered in 3ds Max in the exr fi le format.

Exercise 5-1-2 Blend & Comp Node

1. Open the fi le from the previous exercise called Exercise 5-1-1_Composite02 .txcomposition. In the Schematic viewport, pick and drag the entire scene fi le to the left of the Output node. Click and drag from the output on the right side of the image node to the input on the left side of the Output node. This feeds the image into the Output node and displays it in the Player viewport (see Figure 5-6 ).

FIG 5-6 Connect the output of the street scene image to the input of the Output node.

Page 6: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Getting Started in 3D with 3ds Max

40

2. Right-click on the Schematic viewport and then go to Add from Pick List, Compositing, and choose Blend & Comp. This adds a Blend & Comp tool to the Schematic viewport. Wire the image output to the “Back” input of Blend & Comp. Wire the output of Blend & Comp to the input of Output (see Figure 5-7 ). The street scene is now the background image of a new composition and is being displayed in the Player viewport by the Output node.

FIG 5-7 The street scene is the background image of a Blend & Comp composition.

3. Select and move the Tram Image node above the Street Scene Image node and then wire the tram image output into the Front input of the Blend & Comp. Use the keyboard shortcut Home button to center the nodes in the Schematic viewport (see  Figure 5-8 ). The result is a composite of two images using alpha channel transparency. The street scene with the tram in the background has a layer on top of it that contains only the tram with alpha transparency.

FIG 5-8 Connect the output of the tram image to the Front input of the Blend & Comp.

Page 7: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Introduction to Compositing

41

Exercise 5-2-1 CC Basics Node

1. Open the fi le from the previous exercise called Exercise 5-1-1_Composite03 .txcomposition. In the Schematic viewport, hover the cursor over the wire connecting the tram image to the Blend & Comp tool. The wire will glow. Right-click and go to Add from Pick List, Color Correction, and choose CC Basics (see Figure 5-9 ).

4. Use File, Save As to save the fi le to your hard drive with a new incremental name. You must change the name manually in the Save Composition As dialog.

In Exercise 5-2-1 , you will add a CC Basics color correction tool between the tram image and the Blend & Comp tool, then you will do color correction only for the tram layer in the composition.

5.2 Color Correction The client would like to see diff erent color schemes on the tram, so you will add a CC Basics color correction tool and make real-time changes that will display in the Player viewport.

FIG 5-9 Add, and automatically connect, a CC Basics color correction tool between the tram image and the Output node.

2. Make sure the CC Basics tool is selected in the Schematic viewport. In the Tool UI, CC Basics tab, click and drag the black spot in the center of the color wheel and drag it to the outside edge. As you drag the spot around the outside edge, you will see that the tram is being color corrected (see Figure 5-10 ).

Page 8: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Getting Started in 3D with 3ds Max

42

3. Use File, Save As to save the fi le to your hard drive with a new incremental name. You must change the name manually in the Save Composition As dialog. You are color correcting only the front layer in the current composition, providing you with the fl exibility to show the client diff erent color schemes in real time.

If you look closely at the tram in the Player viewport (you can zoom with the mouse wheel and pan by holding the spacebar and then clicking and dragging in the viewport), you will see that the bushes that are in the background image are obscured by the tram layer in the foreground image (see Figure 5-11 ).

FIG 5-10 Color correct the tram image layer only.

FIG 5-11 The front layer of the composition obscures the bushes in the background layer.

In Exercise 5-2-2 , you’ll learn to use the alpha channel of an image containing just the bushes to reveal the background bushes through the foreground tram. You have already learned about the concept of masking when creating materials.

Page 9: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Introduction to Compositing

43

Exercise 5-2-2 Masking

1. Open the fi le from the previous exercise called Exercise 5-1-1_Composite04 .txcomposition. In the Schematic viewport, use the mouse wheel zooming and spacebar panning to zoom in closer to the tram in the scene.

2. In the Schematic viewport, wire the output of the bushes image to the Masking input of the Output node. This uses the color information in the image to create transparency, resulting in a semi-transparent reveal of the bushes hidden behind the tram, and the tram has returned to its original colors (see Figure 5-12 ). The mask uses alpha channel transparency information in the exr fi le, which is white bushes against a transparent black background. The alpha channel must be inverted.

FIG 5-12 The alpha channel information in the bushes image needs to be inverted.

3. In the Schematic viewport, hover the cursor over the wire connecting the bushes image and the Blend & Comp. Right-click and go to Add from Pick List, Channels, and then choose Invert Alpha. The Invert Alpha tool will be connected and the transparency is reversed, resulting in a corrected output in the Player viewport (see  Figure 5-13 ).

FIG 5-13 The Invert Alpha tool reverses the transparency information of the image.

Page 10: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Getting Started in 3D with 3ds Max

44

Exercise 5-3-1 Blur Node and Z Depth

1. Open the Composite composition from the previous exercise called Exercise 5-1-1_ Composite05.txcomposition. In the Schematic viewport, right-click on the street scene image and choose Copy in the menu. Position the cursor below the Blend & Comp tool in the Schematic viewport, then right-click and choose Paste to make a copy of the image. In the Tool UI, Options tab, Channel Views drop-down list, choose Z Depth (see Figure 5-14 ). The image copy in the Schematic viewport becomes a grayscale image.

4. Right-click on the Player viewport and choose Fit to Player. Save the fi le to your hard drive with a new incremental name. Masking is a technique for a more logical blending of layers in a composition. The exr fi le type that was rendered from 3ds Max contains information that can be used in multiple ways, for example, color information and alpha channel transparency as you’ve used here.

Let’s enhance the scene by simulating depth of fi eld blurring.

5.3 Depth of Field There is one more request from the client. It would help bring the viewer’s attention to the tram if the scene behind the tram could be blurred similar to the depth of fi eld in a photo. In Exercise 5-3-1 , you will add a Blur tool between the Blend & Comp and the Output node. Normally, this would blur the entire image, but you will use a copy of the street scene image in the Modulation image input to aff ect a selective blurring, simulating depth of fi eld.

When the street scene was rendered in 3ds Max, it included a Render Element called Z Depth, which was included in the street scene exr fi le. Z Depth represents objects close to the camera as white pixels and objects further from the camera with grayscale pixels relative to the distance from the camera, the further the distance the darker the pixel.

FIG 5-14 The street scene image was rendered as an exr fi le with Z Depth channel information.

Page 11: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Introduction to Compositing

45

2. In the Schematic viewport, hover the cursor over the wire between Blend & Comp and the Output node. Right-click and, in Add from Pick List, Compositing, choose the Blur tool. In the Schematic viewport, drag from the Z Depth image output to the Modulation image input of the Blur tool (see Figure 5-15 ). No blurring occurs yet.

FIG 5-15 The Z Depth information will be used to modulate the amount of blur in the scene.

3. In the Schematic viewport, select the Blur tool. In the Tool UI, Modulation tab, enter 15 in the X Radius numeric fi eld and then press Enter. The X and Y values are linked together (see Figure 5-16 ). The foreground becomes blurry while the background remains clear, just the opposite of what you want.

FIG 5-16 The Blur Modulation starts blurring at the camera position.

4. In the Tool UI, Modulation tab, click the eyedropper icon to the right of Off set numeric fi eld. In the Player viewport, pick in the middle of the bush in front of the tram (see Figure 5-17 ). The blurring will begin at that point making the tram stand out against its blurred background. You can then edit the space X Radius numeric fi eld to set the blur amount to your taste.

Page 12: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Getting Started in 3D with 3ds Max

46

5. Save the fi le. It should already be called Exercise 5-1-1_Composite05.txcomposition. Even though the exr fi le type images you are using are 2D, the fi les contain information that can simulate 3D eff ects.

FIG 5-17 You can manually pick the Off set point when the blurring begins.

The process of compositing layers of rendered information is a powerful productivity tool. It allows multiple teams to create portions of a scene that render quickly and are then stored in an exr fi le, which can have extended channels for editing and creating special eff ects in the fi nal 2D composition.

Although this chapter has only been an introduction to Autodesk’s ® Composite software, you have learned some of the fundamental concepts that are used as a basis for practically all compositing.

Page 13: Introduction to Compositing - Amazon S3 · • Compositing: Learn the process of creating a composition and then blend two image layers using alpha channel. • Color correction:

Author QueryAQ1: Page 36 Please advice, should we insert registered trademark symbol after Autodesk.