Showing posts with label Deep Compositing. Show all posts
Showing posts with label Deep Compositing. Show all posts

Wednesday, June 5, 2013

How to recolor the deep buffer data in Nuke 7

The DeepRecolor node is used to merge deep buffer files (contains per sample opacity values) and standard 2D color image. This node spreads the color across all samples using the per sample opacity values.

Read in the deep image that contains per sample opacity values and the color image. Add a DeepRecolor node from the Deep menu. Connect the depth input of the DeepRecolor node with the deep image. Next, connect the color input of the DeepRecolor node with the 2D color image.
Note: If the color image is premultiplied, add an Unpermult node between the Read and DeepRecolor nodes.
On selecting the target input alpha check box, the alpha of the color image is distributed among the deep samples. As a result, when you flatten the image later, the resulting alpha will match the alpha of the color image. If this check box is clear, the DeepRecolor node distributes the color to each sample by unpremultiplying by the alpha of the color image and then remultiply by the alpha of each sample. As a result, the alpha generated by the DeepColor node will not match with the alpha of the color image.

How to convert a standard 2D image to a deep image using the depth channel

The DeepFromImage node is used to convert a standard 2D image to a deep image with a single sample for each pixel by using the depth.z channel.

Read in the image that want to convert to a deep image.
Note: If the depth information is not available in the depth.z channel, make sure that you copy the information  to the depth.z channel using the Channel nodes.
Select the premultiplied check box if you want to premultiply the input channels. If this check box is clear, the DeepFromImage node assumes that the input stream is premultiplied. Select the keep zero alpha check box if you want to keep the input samples with zero alpha are considered in the deep output. If you want to manually specify the z depth, select the specify z check box and then specify a value for the  z parameter.

You can use the DeepSample node to check the deep data created by the DeepFromImage node.

How to convert a standard image to a deep image using frames

In Nuke 7, you can use the DeepFromFrames node to create depth samples from the standard 2D image. To understand the concept, follow these steps:

Step - 1
Create a new script in Nuke and then set the format in the Project Settings panel.

Step - 2
Download an image of sky, refer Figure 1 and the load the sky image into the Nuke script.
Figure 1
Step - 3
Connect a Reformat node to the Read# node to reformat the sky image.

Step - 4
Connect a Noise node (from Filter menu) with the Reformat# node. Animate the z parameter and modify the other settings as required, in the Noise# node properties panel to apply fog over the sky image, refer Figure 2.

Tuesday, June 4, 2013

Working with deep images in Nuke 7

Nuke's powerful deep compositing tools set gives you ability to create high quality digital images faster. Deep compositing is a way to composite images with additional depth data. It helps in eliminating artifacts around the edges of the objects. Also, it reduces the need to re-render the image. You need to render the background once and then you can move the foreground objects at different places and depth in the scene. Deep images contain multiple samples per pixel at various depths. Each sample contains per pixel information about color, opacity, and depth.

Deep Read Node
The DeepRead node is used to read the deep images to the script. In Nuke, you can read deep images in two formats: DTEX (Generated by Pixar's PhotoRealistic Renderman Pro Server) and Scanline OpenEXR 2.0.
Note: The tiled OpenEXR 2.0 files are not supported by Nuke.
The parameters in the DeepRead node properties panel are similar to that of the Read node.

Deep Merge Node
The DeepMerge node is used to merge multiple deep images. It has two inputs: A and B. You can use these inputs to connect the deep images you want to merge. The options in the operation drop-down in the DeepMerge tab of the DeepMerge node properties panel are used to specify the method for combining the deep images. By default, combine is selected in this drop-down. As a result, Nuke combines samples from the A and B inputs. The drop hidden samples check box will be only available, if you select combine from the operation drop-down. When this check box is selected, all the samples that have an alpha value of 1 and are behind other samples will be discarded. If you select holdout from the operation drop-down, the samples from the B input will be hold out by the samples in the A input. As a result, samples in the B input will be removed or fade out that are occluded by the samples in the A input.