Keep up-to-date with Free tutorials!!

 

Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more

 

Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

 
submit tutorial
1 | 2
ZDepth and height GrayScale Representation

By Nakhle Georges
| Your Rating:
rating star nonerating star nonerating star nonerating star nonerating star none
(0 Votes)
| 12591 Views
| 0 Comments
| Comments 0
Date Added: 9th December 2009
Software used:
Maya
This tutorial shows 3 different methods to create height and depth grayscale representations of a maya scene, which may be useful in many cases such as adding depth of field or fog in post production.

First Method

1. Create some spheres, and post them on different distances from the camera. Assign a material to the spheres, such as a simple lambert material (to make the result independent from the lights in your scene, use in all the methods a surface shader). When rendering at this stage, all the spheres have the same color, independently from the distance from the camera.

100_tid_image001.jpg
2. Go to the Attribute Editor of the material, and map its color with a ramp. In the Create render node dialog, make sure that As Projection is selected, and choose a ramp.

100_tid_image002.jpg
Edit the projection node by choosing planar as the projection type, and make the ramp a black and white 2 colors ramp.

100_tid_image003.jpg
3. The projection icon is now visible in the viewport, as a small rectangular shape. Scale that icon to fit your scene entirely. Take a render of the scene. The color of the spheres must now be fading towards black. If it is not the case, you will have to change the ramp type from U ramp to V ramp or vice versa.

100_tid_image004.jpg
100_tid_image005.jpg
4. The 2 main limitations of this method are:

  • If you move the camera away from the spheres, their color remains unchanged when rendering.
  • If you render the scene from the opposite side, the colors also remain unchanged, so that the closest sphere is dark, while the farthest sphere is clear.

  • This method is suitable for a static scene, where the place of the camera is already decided, because the result here is static, so it's not suitable for moving cameras. The problem can be solved by parenting the projection icon to the camera, but here another problem arises: the scene might fall out of the range of the projection icon, which will lead to unexpected results.


    Second Method

    5. Let's check another method to generate the same effect. Here it is calculated based on the distance of the object from the camera, so it's a lot more logical. In the hypershade, assign a lambert material to the spheres, and then create a sampler info node. You will take the point camera attribute, compute the RMS {root - mean - square: distance = <} value, and then choose a color on a ramp based on that distance.

    6. For this, your hypershade still open, create a multiplyDivide node. Click on the sampler info node you've created, then shift-click on the multiplyDivide node. Go to the hypershade menu click on window, and choose Connect selected. In the connection editor connect the Point CameraX of the sampler info node to the Input 1X of the multiplyDivide node; do the same for Point CameraY to the Input 1Y and Point CameraZ to the Input 1Z.

    100_tid_image007.jpg
    In the multiplyDivide node attributes, choose Power as operation, and set all the 'Input 2' values to 2.

    100_tid_image008.jpg
    Now to sum up these values, use a plusMinusAverage node. If you load the plusMinusAverage into the connection editor, under Input3D section you can't find the inputs to connect to. To make them appear, do the following steps. Using the middle mouse button, click on the multiplyDivide node and drag it on the plusMinusAverage node, then choose input3D[ n] -> 0. Do this 2 more times to choose input3D[ n] -> 1 and input3D[ n] -> 2.

    100_tid_image009.jpg


    next page >

     
    1 | 2
    Related Tutorials

    Tutorial

    Gallery Image.



    Keywords: Maya, ZBrush, Maquette, Creature

    Go to tutorial
    rating star fullrating star fullrating star fullrating star fullrating star full (14)
    Comments 0 Views 17045

    Tutorial

    Gallery Image.



    Keywords: Maya, Rigging, Animation,

    Go to galleries 1
    rating star fullrating star fullrating star fullrating star fullrating star half
    Comments 2 Views 11899

    Tutorial

    Gallery Image.



    Keywords: Project, ZBrush, Maya, MARI, Photoshop, Marvelous Designer, Yeti, Hair, Fur, Orc

    Go to galleries 1
    rating star fullrating star fullrating star fullrating star fullrating star half
    Comments 3 Views 15589

    Tutorial

    Gallery Image.



    Keywords: Maya, Rigging, Animation, Blend Shapes

    Go to galleries 1
    rating star fullrating star fullrating star fullrating star fullrating star half
    Comments 0 Views 16875
    Readers Comments (Newest on Top)
    no comments!
    No comments yet. Be the first to comment!
    Add Your Comment