There are a few things you should do to optimise the shadows inyour game:
Use lightmapping heavily to compute the shadows for static meshes.Unity has a builtin lightmapper. See
The computation of dynamic lights have 3 main aspects and each onemust be tweaked for performance: the light itself, the casters andthe receivers.
To make a dynamic light, set Hard Shadows or Soft Shadows in it.However, the number of dynamic lights should be minimal since eachone issue additional rendering for shadow projection. Also, SoftShadows require a blur filter to ensure smoothness, which canimpact the performance. Finally, the resolution of the shadowtexture also affects performance. Seehttp://docs.unity3d.com/Documentation/Manual/Shadows.html
To make a mesh receive or cast shadows, set Receive Shadows or CastShadows in the respective Renderer (BEWARE:by default these settings are on). However, the number ofcasters and receivers should also be minimal, since each caster orreceiver in the "light frustum" must be rendered additional times.See
Another related performance tweek is to use the Deferred RenderingPath instead of the Forward Rendering Path.
In summary:
- Bake light maps;
- Keep the number of dynamic lights to a minimum;
- Tweak the resolution of the shadow texture;
- Tweak the filter for Soft Shadows;
- Use Receive Shadows and Cast Shadows judiciously;
- Use the Deferred Rendering Path.