Troubleshooting Shadows

 
 
 

The following will help you optimize your scene's shadows, as well as troubleshoot common problems.

NoteKeep in mind that speed optimizations usually sacrifice quality and that quality optimizations usually decrease speed.

Enabled Shadows (Speed Optimization)

Shadows are time-consuming to render, so remember to select None as the Shadow Type on the Active Effects tab of the Rendering Options property editor for passes that do not require shadows.

In addition, shadows on distant objects do not need to be as accurate as those on objects that are close to the camera. For example, you could use a selective area light to generate soft shadows for close objects and a selective point light in the same location to generate simpler shadows for distant objects.

Alternatively, you could use two separate render passes: one with raytraced shadows for close objects and one with shadow-mapped shadows for distant objects.

Shadows and Scanline (Speed Optimization)

For fast previewing of scenes, shadow maps can be used by the scanline renderer to produce fast approximate renderings with shadows without using any raytracing.

Shadows and Motion Blur (Speed Optimization)

If your scene has both shadows and motion blur, turn off the ShadowMap Motion Blur option (in the Render Options property editor) if there is little movement and a normal shadow map softness can be achieved through the blurring effect.

Opaque Shadows (Speed Optimization)

If a light is emanating opaque shadows, it is best to use Shadow Maps for that light. In addition, if the light's position is not animated, you can define a shadow map file name so the shadow map can be used again across several frames.

Troubleshooting

Here are some common problems and their solutions:

Soft Shadows Are Grainy

If your soft shadows are emanating from an area light, increase the area light's U and V sampling values to 3, 3 or 5, 5 or even higher in the light shader property editor.

If the grainy shadows are created using a shadow map, increase either the shadow samples or resolution in the light shader property editor.

Soft Shadow Map Shows Random Speckles

This problem is often caused by too high a value in the shadow map's Softness parameter. Reduce the value to a small amount (such as 0.05) and start working up from there.

Texturing Shadows Produces Unexpected Results

This problem is typically the result of connecting the wrong shader to the shadow port of an object's material. Not every shader is equipped to handle shadows correctly.

For example, surface shaders and shadow shaders are designed to process shadow information, but texture shaders are not. Connecting a texture shader to a material's Shadow port will produce colored shadows, but they won't necessarily be correctly calculated. One immediate effect is that instructions from selective lights will be ignored. So even if a light is not supposed to affect the object, the object's shadows will be rendered because the texture shader controlling the shadows ignores the information about the light's selectivity.

In short, the shader connected to a material's Shadow port should always be a shader that is designed to handle shadows. One way to texture shadows is to apply a Simple Shadow shader to the material's Shadow port, and use a texture shader to drive the shadow's color.