REGULAR COLUMN

compositing 3d animation



Sometimes animation can be overwhelming. Unless you are a large studio with teams of specialized modelers and technical directors you must often be an expert at modeling, lighting, texturing, and choreography. On top of that you must also be an expert at client service and job management. It is difficult for an individual to be equally skilled in all of these areas. One of the best lessons we can learn from big animation studios is how to do one simple thing - cheat.

By cheating I mean you shouldn't limit yourself to one program to finish your animation. If your 3D program can't accomplish the effect you are after or if you hold off on changing little things because it will take too much time to rerender your project you can benefit from some of the following techniques. Remember an old adage, you can get 90% of a project done in 10% of the project time but the last 10% is what takes the longest and usually makes or breaks the project.

Compositing is the layering of images on top of and behind other images.
Figure 1 -- Click for a larger image
Figure 1.
One of the biggest mistakes animators can make is trying to get everything perfectly imaged in one program and in one rendering pass. Most of the stunning imagery we see on television and movies has been digitally sweetened in post production using a process called compositing.

Compositing, in its simplest form, is the layering of separate elements (see fig. 1). In most cases this would be separate layers of film or video that are blended or matted together using keys or an alpha channel (see fig. 2). The principles that 2D artists use for compositing can also be applied to separate 3D elements. By using a process called multipass rendering you can gain more control and "tweakability" over the final look of your animation.

An object and it's alpha channel (matte).
Figure 2 -- Click for a larger image.
Figure 2.
I'm going to show you how I used multipass rendering and compositing to help me in a current project. The programs I am using for this project are Electric Image, Adobe After Effects, Elastic Reality, and Form-Z. If you use different programs the techniques and principles should still work the same.

In this particular project we were creating a 3D chess set for our client. The animation involves 12 shots. This article focuses on the opening shot.

We knew going into this project that there would be multiple changes and approvals that we would have to go through with our client. With this knowledge in hand we designed the project with flexibility in mind. To begin with, we walked the client through the process of producing animation and had the client sign off on different aspects of the project in steps.

Unfortunatey, our first model did not meet the clients expectations.
Figure 3
Figure 3.


We built a new model in Form-Z.
Figure 4
Figure 4.


The approved model.
Figure 5. -- Click for a larger image
Figure 5.


These are the seperate passes that were rendered with alpha mattes. They are displayed on blue to show detail.
Figure 6. -- Click for a larger image
Figure 6.


Working on the morph in Elastic Reality.
Figure 7
Figure 7.
The first thing we did was buy a model of a chess set from Viewpoint Data Labs (see fig. 3). Unfortunately, the detail and appearance of the chess pieces in this model did not suit the needs of our client so we created our own chess set model using Form-Z and elements of the Viewpoint model (see fig. 4). After we got our client to sign off on the geometry of the model we moved on to texturing the chess pieces, the chess board, and the table it rested on. We then lit the scene and came up with the lighting. Once all of these elements were "locked" we moved on to the actual animation itself (see fig. 5). We broke this animation into two categories, camera movement and model movement. We created a camera move first and then animated the chess pieces as they moved across the board. At this point we were ready to fully render the scene.

Multipass rendering a scene is relatively simple. You simple turn off and turn on certain sets of geometry in your animation program and render separate passes of elements with mattes so you can composite them back together later. We decided to render the table top in one pass, the chess board in one pass, the white chess pieces in one pass, the black chess pieces in one pass, the shadows in one pass, and (finally!) a high contrast pass of the entire environment to use for a depth of field effect at the end of the animation (see fig. 6).

In addition, at the end of the animation, we had to morph a pawn chess piece into a queen chess piece while the camera was still in motion. While we could have done this effect in Electric Image our geometry of the queen and the pawn were too dissimilar to have the effect look convincing. So in addition, we had to render a pass of a pawn, a pass of a queen, and a shadow pass so we could execute the morph in a 2D effects program called Elastic Reality (see fig. 7). We chose to go this route because of the robust morphing capabilities that the program offers.

The set up to render this project is a little more involved than if we had rendered the animation in one pass. However, the flexibility we gain is worth the extra hour or so it takes us to set up the render. For example, If the client wants to change the texture on the table we don’t need to render the whole animation again. All we need is one pass with the new texture for the table. Since that table disappeared after the first six seconds of the animation we don’t even need to rerender all of the frames. A revision that normally takes over 2 minutes a frame now takes 30 seconds a frame.

Suppose we want to punch up the saturation of the wood texture on the chess board. In a compositing program this is a simple color correction and 2D render of the composite. Again, we save minutes per frame.

Now there are some cases where this technique is overkill and there are others where the extra time in setting up the render isn’t really worth the time savings. But in a complicated project where your client is apt to change his mind this technique can make your job easier and your client happier. The only thing the client could request that would require a complete rerender is if we changed the motion of the camera, if they wanted the motion of the chess pieces to change we only need to rerender the layers with the chess geometry and a shadow pass, not the whole project.

When you use this technique you can really tweak and embellish characteristics of your animation. If you had lights on a ship you could add a subtle glow, if you wanted highlights on animated water you could punch that up without affecting any of your other attributes in the scene. These are the kinds of thing that can add that final touch or sparkle to your project, and because these changes can be rendered in a few seconds per frame instead of a few minutes per frame you are more likely to experiment and get the look that you want and not the look that you have to settle for.

There are a few other things you need to know about this technique to have it work well. If you have objects that pass in front of each other during your animation you need to create what are called "masking" or "matte" objects so your elements don’t intersect each other. These are objects that mask out the areas that an object would pass behind or in front of. In Electric Image there is a feature that does this automatically by creating a cutting matte in the alpha channel. If your 3D program doesn’t support this you can do it yourself by rendering another pass and making the masking object black with no specular attributes and making the object that should be visible white with your luminance turned all the way up. This will create a matte that you can use with your other prerendered elements (refer to fig. 2 to see what a matte looks like).

In addition, by rendering your shadow pass separately you can have shadows that you can adjust very easily. In Electric Image this is accomplished by checked a box called shadow object only on the object you want to have receive the shadows and setting the color of that object to the color you want your shadow to be. You can also tell Electric Image to render the shadow of an object without rendering the object itself. This creates a nice alpha channel matte with all of the shadow information. Again this is an effect you can cheat in just about any program by rendering another pass and setting all objects to black with no specular attributes and setting the color of your shadows to white. Use this element as a matte for your shadow source and it works the same way.

The image before and after "tweaking". Figure 8. -- Click for a larger image
Figure 8.
Let’s jump back into my project so we can see how we bring this all together. At the end of my animation two final chess pieces slide out into the middle of the chess board and while one of the pieces is sliding out it morphs into a Queen. This element is created in Elastic Reality and composited just like the rest of the elements. To draw attention to this effect I’ll use two subtle embellishments.

Bringing it all together in After Effects. Figure 9.
Figure 9.


Download Quicktime 1
Download Quicktime 2
Since the version of Electric Image I used on this project cannot render depth of field I rendered a special depth of field pass where I set the color of all of my objects to white and rendered a white fog that gently falls off into the background. I will invert this clip in After Effects and use it to control a Gaussian blur effect on my background clip that gently ramps up simulating a rack focus. In addition I will slightly desaturate all of the elements in my composition except for the morphing chess piece. This draws the viewers attention to exactly what I want them to see (see fig. 8 and 9). If you want to see some earlier motion tests and composites of this project there are two short QuickTime movies that you can download.

These techniques help you meet those tough deadlines and they give you the ability to tell you client "yes" instead of "no" when they ask for changes. Try these techniques for yourself on your next project. In the future we’ll go into more detail about compositing and how to prepare files for compositing. Take care.

Copyright © 1998, Chris Bernard


Chris Bernard lives in Chicago and works as an animation and design director at an integrated marketing communications company. He can be reached at thenerve@enteract.com