Mental ray volumetric shadows with parti volume in Maya
parti_volume volumetric shadows in mental ray for Maya->
This tutorial explains how to create volumetric shadows in haze or fog using the parti_volume mental ray render node. Of course, it'll only render in mental ray! This technique can be used to simulate "God-Rays", technically known as Crepuscular Rays, as seen in the thumbnail on the right.
Demonstration Scene for Download
This tutorial will go through some simple steps to set up this kind of effect using a demonstration scene. Click Here to download the example scene and follow along. It includes a final version of the scene so you can double-check your settings.
1. Add a Light and set Trace Depth attributes
Enable the mental ray plugin, if it isn't already running. From your render settings, make sure mental ray is set to be the current renderer, by selecting it from the "Render Using" combo-box at the top of the render settings window.
Under the Quality tab, make sure raytracing is turned on, and that the shadow trace depth is at least 5. If it's any less, the shadows won't trace deep enough through the volume and therefore won't render.
2. Enable Auto Volume
3. Fit a Polygon Primitive around your scene
Create a new Polygon Primitive and fit it around your scene, or wherever it is that you need the fog or haze to appear.
4. Make a new Lambert Material and MR nodes
5. Connect up the Shader Network
Select the Shading Group for the new Lambert in the work area and press control+a to open the Attribute Editor. Arrange your windows so you can see both your work area with your new Render Nodes and the Attribute Editor at the same time.
The transmat is responsible for making the surface of your stand-in primitive transparent, and to stop the surface itself from casting shadows. If you simply suppress the maya shaders instead, Maya will ignore the whole object when it goes to render it - so make sure you don't check that flag. The parti_volume is responsible for creating the atmospheric effect inside the primitive.
6. Connect the Lights to the parti_volume
In the same fashion as the previous step, middle mouse button drag your Light icon from the Lights Tab into the lights channel slot in the Attribute Editor. If you need to connect more lights, refresh the Attribute Editor and another slot will appear.
The setup will work without explicitly connecting your lights to the parti_volume, but it's better to be sure...
7. Tweak the Shading Network
The final step is to tweak the parti_volume node to make the volume material actually respond to light. At the very least, turn up the Scatter attribute. For more information on tweaking the parti_volume node, click here.
A Note re: Photons!
In its current form, this setup won't allow photons to enter the volume. If you do need photons coming in from your light, follow the steps at the end of this tutorial to add a transmat_photon to your Photon Shader slot.