It may not be necessary for every 3D integration VFX you create, but quite often you find yourself in a situation where you want to render out different layers of your 3D scene separately to gain more control over how they are composited in your final effect. These layers can be the so-called beauty pass (full render), shadows only, alpha information, zDepth, illumination and much much more. These layers are usually exported by using separate render passes.
In 3dsMax, these render passes can be configured in the 'Render Elements' tab in your render settings dialog.
Besides your beauty render, you can add individual render passes by clicking the 'Add' button in the Render Elements section.
Note that 3dsMax provides a very large list of individual render passes that you can export. The list might differ slightly depending on your version of 3dsMax and which plug-ins you have installed.
Of particular interest to me are usually the Shadow and zDepth passes.
A Z-Depth pass is a greyscale image that provides depth information by representing elements closer to the camera with lighter and the objects further away from the camera darker.Here is the Z-Depth layer I rendered out for my Dissolve Into Crows effect.
Note that the crows closer to the camera are very bright and the crows further away from the camera are darker. A Z-Depth pass has a min and a max distance setting that control how close an element has to be to become 100% white and how far it has to be to be 100% black. You have to take care to set up your min and max values for the Z-Depth render pass to encompass your entire scene to get a smooth greyscale image.Why render a Z-Depth pass?
The Z-Depth pass can help you during compositing and is usually used as a matte (or other type of invisible control) layer to integrate 2D layers with your 3D footage. Now of course during compositing you are exclusively dealing with 2D layers, but using the Z-Depth pass you can apply depth information to your effect
Once you added the Z-Depth pass, you need to configure it and specify where you want your render pass files to be saved. I usually export them next to my beauty pass with a "_zDepth" suffix. Additionally, be sure to set the Z min and Z max values according to your scene dimensions.
Just like the beauty pass, I like to use the OpenEXR file format in full 32 bit for all of my render passes. It will give you a lot more quality and control during compositing then a Quicktime or MPEG movie or a JPEG sequence would give you.
Finally, return to the main render settings and ensure that you tick the 'Save File' check box and specify an output path for your beauty render. Ensure the export quality is set to 'Production', select the viewport that uses the camera we imported from After Effects and hit the Render button
This might take a while depending on the complexity of your scene, the number of render passes you selected and the processing power of your computer, but you should end up with a full render of your beauty pass as well as any other render passes you set up. For this example I have my UFO and the Z-Depth pass for the UFO here.
We are now ready to take our rendered elements back into After Effects and composite them onto our original footage... but how do we deal with shadows?