Lighting a Scene

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.

Figure 9-1: Different lighting configurations can drastically affect the look of a scene.

image

Understanding a basic three-point lighting setup

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.

The key light

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.

Figure 9-2: A typical three-point lighting setup.

image

The fill light

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.

image 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 back light

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!

Knowing when to use which type of lamp

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+AimageLamp and you see the menu shown in Figure 9-3.

Figure 9-3: Adding a lamp in the 3D View.

image

The Lamp menu offers you the following types of lights to choose from:

  • Point: This type of light is sometimes also referred to as an omni light, meaning that the light is located at a single point in space and emanates in all directions from that point. The default Blender scene has a single light of this type. The Point lamp is a good general-purpose light, but I prefer to use it as secondary illumination or as a fill light.
  • Sun: The Sun lamp represents a single universal light that comes from a single direction. Because of this single source, the location of the Sun lamp in your scene doesn't really matter; only its orientation is relevant. This type of light is the only one that affects the look of the sky and is well suited as a key light for scenes set outdoors.
  • Spot: In many ways, the Spot is the workhorse of CG lighting. It works quite a bit like a flashlight or a theater spotlight, and of all the light types, it gives you the most control over the nature of the shadows and where light lands. Because of this control, Spots are fantastic key lights.
  • Hemi: A Hemi lamp is very similar to the Sun lamp in that it doesn't matter where you place the lamp in your scene. Its orientation is its most important aspect. However, because it's treated as a full hemisphere of light around the scene, lighting from a Hemi tends to be softer and flatter than the sun. Hemis are also the only Blender lights that cannot cast shadows. I like using them for fills and back lights. They're also handy for outdoor lighting.
  • Area: Area lights are powerful lights that behave similar to Spots; however, the shadows tend to be softer and more accurate because they're based on having a grid of lights to work with. As a result, they work well for key lights, but because they tend to take more time to process, you should use them sparingly.

Figure 9-4 shows what each light type looks like in the 3D View.

Figure 9-4: From left to right, Point, Sun, Spot, Hemi, and Area lights.

image

Universal lamp options

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.

Figure 9-5: Panels and options available for all lamp types.

image

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.

image 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:

  • Shadow color: Left-click this swatch to get a color picker for selecting the color of your cast shadow. Of course, this isn't physically accurate. Real-world shadows are always black unless other lighting is present.
  • Samples: This option dictates how many samples the ray traced shadow uses. Increasing this value increases the accuracy of the shadows at the expense of longer render times.

image

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.

  • Soft Size: This option controls how blurry the edge of your cast shadows are. The higher the value, the blurrier the shadow. However, with only one sample (the previous option), the shadows won't blur that much. Blurry shadows require more samples.
  • QMC Sampling Types: You generally have the choice between Adaptive QMC and Constant QMC. QMC stands for Quasi-Monti Carlo and is an algorithm for taking random samples. Generally speaking, the Adaptive QMC setting gives you faster render times and better results.
  • Threshold: This option is available only when you choose the Adaptive QMC sampling type. It basically helps the renderer decide which samples to use and which ones to ignore. A higher Threshold value shortens your render times, but may decrease accuracy.

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.

Light-specific options

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.

Options specific to Sun lamps

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.

image 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:

  • Sun: This value adjusts the influence of the Sun's intensity on the atmosphere. Increasing it makes objects in the distance bluer.
  • Distance: This value controls the distance that the atmosphere has an influence. At low values, you see everything. Increasing this value, the light becomes yellower, and distant objects become more like silhouettes.

    Figure 9-6: Controls for the Sun lamps.

    image

  • Inscattering: Increasing this value makes the light appear to scatter more between the camera and the objects it's pointing at. Set this value to 1.0 for the most physically accurate results.
  • Extinction: Lower numbers for this option reduce the amount of detail seen in your objects. This setting is similar to Distance, except it doesn't really matter how close objects are to the camera. Like Inscattering, you get the most physically accurate results with a value of 1.0.
Options specific to Spot lamps

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:

  • Size: This setting controls the width of the Spot's throw, measured in degrees. So a value of 180 degrees is completely wide, whereas a value of 30 degrees gives you a narrower cone. Unless I'm doing something special, I like to start with my Spots with a Size value around 60 degrees.
  • Blend: Blend controls the sharpness of the edges at the boundary where the Spot's cone of influence ends. Lower values give you a crisp edge, whereas higher values soften it, making the light appear more diffuse.
  • Halo: Enabling this check box allows the renderer to show the full cone of light generated by the Spot. This is called volumetric light. You see this effect when you use a flashlight in a dusty room or when you want the “sunbeams from the sky” effect.
  • Intensity: Specifically speaking, this value controls Halo Intensity. This value has no influence unless you enable the Halo check box. If Halo is enabled, increasing this value brightens the volumetric effect.
  • Square: Enable this check box if you would prefer the Spot lamp to come from a square source rather than a round one.
  • image 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:

  • Sample Buffers: In essence, Sample Buffers are basically the same as the Samples values discussed elsewhere throughout this chapter, but they're specifically for helping render hair and fur more effectively. Higher values give better results, but at the cost of more system memory when rendering. Unless you're rendering hair or fine detail, keep this set to 1.
  • Size: Buffered shadows is an image-based technique. The shadow buffer size is the resolution of the image used to create the shadows. Lower values work faster, but look more jagged.

    Figure 9-7: Controls for a buffered Spot lamp.

    image

  • Samples: Each sample is an offset copy of the shadow buffer. Soft shadow edges come from mixing samples, so a higher value makes them look better. Render time does increase with more samples, but because buffered shadows are typically much faster than ray traced shadows, it's okay to splurge a bit and allow yourself a few extra samples.
  • Soft: Increasing this value makes your shadows softer and blurrier. To use this setting effectively, make sure that you have a Samples value greater than 1. And at the same time, you get the best results by not setting the Soft value higher than double your Samples value. So at the default Samples setting of 3, you should keep your Soft value below 6.
  • Bias: This value offsets the shadow from where it connects to the shadow-casting object. Occasionally, you may get some weird jaggies or artifacts in your shadows. Increasing the Bias can help get rid of those artifacts. If you do have to adjust the Bias, adjust it only as low as it can go before you get artifacts in your renders. Otherwise, your shadows will begin to look very unnatural. A good practice is to do a series of test renders starting with a Bias value of 0.1 and working your way up until you no longer see artifacts.
  • Clip Start/Clip End: Consider these values as a secondary control in addition to the Distance value in the Lamp panel. Objects that appear within these two values, indicated by a line on the Spot lamp in the 3D View, cast shadows, whereas objects outside of this range do not. Keeping the Clip values as close to your shadow-casting objects as possible gives you the most accurate results. If you don't want to adjust these values manually, enable the Autoclip check box to either value. Blender then automatically sets the Clip values to include objects within the Spot's cone.
  • Halo Step: This value is in the Spot Shape panel and has an effect only if you have the Halo check box enabled. Adjusting it controls your volumetric shadow, or how much of the volumetric effect your object blocks. Higher values render faster, but are less accurate. Setting it to 1 gives you the best, albeit the slowest, results. However, setting it to 0 means that you have no volumetric shadow, so you have the volumetric cone, but your object won't block it at all.
Options specific to Area lamps

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.

Figure 9-8: The controls for Area lights.

image

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.

Figure 9-9: Light arrangement on a square (left) and rectangular (right) Area light.

image

image 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset