Tips, Optimizing & Troubleshooting (Lights & Shadows)

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

 

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

Tips on Lights

Specular and diffuse light contribution—Each light can contribute to a material’s specular and diffuse components. If you want a light to affect only the specular of a material such as Blinn, Phong, or Strauss, select Specular Only from the light’s property editor.

If a light doesn’t have to calculate its effect on a component, it renders faster. By default, all lights affect both the diffuse and specular components.

Toggling area lights—You can toggle off all of a scene’s area lights before rendering by typing ToggleAreaLights in the Scripting text box.

Keep in mind that this toggles off the area lights for the entire scene and not just the active render or active layer.

Being selective—If your scene requires area lights, but only on certain objects, make those area light selective so they don’t need to calculate lighting on other objects.

To create a selective light, refer to Using Selective Lights.

What is your spotlight looking at?—From any viewport, you can select a spotlight view to “see” what your spotlight sees.

In addition, any changes you make to the spotlight’s view or position are carried over to the light’s position and angle.

Optimizing Lights and Shadows

Number of Lights (Speed Optimization)

Rendering time is directly affected by the number and type of lights. Use the minimum number of lights necessary in each pass and use selective lights whenever possible to reduce the amount of calculations per light.

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 looks like 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.

 



Autodesk Softimage v.7.5