Lighting Tutorial

Shadows quality

Cast shadows are an important cue in perceiving depth and spatial relationships, in particular when an object is seated on another object. This is the case for the table, chairs and the credence in this scene.

In Computer Graphics, there are two types of shadows: hidden surface shadows and casted shadows.

Hidden surface shadows are shadows that are caused by surfaces that are facing away from the light source. In the scene that is used here, the back of the chairs are in hidden surface shadows because the back of the chairs are facing away from the chandelier lights.

Casted shadows are caused by objects occluding the light path between a light and another object that would otherwise receives the light. In the scene used here, we can see casted shadows on the chair seats, right under the table. We should normally see casted shadows under the chairs and under the table on the floor but those casted shadows are barely visible.

Examining the light in the current scene, we have 5 lights for the chandelier with 80% shadow darkness and raytraced shadows casting one ray.

With the shadow darkness set to its default of 80% we get a rather light shadow everywhere. Here again, this is a Computer Graphics trick to compensate for the fact that a raytracer renderer does not compute indirect illumination. Normally, a traditional raytracer would produce pure black shadows. But by using this trick, it is possible to simulate somehow the effect of indirect illumination. And it is possible to control this indirect illumination effect by increasing or decreasing the shadow "darkness" property.

Some examples:

Note that I removed ambiance color and color on the lights so the shadows and the effect of changing their parameters are more clearly visible.

It can be observed that increasing the shadow darkness does not change the shadow quality. It really only change its darkness. The shadow quality, or its softness, comes mostly from the 9 passes that were used to render this picture.

The other important property that affects shadows is the light width. When rendering in multipasses, the light width will determine the quality, or softness, and the darkness of the shadows.

Here are a set of renders with shadow darkness set to 100% but with different light widths:

A light width of 0 will produce very sharp shadows typical of traditional raytraced renders. And note also, that the shadows are black just like traditional raytraced renders. A light width of 0 is called a "point light source". Remember that there a actually 5 lights in this scene.

As the light width increases, not only does the shadow softness increases but its shadow darkness also decreases. And this even though we set the shadow darkness to 100%. This is particularly noticeable under the table. At 100 cm width, there is almost no perceivable shadows under the table. And the shadows is so soft that it is almost unnoticeable except on nearby objects like under the plates and on the chair seat.

Not surprisingly, the best light width for this scene is 15 cm. This is actually the size required for the light to overlap the modeled candle bulb. 30 cm width is not bad too but still too soft and thus not realistic enough for my taste. I would probably choose a width between 15 and 30 cm to get the best and most believable results. I would guess that 20 cm is the best bet.

So it is important to remember that the light width will also control the shadow darkness in addition to the shadow softness. And the shadow softness as well as the shadow darkness is in direct relation with the distance between the shadow casting object and the shadow receiving object.

It is possible to have the light width control only the shadow softness and adjust the shadow darkness exclusively with the shadow "darkness" attribute instead of having it dependent on the light width. To get that, simply set the number of rays cast to any number greater than 1.

Here are a set of renders with light's shadow darkness set to 100% but with different light widths and 2 rays cast:

Notice how the shadows are always black except in their softness areas. Increasing the light width only affects the shadow softness. That is because by setting more than one ray cast from the light, it is equivalent to setting several point-light sources per light. By using a 9 pass render, we actually get 18 point light sources per light.

Important:
When preparing a scene for radiosity, it is extremely important to have black shadows. The shadows should be soft but black. That is because we don't want the raytracer to contribute any indirect illumination approximations. We want the radiosity to be alone in contributing the indirect illumination.