Титульная страница
ISO 9000 ISO 14000
GMP Consulting
 
Mastering 3D Studio MAX R3

Previous Table of Contents Next


Attenuating Light at a Distance

As mentioned earlier, a CG light will go on forever unless you specify how it attenuates. All lights in MAX can be attenuated at a distance. The attenuation settings control how light diminishes relative to the distance from the light, including the total distance of the light’s throw, where the light starts falling off, where the light starts “falling on” (something not possible in a real light), and the type of decay calculation used for the falloff.


TIP If an object is too dark, check whether it is within the attenuation ranges of the light.

Near Attenuation

This setting controls where the light begins to fade in. As mentioned above, this is not comparable to a real-life situation. Imagine that the light emitted by a light does not have to start at the light, illuminating everything in its path, but can start somewhere along its path. The End setting of the Near Attenuation parameter is the distance where the light reaches 100% of its intensity. The Start setting is the distance where the light value starts fading in from zero.


WARNING Remember to always check the Use box when using attenuation settings.


TIP Checking Show will allow you to also see the settings represented schematically in the viewport, as in Figure 10.6. Here, the far attenuation settings are being displayed; the larger, darker oval is the End setting and the smaller, lighter one is the Start setting.


FIGURE 10.6  Attenuation (for a spotlight) shown in viewport

Far Attenuation

The Far Attenuation setting determines where a light begins to fade out at a distance. This is the type of attenuation we are more accustomed to in the real world and is much more common in CG as well. The Start setting is the distance where the light begins to fall off from its full intensity. The End value designates the farthest reach of the light; after that distance, the light has no effect at all.


NOTE Near Attenuation was introduced in MAX R2.5, so anything you come across referring to attenuation before that version of MAX refers to Far Attenuation.

Decay

The Decay settings determine which mathematical formula MAX uses to calculate the falloff in light from 100 percent to zero. Table 10.1 shows the effects of the three decay types.

Table 10.1: EFFECT OF DECAY SETTINGS OF LIGHTS

Decay Type Effect

None There is no falloff.

Inverse The falloff is proportional to the inverse of the distance.

Inverse Square The falloff is proportional to the inverse of the distance squared. This is real-world falloff, but is rarely necessary and dims the light greatly. To use this setting in MAX, you will need to either use a lot of lights or crank up the multiplier value.

Adjusting the Hotspot and Falloff

In addition to attenuating at a distance, spotlights and directional lights also diminish along the edges of their cone or cylinder, according to parameters that can also be adjusted. The hotspot is the angle of the cone of a spotlight (or width of the cylinder of a direct light) within which the light is still at full intensity. The falloff is the angle or width at which no illumination is received from the light. You can set these in the Spotlight Parameters rollout of the Modify tab, or use a Light view and the viewport navigation controls (the Hotspot and Falloff tools) to adjust them. If you check Show Cone in the Spotlight Parameters, the cone will display in the viewport even when the light is not selected. The light blue inner cone is the hotspot; the dark blue outer cone is the falloff.

Casting Shadows

All lights in MAX can cast shadows but, unlike real lights, CG lights have to be instructed to do so. Calculating shadows increases render time, therefore shadows are not turned on as a default. The Shadow Parameters rollout allows you to choose how the shadows should be determined.

The two types of shadow calculations are shadow map and ray-traced shadows. You choose these in the Object Shadows drop-down list in the Shadow Parameters rollout. Shadow Map applies a silhouette image of the object projected along the line of light as a bitmap for shadow images. Ray Traced Shadows calculates the actual fall of light rays around the object. We will look at the benefits and drawbacks of each.

Shadow Maps

Shadow maps are bitmaps created during the rendering process and projected in the direction of the light. Specific settings can then be adjusted to control the anti-aliasing of the shadow bitmap. Since shadow-mapped shadows are bitmaps, their resolution relative to the total render size affects how coarse the shadows appear. If your shadows are coarse, the map size may be too small, the camera may be too close, or your falloff may be too wide. (The map size has to cover the entire area within the light’s falloff.) If you have two different-sized objects near each other, you may need to use separate lights with different map sizes, excluding the other object from each light.

Here are some of the advantages and disadvantages of shadow-mapped shadows, followed by further discussion of the parameters of shadow maps:

Advantages Disadvantages
Soft edges Have to fiddle with map size and sampling to control coarseness
Can add color and map to shadow Won’t apply transparency or filter color of transparent objects
Faster to calculate Not calculated as precisely as raytraced shadows
Controllable maps Large map sizes bog down the system

Bias This parameter adjusts the distance of the map from the object casting shadows. In the scene below, the sphere on the left has the default map bias of 1, while the sphere on the right has a map bias of 50.

Size This parameter determines the dimensions of the map used to make the shadows. As mentioned before, increasing the map size can help get rid of the coarseness (jagged edges) around your shadows. The downside, of course, is that this uses more RAM.


Previous Table of Contents Next

© 2000, Frol (selection, edition, publication)

 
Rambler's Top100