Optimizing Shaders for Mobile Platforms
Tutorial
·
intermediate
·
+0XP
·
15 mins
·
(95)
Unity Technologies

In this tutorial, we will review best practices for optimizing shaders on your intended mobile platform using the correct lit and unlit shaders in Unity.
Languages available:
1. Using the Unlit Shader for Mobile Platforms
Unity has a collection of built-in Shaders located in the Universal Render Pipeline (URP). The following screenshot shows you where you can find URP-dedicated Shaders


As of 2019.4, only the built-in Unlit Shaders under the ‘Mobile’ section will work with Unity's Universal Render Pipeline (URP). If you intend to use a mobile-focused lit shader, you should use the “Universal Render Pipeline/Simple Lit” shader as a foundation as this is a simpler and more performant lit shader in URP.
It’s a good practice to use only the Shader features needed to customize a Material. Unity will create an optimized run-time version of the Shader you’ve chosen and configured. This reduction in Shader complexity helps with performance on mobile platforms.
2. Lit vs. Unlit Shaders
When creating a Shader, you can decide how the Material will react to light. Most Shaders are classified as either lit or unlit.
An unlit Shader is the fastest and computationally cheapest shading model. Use it if you’re targeting a lower-end device. Key points to consider include:
- Lighting does not affect an unlit shading model. This means that many calculations, such as specularity calculations, aren’t needed. The result is either cheaper or faster rendering.
- Using a stylized art direction that resembles a cartoon works well with unlit shading. This style is worth considering when you’re developing games for mobile platforms.
A lit Shader uses more processing power than an unlit Shader. However:
- Light affects a lit Shader and allows the surface to have specularity.
- This is probably the shading model that is most used in mobile games today.
The following image shows the difference between a lit and an unlit object:

The same tower Mesh and Texture have been applied, but using different Shaders. Lights don’t not affect unlit Shaders, so they need less computation in order to be rendered on-screen. This results in better performance, especially on less-powerful devices.
3. Conclusion
It’s important to consider which Shader and Material features are absolutely necessary to achieve the desired visual style for your application and limit the use of features that don’t directly contribute to that style. In the next tutorial, we’ll examine the impact of transparent Materials on mobile application performance.