Two Ways to Generate Z Depth in 3ds Max


Final product image
What You'll Be Creating
I have made a very simple scene for the demonstration. This scene contains several spheres. I have also applied some materials and set the rendering engine to Mental Ray. I have set a camera also.
Creating a simple scene
Creating a simple scene
I have added and positioned several Omni lights in the scene. I have chosen Ray Traced Shadows as shadow type.
Ray traced shadow
Ray traced shadow
Press the F10 key to open the Render Setup window. In the Renderer tab, set the Minimum value to 4 and the Maximum value to 16. Select Mitchell for the Filter Type.
Renderer
Renderer
Now render the scene. It looks nice, but the depth is still missing. I can enhance the overall look by adding a Z Depth pass while compositing.
Rendering the frame
Rendering the frame
In general words, a Z Depth pass is a grayscale image, similar to the alpha channel for the graphical representation of depth.  In a Z Depth pass, every pixel in a scene is assigned a 0-255 grayscale value based upon its distance from the camera.
The objects closest to the camera are white and the objects furthest from the camera are black. It gives an extra sense of depth and realism after compositing. Look at the image below for a before and after comparison.
Z Depth
Z Depth
See how I generate a Z Depth pass using Mental Ray. Press the F10 key to open the Render Setup window. In the Render Element tab, click on Add button and choose Z Depth from the list. Click on OK.
Adding Z Depth pass
Adding Z Depth pass
Press F9 to render the frame. You can see a grayscale Z Depth pass. The objects closest to the camera are white and the objects furthest from the camera are black.This is not the correct Z Depth pass as I don’t know the exact distance between the camera and the objects in the scene.
Z Depth pass rendered frame
Z Depth pass rendered frame
To know the exact distance between the camera and the objects, Z Min and Z Max values will help. Z Min defines the distance between the camera and the closest object. And Z Max defines the distance between the camera and the furthest object.
Z Depth element parameters
Z Depth element parameters
To measure the distance, I need a tape. So, go to Helpers > Tape and draw a tape from the camera to the closest sphere.
Using tape
Using tape
Pick the tape’s head and you will get its value. This is the Z Min value.
Z Min value
Z Min value
Put the value in Z Min box.
Z Min value
Z Min value
Pick the target of the tape tool and put it beside the furthest sphere from the camera. Pick the tape’s head and you will get the Z Max value.
Z Max value
Z Max value
Put this value in Z Max box.
Z Max value
Z Max value
Press F9 to render the frame. Now you will get a perfect Z Depth pass along with the Diffuse pass.

Final Z Depth pass
Final Z Depth pass
Michele Marcelli has written a very useful script for creating Z Depth. You can go to www.scriptspot.com to obtain the script. The best thing about it is that the script is free to use.
Free script
Free script
Download and install the script. Normally you have to put the script into the Scripts folder of the 3ds Max root directory.
Install the script
Install the script
Back in 3ds Max, go to MAXScript > Run Script. This opens the browser, select the script and click on Open. This opens the script’s window.
Run Max Script
Run Max Script
Click on Pick and Select Camera button. Press H to open the Pick Object window and here select the camera.
Pick camera
Pick camera
Click on Preview Z-Depth (Selected Camera) button. Within a couple of seconds, you will see a preview of Z Depth pass in the preview window. The output result looks good, but a bit grainy. So I need to tweak some values.
Preview Z Depth
Preview Z Depth
You can play with the Z Min and Z Max values to get the desired Z Depth pass. Each and every time you need to check the pass clicking on the preview button.
Z Min and Z Max
Z Min and Z Max
Once you are satisfied with the preview, click on Render VFB button. This will show you the final result.  
Final rendered frame of Z Depth pass
Final rendered frame of Z Depth pass
Open both the Diffuse and Z Depth pass renders in Photoshop.
Open Photoshop
Open Photoshop
With the Z Depth layer selected, press Crtl-A button to select the entire image and then press Ctrl-C to copy the image.
Copy the Z Depth image
Copy the Z Depth image
Now deselect the Z Depth layer and select the Diffuse layer. Then go to Channels tab.
Open Channels tab
Open Channels tab
In the right side corner, click on the drop down arrow menu and select New Channel from the list.
New Channel
New Channel
It opens the New Channel window. Give it a name, such as Alpha 1.
Rename the channel
Rename the channel
With the Alpha 1 channel selected, press Ctrl-V to paste the copied Z Depth image.
Paste the channel
Paste the channel
Go to Layer panel once again. Now, with the Diffuse layer selected, go to Filter > Blur > Lens Blur.
Apply Lens Blur filter
Apply Lens Blur filter
It opens the Lens Blur window. The image look totally blurred and out of focus right now.
Lens Blur window
Lens Blur window
Select Alpha 1 as the Source channel and set the Blur Focal Distance to 255. Now you will see an extra realm of depth in the scene as some part of the image gets blurred partially and rest of the part remains in focus. This happens due to the Z Depth pass.  You can easily control the amount of the focus and area of focus with the parameters of the lens blur effect.
Setting the parameters
Setting the parameters
I hope you have enjoyed these ways to create Z Depth pass in 3ds Max. The script written by Michele Marcelli is the fastest way to get the Z Depth pass. The script is totally free to use, however if you find it useful, you can donate an amount to the creator of the script as a return gesture. This is only a matter of choice.

Creating Realistic Clouds in Autodesk 3ds Max Using Particle Flow and AfterBurn


Final product image
What You'll Be Creating
AfterBurn is a great volumetric plugin for Autodesk 3ds Max. In this tutorial, I'll show you how to use AfterBurn, along with Particle Flow, to create a realistic puffy cloud scene. I'll finish by doing some compositing in Adobe After Effects to make the result look even better. 
First of all go to Create > Particles > Particle Flow Source.
Creating PF Source
Creating PF Source
Then draw a PF Source icon in the perspective viewport.
Creating PF Source Icon in the Viewport
Creating PF Source Icon in the Viewport
Click on the Modify panel and then click on the Particle View tab. Alternatively, you can press the 6 key on the keyboard.
Ways to Access the Particle Flow
Ways to Access the Particle Flow 
This opens the Particle View window:
Opening the Particle View Window
Opening the Particle View Window
Select the Speed, Rotation and Shape operators and then delete them, as these operators are not required for creating static clouds. If, however, you want some motion in cloud puffs then you can play with these parameters later.
Deleting Several Operators
Deleting Several Operators
Select the Birth operator and set the values of Emit Stop as 0 and Amount as 10.
Setting the Birth Parameter
Setting the Birth Parameter
Select the PF Source icon in the viewport and change the Viewport % value to 100.
100 Particles in the Viewport
100% Particles in the Viewport
Set Icon Type as Box and set the Length, Width and Height values as 50, 80 and 10 respectively. The values may differ in your case.
Changing PF Source Icons Parameters
Changing PF Source Icon's Parameters
Go to Rendering > Environment, or press the 8 key on the keyboard.
Opening Environment Window
Opening Environment Window
This opens the Environment and Effects window. Inside the Atmosphere panel, click on the Add tab. This opens the Add Atmospheric Effect sub-window. Select AfterBurn and click OK.
Applying AfterBurn Effect
Applying AfterBurn Effect
You will see AfterBurn and FusionWorks Renderer are added to the list.
Applying FusionWorks Renderer
Applying FusionWorks Renderer
Apply a standard Target Spot light in the scene. I have done it this way to illuminate the AfterBurn particles. I can always change its settings at a later stage.
Applying a Traget Spot Light
Applying a Target Spot Light
Turn on the Shadow option and choose AB Shadow Map. Increase the Multiplier value a bit and choose a light blue color for the light’s color.
Changing the Parameters of the Light
Changing the Parameters of the Light
Press 8 on the keyboard to open the Environment and Effects window again. Select the AfterBurn effect which opens the AfterBurn Manager below.
Opening AfterBurn Manager
Opening AfterBurn Manager
First click on the Pick Particles/Daemons icon, and then select the PF Source icon in the viewport. This adds the PF Source to the list. Click on the Show in Viewport icon to see the actual shape of the AfterBurn particles in the viewport.
Selecting the PF Source Icon in the List
Selecting the PF Source Icon in the List
Click on the Pick Lights icon and press the H key to open the Pick Object window. Select the spot light and then click on the Pick button. You will see the spot light gets added to the scene.
Selecting the Light Source in the List
Selecting the Light Source in the List
Render the scene now. At this stage it still doesn’t look very realistic. I need to tweak some parameters and their values and then it will look much better.
Rendering the Scene
Rendering the Scene
First of all, go to the Particle Shape parameter and change the Sphere Radius to 25 and Squash to 1.5. Set the Variation percentage to 50.
Changing the Radius Value of AfterBurn Particles
Changing the Radius Value of AfterBurn Particles
Go to the Rendering parameter, change the Falloff to 1.5, and turn on the Self Shadows option. This will enable the cloud to generate and receive its own shadow.
Changing the Falloff Value
Changing the Falloff Value
Render the scene to see how it looks. Now we can see the cloud formation clearly. But I've still got to change a few more things to make it look like a realistic cloud.
Render the Scene
Render the Scene
Go to the Shading parameter and change the Ambient Color to light blue. After rendering the scene you will clearly see the difference in the ambient shadow part.
Changing the Ambient Color
Changing the Ambient Color
Go to the Noise Animation parameter and change the Noise Size to 25. Set the Type as Smoke and don’t forget to turn on the Cubic option.
Changing the Noise Size
Changing the Noise Size
Render the scene again. Now the cloud looks much better.
Render the Scene
Render the Scene
You can increase the Density to 5 to check the result.
Increasing the Density
Increasing the Density
Press 6 to open the Particle View once again and this time decrease the Amount to 5. A smaller amount of particles will make only one or two big puffs of cloud.
Decreasing the Number of Birth Particles
Decreasing the Number of Birth Particles
Change the Shadow Falloff value to 1.5 to make the shadow a bit smoother. Also decrease the Opacity amount to 0.7 or 0.8 to reduce the darkness of the shadow.
Changing the Falloff and Opacity Values
Changing the Falloff and Opacity Values
Now let’s render the scene and see how it looks. You can check from any angle. It looks pretty good.
Render the Scene
Render the Scene
Try tweaking some more parameters and their values to get different results. Decrease the Noise value to 15 and then render the scene to check how it looks.
Changing the Noise Size
Changing the Noise Size
To add some more variation decrease the Hi Threshold value to 0.7 and the Low Threshold value to 0.2. It adds fractal and turbulent edges to the cloud.
Changing the Threshold Values
Changing the Threshold Values
This time increase the Noise value to 20 and select the Cubic option. The Cubic option adds much smoother and feathered edges to the cloud.
Decreasing the Noise Size
Decreasing the Noise Size
Once you’re satisfied with the settings, go to the Smoke parameter and increase the Levels value to 15. Now render the scene and you will see more detailed cloud puffs.
Increasing the Levels Values
Increasing the Levels Values
Go to Rendering > Render Setup. This opens the Render Setup window. Here go to the Renderer tab and select Catmull-Rom as the Filter.
Changing the Rendering Filter to Catmull-Rom
Changing the Rendering Filter to Catmull-Rom
Now render the scene once again. The Catmull-Rom filter makes the rendered frame sharper.
Rendering the Scene
Rendering the Scene
Increase the Length and Width values of the PF Source box. This will scatter the cloud puffs across a broader area.
Scattering the PF Cloud
Scattering the PF Cloud
Go to Rendering > Environment and set the Background color as black.
Black Background
Black Background
Render the scene. The cloud looks quite nice. It's time to do some compositing in Adobe After Effects and add some effects to make the final result look much better.
Redering the Final Frame
Rendering the Final Frame
Open After Effects, import the cloud footage, and place it on the timeline.
Opening After Effects
Opening After Effects
Press Control-Y to create a new Solid Layer. The solid layer color should be white. Put this white solid layer behind the cloud layer.
Creating a Solid Layer
Creating a Solid Layer
Take the Ellipse masking tool and, while pressing Shift-Alt, mask a circular area in the white solid layer. This will act as the Sun. Add some feathering as well.
Masking the Solid Layer
Masking the Solid Layer
Feathering the Mask
Feathering the Mask
With the white solid layer selected, go to Effects > Sapphire Lighting > S_Rays. Use the same settings as shown in the image. You can play with the values to get different results.
Adding Rays
Adding Rays
Make another solid layer and make its color royal blue, just like the sky. Put this layer beneath all the layers.
Creating a Navy Blue Background
Creating a Royal Blue Background
With the cloud layer selected, press Control-D to make a duplicate layer of it. Select the upper duplicated layer and apply the Brightness & Contrast effect. Use the values shown in the image.
Adjusting the Brightness and Contrast
Adjusting the Brightness and Contrast
Pick the Pen tool and make a mask around the cloud layer as shown here.
Making a Mask Around the Cloud
Making a Mask Around the Cloud
With the upper white solid layer selected, go to Effects > Sapphire Lighting > S_LensFlare. The settings shown in the image will give a nice lens flare effect.
Adding Lens Flare Effect
Finally, add a Tint effect to the upper cloud layer to make it a bit unsaturated.
Adding Tint Effect
Adding Tint Effect
This is the cloud I made following the same procedure. You can play with the settings, parameters and their values to get different results. I hope you enjoyed the tutorial. Do share your results and views.
Final Scene
Final Scene
A Different Look with Live Element
A Different Look with Live Element!
In this tutorial I’ve shown you how to create a puffy cloud scene in 3ds Max using AfterBurn and Particle Flow. AfterBurn is a great volumetric plugin for 3ds Max. You must give it a try. I hope you have enjoyed the tutorial.

 

Copyright @ 2013 Krobknea.

Designed by Next Learn | My partner