Showing posts with label 3D Nodes. Show all posts
Showing posts with label 3D Nodes. Show all posts

Sunday, June 2, 2013

How to create a position pass in Nuke 7 using the DepthToPosition node

The DepthToPosition node is used to generate 2D position pass using the depth data available in the input image. The position pass is created by projecting the depth through camera. Then, position of each projected point is saved. This node along with the PositionToPoints node is used to create a point cloud similar to the point cloud that the DepthToPoints node generates. In fact, the DepthToPoints node is a gizmo that contains the DepthToPosition and DepthToPoints nodes. In this tutorial, we will generate a position pass and then place a 3D sphere in the scene. To do this, follow these steps.

Step - 1
Navigate to the following link and then download the zip file to your hard-drive: https://www.dropbox.com/s/xo7eemr6qz16icl/nt007.zip. Next, extract the content of the zip file.

Step - 2
Using a Read node, bring in the nt007.rar; the Read1 node will be inserted in the Node Graph panel.

Step - 3
Connect the Read1 node to the Viewer1 node by selecting the Read1 node and then pressing 1, refer to Figure 1.

Saturday, June 1, 2013

How to render position pass in Maya and then use it with the PositionToPoints node

The PositionToPoints node is used to generate a 3D point cloud using the position data contained in the image. In this tutorial, we will first create a position render pass in Maya 2014 and then we will create a 3D point cloud using the position data in Nuke. Then, we will composite a 3D object in our scene with help of the 3D point cloud. Lets get started:

Step - 1
Create a project folder in Maya and open the scene that you need to render. Next, create a camera and set the camera angle. Figure 1 displays the scene that we will render.
Figure 1
We will be rendering a 32 bit image so first we set frame buffer to 32 bit.

Step - 2
Invoke the Render Settings window and then select mental ray from the Render Using drop-down list.

Step - 3
Now, choose the Quality tab and then enter 1.5 in the Quality edit box.

Step - 4
Scroll down to Framebuffer area in the Quality tab and then select RGBA (Float) 4x32 Bit from the Data Type drop-down list.

Next, you will create layers in Layer Editor and create layer overrides.

Step - 5
Select everything in the viewport and then choose the Render tab in Layer Editor. Next, choose the Create new layer and assign selected objects button from Layer Editor, refer to Figure 2; the layer1 layer will be created in Layer Editor.

Friday, May 31, 2013

Create a Point Cloud by using the DepthToPoints Node

The DepthToPoints gizmo is used to generate a 3D point cloud from a depth pass and 3D camera. This gizmo takes the color and depth information in the image and then creates the image as a 3D point cloud. Then, you can use the points in the point cloud to line up any geometry in the 3D space. Make sure that the alpha channel of the image is not set to black. Figures 1 and Figure 2 display the color and depth information of an input image.
Figure 1
Figure 2
To generate a point cloud using DepthToPoints gizmo, you need to follow the steps given below:

Step - 1
Export a camera chan file from your 3D application.

Step - 2
Read in the input image having depth channel embedded in it; the Read1 node will be inserted into the Node Graph panel.

Step - 3
Add a DepthToPoints node from the 3D > Geometry menu; the DepthToPoints1 node will be inserted in the Node Graph panel.

Step - 4
Make a connection between the image input of the DepthToPoints1 node and Read1 node. If image contains normal data, connect it with the norm input of the DepthToPoints1 node.

Step - 5
Click on the empty area of the Node Graph panel and then add a Camera node from the 3D menu; the Camera1 node will be inserted in the Node Graph panel.

Step - 6
In the Camera tab of the Camera1 node properties panel, click on the file_menu icon; a flyout will be displayed.

Step - 7
Choose the Import chan file option from the flyout; the Chan File dialog box will be displayed. In this dialog box, navigate to the location where you saved the chan file and then select it. Next, choose the Open button from the dialog box.

Step - 8
Select the DepthToPoints1 node in the Node Graph and then press 1 to view the output in the Viewer1 panel. You will notice that point cloud is displayed in the Viewer1 panel but the position of the cloud is not proper. We need to connect the chan camera data to the DepthToPoints1 to get the correct camera angle.

Step - 9                                  
In the User tab of the DepthToPoints1 node properties panel, select the depth channel from the depth drop-down.

Step - 10
Connect the camera input of the DepthToPoints1 node with the Camera1 node; the point cloud will be displayed in the Viewer1 panel, refer to Figure 3.
Figure 3
By default, the DepthToPoints node displays the point cloud in a solid color. If you want to display the outline of the geometry in the Viewer panel, select the wireframe option from the display drop-down, refer to Figure 4.
Figure 4
Step - 11
Enter 0.1 in the point detail field; the density of the point cloud will change in the Viewer1 panel, refer Figure 5.
Figure 5
If you set the value 1 for the point detail field, all available points will be displayed in the Viewer panel. If you want to change the size of the points, enter a value in the point size field. Now, you can place a 3D geometry in the 3D space with help of the point cloud.