Basic Maya Lighting Tutorial
This is hopefully a tutorial covering some basics of lighting in Maya, utilising Mental Ray.Â I made this tutorial for someone in a forum and tried to replicate their scene to better show them how to control their lighting.Â So while I wish I had some more detailed models in there to demonstrate with, such as the head, I used what I could find that was shaped most like the stuff in their scene, rather than what looked best.Â I don't consider myself great at lighting or anything, but I noticed a lot of people seemed to have issues with artefacts in their shadows, or lighting set ups that make it looks like it has artefacts, or they can't soften their shadows, so I figured I would try to help out.Â There's probably some better ways to do some of this stuff, but this is what I have to offer, and hopefully I'm not providing any incorrect information.
I will start off on the concept of 3-point lighting, as I understand it.Â The three light points are typically referred to as Key, Fill and Back.Â We will cover this all again when we start lighting, but first we have an overview so we are working with the same mind set.
1. Your key light is your main light source. Â Sun, lights above, spot lights, etc. Â This is your main light source. Â Often it seems like people aren't sure where to put this light and will toss a light wherever and often in places that make no sense.Â In a case like this you may want to tell yourself a bit of a story if you're trying to get it to blend into a scene nicely, and figure out where this light would be coming from in the scene. Â It's possible it's just lighting you set up for a beauty shot there, but try to think of it like how you might light it in real life. Â But anyway, the key light is mainly where your light is coming from. Â Pick an angle that defines the features of your model well, if you can.Â Sometimes you pick realism over design, but I suggest that whenever you can, since artists are often trying to show off their work, light at angles that are going to cast shadows and catch highlights in a way that best defines the features of whatever the focus of the scene is.
2. Your fill light is off to the side and is again used to help display the details of the model, rather than hiding it in hard shadows. Â It simulates the way that light typically diffuses across an object. Â In real life light diffuses across a surface and we have bounced light, etc. Â So sometimes, in lighting a shot, we're helping to accentuate that, which is generally what I use a fill light for.
3. Your back light is used to break the image up from the background. Â A lot of people tell you that your key light is your brightest light source. Â Often I have my backlight just as bright, if not brighter, for my back light (but not always). Â The idea is to get just that bit of rim light on the back to break up the model from the dark or similar spots on the background.
Now, while it's called 3-point lighting, there is often a misconception that this means only 3 lights in the scene.Â Nothing could be farther from the truth!Â 3 points refers to 3 bulletin points.Â It's not the light itself that is important, but the concept that the bulletin point is trying to execute.Â A better way to think of the three points of lighting is like this:
- Set up lights for your main source(s) of light
- Set up lights to diffuse the light from your key lights across the surface of your models
- Set up back lights that help break up the model from the background and give them added depth
So even though it's called 3-point lighting, it's very rare that we ever use only 3 lights. Â Â In this tutorial, as we go, we will have other light sources from a background image that isn't accounted for in the lighting of the render that we will have to emulate.Â There will be a bounce light from a floor that isn't there, so we will have to add it ourselves.Â So these are all lights I will add after my 3-point lighting (though, depending on the scene, they could just as easily be part of the 3-point lighting too.Â Really, any light you add tends to add to one of the points!).
I remade this scene with an old, ugly head that looked similar in shape to the head I was comparing when I made this tutorial, and I remade the pedestal. Â The background is an image plane attached to the camera. Â Whilst not the prettiest thing, it's enough to catch light well enough to demonstrate the process.
When I light a scene, I usually start with a white Lambert on everything. Â The reason for this is because I want to see exactly what the light is doing, how it's casting shadows, etc. Â I use white so I can see what areas get washed out easily. If I have textures on, they can confuse me as to what is shadow and what is texture. You can throw on a bump map or displacement map if you want to get that detail, but I usually wait till later when I do, because they add render time.Â You can easily get through this tutorial before needing to add bump or displacement, and at the end of this tutorial I would still continue to tweak my lighting as I work.(Fig.01)
First, I will use a spot light, and then soften up the fall off on it. I use the manipulator tool to easily set up its placement and direction.(Fig.02)
I then hit that little blue dial button by the light two times until I get to this tool, which lets me adjust the Cone Angle and then click it once again to adjust the Penumbra Angle of the light ( I could do this from the attribute editor too, but I prefer the visual method). I believe the first one is where the light fall off ends from the center of the light and the second is where that solid center of light ends and starts to fall off. ( Fig.03)
Next I open up the attribute editor for the light and go to the Shadows tab. I turn on Use Ray Trace Shadows and set the light radius to 10, and both shadow rays and depth limit to 3.
Really, in this case, I probably don't need depth limit because we don't have anything transparent. Depth limit is how many times a ray will pass though a transparent object and refract. Something like glass, it could theoretically bounce 100s if not thousands of times, so we limit it to just three bounces before it stops. Shadow rays if I recall correctly is how many samples Mental Ray takes.Â A lower shadow ray setting will be grainy and a higher shadow ray limit will be softer and smoother.Â For now, keep it low while you're testing but for your final render you may need to turn it up.Â Keep in mind that the higher the setting the longer the render time.(Fig.04)
We're going to use final gather to render this. The difference in ray tracing from final gather is that ray tracing the rays come from the camera and go to the object. Final Gather the rays come from the light and go to the camera. Actually, here's what the help menu describes it at, which explains it better than I probably will:
With Final Gather, rays are first cast from the light (rather than from the camera, as with simple ray tracing). When a ray strikes an object, a series of secondary rays are diverted at random angles to calculate the light energy contribution from surrounding objects, which is then evaluated during the ray tracing process to add the effect of the bounced light. This basically turns every object into a light source so each object in a scene influences the color of its surroundings as in the real world.
So next, we'll go turn on our render settings to use Mental Ray rather than Maya software. I'm going to set it to Preview and Final gather. This will give us a quick render time to see how our lighting is going.Â Remember this part later, because come your final render, you will want to change this at least to Production quality. (Fig.05)
So once you got that set up, let's render and see what we got. When rendering lights, I like to render one light at a time, so you can see what each light is doing and what's changing. As well, I like to click that little down arrow button and save each render stage so I can scrub back and forth in the render view and see subtle changes that are happening. I'm going to guess it's going to be hard for you to see a lot of the little changes I make here, but it really helps. Sometimes I hide old lights as I add new lights so I can see what that single light is contributing to the scene all on its own.
Think of it like playing 20 songs at once. 19 of them are playing various songs like Led Zeppelin, Rolling Stones, and other music that doesn't suck.Â But one of them is playing Celine Dion, and I tell you to turn off the Celine Dion one because that high pitch shrieking from Titanic song is going to make my head explode. It's going to be hard to tell which one is Celine Dion with all that other music playing. Turn them off and play them one at a time though and you'll figure it out. Shadows work the same way. Got a strange light? Narrow it down one by one trying to figure out which light or lights is making them.(Fig.06)
This isn't too bad. It's casting a decent brightness. The way the shadows are cast, they define the features of the face ok so far. Good enough to move on to the fill light. To do that I'm going to just duplicate the key light I made already (No need to keep setting the same settings over and over). I'll use the manipulator tool to position it so I don't have to rotate it around to aim back at the head. I may adjust where exactly it's aiming at though (Fig.07).
I'm going to turn down the lights intensity of this new light so it's not as bright as the key and then render and see what it looks like.(Fig.08 & 09)
To me, this seems way too bright. It's starting to wash out the model a little and it doesn't really define the model any better. So I'm going to go back and adjust the intensity until I'm happy with it. (Fig.10)
So here I've lowered the intensity of the fill light to around 0.2 and added a slight green tint to the light. I got the color from sampling from the floor and then lightening it a little. Next I'll add a rim light to help better define the model from the background and define some of the features of the model better. I will again duplicate the light, and in this case I'm going to turn up the intensity. I'm also going to add a little color. In the next image you can see how little color I tend to add. (Fig.11)
Here we are with a little bit of back light now added. It looks alright on the head to me but on the top of the pedestal, right above the vertically ridged part, the light feels too hard to me. So I'm going to soften the shadows up a little by turning down the intensity just a little more. It's just one little spot, but it looks off and should be corrected.(Fig.12)
This image below looks a little more natrual to me. If it doesn't seem like enough rimlight on the head yet, just keep in mind we're still adding light. We still have to mimic the lighting coming from the windows, which will add to the back light.(Fig.13)
One thing I don't like at this point is the Key light color. It feels a little bright too, like it's not light from this background scene. I'm going to change it to a color that has tones more like the image and turn down the intensity just a little.Â Right now it's a pure white light, so I'm going to add just a slight bit of brown, like the walls, since there doesn't really seem to be any pure white sources of light here.Â Rarely is light pure light and has some sort of slight color tint. (Fig.14)
This color feels a little more natural to me. Now I'll go onto the next lights that I feel pretty happy with the ones I already have.Â I have covered the basics or bare bones of the 3 point lighting. (Fig.15)
So below here you can see the lights in my scene that I've added. I added a couple for the light coming through the windows and then added a few for the bounce light off the floors coming from the windows (since there's no geometry there to bounce light off of, we have to put lights in to do that) None of the lights in back are too high in intensity, since the more lights we add the brighter things get. Light is additive. The more you add in the more it gets towards white. There's a little fudging in that theory with light color or negative light intensity, but in general, try to keep that in mind.(Fig.16)
Here's the render I end up with after a bit of tweaking of those lights.(Fig.17)
Now what I don't like about this render is the model. It's too soft, and the edges can't catch highlights. So I'm going to go bevel everything on the pedestal. Select all the edges that you want to bevel on any particular object all at once, and then bevel them. I do a some what small bevel. You can hardly see them here. But later, they will really add to being able to catch highlights on the model from the Also, later if we smooth this stuff, it'll all keep there shape. Anywhere where there was a hard edge, I beveled it. I don't recommend being lazy and beveling the whole model if you plan to smooth it later, unless you want it to not be round and keep those straight edges that it has.Â And yes, this seems like a modeling step, but it's a modeling step that's taken for the sake of lighting, which is why I've included it in here.
Here is my model after being beveled (Fig.18):
Not much to see here, but that's partially due to this shader and partly due to the low render quality. But trust me, this is the stuff good models are made of.Â If you're following along, try throwing a blinn on there and you may be able to see the highlights much better.Â Since this lambert has no specularity, there aren't really any highlights to catch.
To take it to the next level after that, I'm going to smooth it. But I'm not going to actually smooth the model. I'm going to use Mental Ray Approximation smooth so I keep my scene quick moving and it can be more efficient to render like this without crashing Maya or Mental ray when it comes to a lot of geometry. It's not always a huge jump in performance, but it can take you farther.
To apply it, select all your models you want to smooth (or you could do this one by one if you want different smoothing settings for each model) and then go to the approximation editor, like so (Fig.19):
Under the Subdivision set, first hit the create button. This creates a new approximation setting. This can later be selected by that menu and apply it to any object. To get rid of it, you'll have to delete the node in the outliner (turn off show DAG objects only).
Once it's created click edit and we'll set up the approximation smooth settings.(Fig.20)
We're going to set the Approx Method to Spatial.
Leave Min Subdivisions at 0.
Set Max Subdivisions to something like 3 or 4.
Check on Fine and View Dependant.
With these settings we've told it by using fine that it'll render the image in sections which means it doesn't have to subdivide the whole model at once, where you get a little better ability to render large amounts of geometry. Length says if an edge is longer than this, don't subdivide it. Max subdivisions will only subdivide it that many times until it gets to that edge length. If you have view dependent on, rather than going by the scene scale for the length, it'll go by pixel size. So with view dependent turned on, it'll split any edge smaller than one tenth of a pixel, up to 4 times with the settings I have.
(Note, if you're adding displacement, you'll have to add a Displacement Approximation node as well.Â Simply set its quality settings to Fine View High Quality.Â This sets it up to use Fine rendering like we talked about before, which is view dependant.Â High quality because it's max subdivisions is set to 7.Â Often people find they can't get a subdivision higher than 3 or 4 on their characters because of all the geometry it creates.Â What ever you set your min max settings to here, do not set your Subdivision Approximation settings any higher.Â Subdivision approximation won't adjust the UVs, so if it's higher than the Displacement approximation, at least in Maya 2008, you're texture may not fully displace with the rest of the model and parts of the texture become blurred.Â If you keep running out of memory or Mental Ray is having fatal errors, turn down your max subdivision levels.) (Fig.21)
Here's the render I get with those settings. Yay! No more jaggy model.(Fig.22)
So there are a few other ways we could do to light this thing. We can use bounce cards. Or at least simulated bounce cards. I'm going to throw in a polygon plane into the scene and put a lambert on it that's white with an ambient color of white as well. This will bounce white light onto the model. (Really, it doesn't have to be a card, it could be any shape and size model. But a card is easy to tell where it's bouncing to.) (Fig.23 & 24)
Now if I don't want a big white square in my scene when I render this, I better open up the attribute editor for the plane I made and turn off some render settings so it's only casting light but not rendering in the scene and not casting or stopping shadows.(fig.25)
Here's the model with that bounce card to the side. (Fig.26)
Little change, but to really see a bounce card, a little specularity and reflectivity on the model helps. So I'm going to change my Lambert to a Blinn and adjust the Specularity, Eccentricty and Reflectivity settings a bit: (Fig.27 & 28)
So here, you can see how you can slightly see the bounce card being reflected in the side of the object. It adds some interesting detail having these around, especially in a scene with nothing to reflect. They use these a lot in car ads to add those interesting highlights in the paint. They are great for getting highlights in eyes as well. If you didn't want it to be reflected you could turn the reflectivity off in the shader, or check it off in the render stats of that polygon plane. As well, you could make a bigger plane, or half cylinder and texture on an image of the room in the color channel and ambient color channel, and get the colors from the image to bounce over the object.
After about this point is when I would start designing my shader and tweaking the specular settings and such. Much the same way we did the lights, focusing on one attribute at a time, and often turning off the other attributes so I can see what it's doing as I'm changing it. As you get better you get a feel for what does what, and don't have to turn stuff off so much, or can tweak multiple lights at once because you have a good idea of what's going on and what should happen.Â As well, I consider shader design part of lighting.Â So I wouldn't got any further with the lighting without making my shaders to see how they handle the lighting and are doing what I need them to do.Â This is about as far as lighting goes without well designed shaders, and you can't tell if a shader is working properly without good lighting.
So there you have it. Hope you learned something. Not the best end example ( I would have taken it a little farther, but I was so busy making images in Photoshop for the tutorial, I forgot to save the scene and it crashed when I tried changing something), but really, the process is no different. It's just more time tweaking everything, which is the long part.Â I would call this image far from finished, but from here it's just observation of references, trying to figure out the properties this image needs and tweaking all the same light settings we already have and adjusting my shaders.
One challenge you are always facing that I haven't mentioned is composition. One tip on composition is the eye is drawn to the biggest brightest fasting thing on the screen generally. The windows in this image are bright white and the model is darker than them, and the room around the windows is dark, so the eye is first drawn to the windows instead of the model, which you're trying to make the focus of your piece.
Now if the whole image was lighter and the head was darker, and the model had the contrast against the background image, then even though the framing image is brighter, the eye could be drawn to this darker floating center, as if we reversed the concept. Color could also really help here. A yellow orange, warm tone bronze metal head against this cool colored background could bring it out as well. Faking the lighting by having less lighting on the pedestal and more on the head, so the other parts of the model aren't as bright as the face, could also help direct the eye where we want it. Luckily it's a face, which is one exception to that "rule" (though I don't like that word, It's more of a general guide. There's no rules. Just what works.) and the human eye is drawn to human faces, so you have that working for it.Â (Really, I could right a whole other tutorial on composition, but it's worth mentioning here because part of the goal of good lighting is to control the composition.Â Despite what most 3D layout people would tell you, I believe you haven't done your layout until you light it.Â If that background image was just a grey 3D model that wasn't lit, imagine how flat and lacking in contrast it would be.Â Once lighting is added, it has a completely different composition.)
As far as what I consider good composition, your eye stars at the biggest brightest thing, and then moves to the next biggest brightest thing, and so on and so on. Good layout will have something that helps direct the eye to the next thing, and in good composition nothing leads the eye outside of the frame of the image and tends to bounce it round between a number of features. Look through some of the better paintings you've seen and you'll see the pattern all over the place. Observe some of the works you don't like and try to figure out what fails about the composition. It probably doesn't pull your eye in the right places, or leads your eye no where, or has only one thing your eye is drawn to. The more of this you figure out, good and bad, the better work you make.
And then on top of that with composition and lighting, we talked about key, fill and back light and biggest brightest thing drawing your eye. These are guides. Not rules. Think of the concept of what these are trying to do, not that you always need a back light. The purpose of adding a back light is to break up your image from the background. Now if you have a character on all white background would you light them with a really bright white back light? No, because where they were once defined from the background you've now added this light that blends them into the background, which defeats the purpose of a back light.
Your key light could be a really dark light if that's the mood of the image. The goal of the key light it to define the features of what it's lighting. A dim light in a dark scene can do that. The fill light is there to soften up overly hard shadows and help diffuse the light more. Any of these could be one light and any of them could be 20 lights. As long as they're completing the concept of the reason you add them into the scene in the first place.
So on any of these steps, if you can't come up with a why for why you are adding something, don't add it. If you don't have a reason you decided to pick a color, figure out why. All the colors I added to the lights balance it out more with the colors in the image. I added colors that were already found in that image. I didn't add any purple or red (though I could of for contrast, if it was the right contrasting color). I did add a slight bit of yellow/orange, but that's on the concept that sun light is either soft blue or soft yellow/orange and that's your light source from the windows. The bounce light is off a green floor and thus more green. But I have a reason, a logic, to all of it. There's never a light over the top of the model, because the image shows no light source from there. I tried to place lights where other light sources seemed to be coming from. So figure out why you add anything to the scene, or you don't actually have any control over it. Without understanding or reasoning, you're out of control and it's just luck if it works out and you probably can't easily repeat it.
Anyway, I know that was a lot, but I hope it helped. I know I always wished there was more info on this stuff when I was learning, and these are the big concepts for me. There's plenty more tools out there, but I've found I can get pretty far with these concepts in mind and don't need that many tools to get a nice look.