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 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.