Light Fog with Maya Mental Ray using Parti Volume

Light fog doesn’t show up when you render with mentay ray like it does with Maya’s default software renderer. To make it work with mental ray, you need to create a parti volume.

 

1. To get started with parti volume, go to Render Settings => Features tab. Under Extra features, tick the box for Auto volume and increase volume samples to at least 5 for now.

2. Create a new Polygon Primitive such as a cube and scale it so your whole scene fits inside it.

3. Assign a new Lambert Material to the cube. In the Hypershade window, right click on the lambert node and select Graph Network to show its input and output connections in the Work Area.

4. Now, switch the list of render nodes on the left hand side by right-clicking on Create Maya Nodes button and selecting Create mental ray Nodes.

5. From the Materials tab, middle-mouse drag a transmat to the Work Area.

6. From the Volumetric Materials tab, middle-mouse drag a parti-volume to the Work Area as well.

7. Select the Shading Group for the new Lambert material and open up the Attribute Editor. The current tab name in the Attribute Editor should be lambertxxSG. Expand the mental ray => Custom Shaders section in the tab.

8. Middle mouse drag the transmat from the Hypershade Work Area onto the Material Shader and Shadow Shader in the Custom Shaders section in the Attribute Editor.
Middle mouse drag the parti_volume from the Hypershade Work Area onto the Volume Shader slot.

9. Select the parti_volume node in the Hypershade Work Area. In the Attributes Editor, expand the Light Linking => Lights set.

10. Go to the Lights tab in the Hypershade window and middle-mouse drag your light onto the lights[0] slot in the Attributes Editor.


If you render now, it looks very close to no fog like below.

11. To get the fog effect, you need to turn up the Scatter attribute in the parti_volume’s Attribute Window.

When you raise the Scatter slide slightly, you’ll get the fog effect like below.

12. You can link more lights to the parti_volume by refreshing parti_volume’s Attributes Editor window as more slots for lights[x] appears.

Hope that helped in getting light fog to work with mental ray!  It’s not as simple as maya’s default software renderer which gives you light fog with no effort, but without mental ray you couldn’t render out any professional 3D features like subdivision and lighting effects.

Of course, you could skip the parti volume and add light fogs in post production in  Photoshop for still images, or AfterEffects for animation.

6 Comments Add yours

  1. Alexander Carby says:

    Hey this project is coming together well. For the fog on this lamp, would it not be possible to use Maya’s glow in the shader tab (does this work with mental ray?)

    1. Kakes says:

      Hi Alexander,

      I’d be happy to be corrected, but I don’t think that works with mental ray – I tried that before deciding to use parti volume.

      Although, I have been told that I should render the glow/fog on its own using Maya’s software renderer and composit it on top of the mental ray render that doesn’t have the glow.

      I’d probably do that next time to save render time – I just wanted to see if there is a way to do it with just Mental Ray this time :)

  2. Scott says:

    Hey, great tutorial man, just had a quick question though – my scene is huge so when the box encompasses the whole scene, mental ray takes a year to render. I tried making the box fit just around the area where I need the light cone but I can see the black box edges. Is there a way to not see them?

    Thanks!

    Scott

  3. Scott says:

    Nevermind, had my raytracing rays set too low for the light to escape! Fixed!

Leave a comment