beautypg.com

Creating composites with zcompose – Apple Shake 4 Tutorials User Manual

Page 98

background image

98

Chapter 3

Depth Compositing

Some software processes Z channel data differently than Shake. If you’re using 3ds Max,
for example, you’ll see negative values in the Z channel of the rendered image. If you’re
using a Maya-rendered image, you’ll see values calculated as –1/distance. Setting the
floatZinA parameter to Distance returns the actual distance from the camera. You can
also choose to “normalize” the Z channel data for either Maya or 3ds Max by selecting
the appropriate item in the zNormalize parameter.

10

Click the View Z button to disable the Viewer script, then press C to reset the Viewer to
display all color channels.

Creating Composites With ZCompose

In the next example, use the ZCompose node to composite these elements together.
The ZCompose node is designed to consider five channels—R, G, B, A, and Z—when
layering images. A little preparation is required to convert the painted Z channel
(city_bg_depth.jpg) into a proper Z channel for the background image.

To prepare the Z channel for the city_bg_depth image:

1

In the Node View, select the city_bg_depth node.

2

Apply a Color–Invert node.

Why the Invert node? The Z data must be inverted for one of the images, because the Z
channels don’t match. In the city_bg_depth image, the pixel values go from light to
dark as distance increases, while in balloons.iff, the inverse is true. Therefore, you need
to invert the city_bg_depth image to match the Z channel of the other image.

3

With the Invert1 node selected, add a Color–Reorder node.

The Reorder node will create a Z channel for this image by copying another channel
(red) to the Z channel position.