Is there a way how to optimally set up shadows?

Is there a way how to somehow set up the shadows optimally for a game?
I have a problem with shadows when there are many objects in the scene, the fps drops a lot.
Even if the shadows are low resolution.
It’s not that much of a problem on my PC but on a friend’s PC, it’s virtually unplayable.
Can you set it up somehow to be less taxing on processing or do I have to bake the shadow on a texture?

use static shadows in setup sun point or use low size containers in sun setup and low range distance tracing shadows draws or bake ambient occlusion maps for game

Would be smart to say how you have done it.

Some basic things:

  • do not create a sun or spot lamp to cover the whole map
  • do not make shadow box/area to big
  • do not oversize the shadow resolution and keep it in power of 2 (512, 1024, 2048, etc)

Vertex parent the sun lamp to the player, figure out how big of an area you want to see shadows. That’s the biggest impact, the size and resolution so i would say keep the size around 50, resolution at 1024 or 2048. This case when you move the player the shadow is only visible like 50 meters around the player (squared, shadowbox is not round, you can turn on the checkbox to make the shadow range visible on the lamp).

Do you want more shadows then baking it into an atlas texture is the best solution.

Another optimal option is shadow filtering types. Taking the time to learn which type does what can sometimes be game changing for performance on lower-spec computers.