Sunday, December 9, 2007

Rendering Basics

Rendering an Object

As we've done in previous chapters, we will explore the rendering process by working through an example from beginning to end. To demonstrate rendering, we'll use a beveled text letter. We will light it, texture it, and animate it appearing and disappearing against a textured background. Then we will render the animation as a video-quality picture sequence.

Setting the Camera and the Resolution

First, you need to set the camera. As you learned in earlier chapters, cameras are windows through which you look at objects in Maya's world space. The four default views that you see when you start a new scene are actually four cameras that cannot be deleted: one camera with a perspective view and three cameras with orthographic views, which you know as the front, side, and top views. Generally, you use the orthographic views for modeling, texturing, and animation purposes, and rendering is done only through the perspective views.

To set the camera and the resolution, follow these steps:

  1. Create a beveled text letter M (choose Surfaces ® Bevel), "NURBS Modeling."

  2. Create another perspective view by choosing Panels ® Perspective ® New. Persp1 camera is created.

  3. In the Outliner, rename the view to Camera. Open its Attribute Editorand in the Film Back section, set Overscan to 1.1. In the Display Options section, check Display Resolution. (You can also turn on Display Resolution by choosing View ® Camera Settings ® Resolution Gate.) In the camera view, you will see a box that shows the exact area that will be rendered. The Overscan setting of 1.1 also shows a bit of the area just outside the box. In the Display Options section, also check the Display Film Gate setting. This displays another box, representing the Film Gate, the camera setting for the medium in which you want to display the images. The default resolution size in Maya is 320 × 240 pixels, which gives a width × height (aspect) ratio of 1.33333. If you see the Film Gate box overlapping the resolution box imperfectly, there is an imperfect match between the aspect ratio of the pictures being rendered and the ratio used in the final display medium.

  4. In the Film Back section, select different media in the Film Gate drop-down list, such as 70mm projection, to see how the aspect ratio changes. Change the preset to 35mm TV Projection.This setting has the 1.33333 ratio for television. The Film Gate and Resolution boxes should now match perfectly.

  5. The default resolution setting is at 320 × 240, which you can see at the top of the resolution gate in the camera view, but you will probably want to render the pictures at a higher resolution. Choose Window ® Rendering Editors ® Render Globals (or click the Render Globals button in the Status line) and open the Resolution section. For our example, set the Render Resolution to 640×480.

  6. Adjust the camera view, dragging and rotating the camera until you have the proper composition for the letter M. Then keyframe the Camera attributes. (First, make sure you are at frame 1 on the Time Slider. Then, with the camera selected, RM click any of the attributes in the Channel Box and select Key All.) Now you can switch back to the regular perspective window and test-render the camera view as you make changes to the lighting and textures.


Layer Rendering, Compositing, and Editing

What we've done with the letter M rendering is actually rather … dumb. Because the letter wasn't moving, the 60 frames of rendering were not necessary; only the first 10 frames need to be rendered. In studio environments, where meeting deadlines and work efficiency are always paramount, this kind of rendering redundancy would have been frowned upon.

With any editing software or with some renaming and renumbering script commands, you can extend frame 1 forward to frame 5, reverse the animation from frames 5 to 15 to make them frames 50 to 60, and hold frame 15 until frame 49.

Alternatively, we could have rendered the letter M separately from the fractal textured background. Since the background remains constant, only a single frame is necessary. Using compositing software, we could have composited the letter M onto the background.

Adding Depth of Field

Maya cameras can also imitate the depth-of-field functionality of real-world cameras. To use this capacity in any practical way, however, requires some setup.

Open the letter_M file, select Camera, and open its Attribute Editor. Go to the Depth Of Field section and check Depth Of Field. Its attributes become active. The Focus Distance attribute does what it says—it sets the distance for the camera focus.

It would be useful to have a way of interactively controlling that distance in the modeling window, instead of punching in numbers. An easy way to do this is to open the Connection Editor with the Camera Shape loaded on both windows and connect the Center Of Interest output to the Focus Distance input. This constrains the focus distance to the camera's center of interest, which shows up as part of the Show Manipulator handle.


No comments: