Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Lighting and Rendering with mental ray in Maya with Eric Keller shows how to master practical mental ray techniques for rendering models created in Maya. This course walks through the most efficient and innovative mental ray techniques, including direct versus indirect lighting methods, creating different types of shadows, using the new ShadowMap camera, and reusing shadow and final gathering maps. A chapter on optimizing render times and enhancing render quality is also included. Exercise files are included with the course.
Participating Media refers to the effect of light streaming through a medium such as dust, or fog, or some kind of cloud that's creating that wonderful effect of streaming rays of light coming in through a window. mental ray has a special setup that can allow you to create a very realistic volumetric light effect or Participating Media effect, and I am going to show you the basics of how to set that up. So we have our scene here which is our dining room, and we have a little skylight here.
I have added a simple directional light that is going to have the light coming through this window right here. I have also blocked off the windows. So I just have added some geometry here and applied just a regular Lambert shader to the geometry, because I just want to focus right now on the light coming through the skylight. I am not going to worry about these lights right now. I just want to focus on that. So there are number of steps that you will need to take in order to set up this effect. So I'd like to go through those steps one-by-one. The first thing I need to do is select the light that is going to be casting the Participating Media, and I am going to add a Physical Light shader to it.
So here I have the directionalLight selected, and I have the Attribute Editor open to the directionalLightShape 1 tab, and I will scroll down to the Light Shader section and under Custom Shaders, I am going to click on little checker box here and under mental ray, switch over to MentalRay Lights and click on physical_light. Now, by default, when I click on the color channel that controls the intensity of the physical_light Shader, this is set to, if I look at the value, I can set this HSV so that Hue, Saturation and Value.
So I can see the value is set to 1000. That's a bit strong for a directionalLight. That value works very well for point lights and spot lights, but for directionalLight, it's very strong. So I am going to set this down to 20. This is also going to take care of things like the shadows, and so on and so forth. So I have the light set up. The next thing I need to do is create the volume, the volume that creates the sort of dusty effect that the beams of light are going to stream through.
To do this, I am going to create a polygon cube. So Create > Polygon Primitives > Cube. It's going to ask me to drag it on the grid. So I am creating my Polygon Cube. I am going to use the Scale tool. I just want to basically scale this up so it encompasses the entire room. Switch to a Side view and press 4 to switch to wireframe, and I can easily see what's going on here, and I am just roughly positioning this area.
Switch to a Top view, just to take a look and scale it. I am zooming out, and now I can see that this volume is encompassing the entire room. Then I switch back to the renderCam camera and press 5 to switch back to Shaded view. The next thing I need to do is make sure that my cube is not casting any shadows, so that the light cast by the directionalLight is not being blocked by this cube. So I am going to select the cube and open this Attribute Editor to the pCubeShape 1 tab and turn off Casts Shadows, and I might as well go ahead and turn off Receive Shadows as well.
Now I am going to go into the Hypershade window, and I am going to create a special shader to apply to this cube. In the mental ray section, under Materials, I am going to scroll over to the bottom here, and you will find the transmat material. So I am going to create this transmat material, select the cube in the Outliner, and I am going to right-click over the material in the Hypershade and do Assign Material To Selection.
So that assigns this material. If I switch to the Perspective view, you will see that the cube has now turned red. This is just indicating that the transmat material has been applied to the cube. So, the next thing I am going to do is apply the Volumetric effect to the Shader. To do that, I will select transmat1 Shader in the Work Area of the hypershade, and I will do Graph > Input and Output Connections. So we can see that I have the transmat1SG node here.
This is the Shading Group node. This is the node that acts as an intermediate between the shader, the transmat shader, and the geometry that it's applied to. I am going to select this transmat1SG node, SG stands for Shading Group, and open this Attribute Editor. I will make sure I am on the transmat1SG tab, and I am going to scroll down, I am at the top of the attributes here, I will scroll down to the Custom Shader section and click on the checker box next to Volume Shader.
This will pull up the Create Render Node window again. Under here, under mental ray, I am going to select Volumetric Materials and click on the parti_volume button. This applies the shader. You can see in the Hypershade, if I scroll out here, that I have the transmat1 node, connected to transmat1SG, and I have parti_volume also connected to transmat1SG. Now, I am going to switch to the renderCam camera, and I will close the Hypershade so we can see what's going on here, and I am going to create a test render, and see how it looks so far from the renderCam.
So we can see the light coming in here, but I am not seeing any effect of the Volumetric Material, and this is a common mistake. This is a mistake I actually make almost every time I do this. So I am kind of glad that it's happening here. This is something that can drive you crazy very quickly. Let me minimize this, and I'll show you what's going on. If I go into the Render Settings, there is a very sneaky little setting that you have to remember to turn on; otherwise, the effect won't work. And this is a kind of thing that will definitely drive you crazy. I am going to switch to the Features tab in the Render Settings window, and I am going to scroll down to Extra Features right here, and there is an Auto Volume setting.
If this is not turned on, then no matter what you do in the Maya scene, you will never see that effect. So make sure that this is turned on now, and I will minimize this and create another test render. Now, we can see the effect is starting to appear in our render. Now, I have the Quality Preset set to Preview. So this is why you can see that the quality of the geometry in this scene is quite low. Now, I am just doing that to save a little bit of time when I am creating the render, because right now I am just interested in tuning the effect, so I can see how this is going to look.
But you can see how the light is coming through here. The bars here in the skylight are creating some detail in the Volumetric and same with the legs of the chairs. So this already starts to look pretty nice. A couple of things that I'd like to do to improve the look of this effect. I mean, for one thing, we have a dark sky casting lights in here, which looks a little bit strange. So I can very easily change that effect. I am going to select the renderCam camera, and just as a quick way to fix that, switch to the renderCamShape, and here in the Environment, I am going to set the Background Color to White.
This will end up looking like a black- and-white image, because I don't have any Shaders applied to the objects in the scene. That's fine. And you get the basic idea of how this is going to look. So that starts to look a little bit more natural. This effect is quite expensive, meaning that it's going to add an awful lot to render time. So you want to be careful in how you use it. If I start to add things like Global Illumination and Final Gather, and Complex Textures, and increase the Render Quality, I am going to very quickly increase my render time to something that's going to be difficult to work with.
So, you want to be careful how you use this effect, and there are strategies for optimizing the way this effect can be applied, especially strategies for compositing just the rays of light separately from the rest of the objects in the scene. That's usually the best way to go when using this effect, rather than trying to apply everything in a single render, which can turn into a very difficult scene to work with. The other setting that I'd like to show, if I select the Cube here, and I am going to click on the parti_volume1 tab that's connected to transmat, and there is a number of settings here that effect the way that light looks.
As you increase the Extinction setting, that will start to turn off the effect sooner. So higher values are basically say, the light coming through the medium becomes extinct sooner. So it doesn't reach quite as far. You can also adjust the color of the medium. The Scatter setting has a large effect on overall brightness. The value, as you can see right here, is very low. So this is an extremely sensitive setting. You set this to HSV and start to adjust the value that's going to change the brightness of the effect.
And there are number of other settings in here which are going to relate to the look of the effect. Some of these actually get quite complex, and there is a lot of physics involved in how they work. So you will want to consult the mental ray manual that's in the documentation for more information on how these settings work, but they do get quite technical. But that's basic overview of how to set up the effect and add it to a scene.
There are currently no FAQs about Lighting and Rendering with mental ray in Maya.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.