Light Fog with Maya Mental Ray using Parti Volume

Sunset with Light Fog

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.

Before you start, 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.

Create a new Polygon Primitive such as a cube and scale it so your whole scene fits inside it.
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.
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.
From the Materials tab, middle-mouse drag a transmat to the Work Area.
From the Volumetric Materials tab, middle-mouse drag a parti-volume to the Work Area as well.

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.

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.

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

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.

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 get the fog effect like below.

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

Advertisements

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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s