Shadows

Shadows can add realism to the scene and better understanding of your product.

Shadows can slow the scene’s performance and distract your user with unnecessary details. Consider if the visual clues shadows add to the scene are worth the slower rendering.

 

Three scene elements are required to cast a shadow.

  1. One or more global lights in your scene must have the property “generate shadows” set to true.

  2. One or more meshes in your scene must have the property “cast shadows” set to true.

  3. One or more meshes must have the property “receive shadows” set to true.

Only if all three are set will a shadow appear. The light from element 1 is blocked by element 2, causing a shadow to appear on item 3. In this way, you can use shadows to add a depth effect only where needed. Adding too many shadow calculations can slow the scene’s frame rate.

Shadow Properties

The properties of shadows are first set at the source: in the properties of the global light casting them. Then adjust how meshes cast or receive shadows by adjusting the shadow properties on each mesh.

Troubleshooting Shadows

If your shadows are not appearing as you would expect, try these troubleshooting steps:

  1. Ensure the source global light is aimed correctly. You can temporarily change the color of the light it emits to troubleshoot.

  2. Turn down or even remove environment lighting. In the scene node, set the environment lighting intensity to a low number or zero.

  3. Don’t combine the use of a hemispheric light and environment lighting. This results in redundant lighting which can be difficult to troubleshoot.

  4. Set the shadow filter of that source global light to 'Simple' which makes it easier to see.  If the filter is set to 'Advanced' the shadow becomes more realistically blurry, but more difficult to trace.

Was this article helpful?