Lighting has an incredible amount of power to convey your scene to the viewer. Harsh, stark lighting can give you a dramatic film noir look. Low-angle lights with long shadows can give you a creepy horror movie feeling, whereas brighter high-angle lights can make things look like they are taking place during a beautiful summer day. Or, you can use a bluish light that projects a hard noise cloud texture and makes your scene feel like it's happening under water.
Equally important is setting up your environment. Depending on how you set it up, you can achieve a variety of looks. You can set your scene in an infinitely large white space, commonly known as the white void in film and television. Or, you can adjust your environment such that your scene takes place outside during the day or somewhere on the moon. When you combine good lighting and a few additional tricks, you can make your scene take place just about anywhere. Figure 9-1 shows a pretty simple scene with a few different environment and lighting schemes to illustrate this point.
Before I get too deep into how you light a scene in Blender, you should understand some standard lighting setups and terminology. The cool thing is that most of this information isn't limited to use in 3D computer graphics. It's actually pretty standard in professional film, video, and still photography. In fact, quite a few photographers and directors like to use 3D graphics as a form of previsualization to test out lighting setups before arriving on set for the actual shoot. (And you thought you were just making pretty pictures on a computer screen! Ha!)
One of the most common ways to arrange lights is called three-point lighting. As the name implies, it involves the use of three different sets of lights. It's a common studio setup for interviews, and it's the starting point for nearly all other lighting arrangements. Figure 9-2 shows a top-down illustration of a typical three-point lighting setup.
Setting up a three-point lighting scheme starts with placing your subject at the center of the scene and aiming your camera at that subject. Then you set up your main light, the key light. The key light is usually the most powerful light in the scene. It's where your main shadows come from, as well as your brightest highlights. Typically, you want to set this light just to the left or just to the right of your camera, and you usually want it to be higher than your subject. This placement is to ensure that the shadows fall naturally, and you don't get that creepy flashlight-under-the-chin look that your friends used for telling scary stories around the campfire.
After your key light is established, the next light you want to place is the fill light. The purpose of the fill light is to brighten up the dark parts of your subject. See, the key light is great for putting shadows on your subject, but without any other light, your shadows end up being stark black, obscuring your subject. Unless you're aiming for a dramatic lighting effect, this effect is not what you normally want. The fill light tends to be less powerful than the key, but you want it to have a wider, more diffuse throw. The throw is the radius of space that the light reaches. For example, a flashlight has a narrow throw, whereas fluorescent lights like the ones used in office buildings throw light wider. You want this wide throw on your fill because it reduces the amount of highlight generated by this light. Typically, you don't want highlights from your fill to compete with the highlights from your key. As far as placement goes, you normally want to place your fill on the opposite side of the camera from the key and roughly at the same height as your subject.
Here's a way to figure out a good place to position your fill light. Draw an imaginary line from your key light to your subject. Now, with your subject as the pivot point, rotate that line 90 degrees. When you do, the line points right where you should place the fill.
The last light in a three-point lighting configuration is the back light or rim light. This light shines at the back of your subject, creating a small edge of light around the profile. That sliver of light helps separate your subject from the background and serves as the nice little bit of polish that often separates a mediocre lighting setup from a really good one.
Now, I've sat through many long discussions about the best way to position a back light (yes, my friends are nerds, too). Some people like to place it directly opposite from the key light, which works well, but sometimes the rim effect competes with the key's highlights. Other people prefer placing it opposite to the camera, which, too, is a good way to go, but if the subject moves, you risk the possibility of blinding the audience. And yet another group of people recommend placing the back light opposite to the fill. This approach can create a nice rim of light that complements the key, but it also has the possibility of looking a bit unnatural. As you can see, everything is a tradeoff when it comes to lighting. In fact, the only really consistent thing that people agree on is that the light should generally point toward the subject. The bottom line is that the best course of action is to play around with your back light and see for yourself where you get the best results.
As for the power and throw, you typically want to use a back light that is less powerful than your key so things appear natural. The throw can vary because the highlights are all on the opposite side of your subject. I personally like to keep it narrow, but a wide throw can work nicely for large scenes.
That's basic three-point lighting for you. It works well in computer graphics as well as the “real world” and it's the starting point for most other lighting configurations. Lower the angle of your key to make your subject creepy. Remove or reduce the power of your fill and back lights to get more dramatic shadows. Place your key behind your subject to get a mysterious or romantic silhouette. And that's just the tip of the iceberg!
After you're familiar with the basic principles of three-point lighting, you can use that knowledge to light your scenes in Blender. To add a new light, use Shift+ALamp and you see the menu shown in Figure 9-3.
The Lamp menu offers you the following types of lights to choose from:
Figure 9-4 shows what each light type looks like in the 3D View.
When you've chosen a type of lamp and added it to the scene, the controls to modify these lamps are in Object Data Properties. When you have a lamp selected, the Object Data Properties button in the Properties editor features a lamp icon. With a couple of exceptions, all the lamps share a few of the same controls. Figure 9-5 highlights the options that are universal for nearly all lights.
One cool thing about Blender's lamps is that you can instantly change lamp types whenever you want. Simply select the lamp you want to work with and choose the type of lamp you would like it to be in the Lamp panel. This feature is great for quickly sorting out the type of light you want to use. You can test out different lighting schemes without cluttering the scene by having a bunch of extraneous lights that you have to move to other layers or hide.
The Energy value and color swatch control the strength and color of the lamp. I rarely set the Energy to a value greater than 1.000, but when you need it, it's handy to have the option. And, of course, to set the color for your lamp, left-click the color swatch and use Blender's color picker.
The Distance value is only available for the Point, Spot, and Area lamps. The value is in the units you define in Scene Properties and, if an object is farther away from the light than that distance, it receives no light. For each of the light types, an indicator defines the range of this value. For the Area lamp, it's a line pointing in the direction that the light is facing. For the Spot, it's the length of the cone. For the Point lamp, no indicator is on by default, but if you enable the Sphere check box in the Lamp panel, a dashed circle appears to indicate the distance of the Point lamp's throw. If you don't see this circle immediately, you may have to zoom out in the 3D View so that you can see it.
Be careful when enabling the Sphere check box on the Point lamp. It subtly changes how the light works. With Sphere enabled, light coming from the Point lamp starts to weaken, or attenuate, starting at the light's location, so by the time it gets to the Distance value, no light is available. However, if you have Sphere disabled, that attenuation doesn't start until you actually reach that Distance value, so you have a farther throw. Having Sphere enabled makes the light behave more like it would in meatspace, but it's often more convenient to keep it disabled. In either case, you can control how dramatically that attenuation occurs by using the Falloff drop-down menu. The default value of Inverse Square behaves the most like real-world lights.
With the exception of the Hemi lamp, each lamp has the option of using ray tracing to cast shadows. Ray traced shadows are enabled by left-clicking the Ray Shadow button in the Shadow panel, and it's the default behavior for new lights. Know, however, that using ray traced shadows can drastically increase your render times. The next section goes more deeply into some techniques for optimizing your lighting to try to deal with that. However, if you do want to use ray traced shadows, you should be aware of a few options:
Adaptive QMC
Without getting too deep into all the crazy mathematical details, understanding QMC requires knowing a little bit more about how ray tracing works. In Chapter 7, I give a brief description of ray tracing that says it's done by tracing each and every vector of light bouncing from the light source(s) to the camera. This description is somewhat oversimplified. Tracing every single vector would take an incredibly excessive amount of time. In order to get around that, programmers decided to take a sampling of those vectors and approximate everything in between them. To choose which sample vectors to select, they first tried just randomly picking them. The problem, though, is that raw random selection doesn't give consistent or accurate results. Samples aren't necessarily where they're most useful. So to accommodate that, it was decided that samples could be random, but evenly dispersed. Evenly dispersed random sampling is basically constant QMC. Of course, the downside to constant QMC is that you still might be taking samples from parts of the scene that don't need very many. If you can stay random, but have more of the samples taken from busier parts of the scene, you might get better performance. This logic is behind adaptive QMC.
Like with materials for objects, you can also apply textures to your lights and apply them to the lamp's color, its shadow's color, or both. This ability is a great way to use lighting to enhance the environment of your scene or to fake certain lighting effects that are typically only achievable with ray tracing. One specific example is caustic effects. If you have some free time, take a glass of water and shine light through it. Due to the refractive nature of the glass and the water, you usually see a strange light pattern on the table near or around the glass. That effect is an example of caustics and, if you don't need 100 percent accuracy, you can fake it with a Clouds texture on a Spot lamp.
On a larger scale, caustics are what make the cool moving patterns you can see on the bottom of a swimming pool. To add a texture to your selected lamp, use Texture Properties and use the same procedures covered for texturing materials as described in Chapter 8.
As you can see in Figure 9-5, the Point lamp has options that are available on nearly every other lamp but doesn't have much in the way of unique controls. The same could actually be said of the Hemi lamp. In fact, it has even fewer controls because Hemis can't cast shadows. However, the remaining three lights have some interesting options that allow you to optimize their usage to meet your needs.
The Sun lamp is incredibly useful because it has the ability to behave more like the real sun. It's the only type of light that Blender has that influences the look of the sky and even provides some atmospheric effects. You control this lamp with the Sky & Atmosphere panel that appears when you set your lamp to be a Sun. By default, both the Sky and Atmosphere check boxes are disabled, but you can enable them with a left-click. Figure 9-6 shows the options as they pertain to the Sun light type.
When you enable the Sky check box, you can use the controls in its panel to determine how the Sun lamp influences the sky background. At the top of the panel is the Turbidity value. Keep Turbidity low for clear day skies and increase it for hazy, overcast skies. When you see the sky on a clear day — the real sky outside; you know, in the for-really-real world —that it's lighter near the horizon and darker as you look farther up. The Brightness and Size values under the Horizon label control this effect in Blender. The Brightness and Size values under the Sun label adjust your sun's visibility.
If you try to render your scene, you may not see the sun in your sky, even if you've placed the Sun lamp within your camera's view. Because the position of the Sun lamp is irrelevant and only its orientation is important, you have to rotate the lamp so that it points in the opposite direction of the camera's orientation.
When you enable the Atmosphere check box, you can control the sun's influence on how the air in your scene looks from a distance. These options are best suited where you have a wide outdoor shot of your scene's environment. There's really no good way to preview the effects of these values other than to do test renders. Here's a quick guideline to help understand what each one does:
When working with Spot lamps, you have the option of two different ways to cast shadows: ray tracing or buffers. The simplest way to know the difference between the two is to know that, generally speaking, ray traced shadows are more accurate whereas buffered shadows render faster.
Regardless of which type of shadows you cast (if you decide to cast shadows at all with this lamp), a handful of settings are available in the Spot Shape panel:
Show Cone: New to Blender, this feature is incredibly cool and useful. When you enable the Show Cone check box, Blender allows you to more clearly see the volume of the cone, making it much easier to see what objects are within your Spot lamp's influence area.
Using buffered shadows instead of ray traced ones, the options in the Shadow panel change. All the ray traced shadow controls are replaced with a different set of options because buffered shadows use an image-based process instead of ray tracing. You have more ways to control how the shadows look because you're no longer constrained by the limits of reality. Figure 9-7 shows the various settings for a Spot lamp with buffered shadows.
Trying to sort out all these controls can be daunting. However, the following values are the most important ones that you should know about:
Area lamps are very similar to Spots, except Area lamps can use ray tracing only for creating shadows. The shadows are generally smoother and more accurate; however, they can increase your render time dramatically. Figure 9-8 shows the options and settings for Area lights.
The way an Area light works is pretty simple. Imagine that at the lamp's location, you don't have a single light, but instead you have a grid of lights, and you can control the width and height of this grid as well as the number of lights in it. As a result, you have even more control over your lamp's throw.
To control the dimensions of your Area lamp, use the Size value in the Area Shape panel. This size is measured in units chosen in Scene Properties and, by default, controls both the width and the height of the Area lamp. You control the number of lights in the Area lamp by adjusting the Samples value in the Shadow panel. Because the default shape of the lamp is a square, increasing the number of samples gives you the square of the sample value. So setting Samples to 3 creates 9 lights in the grid, and setting it to 5 creates 25 lights in the grid.
If you'd rather have a rectangular Area lamp, left-click the Rectangle button in the Area Shape panel. When you do, you can set the width (Size X) and height (Size Y) of your Area lamp. In addition, the Samples value in the Shadow panel changes to Samples X and Samples Y, giving you control over the number of horizontal and vertical lights you have on your Area light's grid. The total of lights you have in the grid is the value of Samples X multiplied by the value of Samples Y. Figure 9-9 shows an illustration of how the lights are arranged in square and rectangular Area lamps.
When working with Area lights, remember that you actually have multiple lights arranged on the lamp's grid, which can make an Area light with an Energy of 1.0 excessively bright. So if you use an Area lamp, try a much lower Energy value. Depending on the number of samples in your Area lamp, you may want to start as low 0.050.