Dumb question about the Mobile Shaders

I’m wondering, since Unity is supposed to be easily multi-platform, what is the asset and matertials workflow expected to be when targetting both mobile and PC and we still want to use the optimized Mobile shaders for performance on those platforms? Are we supposed to have scripts that go through and swap every material or shader depending on what platform we are targetting? Or do I have two materials (or two shaders) applied to every object and then through script enable/disable the appropriate one?

It seems cumbersome and I am surprised there isn’t a built-in fallback.

Actually, I do know the Standard shader has fallbacks in the form of skipping options that aren’t checked on, but I have read they are nowhere as performant as the mobile shaders (hence my line of thinking/questioning above).

In a previous project, I didn’t care as it seemed the Standard shader worked well on iOS. But now on a new project also targetting Android I’ve run into rendering issues which have sent me down this rabbit hole of inquiry and testing…

You can use the legacy shaders those are a good in-between balance. Mobile/Diffuse does per pixel lighting + shadows. These run decent on galaxy s3 ish phones.

You can also just get the shader code and define what fallback you want in the shader code and use shader LOD levels. That means you don’t have to do anything in code except set the global shader LOD level.

Although it’s never that easy… I’m sure a lot of other things you need to consider like post processing effects and mesh density and so on.

Generally it’s hard to do cross platform:)

1 Like