Light reveals the world around us and defines shape, color, and texture. Lighting is the most important aspect of computer graphics (CG), and it simply cannot be mastered at a snap of the fingers. The trick to correctly lighting a CG scene is to understand how light works and to see the visual nuances it has to offer.
In this chapter, you will study the various tools used to create light in the Autodesk® 3ds Max® 2016 software. This chapter will serve as a primer on this important aspect of CG. It will start you on the path by showing you the tools available and giving you opportunities to begin using them.
In this chapter, you will learn to
The 3ds Max program has two types of light objects: photometric and standard. Photometric lights are lights that possess specific features to enable a more accurate definition of lighting, as you would see in the real world. Photometric lights have physically based intensity values that closely mimic the behavior of real light. Standard lights are extremely powerful and capable of realism, but they are more straightforward to use than photometric lights and less taxing on the system at render time. In this chapter, we will discuss only the standard lights.
The 3ds Max lights attempt to mimic the way real lights work. For example, a lightbulb that emits light all around itself would be an omni light in 3ds Max terminology. A desk lamp that shines light in a specific direction in a cone shape would be a spotlight. Each of the different standard lights casts light differently. We will look at the most commonly used lights.
The 3ds Max program has a total of eight light types in its Standard Light collection:
The last two on this list begin with mr to signify that they are mental ray–specific lights (see Chapter 15, “mental ray,” for more about mental ray). An advanced renderer, mental ray is commonly used in production today. It offers many sophisticated and frequently complex methods of lighting that enhance the realism of a rendered scene. In this chapter, we will cover only the first five standard lights.
A target spotlight, as shown in Figure 13.1, is one of the most commonly used lights because it is extremely versatile. A spotlight casts light in a focused beam, similar to a flashlight. This type of lighting allows you to light specific areas of a scene without casting any unwanted light on areas that may not need that light. You can control the size of the hotspot, which is the size of the beam before it starts losing intensity.
The light is created with two nodes: the light itself (light source) and the target node (at which the light points at all times). This way, you are easily able to move the light following the subject of the scene, as a spotlight would follow a singer on stage. Select the target and move it as you would any other object. The target spot rotates to follow the target. Similarly, you can move the light source, and it will orient itself accordingly to aim at the stationary target. To see the Spotlight Parameters, select the light source, go to the Modify panel, and open the Spotlight Parameters rollout, shown in Figure 13.2.
The falloff, which pertains to standard lights in 3ds Max software, is represented in the viewport by the area between the inner, lighter yellow cone and the outer, darker yellow cone, shown in Figure 13.1. The light diminishes to 0 by the outer region, creating a soft area around the hotspot circle (where the light is the brightest), as shown in Figure 13.3.
A target direct light has target and light nodes to help you control the direction of the light. It also has a hotspot and beam, as well as a falloff, much like the target spot. However, whereas the target spot emits light rays from a single point (the light source) outward in a cone shape, the target direct light casts parallel rays of light within its beam area. This helps simulate the lighting effect of the sun because its light rays (for all practical purposes on Earth) are parallel. Figure 13.4 shows a target direct light in a viewport.
You can create and select/move parts of a target direct light in much the same way as a target spot. In the Directional Parameters rollout, you'll find the similar parameters for the target direct light. Although the spotlight and the directional light don't seem to be very different, the way they light is strikingly different, as you can see in Figure 13.5. The spotlight rays cast an entirely different hotspot and shadow than the directional light, despite having the same values for those parameters.
Free spotlights and free direct lights are virtually identical to target spots and target direct lights, respectively, except that the free spot and direct lights have no Target object. You can move and rotate the free spot however you want, relying on rotation instead of a target to aim it in any direction, as shown in Figure 13.6.
Another difference between a free spot or direct light and a target spot or direct light is that while the length of the target spotlight is controlled by its target, a free spot or direct light instead has, in the General Parameters rollout, a parameter called Targ. Dist: The default is 240 units.
Because they are very easy to control and give a fantastic sense of direction, free spot and free direct (as well as target spot and target direct) lights are great for creating the main lighting in your scene. When a light is selected, go to the Modify tab and go to the General Parameters rollout; you'll find a drop-down menu that will allow you to change your chosen light type to another type. You can also change a free light to a target light by checking the Targeted box.
The 3ds Max omni light is a point light that emanates light from a single point in all directions around it. Figure 13.7 shows an omni light. Unlike the spot and directional lights, the omni light does not have a special rollout, and its General Parameters rollout is much simpler.
Omni lights are not as good for simulating sunlight as directional lights are. In Figure 13.8, the omni light in the image on the left creates different shadow and lighting directions for all the objects in the scene, and the directional light in the image on the right creates a uniform direction for the light and shadow, as would the sun here on Earth.
Omni lights are good for fill lights, which are supplementary lights used in photography or filming that do not change the character of the main light and are used chiefly to lighten shadows.
Lighting a still life can be approached using the three-point lighting setup. Three-point lighting is a traditional approach to lighting a television shot. After all these years, the concepts still carry over to CG lighting. In this setup, three distinct roles are used to light the subject of a shot. The scene should, in effect, seem to have the following elements:
Only one primary or key light to define lighting direction and create primary shadows
A softer light to fill the scene and soften the shadows a bit
A back light to make the subject pop out from the background
This does not mean there are only three lights in the scene. Three-point lighting suggests that there are three primary angles of light for your shot, dependent on where the camera is located.
Three-point lighting ensures that your scene's main subject for a particular shot is well lit, has highlights, and has a sense of lighting direction using shadow and tone. Figure 13.9 shows a plan view of the three-point lighting layout. The subject is in the middle of the image.
Now that you have an overview of how lights work in a 3ds Max scene, let's put them to good use and light the room from Chapter 3, “Modeling in 3ds Max: Architectural Model Part I,” and create a basic light setup for the scene. Set your current project to the c13_IntroLight you copied to your hard drive from this book's web page, www.sybex.com/go/3dsmax2016essentials
. Open c13_ex1_basic_start.max
from the scenes
folder of the c13_IntroLight
project folder.
Save your file and move on to the next exercise. To check your work, open the c13_ex1_basic_end.max
file from the scenes
folder of the c13_IntroLight
project folder.
Using shadows intelligently is important in lighting your scenes. Without the shadows in the scene, the still life would float and have no contact with its environment.
Continue with the file you are working on or open c13_ex2_shadows_start.max
from the scenes
folder of the c13_IntroLight
project folder.
Save your file and move on to the next exercise. To check your work, open the c13_ex2_shadows_end.max
file from the scenes
folder of the c13_IntroLight
project folder.
In the viewport, the shadow already looks better, but in the render, because the glasses are transparent, the shadow looks a bit weird—too dark and solid for a shadow for a transparent glass. To fix this issue, the shadow's density needs to be lowered. Adding a light to fill in the very dark shadows will correct this issue. A fill light simulates the indirect light seen in the real world. A fill light should not have any shadows or specular highlights; without them, you can make sure the render looks as if there is only one light in the room. Continue with the file you are working on or open c13_ex3_fill_start.max
from the scenes
folder of the c13_IntroLight
project folder.
Save your file and move on to the next exercise. To check your work, open the c13_ex3_fill_end.max
file from the scenes
folder of the c13_IntroLight
project folder.
The omni light needs to have decay or attenuation applied. This means that light over distance loses its intensity or energy. Standard lights don't do this by default; it has to be simulated within the parameters. Continue with the file you are working on or open c13_ex4_attenuation_start.max
from the scenes
folder of the c13_IntroLight
project folder.
Save your file and move on to the next exercise. To check your work, open the c13_ex4_attenuation_end.max
file from the scenes
folder of the c13_IntroLight
project folder.
To get shadows to respond to transparencies, you will need to use raytraced shadows instead of shadow maps.
You can create the following types of shadows using the 3ds Max program:
Advanced Ray Traced
mental ray shadow map
Area shadows
Shadow map
Ray Traced shadows
Each type of shadow has its benefits and its drawbacks. The two most-frequently used types are shadow map (which you've already seen) and raytraced shadows.
Using a shadow map is often the fastest way to cast a shadow. However, shadow map shadows do not show the color cast through transparent or translucent objects.
When you are close to a shadow, to avoid jagged edges around it, use the Size parameter to make the resolution higher. The following parameters are useful for creating shadow maps:
Bias
The shadow is moved, according to the value set, closer to or farther away from the object casting the shadow.
Size
Detailed shadows need detailed shadow maps. Increase the Size value, which in turn will increase the detail of the shadow cast. Figure 13.21 compares using a low Shadow Map Size setting to using one four times larger. Notice how the shadows on the left (Size = 1024) are somewhat mushy and less noticeable, and the shadows on the right (Size = 4096) are crisp and clean. A size around 2048 is good for most cases. Scenes like this chessboard that have a large scale require higher Size values, such as the 4096 that was used.
This option creates and controls the softness of the edge of shadow map shadows: the higher the value, the softer the edges of the shadow.
Raytracing involves tracing a ray of light from every light source in all directions and tracing the reflection back to the camera lens. You can create more accurate shadows with raytracing than with other methods, at the cost of longer render times. Raytraced shadows are realistic for transparent and translucent objects. Figure 13.22 shows the still life rendered with a plane object casting a shadow over it. The plane has a checker pattern mapped to its Opacity map channel, so it has alternating transparent and opaque areas defining the solid and transparent parts of the logo. On the left side of the image in Figure 13.22, the light is casting shadow map shadows; and on the right, the light is casting raytraced shadows.
Use raytraced shadows when you need highly accurate shadows or when shadow map resolutions are just not high enough to get you the crisp edges you need. You can also use raytraced shadows to cast shadows from wireframe rendered objects.
The Ray Traced Shadow Params rollout controls the shadow. The Ray Bias parameter is the same as the Shadow Map Bias parameter in that it controls how far the shadow is from the casting.
Atmospherics provides effects such as parallel beams of fog seen within light rays and glows. Atmospheric effects with lights, such as fog or volume lights, are created using the Atmospheres & Effects rollout in the Modify panel for the selected light. Using this rollout, you can assign and manage atmospheric effects and other rendering effects that are associated with lights.
Volume Light is a light effect based on the interaction of a light with the atmosphere. In the real world, this effect is visible when there's a lot of dust in an enclosed space.
c13_ex5_volume_start.max
file from the scenes
folder of the c13_IntroLight
project folder.Save your file. To check your work, open the c13_ex5_volume_end.max
file from the scenes
folder of the c13_IntroLight
project folder.
The default parameters for a volume light will give you some nice volume in the light for most scenes, right off the bat. If you want to adjust the volume settings, you can edit the following parameters:
The density of the volume light will increase exponentially with distance. By default (Exponential is off), density will increase linearly with distance. You will want to enable Exponential only when you need to render transparent objects in volume fog.
This value sets the fog's density. The denser the fog is, the more light will reflect off the fog inside the volume. The most realistic fog can be rendered with about a 2 to 6 percent density value, depending on the scene.
Most of the parameters are for troubleshooting volume problems in your scene if it is not rendering very well. Sometimes you just don't know what the problem is, and you have to experiment with switches and buttons.
The Noise settings are another cool feature to add some randomness to your volume:
This toggles the noise on and off. Render times will increase slightly with noise enabled for the volume.
This is the amount of noise that is applied to the fog. A value of 0 creates no noise. If the amount is set to 1, the fog renders with pure noise.
These settings determine the look of the noise and let you set a noise type (Regular, Fractal, or Turbulence).
Adding atmosphere to a scene can heighten the sense of realism and mood. Creating a little bit of a volume for some lights can go a long way to improve the look of your renders. However, adding volume to lights can also slow your renders, so use it with care.
If several lights are in your scene, and you need to adjust all of them, selecting each light and making one adjustment at a time can become tedious. This is where 3ds Max Light Lister comes in handy. Accessed through the menu bar by choosing Tools Light Lister, this floating palette gives you control over all of your scene lights, as shown in Figure 13.28.
You can choose to view or edit all the lights in your scene or just the ones that are selected. When you adjust the values for any parameter in the Light Lister dialog box, the changes are reflected in the appropriate place in the Modify panel for that changed light.