Shadows not show on mobile devices

Hello guys!

I created a mobile game and I use directional light with shadows. On the editor everything works good but when I create a mobile build (Android or IOS) the shadows not visible.
I try to add graphics setting to switch between the quality setting but did not help.

why is that?

is your quality settings same for all platforms? are you using default materials/shaders?

Also, which Unity version are you using?
Builtin render pipe or Lightweight/Universal or something else?

I tried with Unity 2018.4,15f1 and 2019.3.0f6 too.

  • Shaders: LWRP/LIT with receive shadows on.
  • Lightmap: Baked
  • 1 Directional Light on Mixed mode.

The quality settings are the same on all the platforms but the shadows handled by the Scriptable Render Pipeline settings what I change from code.

public RenderPipelineAsset lowQuality;
public RenderPipelineAsset mediumQuality;
public RenderPipelineAsset highQuality;

public void SetQuality(int _quality)
{
        switch (_quality)
        {
            case 0:
                GraphicsSettings.renderPipelineAsset = lowQuality;
                QualitySettings.SetQualityLevel(1, true);
                break;
            case 1:
                GraphicsSettings.renderPipelineAsset = mediumQuality;
                QualitySettings.SetQualityLevel(3, true);
                break;
            case 2:
                GraphicsSettings.renderPipelineAsset = highQuality;
                QualitySettings.SetQualityLevel(5, true);
                break;
        }
}

In editor everything is okay…

When you build the player do you have an SRP assigned in the Graphics settings? It uses this to figure out what should be stripped so if there is none there it might strip the shaders you intend to use. We have this being tested in our automation so we kknow shadows work on players.

If this is set up properly can you log a bug as we have not seen this.

HAHA!

I changed the SRP to the highest on Graphics settings and after that, I build … and voila!
Thanks for the tip! Now I can change the quality of my game!