Chapter 10

Autodesk Maya Lighting

Light shapes the world by showing us what we see. It creates a sense of depth, it initiates the perception of color, and it allows us to distinguish shape and form. For a scene to be successful in CG, these realities of light need to be reproduced as faithfully as possible. The trick is learning to see light and its astonishing effects on the world around us.

Learning Outcomes: In this chapter, you will be able to
  • Understand basic concepts for setting up CG lighting
  • Choose the appropriate Autodesk® Maya® light for a scene based on light attributes
  • Control which lights illuminate certain objects through light linking
  • Create mood and realism with shadow maps and raytraced shadows
  • Illuminate and render a scene with mental ray® Physical Sun and Sky
  • Produce special lighting effects with volumetric lighting, lens flare, and shader glow
  • Practice setting up a basic lighting solution for a lamp and decorative box
  • Animate the attributes of a light and aim lights with the Special Manipulator

Basic Lighting Concepts

It’s no surprise that lighting in Maya resembles actual direct-lighting techniques used in photography and filmmaking. Lights of various types are placed around a scene to illuminate the subjects as they would for a still life or a portrait. Your scene and what’s in it dictate, to some degree at least, which lights you put where. The type of lights you use depends on the desired effect.

At the basic level, you want your lights to illuminate the scene. Without lights, your cameras have nothing to capture. Although it seems rather easy to throw your lights in, turn them all on, and render a scene, that couldn’t be further from the truth.

Although it’s easy to insert and configure lights, it’s how you light that will make or break your scene. Knowing how to do that really comes only with a good deal of experience and experimentation, as well as a good eye and patience.

This chapter will familiarize you with the basic techniques of lighting a scene in Maya and start you on the road to finding out more.

Learning to See

There are many nuances to the real-world lighting around us that we take for granted; we infer a tremendous amount of visual information without much consideration. With CG lighting, you must re-create these nuances for your scene.

The most valuable thing you can do to improve your lighting technique is to relearn how you see your environment. Question why things look the way they do, and you’ll find that the answers almost always come around to lighting. Take note of the distinction between light and dark in the room you’re in now. Notice the difference in the brightness of highlights and how they dissipate into diffused light and then into shadow.

When you start understanding how real light affects objects, you’ll be much better equipped to generate your own light. After all, the key to good lighting starts with the desire to create an interesting image.

What Your Scene Needs

Ideally, your scene needs areas of highlight and shadow. Overlighting a scene flattens everything and diminishes details. Figure 10-1 shows a still life with too many bright lights that only flatten the image and remove any sense of color and depth.

Figure 10-1: An overlit still life

c10f001.tif

Similarly, underlighting your scene makes it muddy and lifeless, and it flattens the entire frame. Figure 10-2 shows the still life underlit. The bumps and curves of the mesh are hardly noticeable.

Figure 10-2: An underlit still life

c10f002.tif

Like a photographer, you want your image to have the full range of exposure. You want the richest blacks to the brightest whites in your frame to create a deep sense of detail. As in Figure 10-3, light and shadow complement each other and work to show the features of your surface.

Figure 10-3: Balanced lighting creates a more interesting picture.

c10f003.tif

Three-Point Lighting

Because your scene needs to be rendered and lighting can be a fairly heavy rendering process, your lighting needs to be efficient. That means not using dozens of lights for every part of the scene.

The traditional filmmaking and television approach to lighting is called three-point lighting. Three distinct roles are used to light the subject of a shot. More than one light can be used for each of the three roles, but the scene should seem to have only one primary (or key) light, a softer light to fill the scene, and a back light to pop the subject out from the background.

Three-point lighting ensures that the primary subject’s features aren’t just illuminated but featured with highlights and shadow. Using three directions and qualities of light creates the best level of depth. Figure 10-4 shows a schematic of a basic three-point setup.

Figure 10-4: A three-point lighting schematic

c10f004.eps

Key Light

A key light is placed in front of the subject and off to the side to provide the principal light on the subject. Because it’s usually off-center, the key light creates one side of brighter light, increasing the depth of the shot. This light also provides the primary shadows and gives the important sense of lighting direction in the shot.

Although it’s possible for several lights to fulfill the role of key light in a scene—for example, three ceiling lights overhead—one light should dominate, creating a definitive direction. Figure 10-5 (left) shows the subject being lit by only a key light, although it’s physically composed of two lights.

Figure 10-5: Key light only

c10f005.tif

The direction of the two lights remains the same, and one takes intensity precedence over the other and casts shadows. The effect creates a single key light, which produces a moody still life.

Try This
1. Open the scene file still_life_v01.mb from the Lighting project downloaded from the book’s web site.
2. In the camera1 panel, press 7 for lighting mode. It should turn black; there are no lights.
3. Click Create ⇒ Lights ⇒ Point Light, and in the persp window, place it as your key light (Figure 10-5, right). Use the camera1 panel to gauge how the lighting composition is working for optimum placement of the Point light.

Fill Light

A more diffused light than the key light, the fill light seems directionless and evenly spread across the subject’s dark side. This fills the rest of the subject with light and decreases the dark area caused by the key light.

The fill light isn’t meant to cast any shadows onto the subject or background itself and is actually used to help soften the shadows created by the key light. Figure 10-6 shows the still life with an added fill light. Notice how it softens the shadows and illuminates the dark areas the key light misses.

Figure 10-6: A fill light is now included.

c10f006.tif

Typically, you place the fill light in front of the subject and aim it so that it comes from the opposite side of the key light to target the dark side of the subject. Even though the still life in Figure 10-6 is still a fairly moody composition, much more is visible than with only the key light in the previous figure.

Typically, you place the fill light in front of the subject and aim it so that it comes from the opposite side of the key light to target the dark side of the subject. Even though the still life in Figure 10-6 is still a fairly moody composition, much more is visible than with only the key light.

Try This
1. In the existing scene that you started with a single Point light, choose Create ⇒ Lights ⇒ Directional Light. Where you place the light doesn’t matter, but how you rotate it does.
2. Rotate the light so you get a lighting direction opposite to the direction of the key light from the Point light already in the scene.
3. With the Directional light selected, change its Intensity attribute in the Channel Box or the Attribute Editor from 1.0 to 0.5. Use the camera1 panel to see how the fill light is working.

Back Light

The back light,orrim light,is placed behind the subject to create a bit of a halo, which helps pop the subject out in the shot. Therefore, the subject has more presence against its background. Figure 10-7 shows how helpful a back light can be.

Figure 10-7: A back light makes the subject pop right out.

c10f007.tif

The back light brings the fruit in this still life out from the background and adds some highlights to the edges, giving the composition more focus on the fruit.

Don’t confuse the back light with the background light, which lights the environment behind the subject.

Try This
1. In your current scene with the two lights, create a third light to be a spotlight.
2. You can use Move and Rotate to position the light to shine from behind the fruit, or you can use the Special Manipulator. To use that, press T with the spotlight selected. You will see two move manipulators, one for the source of the light and one for the target.
3. Move the target to the front of the column stand, and move the target behind and slightly above the fruit (Figure 10-7, right). Use the camera1 panel to see how the back light should be placed.

Using Three-Point Lighting

The three-point lighting system is used for the primary subject of the scene. Because it’s based on position and angle of the subject to the camera, a new setup is needed when the camera is moved for a different shot in the same scene. Three-point lighting is, therefore, not scene specific but shot specific, as long as it does not break the overall continuity of the scene.

After the lighting is set up for the subject of a shot, the background must be lit. Use a directed primary light source that matches the direction of the key light for the main light, and use a softer fill light to illuminate the rest of the scene and soften the primary shadows.

Practical Lighting

Practical lighting is a theatrical term describing any lights in a scene that are cast from lighting objects within the scene. For example, a desk lamp on a table in the background of a scene would need practical lighting when it’s on. You never want the practical lighting to interfere with the main lighting of the scene, unless the scene’s lighting is explicitly coming from such a source.

Each light-emitting object in your CG scene doesn’t necessarily need its own Maya light. Rendering tricks such as glow (for glow effects, see “Lighting Effects” later in this chapter) can simulate the effect that a light is turned on without actually having to use a Maya light. Of course, if you need the practical light to illuminate something in the scene, you need to create a light for it.

Maya Lights

Six types of light are available in Maya: Ambient, Directional, Point, Spot, Area, and Volume. These lights are also used when rendering in mental ray. How you use each dictates whether they become key, fill, or rim lights. Each light can fill any of those roles, although some are better for certain jobs than others. The most commonly used light types for most scenes are Spot, Directional, and Ambient. All of these Maya lights render in Maya Software as well as mental ray.

To create each light, choose Create ⇒ Lights, and click the light type.

Common Light Attributes

Lights in Maya are treated like any other object node. They can be transformed, rotated, scaled, duplicated, deleted, and so forth, and they are visible as nodes in the Hypergraph and Outliner alongside other objects in the scene. Like any other node, lights have attributes that govern how they function. Figure 10-8 shows the Attribute Editor for a typical light.

Figure 10-8: A typical light’s Attribute Editor

c10f008.tif

When you select any light type and then open the Attribute Editor, you’ll see the following attributes and options:

Type This drop-down menu sets the type of light. You can change from one light type to another (for instance, from Spot to Point) at any time.
Color This attribute controls the color cast by the light. The darker the color, the dimmer the light will be. You can use Color in conjunction with Intensity to govern brightness, although it’s best to leave that to Intensity only.
Intensity This attribute specifies how much light is cast. The higher the intensity, the brighter the illumination will be.
Illuminates By Default This check box deals with light linking, or the ability to illuminate specific objects with specific lights. Clearing this check box causes the light not to illuminate all objects by default, requiring you to link the light to objects you do want it to light. Keep this check box checked unless you’re linking lights to specific objects. This chapter will briefly touch on light linking later.
Emit Diffuse and Emit Specular These two check boxes aren’t available with the Ambient light type. For all other light types, they toggle on or off the ability to cast diffuse lighting or specular highlights on an object (see Figure 10-9). This is useful for creating specific lighting effects. For example, if lighting an object makes it too shiny, you can disable the specular emission from one or more of the lights on that object to reduce the glare.

Figure 10-9: Lights can render diffuse or specular components if needed.

c10f009.eps

Light Types

Beyond the common light attributes, each light type carries its own attributes that govern its particular settings. In the following section, open the scene file still_life_v01.mb from the Lighting project, and create the light being described to see firsthand how that particular light affects the scene.

Ambient Lights

Ambient lights cast an even light across the entire scene. These lights are great for creating a quick, even illumination in a scene; but, as you can see in Figure 10-10, they run the risk of flattening the composition. They’re perhaps best used sparingly and at low intensities as fill lights or background lights.

Figure 10-10: Ambient light

c10f010.tif

The Ambient Shade slider in the Attribute Editor governs how flat the lighting is. The lower the value, the flatter the lighting. Figure 10-11 shows the effect of two contrasting Ambient Shade settings.

Figure 10-11: A low Ambient Shade setting flattens the image.

c10f011.eps

Directional Lights

Directional lights cast a light in a general direction evenly across the scene (see Figure 10-12). These lights are perhaps second to Spot lights as the most commonly used light type. They’re perfect for sunlight or general indoor lighting, for key lights, and for fill and back lights. They give an accurate sense of direction without having to emanate from a specific source.

Figure 10-12: Directional light

c10f012.tif

Point Lights

A Point light casts light from a single specific point in space, similar to a bare light bulb. Its light is spread evenly from the emission point (see Figure 10-13).

Figure 10-13: A Point light placed in the front right of frame

c10f013.tif

Using the Decay Rate drop-down menu in the Attribute Editor, you can set how a Point light’s intensity diminishes over distance. With No Decay, the Point light illuminates an object far away as evenly as it does up close. This is the most common setting for most applications.

Setting Decay Rate to Linear, Quadratic, or Cubic requires you to increase the intensity level exponentially to compensate for the decay. You can use Decay Rate settings to illuminate nearby objects and to leave distant ones unaffected. In reality, lights have decay rates. But in CG, they don’t really need to decay unless the falloff effect is needed, as shown in Figure 10-14. Clever lighting can easily avoid this cumbersome calculation.

Figure 10-14: A Point light with a Decay Rate set

c10f014.tif

Point lights are good for effects such as candlelight or setting a mood.

Spot Lights

Spot lights are arguably the most used lights in Maya because they can be used for keys, fills, or rims; and they’re highly efficient, casting light in specific areas, just like real spotlights.

Similar to Directional lights, Spot lights emphasize direction. But these lights emit from a specific point and radiate out in a cone shape, whereas Directional lights emit from an infinite source from a certain direction. As such, Spot lights can create a circular focus of light on the geometry much like a flashlight on a wall; Directionals spread the light evenly. Figure 10-15 shows a Spot light on the still life.

Figure 10-15: Using a Spot light

c10f015.tif

The following attributes govern the behavior of Spot lights:

Decay Rate Specifies the rate at which the light’s intensity falls off with distance, as with the Point light. Again, the intensity needs to increase exponentially to account for any decay.
Cone Angle Sets the width of the cone of light emitted by the Spot light. The wider a cone, the more calculation intensive it becomes.
Penumbra Angle Specifies how much the intensity at the edges of the cone and hence the circular focus dissipate. (See Figure 10-16.) A negative value softens the light into the width of the cone, decreasing the size of the focus; a positive value softens away from the cone.

Figure 10-16: The Penumbra Angle attribute controls the softness of the edge of a Spot light.

c10f016.eps
Dropoff Specifies how much light is decayed along the distance of the cone. The higher the dropoff, the dimmer the light gets farther along the length of the cone. This effect is much better to use than a decay rate, and it gives similar results.

Most practical lights are created with Spot lights. For example, a desk lamp’s light is best simulated with a Spot light. Spot lights are also the lights of choice to cast shadows. You’ll find more on shadows later in the chapter. Remember, with a Spot light, you can press T for the Special Manipulator, allowing you to move the source and target of the spotlight easily to orient and place the light in your scene.

Area Lights

Area lights emit light from a flat rectangular shape only (see Figure 10-17). They behave similarly to Point lights, except they emit from an area and not from a single point. You can still set a decay rate, just as you can with Point lights. Area lights are the only lights whose scale affects their intensity. The larger an Area light, the brighter the light.

Figure 10-17: An Area light and its placement

c10f017.tif

Because you can control the size of the area of light being emitted, these lights are good for creating effects such as a sliver of light falling onto an object from a crack in a door (as in Figure 10-18), overhead skylights, or the simulation of large, diffused lighting fixtures such as overhead office lights. Use Area lights when you need to light a specific area of an object.

Figure 10-18: An Area light as a sliver and its placement

c10f018.tif

Volume Lights

Volume lights emit light from a specific 3D volumetric area as opposed to an Area light’s flat rectangle(see Figure 10-19). Proximity is important for a Volume light, as is its scale.

Figure 10-19: A Volume light and placement

c10f019.tif

A Volume light can have the following attributes:

Light Shape A Volume light can be in the shape of a sphere, a box, a cylinder, or a cone. You select a shape from the Light Shape drop-down menu.
Color Range This section of attributes sets the color of the light using a built-in ramp. The ramp (from right to left) specifies the color from inside to outside. For instance, a white-to-black ramp from right to left creates a white light at the center of the Volume light that grades down to black toward the outer edge.
Volume Light Dir This attribute sets the direction for the light’s color range: Outward lights from inside out, Inward lights from the volume’s edge into the center, and Down Axis lights as a gradient in an axis of the light.
Arc And Cone End Radius This attribute defines the shape for the volume.
Penumbra For cylinder and cone shapes, this attribute adjusts how much the light dims along the edge of its length.

Use Volume lights when you need to control the specific area in which light is cast, or when you need an object to move into and out of a particular area of light. Volume lights are also great for creating volumetric lighting effects such as areas of lit fog. For volumetric effects, see the section “Volumetric Lighting” later in this chapter.

Lighting a Scene

It’s best to start with just a couple types of light, such as Directional and Spot, before turning to the more sophisticated types, such as Area and Volume.

Getting the essence of lighting is far more important in the beginning than understanding the nuances of all the attributes of a light. At first, limit yourself to Spots and Directionals, and try to avoid any Ambient light use.

Light Linking

You can control which lights illuminate which objects by using Maya light linking. Inevitably, a time will come when you want to create a special light for part of your scene but not for all of it.

However, by default, lights created in your scene illuminate all objects in the scene. The easiest way to create an exclusive lighting relationship is first to create a light and then to turn off Illuminates By Default in the light’s Attribute Editor. This ensures that this light won’t cast light on any object unless specifically made to do so through light linking.

1. Open the scene file still_life_linking_v01.mb from the Lighting project, or use your own scene that already has at least three lights. Click the Render button (c10g005.tif) in the Status line to render a frame (Figure 10-20). There are no shadows; you’ll deal with that in the next section.

Figure 10-20: All of the scene’s lights illuminate the scene.

c10f020.tif
2. Create a new Directional Light, and in the Attribute Editor, turn off the check box Illuminates By Default (it’s right below the Intensity slider). Set Intensity to 1 or more. You can see the placement of the light in Figure 10-21.

Figure 10-21: The Light Linking window and the newly added Directional light

c10f021.tif
3. Render a frame, and you won’t see any change. Adding a new light with Illuminates By Default disabled won’t increase the light level in the scene.
4. To assign your new light to the object(s) you want to illuminate exclusively, choose Window ⇒ Relationship Editors ⇒ Light Linking ⇒ Light-Centric. This opens the Relationship Editor and sets it for light linking. Light-Centric means the lights are featured in the left side of the panel, as shown in Figure 10-21, and the objects in your scene that will be lit are on the right.
5. Now, select the light you want to link (in this case, the directionalLight2 you just created) and the objects in the scene you’d like to link to (in this case, the apple and the pepper, as shown in Figure 10-22). Notice that no other objects on the right side of the Relationship Editor are selected; this means they will receive no illumination from this light source.

Figure 10-22: Select the scene objects to link to the Directional light.

c10f022.tif
6. Render a frame, and you’ll see that the objects you linked are lit by the new light. In this case, the apple and the pepper are brighter than the other fruit in the still life. (See Figure 10-23.)

Figure 10-23: A linked light creates extra light for only the apple and the pepper behind it. The other objects aren’t illuminated by that light.

c10f023.tif

When you’re in Lighted mode (press 7 in the Shaded panel), however, keep in mind that linked lights aren’t taken into account in the view panel displays. The linking comes through in the render. Light linking works with Maya Software and mental ray rendering.

Adding Shadows

Don’t be too quick to create an abundance of light in your scene eager to show off your models and textures. Shrouding objects in darkness and shadow is just as important as revealing them in light. You can say a lot visually by not showing parts of a whole, leaving some interpretation to the audience.

A careful balance of light and dark is important for a composition. As Figure 10-24 shows, the realism of a scene is greatly increased with the simple addition of well-placed shadows. Don’t be afraid of the dark. Use it liberally but in balance.

Figure 10-24: Darkness and shadow help add a sense of realism, depth, and mood to an otherwise simple still life.

c10f024.tif

Creating Shadows in Maya

Maya lights don’t cast shadows by default; you need to enable this feature in the light’s Attribute Editor. When you do that, however, lights can cast shadows in one of two ways, depending on how the scene is rendered: depth map shadows and raytraced shadows. Depth map shadows are faster and pretty accurate; however, with computing being as fast as it is now, it’s usually just best to use raytraced shadows, which will be the predominate shadow type you’ll use in this book.

When you enable shadow maps (by clicking the Use Depth Map Shadows check box in the Shadows area of a light’s Attribute Editor), Maya generates shadow maps that locate where shadows fall by following the path of the light backward from the lighted object to the light itself. Shadow maps create fast, fairly accurate shadows through the Maya renderer.

The second method for casting shadows is achieved by raytracing with the Maya Software renderer or mental ray. Raytracing involves tracing a ray of light from every light source in all directions and tracing the reflection to the camera lens. Therefore, you can create more accurate shadows with raytracing. However, this render can take a little longer to calculate, particularly so when using soft shadows, which look more realistic.

You need to turn on raytraced shadows for each light when you want more accurate shadows—either soft and diffused or sharp and crisp edged—as well as enable raytracing in the Render Settings window. (See Figure 10-25 and Figure 10-26.)

Figure 10-25: A light with depth map shadows renders faster, though not as detailed as raytracing.

c10f025.tif

Figure 10-26: A light with raytraced shadows produces more detailed shadows.

c10f026.tif

Shadow Map Shadows

For every light type except Ambient, you can turn on shadow maps through the light type’s Attribute Editor, as shown in Figure 10-27.

Figure 10-27: Turning on shadow maps in the Attribute Editor for a Directional light

c10f027.tif

The depth map resolution defaults at 512. The higher this resolution, the better defined the shadows. Most shadows are detailed enough with a depth map resolution of 1024 using a Spot light.

Spot lights create shadow maps with greater accuracy at lower depth map resolution settings and faster render times than other light types (especially over Directional lights), so if you must have shadow maps, use Spot lights. Figure 10-28 shows the same render with a Spot light and a depth map resolution setting of only 1024. Compare it to Figure 10-25, which is using a Directional light with a depth map shadow with four times the resolution.

Figure 10-28: Spot lights cast faster and more detailed shadow map shadows.

c10f028.tif

Raytraced Shadows

To enable raytraced shadows, turn on the light’s Use Ray Trace Shadows setting in the Attribute Editor (see Figure 10-29, toward the bottom of the Attribute Editor window). If you are rendering with Maya Software, open the Render Settings window by choosing Window ⇒ Rendering Editors ⇒ Render Settings or by clicking the Render Settings icon (c10g001.tif) in the Status line; then enable the Raytracing check box under the Raytracing Quality heading. Let’s add shadows to the scene.

Figure 10-29: Enable raytraced shadows in the light (left), and enable raytracing for Maya Software in the Render Settings window (right).

c10f029.tif
1. In the file still_life_linking_v01.mb from the Lighting project, select the Point light. In the Attribute Editor, turn on Use Ray Trace Shadows under the Shadows ⇒ Raytrace Shadow Attributes heading (Figure 10-29, right).
2. Select the Directional light, and turn on Use Ray Trace Shadows as well.
3. Open the Render Settings window, and enable Raytracing (Figure 10-29, left).
4. Render a frame, and you’ll see the scene looks more natural now with shadows (Figure 10-30). Turning on raytracing has also enabled reflections, which you’ll look at later this chapter. Notice how the brighter key light (Point light) casts darker shadows than the darker fill light (Directional). As a general rule, you don’t want too many lights in the scene all casting shadows; that may confuse the composition.

Figure 10-30: Raytraced shadows add a lot to the scene.

c10f030.tif

For an object that has a transparency map applied to its shader, however, only raytraced shadows can cast proper shadows. On the left of Figure 10-31 is a plane with a mapped checkerboard transparency casting a raytraced shadow over the still life. On the right is the same light using shadow maps instead of raytraced shadows.

Figure 10-31: Only raytraced shadows work with transparencies.

c10f031.eps

Controlling Shadows per Object

To better control your lighting, you can specify whether an object can cast and receive shadows in Maya. For example, if you have geometry casting light in front of a shadow but you don’t want it to cast a shadow, you can manually turn off that feature for that object only.

To turn off shadow casting for an object, follow these steps:

1. Select the foreground lemon in the still_life_linking_v01.mb scene, and open the Attribute Editor.
2. In the Render Stats section is a group of check boxes that control the render properties of the object, as shown in Figure 10-32 (left). Clear the Casts Shadows check box. If you don’t want the object to receive shadows, clear the Receive Shadows check box.

Figure 10-32: You easily can set whether an object casts or receives shadows in the Attribute Editor (left). The lemon does not cast a shadow anymore (compare with Figure 10-30).

c10f032.tif
3. Render a frame, and you’ll see the lemon has no shadows on the column’s tabletop; compare the render in Figure 10-32 (right) with Figure 10-30.

Raytracing Soft Shadows

One interesting feature of shadows is that they can diffuse or soften as the shadow falls from its casting object. This small detail can greatly enhance the reality of any render. To use soft shadows, follow these steps:

1. Open the still_life_shadows_v01.mb scene from the Lighting project. Check out the render settings. Raytracing is enabled. The key and fill lights have raytraced shadows enabled.
2. Render a frame, and notice that the shadows are sharp. Save that image into the render buffer by clicking the Keep Image (c10g003.tif) icon in the Render View settings. In Figure 10-33, you can see the still life rendered with sharp, raytraced shadows.

Figure 10-33: Regular raytraced shadows

c10f033.tif
3. Select the Point light, and open the Attribute Editor. Under the Shadows ⇒ Raytrace Shadow Attributes heading, set Light Radius to 0.2, as shown in Figure 10-34.

Figure 10-34: Setting the Light Radius value

c10f034.tif
4. Select the Directional light, and set its Light Angle option to 4.0. A Directional light’s attribute is called Light Angle instead of Light Radius, but it does the same thing. Now render a frame, and compare it to the previous frame you rendered. The shadows are soft but very noisy, especially on the background (Figure 10-35). Save your image in the render buffer.

Figure 10-35: Soft but noisy shadows

c10f035.tif
The Directional light had a much higher light radius than the Point light because its shadows react differently. The Point light’s distance from the subject plays a big part in how the light affects the shadows from the subject, so it is more sensitive to Light Radius values than is the non-position-dependent Directional light.
5. Now you’ll mitigate the noise. Select the Point light, and in the Shadows ⇒ Raytrace Shadow Attributes heading, set Shadow Rays to 16. Select the Directional light, and set its Shadow Rays value to 12.
6. Render the frame, and your shadows should resemble the ones in Figure 10-36. The higher your Light Radius value, the higher you need to set your Shadow Rays setting to compensate for noise.

Figure 10-36: A higher Shadow Rays setting makes for cleaner soft shadows.

c10f036.tif

Notice how the shadows soften more toward the edge of the shadow; the shadow is still sharp at the point of contact. This gives a much nicer feeling of depth to the scene. There is an increase in render time—it’s important to evaluate how much softening you need so you don’t overdo the look or increase the render time too much.

Using soft shadows was easy! Make sure you enable raytracing in Render Settings, of course. These soft raytraced shadows work both in Maya Software rendering as well as mental ray rendering.

mental ray Lighting

mental ray lighting and rendering opens up a large range of possibilities within Maya. As with all rendering, lighting plays the primary role. I’ll cover mental ray rendering more in the next chapter; however, because rendering and lighting go hand in hand, it’s tough to ignore it in this chapter. This section is a primer on mental ray light functionality.


Open the Render Settings window by choosing Window ⇒ Rendering Editors ⇒ Render Settings. If you don’t see the mental ray (or any other, such as the Maya Vector) option in the Render Using drop-down menu, you need to load the plug-in. Choose Window ⇒ Settings/Preferences ⇒ Plug-in Manager to open the Plug-in Manager. Make sure Mayatomr.mll is checked for Loaded as well as for Auto Load to ensure that it loads by default.

Two important functions that mental ray brings to the Maya table are caustics and global illumination (GI). Caustics is the scattering of light reflections off and through semitransparent objects, such as the light that shines on the ceiling above an indoor pool or the sunshine at the bottom of an outdoor pool. Global illumination is the effect of light reflected from one object to another. For example, if you place colored spheres inside a gray box and shine a light into the box, the walls and floor of that box pick up the color of the spheres. The light from the spheres reflects onto the walls and tints them with the spheres’ color. Furthermore, the light from the floor of the box bounces and helps illuminate the undersides of the balls.

For example, Figure 10-37 shows a scene file that has a dozen or so glass spheres inside an enclosed box. The box has four holes in the top, and two spotlights with shadows turned on are positioned outside the box, shining in through the holes. Figure 10-37 shows a typical software render. The spheres under the holes are visible, and the rest of the box is in shadow.

Figure 10-37: The Maya Software render of the box of spheres scene

c10f037.tif

However, when rendering through mental ray for Maya (see Figure 10-38), the light that enters the box bounces around the scene and illuminates the other spheres. The color of the spheres also colors the area immediately around them because of GI. Additionally, the light shines through the semitransparent spheres and casts caustic highlights on the floor. (You can see the full effect in the Color Section of this book.)

Figure 10-38: The mental ray for Maya render of the scene

c10f038.tif

Global Illumination: A Downloadable PDF Exercise

Global illumination and caustics are both advanced lighting effects and won’t be covered in this book. However, a short GI exercise from a previous version of this book is available for download from the book’s web page, www.sybex.com/go/introducingmaya2014. The scene files for this exercise are also available there. Once you download the exercise, you can use Adobe Acrobat and the scene files to run through this livingroom exercise, where you use simple GI techniques to explore this powerful rendering option in mental ray.

Image-Based Lighting

mental ray also brings image-based lighting (IBL) to Maya. This method of lighting uses an image, typically a high dynamic range image (HDRI), to illuminate the scene using Final Gather or GI. Final Gather is a form of global illumination that relies on direct as well as indirect illumination. Direct illumination calculates the amount of light coming directly from lights in the scene and renders the result. However, it misses an important aspect of real-life lighting: diffuse reflections of light. Indirect illumination happens when light bounces off objects in a scene in order to reach and therefore light the rest of the scene—that is, diffuse reflections. Final Gather is typically a faster way than GI to get indirect illumination in a scene.

I’ll briefly touch on Final Gather here as we explore Physical Sun and Sky lighting in the next section. However, I’ll cover both IBL and Final Gather in depth in Chapter 11, “Autodesk Maya Rendering” when you light the table lamp and decorative box model (with displacement maps for box details as well).

mental ray Physical Sun and Sky

In Physical Sun and Sky lighting, mental ray for Maya creates nodes in your scene to simulate an open-air sunlight effect for your scene lighting. It’s a quick way to create a nice-looking render. You’ll place the textured red wagon into an open scene and apply a Physical Sun and Sky (PSAS) in the following exercise.

Use the scene file WagonSunlight_v01.ma from the Lighting project on the web page to follow along. Follow these steps:

1. The camera for this scene is already set up in the persp panel. Open the Render Settings window and switch to mental ray rendering in the Render Using pull-down menu at the top of the window, as shown in Figure 10-39.

Figure 10-39: Enable mental ray rendering in Render Settings.

c10f039.tif
2. In the Render Settings window, click the Indirect Lighting tab. Under the Environment heading, click the Create button next to Physical Sun And Sky. The Attribute Editor opens for the mia_physicalsky1 node you just created, as shown in Figure 10-40.

Figure 10-40: The mia_physicalsky1 node

c10f040.tif
3. Render a frame in the Perspective window, and compare it to Figure 10-41. It’s a bit bright, but there’s something very nice about this render. Notice that the metal handlebar takes on a good look right off the bat.

Figure 10-41: The first PSAS render doesn’t look too shabby.

c10f041.tif
4. The render is too bright, and the wood slats for the railings shouldn’t be reflective. Your render should also show that the fire-engine red of the wagon is a bit washed out.
Let’s first address the wood railings. Open the Hypershade, and double-click the first Wood shader. Change Reflectivity to 0.1 from 0.5. Repeat for the second Wood shader.
5. In the Render View window, click and drag a box region around the wood railings, as shown in Figure 10-42. Click the Render Region button (c10g002.tif) to render that part of the frame only.

Figure 10-42: Render this region to check the reflection in the wood railings.

c10f042.tif
6. The wood looks much better now, so let’s move on to the brightness of the scene. Open the Render Settings window, and go to the Indirect Lighting tab. Click the Input arrow next to the Physical Sun And Sky attribute’s button (Figure 10-43). Doing so opens the Attribute Editor for the Physical Sun and Sky.

Figure 10-43: Click to open the attributes for the daylight system.

c10f043.tif
7. Change Multiplier to 0.5 from 1.0, and re-render the frame. The brightness comes down nicely, and the wagon is less blown out than in your previous renders. See Figure 10-44.

Figure 10-44: Bringing down the brightness of the sun

c10f044.tif
8. Let’s play with the direction of the sun. Look in your persp panel, and you see a Directional light sitting smack in the middle of the scene. Maya uses this light to set the direction of the sunlight, and it doesn’t contribute to the lighting of the scene in any other way. Only its rotation is important to PSAS. Its intensity, color, and other attributes are irrelevant. In this scene, the Directional light is called sunDirection and is in the wagon behind the third texture placement node, as you can see in Figure 10-45. The light is currently pointing sunlight almost straight down, as if the sun is high in the sky. It seems as if it’s about noon. RotateX for the sunDirection light is –75.

Figure 10-45: The sunDirection light adjusts only the direction of the sunlight in the scene.

c10f045.tif
9. That third texture placement node is getting in the way. To turn off its display easily, in the persp panel, click Show ⇒ Textures to uncheck it. The green box disappears in this view until you turn it back on through the Show menu. Now that you can see the Directional light better, you see that the sun is pointed slightly toward the back of the wagon. Rotate the light so that it’s angled away from the camera even more, as shown in Figure 10-46. The sunDirection’s RotateX should be about –25.

Figure 10-46: Angle the sun farther away from the camera.

c10f046.tif
10. Render the frame, and you’ll see quite a difference in the scene. Maya automatically adjusts PSAS settings to make the render appear as if the sun is about to set. This is because of the new angle. The scene (shown in Figure 10-47) not only shows a new lighting direction (the shadows fall toward the back and are longer) but also is a darker and warmer light, as if it were mid-to-late afternoon.

Figure 10-47: Now it’s late afternoon.

c10f047.tif
11. Angle the sunDirection light even more (so RotateX is at about –2.5), almost parallel with the ground plane, and render a frame. Now the sun has all but set, and it’s dark dusk, just before night falls on the scene. See Figure 10-48.
12. Rotate the sunDirection even more so that it’s at a RotateX of about 15. It’s now dark, and you can barely make out the wagon. (See Figure 10-49.) Time to go home before your mom gets mad. Remember, you can adjust the overall brightness of the scene by adjusting the mia_physicalsky1 node attributes, as you did in steps 6 and 7.

Figure 10-48: It’s getting late; you should get home before nightfall.

c10f048.tif

Figure 10-49: Ooh, it’s dark—Mom is gonna be mad.

c10f049.tif

You can add lights to the scene as well; you aren’t limited to the system’s results. For example, Figure 10-50 shows a render of the wagon with the sun beginning to rise behind it, making the foreground a bit dark. Figure 10-51 shows the same render but with an added Directional light (with an Intensity of just 0.25) pointing toward the front of the wagon. This helps define the front of the wagon, hinting that there is another light source, perhaps a porch light behind the camera.

Figure 10-50: The sun also rises!

c10f050.tif

Figure 10-51: Adding a light to illuminate the front of the wagon in this sunrise scene from Figure 10-50

c10f051.tif

The PSAS system can get you some fairly nice results quickly. Keep experimenting with different sunDirection angles as well as the attributes for the system to see what results you can get for your scene. Add lights to create areas of detail in your model.

Unbeknownst to you, when you invoked the PSAS system, Maya turned on Final Gather in the mental ray settings. This enabled indirect lighting to work in the scene. You’ll explore Final Gather in the next chapter. At the end of this chapter, though, I’ll introduce HDRI and image-based lighting for a fairly photo-real rendering of the table lamp and decorative box.

This is the perfect time for a break, so save your work (as if I have to tell you that at this point!), go grab some iced tea, and rest your eyes for a bit. In the next section, I’ll go over various special lighting effects before returning to the wagon.

Lighting Effects

In CG, you must fake certain traits of light in the real world. Using certain methods, you can create smoky light beams, glowing lights, and lens flares. Although some of these effects fall under the domain of rendering and shader tricks, they’re best explored in the context of lighting, because they’re created by light in the real world.

Volumetric Lighting

How do you create an effect such as a flashlight beam shining through fog? This lighting effect is called volumetric lighting, and you can use it to create some stunning results that can sometimes be time-consuming to render.

You can’t apply volumetric effects to Ambient and Directional light types. To add a volumetric effect to any of the other types of lights, select the light and, in the Attribute Editor under the Light Effects section, click the checkered Map button to the right of the Light Fog attribute. This creates a new render node that appears in the Hypershade window. After you click the Map button, the Attribute Editor takes you to the lightFog node.

Maya handles volumetric lights by attaching a lightFog node to the light. The Color and Density attributes under this node control the brightness, thickness, and color of the fog attached to that light. Furthermore, in the light’s Attribute Editor, you can control the fog with the Fog Spread and Fog Intensity settings. Fog Intensity increases the brightness of the fog, and Fog Spread controls how well the fog is defined within its confines. For example, a Spot light with fog shows the fog in its cone. Figure 10-52 shows how Fog Spread affects the conical fog shape.

Figure 10-52: Fog Spread affects how the fog dissipates to the edges of the cone.

c10f052.eps

To remove a fog effect, right-click the Light Fog label in the light’s Attribute Editor, and choose Break Connection from the context menu.

If you want the rays of light within the fog to cast shadows, check Use Depth Map Shadows for the light. You’ll have to increase the depth map resolution for a higher-quality image.

Lens Flare

Lens flare and light glow, as illustrated in Figure 10-53, mimic the real-world effect created when light strikes a lens or when the light source is visible in the frame. The flare is created when the light hits the lens at a particular angle and causes a reflection of itself in the optics of the lens.

Figure 10-53: Light glow and lens flare turned on for the back light

c10f053.tif

To enable a light glow, under the Light Effects section in the light’s Attribute Editor, click the checkered Map button next to the Light Glow attribute to create an OpticalFX node that appears in the Hypershade. The Attribute Editor shifts focus to that new node, which controls the behavior of the light glow and lens flare. The OpticalFX node contains the following attributes and settings:

Glow Type Setting this attribute specifies the kind of glow: Linear, Exponential, Ball, Lens Flare, and Rim Halo. These define the size and shape of the glow from the light.
Halo Type Specifying a halo creates a foggy halo around the light in addition to the glow. You can find controls for the halo in the Halo section in the Attribute Editor.
Star Points Setting this attribute specifies the number of star points the glow generates.
Rotation Setting this attribute rotates the orientation of the star points.
Radial Frequency Used in conjunction with the Glow Radial Noise attribute (see the next item) in the Glow Attributes section, this attribute defines the smoothness of any added glow noise.
Glow Radial Noise Setting this attribute adds noise to the glow effect, creating light and dark patches within the glow for a more random look, as shown in Figure 10-54.

Figure 10-54: Glow Radial Noise attribute

c10f054.eps
Glow Color Setting this attribute specifies the color of the glow.
Glow Intensity and Spread Setting these attributes specifies the brightness and thickness of the glow and how well it fades away.

To turn on a lens flare along with the light glow, click the Lens Flare check box at upper right in the Attribute Editor for OpticalFX. The attributes in the Lens Flare section control the look of the flare.

Light glows and flares can be highly effective in scenes, adding credibility to the lighting, but they’re often misused or, worse, overused in CG. Used sparingly and with subtlety, lens flares can go a long way toward adding a nice touch to your scene.

Shader Glow Effects

To create a glowing effect, it’s sometimes better to place a glow on a geometry’s shader instead of the light itself. Because a light must be seen in the shot and pointed at the camera to see any light glow and flare, a shader glow is sometimes more desirable. This process will composite a glow on the object that is assigned the Glow shader to simulate a volumetric light, such as a street lamp on a foggy night. Shader glows have far less render cost than true volumetric lights.

Try This To light a still-life scene, follow these steps:
1. Open the still_life_v03.mb file in the Lighting project on the web page. Create a Spot light, place it over the still life, and aim it directly down onto the fruit, as shown in Figure 10-55. Turn on Use Depth Map Shadows for the light, and set Resolution to 1024. Set Penumbra Angle to 10 and Intensity to 1.5. Press 7 for Lighted mode in the Camera1 view panel to see how the light is being cast.

Figure 10-55: Aim a Spot light down toward the fruit.

c10f055.tif
2. The Spot light provides the practical light in the scene. You’ll place a bare bulb on a wire directly above the fruit. Create a NURBS sphere, and position it right over the fruit but in the frame for camera1 to see. In the Render Stats section of the Attribute Editor for the sphere, turn off Casts Shadows.
3. Create a long, thin cylinder for the light bulb’s wire, and position it as if the bulb were hanging from it, as shown in Figure 10-56. Turn off Casts Shadows for the cylinder as well.

Figure 10-56: Place a bulb on a wire over the fruit pedestal.

c10f056.tif
4. Create a black Phong E shader to assign to the cylinder.
5. Create a Phong shader for the bulb, and assign it to the NURBS sphere. Set its Color to a pale, light yellow, and make it about 50 percent transparent.
6. Select the Spot light, and set its Color to the same yellow. You can do this easily through the Color Chooser. With the shader for the bulb selected, open the Color Chooser by clicking the pale yellow color you just made. Click the right arrow to place the yellow color in the swatches to the right of the main color swatch, or right-click any of the swatches.
7. Pick the Spot light, and click its Color attribute to set the Color Chooser to that color. Click the yellow swatch you created to get the same color on the light. For detail’s sake, make the light’s color less saturated. Click Accept to close the Color Chooser window.
8. To make the shader glow for the bulb, open the Hypershade, and select the bulb’s Phong material. In the Attribute Editor’s Special Effects section, drag the Glow Intensity slider from 0 to 1.0.If you render the frame, you’ll see that the glow isn’t quite enough to make a convincing light bulb. In the Hypershade, select the shaderGlow1 node; this node controls all the glows in the scene.
9. Set Quality to 0.1. In the Glow Attributes section, set Glow Intensity to 6.0, set Glow Spread to 0.5, and set Glow Radial Noise to 0.2.

The scene file still_life_v04.mb from the web page contains the full scene for your reference. See Figure 10-57 for the final result.

Figure 10-57: The bare light bulb over the still life is created with a shader glow.

c10f057.tif

Lighting the Table Lamp and Decorative Box

In this section, you’ll set up the table lamp and decorative box together in a scene with lights so that you can render them. Furthermore, in the next chapter, you’ll be using displacement maps for detail on the box and using HDRI, mental ray, and Final Gather to light the scene using the photo of the real lamp and box as a guide. Because most of your “lighting” look results from using an HDR image, the lighting you’ll start with will be basic for now.

The lighting conditions you’ll use as a starting point are shown in Figure 10-58 as well as in the Color Section of this book. You can see that there is a primary key light coming from behind and to the right of the camera, with a fill from the left side and from the top back, which also gives a bit of a rim light. These lights will be easy to set up to get the general feel first. The finesse of this exercise will come from rendering through mental ray in the next chapter, using an HDR IBL, adding reflections to the box, adding displacement maps for the intricate carvings, and adjusting the shaders to taste for both the box and lamp. In the following exercise, you’ll create a basic lighting setup for the lamp and decorative box and get a direct lighting solution first.

Figure 10-58: Lighting the lamp and decorative box using this practical lighting as general reference

c10f058.tif

Set your current project to the TableLamp project, which you should have already downloaded from the book’s web page. This is important to make sure Maya finds all the project files it needs, so it bears repeating: Set your project to TableLamp! Did you set your project yet?

How about now?

To begin lighting, open the lampScene_v07.mb scene file from the Scenes folder of the project. You’ll bring in the decorative box first and place it in the scene with these steps:

1. Open the Outliner, and you’ll be refreshed on how this scene was set up earlier in the book. There are a lampGroup node and a biplane node. The biplane is a referenced scene, if you recall, but it still needs to be grouped with the rest of the lamp. In the Outliner, MMB+drag the biplane reference node to the lampGroup node to parent the biplane to the rest of the lamp.
2. With the top node (lampGroup) selected, move the lamp up so that the bottom rests on the home grid. Create a poly plane for the ground plane, and scale to 25 in all X-, Y-, and Z-axes.
3. Choose File ⇒ Create Reference, and navigate to the Decorative_Box project. In the Scenes folder, select boxDetail01.mb to bring in the latest decorative box scene from Chapter 7, “Autodesk Maya Shading and Texturing” as a reference. This is actually the same scene file as boxTextures03.mb that you completed in Chapter 7 but cleaned up a bit to remove the image reference planes you used for modeling.
4. Scale the box to about three-fourths of its current size (2.85 in X, Y, and Z); then position the box next to the lamp, using Figure 10-58 as a guide.
5. Create a new camera that you can use to render the scene. You’ll keep using the persp camera to navigate through the scene. In one of the other view panels, click Panels ⇒ Perspective ⇒ New. persp1 is created. Then, choose View ⇒ Camera Attribute Editor. Maya shows you the persp1Shape tab. Your camera name may be slightly different (such as persp2Shape).
In the Output Settings heading, make sure the Renderable box is checked. Click the persp1 tab in the Attribute Editor, and rename the camera from persp1 to renderCam (persp1Shape is automatically renamed to renderCamShape).
Select the original persp camera, and, in the Attribute Editor, make sure the Renderable box is unchecked. This ensures that only the correct camera (renderCam) will render.
6. Select the renderCam again, and set its Focal Length attribute to 24. This places a 24mm lens on the renderCam to better match the camera taking the photo in Figure 10-58. Set up the renderCam to approximate the same angle of view in that photo for the lamp and box.
7. Press Ctrl+A to toggle off the Attribute Editor and show the Channel Box. In the Channel Box, select the renderCam’s Translate and Rotate attributes, right-click, and select Lock Selected from the context menu shown in Figure 10-59. Doing so locks the camera in place, disallowing you from moving it. This way, you won’t accidentally mess up the view. To be able to move that camera again, highlight those attributes, right-click them, and select Unlock Selected from the context menu.

Figure 10-59: Match the camera angle and view; then lock the camera in place.

c10f059.tif
8. In the renderCam panel, press 6 for textured display and then 7 for lighted and textured display. This way, you can more easily see how you orient the lights. Your objects should turn black since there are no lights yet.
9. Using the persp view, create a Directional light for the key light, and place it in front of the lamp and box and angled down at about 40 degrees, as shown in Figure 10-60. Set the Intensity to 1.2, and turn on Use Ray Trace Shadows under the Shadows ⇒ Raytrace Shadow Attributes heading.

Figure 10-60: Create the key light, and place it as shown.

c10f060.tif
10. Create another Directional light, and place it as the fill light from the opposite angle from the left side and a bit higher and angled down more than the key light, as shown in Figure 10-61. Set Intensity to 0.25, and turn on Use Ray Trace Shadows. Isn’t this exciting?

Figure 10-61: Create the fill light.

c10f061.tif
11. Create a third Directional light. Place it behind the box on its left side, almost diametrically across from the camera and a bit higher than the box, as shown in Figure 10-62, so you get a nice light grazing across the top of the box. Set Intensity to 0.5. Leave shadows off on this light.

Figure 10-62: Create the back light.

c10f062.tif
12. Open the Render Settings window, and select mental ray as the renderer. This also automatically turns on raytracing, which you need for the shadows from the key and fill lights. (See Figure 10-63.) Render a frame in the renderCam view.

Figure 10-63: Change to mental ray in the Render Settings.

c10f063.tif
Figure 10-64 shows the first render with these three lights. Notice that the gray floor is reflecting in the box because you have a Phong shader assigned to the box. You can use texture maps to adjust the reflective areas of the box and dial in the proper reflections in the next chapter as you render.

Figure 10-64: The render doesn’t look too bad with just the three-point lighting.

c10f064.tif
13. You can see the shadow behind the lamp falling off the edge of the ground plane. Scale it up to cover more of the floor. Select the key light (directionalLight1), and open the Attribute Editor. In the Raytrace Shadow Attributes heading, set a Light Angle setting of 3.5 and a Shadow Rays setting of 64; then render the scene. The primary shadowing on the larger floor looks much nicer.
Select the fill light (directionalLight2), and set its Light Angle option to 7 with a Shadow Rays setting of 72 (see Figure 10-65). Play with the radii and number of rays to get the shadows to your liking. Notice how much longer the render takes with soft shadows enabled. You can temporarily use a smaller Shadow Rays setting on your lights until you’re ready for final renders to save yourself some time. Just don’t forget to turn those attributes back up to their full-quality looks!

Figure 10-65: Much nicer shadows on the floor

c10f065.tif
14. You may be bothered by the low-quality settings on the render and the slight fuzziness of the wood texture on the box. Open the Hypershade, and click the Textures tab in the top part of the window to show the texture nodes in the scene. Select the box’s color texture node (boxDetail01:boxColorMap), and open the Attribute Editor. At the top, change Filter Type from the default Quadratic to Off. This prevents the renderer from slightly blurring the texture image to smooth it. (See Figure 10-66.) Do the same to turn off filtering for the lampshade’s file textures (nodes file1 and file2).

Figure 10-66: Turn off filtering for the color texture image.

c10f066.tif
15. Open the Render Settings window (c10g001.tif), and click the Quality tab. Set Max Sample Level from 0 to 1. (See Figure 10-67.)

Figure 10-67: Select a slightly better render quality in the Render Settings window.

c10f067.tif
16. Save your previous render in the buffer by clicking the Keep Image icon (c10g003.tif) in the Render View window. A scroll bar appears at the bottom of the Render View window. Render a frame of the persp panel now that you’ve turned off filtering for the texture file and increased a quality setting. Use the scroll bar in the Render View window to scrub back and forth between the older fuzzy render and the new unfiltered render. The box’s decorative carvings and lines appear much stronger and crisper, as does the texture on the lampshade, as shown in Figure 10-68. It may be tough to compare the quality levels of the two renders in the book’s black-and-white images, but you should notice them clearly in your Render View window.

Figure 10-68: The render is much crisper and cleaner.

c10f068.tif

You’ve only just begun this process for the lamp and box scene. You’ll pick up this exercise from this point in Chapter 11, where you’ll add more texture maps to control reflections as well as add carving detail to the box, adjust shader settings for the lamp, and enable Final Gather to use an HDR image to light the scene to take it to a new level. Woo!

The scene file lampLighting_v01.mb in the Scenes folder of the TableLamp project gives you this lighting setup.

Further Lighting Practice

Lighting professionals in the CG field are called on to find the most efficient way to light a scene and bring it to the peak of its beauty. Again, this comes only from experience. The best way to become a crackerjack lighting artist is to spend months and years honing your eye and practicing the latest procedures, such as HDR lighting.

The file still_life_v01.mb in the Lighting project on the web page contains the scene of the still life with no lights, so you can play with lighting and shadow methods as well as light linking to create some extra focus on some parts of the frame. The file still_life_v02.mb contains the same scene but with three-point lighting already set up.

Notice in the still_life_v02.mb file that two lights make up the key light (spotLight1 and spotLight2). One light makes up the fill light (directionalLight1), and two lights (spotLight3 and spotLight4) make up the back light.

For practice, download some models from the Internet, and arrange them into your own still-life scenes to gain more lighting experience. Set up scenes, time the rendering process, and try to achieve the same lighting look using faster lighting setups that may not be as taxing on the renderer. Also, try taking pictures of situations and trying to match the lighting in the photo, like you’re doing with the decorative box.

Try setting up simple scenes. Start with an indoor location that is lit by a single light bulb. Then, try the same scene in the following locations to expand your lighting repertoire:

  • A photography studio
  • Outside in the morning on a bright summer day
  • Outside at dusk in the fall
  • Outside at night under a street lamp
  • Inside on a window ledge
  • At the bottom of a closet lit by a nearby hallway light

Tips for Using and Animating Lights

When you’re lighting a scene, invoking a lighting mode in your Perspective or Camera view panel will give you great feedback regarding the relative brightness and direction of your lights. Most computer systems’ graphics cards can handle a maximum of eight lights in Lighted mode; some professional cards can handle more.

You invoke Lighted mode by pressing 7 on your keyboard (not through the number pad on the side). You must first be in Shaded mode (press 5) or Texture mode (press 6) to be able to press 7 for Lighted mode. Remember that Lighted mode displays linked lights as if they’re lighting the entire scene. This can cause some confusion, so it’s wise to take notes on any light linking in your scene.

The Maya IPR renderer is also useful when lighting a scene. This almost-real-time updating renderer will give you a high-quality render of your scene as you adjust your lights. Chapter 11 will explore the IPR renderer.

Animating a Light

Any attribute of a light can be animated in the same way that you animate any other object attribute. You can’t, however, animate a light’s type. To edit a light’s animation, you need only select the light and open the Graph Editor to access its keyframes. You can set keyframes on Intensity, Penumbra Angle, Color, and so on, within the Channel Box or the Attribute Editor. Right-click the name of the attribute, and choose Key Selected from the context menu.


By animating a light’s intensity, you can simulate the real-world appearance of a light turning on or off. To turn on a light, create a quickly increasing curve so that its brightness arcs up slowly at first before climbing to full brightness. This animation mimics the way real lights turn on and off better than simply enabling or disabling them in your scene.

Animating the color of a light, as well as the color of a shader, sets keyframes for the color’s RGB values as three separate keyframes. The Graph Editor shows a separate curve for the red, green, and blue channels of color when you animate a light’s color. You can set all three keys at once by right-clicking the Color attribute in the Attribute Editor and choosing Set Key from the context menu, as shown in Figure 10-69.

Figure 10-69: Set a key for the light.

c10f069.tif

In addition, lights can be animated to be moved, scaled, and rotated like any other object. For further study, try animating the lighting for the simple scene(s) you set up to practice lighting from the previous section. Try creating animated lights to simulate a candle illuminating your scene, a campfire, or the flashing emergency lights you would find in your average space-station airlock.

Using the Show Manipulator Tool for Lights

As you saw earlier in the chapter, an easy way to manipulate lights is to use their Special Manipulator. For example, pressing T or choosing Modify ⇒ Transformation Tools ⇒ Show Manipulator tool with a Spot light selected gives you two Translate Manipulators in the view panel, as shown in Figure 10-70 and displays the icon (c10g004.tif) below the Tool Box.

Figure 10-70: Using Special Manipulators to place and orient the Spot light

c10f070.tif

This allows you to move the source or target of the light to aim it better. By clicking the cyan circle that appears below the source’s Translate Manipulator, you can toggle through a number of Manipulators to adjust the Spot light’s settings, such as cone angle (two clicks clockwise) and penumbra angle (three clicks clockwise). Figure 10-71 shows the Manipulator for cone angle.

Figure 10-71: Adjusting the cone angle interactively with the Special Manipulator.

c10f071.tif

Source and Target Translate Manipulators are available for all light types through the Show Manipulator tool as well.

Summary

This chapter explored lighting in Maya, beginning with basic concepts that included the three-point lighting technique. You then learned about the different lights in Maya, how they work, and how you can use light linking to control your scene better. Shadows are an important part of lighting and were covered in this chapter, followed by a quick exploration of the Physical Sun and Sky system with mental ray and then lighting effects such as lens flare and light glows. You then created simple lighting for the table lamp and decorative box for a still rendering. Finally, you learned how to begin animating lights for use in your scenes.

Lighting is truly the linchpin of CG; it can make or break a scene. As you’ll see in the next chapter, lighting goes hand in hand with rendering and shading, and the more you understand about all three functions, the better your scenes will look. Don’t be afraid to experiment with lighting and shading schemes on all your projects.

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

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