Software used
Maya 2011, mental ray
What you will learn
In this tutorial, we will tackle a lighting challenge with small-scale production needs in mind. Intended for small-scale productions, this tutorial walks through one lighting and rendering workflow that introduces new tools, techniques, and workarounds. We will exploit the environment-sampling power of portal lights, build a fake GI solution with projected light fields, and use MEL scripts to automate tedious tasks. These methods won't work for every scenario, but they can be very useful tools for the guerrilla CG filmmaker.
In this lesson we're going to walk through creating the portal lights that will provide most of the direct lighting in our scene. So back in Maya, we've already set up these directional lights to control the intensity on these back windows. So what we really want to do is start adding the primary illumination for the scene, which will come, in our case, from portal lights. So in order to help us create these portal lights, we're using the clutch tools for this. I'm going to go ahead and unhide a display layer that I've created that contains some geometry that we can use to help us place some lights. This kind of comes down to personal preference. But I found that it's much easier for me to just go in and do a little bit of this modeling to get these little helper objects than it would be to go through and actually manually create and place the lights. So I'm just going to-- well let's just leave that visible for right now-- I'm just going to leave that up and bring up the clutch tools. Go to the Custom tab, where I've got a button for it. Put that on one side. And just start selecting some edges. So, any four edges that describe a quadrangle, you can click on the Build Portal in the Hole button, which will create a portal light that is more or less in the right location and size. And you can scale this to however you like. Continue to do this on the other side. Select these edges, click Build Portal in Hole, and we have a light. Again for these on top, Build Portal in Hole. And you'll notice that this one came in the wrong direction. It's just a quirk with the code, occasionally this happens. So you've just got to flip it around. And it should be more or less in the right place. And do the same over here. Select the edges, build the portal, flip it around, and resize it. There's one more location where I wanted a light, which is down here. So if I go ahead and select these edges, I've got a rectangle here, I'm going to go ahead and put a portal light in there, as well. So now we have all the lights really set up all ready for the scene. Now, it just comes down to tweaking their intensities and the color values in order to get the best result that we can. What I'm going to go ahead and do right now is pause the video and rename these lights. I really can't emphasize enough just how important it is to name your lights. I'm pretty bad about naming my geometry in a scene, but I'm always really careful to name my lights properly. It just makes things much easier down the line, when you're dealing with other artists in your pipeline if you have any. And it just makes things much cleaner and easier to use. So I'm going to go and do that here for a second. All right, so I'm back in my scene in all of my lights have been named properly. And now I'm just going to go ahead and take a render and see where we stand, just putting everything in by default. With no light linking, everything's casting shadows. The quality settings have already been turned up, so let's just see what we get. I'm going to go ahead and hit render, and pause the video one more time. So this is the result from what we get from just those basic lights being put in our scene. You're starting to see some of the sky color coming through. We're getting these nice blues and purples coming through. We got some nice sky color coming in on these skylights. But really, especially over here, we really want to be able to control the light that's coming in through this particular window to a much finer degree. So I'm actually not going to use the sky for that particular light. I'm going to use a custom environment for it. So if I go to the Attribute Editor for the portal light, scroll down to Advanced Attributes, turn on Use Custom Environment. And I'm going to plug-in a black body node to this as well. So go down to mental ray lights, black body, and I'm going to use the same color value then we used for the window itself, 3,200. And you can also control intensity through here. I'd rather use the portal lights control for that, the intensity multiplier, just so we're all on the same page. So I'm just going to go and start turning that up as well, maybe turn that to four to start with. And we're also going to want to turn up the intensity on this other light, the tunnel light that we created earlier, just so we get a lot of intense light coming through here. So I'm going to turn this up to, let's say six, that sounds like a pretty good number. The other thing that we want to do is, if you take a look at that older image, you can see that we're getting some blue light shining inside of this window. But we're not really getting a feel for any blue light shining in the scene. And that's pretty much what we want. We don't really want to get too much of that blue light coming through. And I found that probably the easiest way to restrain this is just to light link it to the geometry that's sitting right here. So I'm just going to grab this light, and go to my light liking on light centric. And I want to make sure that the near roof light and far roof light are both only the linked to those particular objects. So go to station, and link these to the roof windows. And one more time. And hopefully what this will do is also force it to not calculate shadows on the rest of the scene, and it should get our render times down a little bit. And I'm going to turn up the intensity of these a little bit as well, let's go ahead and put this at, say, two. And the one that's a little bit further away at 1.5. A little bit further away from the sunlight source, anyways. And this rear wall, we're getting some contribution in that scene, but I'd like to see quite a bit more, because it's going to be illuminating the front of that train as well whenever we bring it back into the scene. So I'm just going to turn that up to, say, 2.5, just as a starting place. And we're going to take one more render. So if we take a look at what we had previously, this took five minutes and four seconds on my machine at full resolution and full render settings. Let's go and see what we get with the new result. Let it render, and I'm going to pause and come back. So this is the result we get, and I'm noticing a couple of things that I forgot to do. You'll notice that this window is getting much more intense. That's because I haven't light linked it out from that light that's right behind it. So I need to make sure to do that. But overall we're starting to get a result that's much closer to what we want for the final image. And you'll also notice that we've cut off 30 seconds just by light linking out these two lights. And that's honestly not that much of a difference in overall scheme, and we still get these nice blue highlights on the sky, on the roof lights up here. So I'm going to go ahead and set up some more light linking here. I'm going to grab this area light, bring up my light links. So this one is the far window light. I want to make sure that this is being a light linked out from the far wall frosted window and the sky card. And honestly, I probably don't even really need it on the wall parts, but I'm going to leave it on there for right now. The other thing that I want to make sure to do is to essentially limit this light so that it's only affecting through this tunnel. So I want to make sure that it's small enough that it's only inside of the tunnel. So any shadows that are cast by it will-- essentially I want to make sure that light isn't casting through this window up top and creating any problems that way. So I'm going to go ahead and shrink that down just a little bit to make sure it's inside of its container there. And that should work fine for that. Let's go ahead and light link this one out as well. We're going to back up my light links, the near window light, and turn off the light cards in it's light linking. I was also noticing a lot of noise in that render. We may be able to get away with a lot of this, especially once the textures are on top. And if you take a look at what the final image is going to be, we're actually using a bit of depth of field that ultimately nullify a little bit of that. But for the time being, if we want to increase the samples we can isolate these lights and see which one is creating the most noise. I still think so we can push the intensity of this light a little bit more. So let's go ahead and start tweaking these lights a little bit more, and then we'll start putting in some ambient light in next lesson. So I'm going to grab this, try the intensity turned up to, say, eight. That may be a little bit overkill, but we'll see here in the next render. And I want t turn this guy up to something quite a bit more, try 16. These guys probably can be brought up a little bit more, let's try four. And three. And I'm kind of liking the level that this blue light is coming in. But I think if we push it a little bit more, it will give us more leeway in terms of building up a little more contrasts. So I want to go ahead and turn this one up to, say, four, as well. Once again, bring down my camera and take a render. And I'll go and pause the video and come back. So I went ahead and made a few other changes while the video was paused. I went ahead and un light linked both the back wall and the near wall from their respective lights, because the shadows that were being cast by the holes back here were a little bit too noisy for my own liking. And the end result is much cleaner, a little bit brighter. And it's starting to get into the ballpark of what we would hope for in terms of direct lighting for this scene. So at this point it's really just a matter of going through and sort of tweaking our lights and just getting to a happy balance between the foreground lighting and the background lighting. Like right now I would probably say that this back window is a little bit too intense. You might even want to pop up these skylights a little more. It's just a matter of sort of going back and forth until you find something you really like. So what I'm going to go ahead and do is use this direct lighting set up and see what we're getting in the master layer, as opposed to this layer one that I've got set up. So one more time, I'm going to run the render and pause the video. So this is the result that we get with all of the materials applied in our scene. And I definitely think we're in the right ballpark. We've got pretty plausible feeling light coming through this window. The back window, still, I think, can be turned down quite a bit. But I think we're in the neighborhood. A lot of things that I'm really liking here, a lot of things that I think are looking pretty good. One thing that I do want to address real quick is the fact that we're starting to get these really nasty artifacts in areas where we have reflections. The reason for this is that the shadows that are being calculated by these area lights. There are two different settings inside of here. The first one is the high samples, which I've currently got at 64, which I could probably actually turn down. I was messing with that earlier as an experiment to see about some of the noise that I was getting from one of my other renders. But the low samples, that's actually what the samples are whenever a shadow is reflected. So it actually tries to separate those two out so that the more important direct shadows get more samples than those that are scene in reflections. So I can go ahead and start to turn up the samples on this. Usually you can get away with a fairly low number. Eight seems to work pretty well for this scene. It's a matter of personal preference, a matter of sort of seeing what's required for your scene. I've a lots of shiny surfaces, so I may even need to turn this up a little bit more. But for now eight is a pretty good number. So again, tweaking some of these values a little bit more. I can turn that down. I believe also this back window, I can turn that down, as well. Because you'll notice that once I loaded in all my file textures, we were taking a pretty big render time hit, going from about five minutes all the way up to 10 minutes. So we don't really want to be doubling our render time just by adding the reflectivity and materials in our scene. We want to try to keep that number down somewhere around five to seven minutes before we add in the ambient occlusion, which will be coming in in the next lesson. So in this lesson we've taken a look at how to create the portal lights that provide the main direct light for our scene. So I want go ahead and take one more render of this, pause the video and end the lesson there. And here's our result with those changed settings. You'll notice that our render times are hovering back around five minutes. And we've actually dealt with a lot of those artifacts that were coming in previously. There's still a few areas of trouble right in here, but I'm hoping that that will resolve itself once we start adding in ambient light. We'll see you in the next lesson.