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 take a look at one way to get ambient lighting into our scene. So we're back at our simple scene, and I've made a couple of changes. I went in and created a new IBL node, and all this is doing is shining white light into the scene through these portal lights. So if we take a look at what our render looks like right off the bat, we see we're just getting white liked being shined into our scene. And it's looking pretty good, I've got to say. These portal lights are a pretty powerful way to work. They get these really nice soft shadows they're very efficient, and they tend to play nicely whenever you only have a few of them in your scene. But we're missing a lot of bounced light. You would expect to see these corners illuminated better. You would expect to see the shadows over here to be getting a lot more light bouncing around the room. Light transport, traditionally, is a very expensive thing to do. So we're going to try to figure out a way to fake it as best we can. In order to get started with this, I'm actually going to go into my Render settings. And I'm going to turn on Final Gather in Indirect Lighting at fairly decent settings, I'm going to turn up the interpolation a little bit, just so we don't get as much noise. And just take a render of this. This will be our starting point, and sort of our point of reference coming back whenever we're taking a look at the way that our ambient lighting is contributing. So this is looking much better, in terms of how the light is bouncing around in the scene. We're starting to see this nice definition underneath the shadows. We're getting some nice areas around the contacts between the ground. So if I take a look at this and compare to the previous-- I didn't save it, oh well. But if we were just take a look at this in comparison to what we had earlier, it's just a much nicer result overall. It also has taken twice as long to render. But in a much, much higher polygon scene that number goes up even more, because you need to resolve those fine details. If you don't resolve those fine details, you end up with a lot of flickering. You end up with color bleed across boundaries, that kind of thing. So it's just something to bear in mind. So what I'm going to do is go ahead and turn Final Gather back off, and figure out some other way to get ambient lighting into the scene. One method that I've sort of stumbled across over the last year is using an area light in User mode to get this effect. So I'm just going to create an area light, which will pop in at the origin. And it doesn't really matter where I put this, but I'm going to go ahead and just to scale it up a bit so it's easier to select. And if you scroll down to the Mental Ray tab inside of its attributes, again, we're going to click on Use Light Shape, the same way we would if we were putting together a portal light. But under Type, we want to set this to User. And essentially what this is saying is, we are going to be defining the areas at which this light contributes light. And I'm going to turn the samples all down to one. Because we're going to be providing samples through a different node. So keep scrolling down until we get to Custom Shaders, and inside of Light Shader, we're going to choose the MIA ambient occlusion node. So if I go down textures, and I go down to the MIB ambient occlusion node, go ahead and click on that, essentially what this is doing now is it's using this ambient occlusion node-- which I hope you guys are all familiar with, if you're not I recommend taking a look at some of the really good stuff that digital tutors has for it. I want to turn up the samples, 16 is fine for right now. Essentially what this is going to do is define the light characteristics of this area light, based on this MIB ambient occlusion node. And we'll see how this works here in a second. I'm just going to turn the bright color maybe down a bit, and maybe even turn the dark color up a bit. We'll see here in a moment how this is affecting our scene, and tweak it accordingly. The only thing we need to make sure to change is the max distance. Right now it's set to infinity, that's what zero means, it's sort of a special case. So I want to turn this up to, say, 20. Looks like a good number considering our scene scale. Let's just go ahead and take a look and see what this looks like. So if I go and open up my render, remember this is what we were getting with the Final Gather, take a render, see what we get. So you're starting to see we're actually getting a lot of light contribution coming in from this area light that we had set up. And it's following the ambient occlusion node. So we compare these two, probably way too bright. So if I go and grab this one more time-- I don't know why I can't select it right now, that's very odd. Hm, curiouser and curiouser. Anyways, I'm just going to open up the Outliner real quick. Go to Window, Window to Outliner, and I'm just going to grab that area light real quick, that's area light four. Go back to ambient occlusion, and I can just start turning down this brightness value quite a bit. So again, take another render. Go back to my bookmark real quick, just to make sure that we're on the same page. Take another render. And we're starting to get back in the ballpark. Probably still a little bit too bright, probably way too bright in the corners. So if I go and turn the dark down, turn the bright down. One more time, take a render. We're starting to get something very close to what we had previously with the Final Gather solution. And it's also only adding one second to my render time, as opposed to a full 10 seconds with the final gather solution. It's not quite as accurate, but again this is guerrilla production. This is not about getting the most accurate, the most physically possible solutions. This is about getting the thing that's going to be the quickest and the prettiest for whatever your budget is. We also turn up the distance on here, maybe to 50. We'll start to get a little bit more of a natural falloff in terms of the way that these shadows are being calculated in corners, and that kind of thing. And we'll start to get a little bit more of that shading on one side that we're seeing with the other. So again, adding one second to my render time, and we're actually getting a really nice result. Now the really cool thing about this is that you can actually start to play with color in here. So if I go ahead and go back to my bookmark, we can actually start to, say we make the bright color some kind of nice blue. Turn down the intensity of that a little bit. If I take a render of this now, we're actually getting color in that ambient occlusion. And what's really, really cool about this is that we don't even have to have it with one particular color. So if I go and grab this bright color, and map it to a ramp, what you'll get is a nice Technicolor effect across all of the objects in the scene. And right now these colors are being based on the UVs of the individual objects. But there's no particular reason why this would have to be so. So if I create a new ramp, go ahead and go to my Hypershade real quick, it's one of these-- I have a tendency to leave all of my windows open in case any them later, and then never knowing where they are. It's a bad habit of mine. So if I go back to rendering editors, go to Hypershade, let that load up. Go ahead and create a new ramp. I'm going to right click on it, and create as projection. Essentially what this will do is create a projection node that's being used in 3D space instead of 2D space, or UV space as the case may be. So if I go ahead and plug this ramp into my area light for the ambient occlusion, I go to Utilities real quick, go to this light-- excuse me, go to Lights-- and go to this light, bring up the ambient occlusion node, and plug this projection into the bright slot. And then grab the projection itself, should be hiding somewhere around here, there we are, little green guy. Seem to be having difficulty selecting things right now, not entirely sure why. I'll have to take a look at that. But if I go and grab the projection node, actually the place 3D texture node is what's selected in here, go ahead and move it out, scale it up, now this ramp is being projected across the scene space through this node. So if I go back to my bookmark, and take a render now, we'll actually see a transition of colors across the world space. And this becomes very, very powerful when we want to fake the effects of final gather and we have lights of varying colors instead of just having bright white light. Which is exactly what we're going to work on it in a later tutorial, once we get into the train station. So this lesson we've take a look at some ways to create ambient light in our scene, using a area light in User mode. And other ways to get some color value into that same node.