Shadows

The lighting schemes analyzed up to now produce on the objects only areas which are more or less lit, but no cast- or self-shadowing, and a scene without proper shadowing looses depth and realism.

On the other hand proper shadow calculation requires a full - and slow - ray tracer. For a scan liner, as Blender is, shadows can be computed using a shadow buffer for shadow casting lights. This implies that an 'image', as seen from the Spot itself is 'rendered' and that the distance for each point from the spotlight saved. Any point of the rendered image further than any of those points is then considered in shadow.

The shadow buffer stores this data. To keep the algorithm compact, efficient and fast this shadow buffer has a size which is fixed from the beginning and which can be, in blender, from 512x512 to 2560x2560, the higher value the most accurate.

The user can control the algorithm via the bottom two row of buttons in the Lamp window (Figure 16).

Figure 16. Spot Light shadow buttons.

BufSi - A series of TogButtons, from 512 to 2560, defining the shadow buffer size.

ClipSta, ClipEnd - To further enhance efficiency the shadow computations are actually performed only in a predefined range of distances from the spot position, this range goes from ClipSta, nearer to the Spot light, to ClipEnd, further away (Figure 15 in the Section called Spot Buttons). All objects nearer than ClipSta from the Spot light are never checked for shadows, and are always lit. Objects further than ClipEnd are never checked for light and are always in shadow. To have a realistic shadow ClipSta must be less than the smallest distance between any relevant object of the scene and the spot, and ClipEnd larger than the larges distance. For a better utilization of the allocated memory, and a better shadow quality ClipSta must be as large as possible and ClipEnd as small as possible so as to minimize the volume where shadows are to be computed.

Samples - To obtain soft shadows the shadow buffer, once computed, is rendered via its own anti-aliasing algorithm which works by averaging the shadow value over a square of a side of a given number of pixels. Samples is the number of pixels. Its default is 3, that is a 3x3 square. Higher values gives a better anti-aliasing, and a slower computation.

Bias - Is the bias used in computing the shadows, again the higher the better, and the slower.

Soft - Controls the softness of the shadow boundary. The higher, the softer, and the more extended the shadow boundaries are. Commonly it should be assigned a value which ranges from the same value of the Sample NumButton to double that value.

Halo step - The stepping of the halo sampling for volumetric shadows when volumetric light is on. This will be explained in the 'Volumetric light' section.

Figure 17. Spot Light shadow examples.