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.
Image-based lighting, or IBL, refers to the technique of using an image or a photograph to light the elements of a Maya scene. And this is used to most often to match CG Elements with live footage. The image used to create image-based lighting could be a photograph taken on a particular set that's then used to light CG elements, and then these are more easily blended in with the live action footage taken on the set. So it's a fairly common technique. Setting this up in Maya is actually fairly straightforward.
I have a simple scene here with my little monster toy. And I just have a couple of spheres here, which are just going to sort of hope to show off how the lighting works. So the first thing I'm going to do is go to the Window > Rendering Editors > Render Settings window. In the Indirect Lighting tab, I'll just click on this. You'll see, under Environment, I have two options here: Image Based Lighting and Physical Sun and Sky. In this case, I just need Image Based Lighting. So if I press the Create button, it will actually set up the entire network for me.
So I'm going to do that now. Just press Create. There we go. And we can see that a new mentalrayIbl1 node has been added to the scene. Here it is, and the Attribute Editor has opened up to the Shape tab of this node, mentalrayIbLShape1 is right here. So these are the attributes to set up the lighting. So the first thing I need is an image to map to this environment. I'm going to switch to the Perspective view, just so we can see what's going on here a little bit easier. You see how there is a sphere added to the scene here, and this sphere is used to map the image for the lighting.
So when I add an image here in Attribute Editor, this image is going to be mapped to this sphere. The image I'm going to use is known as a high-dynamic range image. And in a nutshell, what that means is that the image data actually contains a wider set of values beyond what can be displayed on a computer screen. And this is what allows the image based lighting to work effectively. Since we have values that go beyond essentially what the computer sees as 100%, then these values can help light the objects.
So I'm going to grab my image and just by clicking in the folder here next to Image Name. And the images are stored in the sourceimages directory of the current project. So I'm going to select sky1.hdr so this is the HDR format. And it maps to right here, and you can see immediately that the image has been mapped to the sphere. So we can see it in the background there are some clouds, bright sunlight, and a ground plane. So this is our HDR image.
So I'll switch to the renderCam Camera. If you're going to use your own HDR images to achieve this, you should know ahead of time how it's mapped, if it's either Spherical or Angular. I just know that this particular HDR image is spherical. You can purchase HDR images from a number of vendors, or you can also find these online, especially if you do a web search for 'HDR' or 'light probe.' If you use those search terms, you'll find a number of sites that allow you to download these for free.
So you can test these out in your scene, but when you download them, make sure you find out whether the mapping is spherical or angular. And you can also try just experimenting, see which setting works better. But now I have this mapped to Image Name. I'm going to go to my Render Settings again. I'm going to use Final Gathering as a way to create the Indirect Lighting. So I'll go of the Final Gathering section of the Indirect Lighting tab, and I'll turn this on. I'm going to increase my Secondary Diffuse Bounces. I'll just type in 1 here, and just to make sure that this looks fairly nice, I'll set the Accuracy up to 400.
And now I'll create a render and see how it comes up. One thing that I'd like to check - this is very important - always double-check to make sure your default light is off. Go to the Common tab, scroll down under Render Options, make sure Enable Default Light is off because I have no other lights in the scene. There is no other lights. This is just the image that is creating all the lighting in the scene. So I want to ensure that this is off because otherwise this will interfere with our render. So now that I have that set, I'll press the Render Current Frame button, and we'll see what we get.
So here's the lighting in our scene. You can see the image in the background of the render. We can also see clearly reflected on the chrome sphere, but you can see all of this lighting is created by the image alone. What's nice about using this technique is you can dramatically change the lighting depending on what image you have. So if you have an HDR of an area of sunset, or as opposed to something in midday, you're going to get different lighting effects. But there is a couple things I'd like to do to just to quickly improve the way this image looks. So I'm going to store this.
And the first thing I'd like to do is turn off the visibility of the IBL of the Image Based Lighting sphere in the background. So I'll select it, open its Attribute Editor to the IblShape1 tab, scroll down to Render Stats, and turn off Primary Visibility. I'll leave the other ones on, so it's Visible In Secondary Reflections, and Refractions, and also In Final Gathering. So I'm just turning that off. Let's do another quick Render and compare that.
I'm going to stop this render really quick, just to demonstrate one thing. You see the blue color here in the background? That is being created because I have a color value in my renderCam Camera. So I'll just go down to the Environments tab and turn this to black. So I know that that's not affecting the colors of the render either. So let's try that again. So we can see that the image-based lighting now is basically lighting the scene. And the colors of the image itself are affecting the way the colors in the scene look.
One last thing I'd like to do is add a direct light source to complete the lighting in the scene. So I'm going to add a directionalLight to represent sunlight. So I just created the directionalLight by clicking on this directionalLight icon on the Rendering Shelf. And I'm going to open up the Attribute Editor to the directionalLightShape1 tab and activate Ray Trace Shadow. So I'm opening the Shadows section and turning on Ray Trace Shadows. And then I'm going to switch to the Perspective view because I know that I have some sunlight here in my IBL.
I want to move the directionalLight, so I just want to move this and scale it and just see if I can turn and quickly match the orientation of the sunlight. So if I get the camera here, so I'm facing that bright ball of sunlight, then if I rotate it so that the light is looking directly at me, theoretically, my direct light should match the light in the IBL. So I'll give that a try and see how that looks. Let's switch to the renderCam Camera and do another render, and there we go.
Now we're own our way to creating some realistic lighting. Of course, you can also select the mentalrayIbl node and rotate it to change the orientation of the light. So if I wanted them coming from a different direction, switch to Perspective view. And maybe, the lights coming from the Front now, once again, the same thing. I'll rotate this one. You can see the spot on the image where the sun is supposed to be, rotate this, so that this is pointing at me, and switch to the renderCam Camera and do another render.
For about five minutes worth of work, it's not looking too bad. We're on our way to creating something that looks fairly nice. One thing I'd like to point out: You'll notice that down here under Light Emission, I actually don't have Emit Light turned on, but you can use the IBL image to actually Emit Light. When you turn this on, you're essentially telling mental ray to sort of create a light for all of the pixels in the image, or create a light that can cover as much as it can of each pixel in the image. And it's just another way to have the IBL node emit light in the scene.
Right now, I'm having the directionalLight, which is casting direct light. In the IBL, the image-based lighting is creating indirectLighting because its values are influencing the Final Gathering points, how Final Gathering is calculated in the scene. So without having to turn on Emit Light, this is already creating lighting in the scene, because it's being combined with the power of Final Gathering. So there are the basics of using image-based lighting in a Maya 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.