July 14 2020

Now You Can Choose High-Performing Unity Shaders


There are many shaders in Unity.

When choosing your next shader, you need to strike the balance between your dream visuals and the performance you take away.

But how much performance do your shaders steal?

Well, in my previous post I showed you a simple process to measure the performance cost of your shaders.

But today I’m doing something different.

Today, I’ll give you handy tables so you can see the performance cost of the commonly used Unity shaders.

Yes, now you can make informed decisions in your game 🙂

How to Read These Performance Numbers

Here’s a few notes regarding these numbers:

  • I did not include all variants, as most shaders can well have 1k+ variants.
  • I simplified the variant term as a concatenation of the shader’s Global Keyword and Local Keyword.
  • The numbers represent the total number of GPU shader unit cycles as estimated by Mali Offline Compiler for OpenGL ES 3 for a modern mobile platform.
  • I’m using Unity default graphic settings regarding hardware tiers.
  • The red number shows the hardware bottleneck for each shader variant.
  • These numbers do not account for your current GPU pipeline state, such as caching.

And here’s the legend:

  • A = Arithmetic operations (e.g. sum, multiply, etc.)
  • LS = Load/Store operations (e.g. loading parameters from buffers)
  • V = Varying operations (i.e. the cost spent in the shader unit varying interpolator)
  • T = Texture operations (e.g. fetching + sampling)

By the way, I suggest reading this on desktop…

Reading this on mobile will only hurt your eyesight.

I know because I tried. And my eyes still hurt after two days.

The Cost of Your Shaders

UI Default Shader (4 Variants)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | NONE1.413.00.00.00.30.00.50.5
NONE | UNITY UI ALPHACLIP 1.413.00.00.00.40.00.50.5
NONE | UNITY UI CLIP RECT 1.413.00.00.00.50.00.80.5
NONE | UNITY UI ALPHACLIP UNITY UI CLIP RECT1.413.00.00.00.70.00.80.5

Sprite Default Shader (4 Variants)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | NONE1.49.00.00.00.30.00.50.5
NONE | PIXELSNAP ON 1.59.00.00.00.30.00.50.5
ETC1 EXTERNAL ALPHA | NONE1.49.00.00.00.40.00.51.0
ETC1 EXTERNAL ALPHA | PIXELSNAP ON 1.59.00.00.00.40.00.51.0

Skybox Procedural (3 Variants)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | SUNDISK NONE 8.39.00.00.00.30.00.60.0
NONE | SUNDISK SIMPLE 8.511.00.00.00.80.01.00.0
NONE | SUNDISK HIGH QUALITY 8.411.00.00.01.70.01.10.0

Skybox Cubemap (1 Variant)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | NONE1.35.00.00.00.60.00.40.5

Skybox 6-Sided (1 Variant)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | NONE (6x)1.26.00.00.00.50.00.30.5

Clearly, the procedural skybox shader is more expensive than its two alternatives.


Unity Alpha Blended Shader

Mobile – Particles – Alpha Blended (1 Variant)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | NONE1.19.00.00.00.20.00.50.5

Unity Shader Diffuse (Source: Unity)

Mobile – Diffuse (17 Variants)

Vertex ShaderFragment Shader
VariantALSVTALSVT
DIRECTIONAL | NONE1.813.00.00.01.50.01.01.0
DIRECTIONAL LIGHTPROBE SH | NONE3.615.00.00.01.50.01.31.0
DIRECTIONAL SHADOWS SCREEN | NONE2.215.00.00.02.00.01.51.5
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN | NONE2.717.00.00.04.60.01.83.0
DIRECTIONAL VERTEXLIGHT ON | NONE1.813.00.00.01.50.01.01.0
DIRECTIONAL LIGHTPROBE SH VERTEXLIGHT ON | NONE5.515.00.00.01.50.01.31.0
DIRECTIONAL SHADOWS SCREEN VERTEXLIGHT ON | NONE2.215.00.00.02.00.01.51.5
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN VERTEXLIGHT ON | NONE5.017.00.00.04.60.01.83.0
NONE | NONE1.88.00.00.00.30.00.40.0
NONE | NONE3.815.00.00.00.90.01.11.0
LIGHTPROBE SH | NONE3.815.00.00.00.90.01.11.0
UNITY HDR ON | NONE3.815.00.00.00.50.01.11.0
LIGHTPROBE SH UNITY HDR ON | NONE3.815.00.00.00.50.01.11.0
NONE | NONE1.813.00.00.00.60.00.60.5
LIGHTPROBE SH | NONE3.615.00.00.00.90.00.90.5
UNITY HDR ON | NONE1.813.00.00.00.60.00.60.5
LIGHTPROBE SH UNITY HDR ON | NONE3.615.00.00.00.70.00.90.5
Unity Shader Bumped Diffuse (Source: Unity)

Mobile – Bumped Diffuse (17 Variants)

Vertex ShaderFragment Shader
VariantALSVTALSVT
DIRECTIONAL | NONE2.816.00.00.02.20.01.81.5
DIRECTIONAL LIGHTPROBE SH | NONE4.518.00.00.02.30.02.01.5
DIRECTIONAL SHADOWS SCREEN | NONE3.018.00.00.02.80.02.32.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN | NONE3.620.00.00.05.20.02.53.5
DIRECTIONAL VERTEXLIGHT ON | NONE2.816.00.00.02.20.01.81.5
DIRECTIONAL LIGHTPROBE SH VERTEXLIGHT ON | NONE6.318.00.00.02.30.02.01.5
DIRECTIONAL SHADOWS SCREEN VERTEXLIGHT ON | NONE3.018.00.00.02.80.02.32.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN VERTEXLIGHT ON | NONE6.020.00.00.05.20.02.53.5
NONE | NONE2.914.00.00.00.80.01.40.5
NONE | NONE3.815.00.00.00.90.01.11.0
LIGHTPROBE SH | NONE3.815.00.00.00.90.01.11.0
UNITY HDR ON | NONE3.815.00.00.00.50.01.11.0
LIGHTPROBE SH UNITY HDR ON | NONE3.815.00.00.00.50.01.11.0
NONE | NONE2.816.00.00.01.30.01.41.0
LIGHTPROBE SH | NONE4.518.00.00.01.40.01.61.0
UNITY HDR ON | NONE2.816.00.00.01.30.01.41.0
LIGHTPROBE SH UNITY HDR ON | NONE4.518.00.00.01.30.01.61.0

As you can see, the bumped diffuse shader is considerably more expensive than the plain diffuse shader.


Unity Unlit Color Shader

Unlit – Color (1 Variant)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | NONE1.23.00.00.00.20.00.00.0
Unity Unlit Texture Shader

Unlit – Texture (1 Variant)

Vertex ShaderFragment Shader
VariantALSVTALSVT
NONE | NONE1.16.00.00.00.10.00.30.5

The unlit shaders are one of the cheapest shaders. The unlit texture variant more than doubles its performance cost.


Unity Standard Shaders (Source: Unity)

Standard Shader (42 Variants)

Vertex ShaderFragment Shader
VariantALSVTALSVT
DIRECTIONAL | NONE2.222.00.00.07.90.01.42.5
DIRECTIONAL LIGHTPROBE SH | NONE3.022.00.00.010.40.01.64.0
DIRECTIONAL SHADOWS SCREEN | NONE2.422.00.00.08.40.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN | NONE3.022.00.00.011.20.02.14.5
DIRECTIONAL VERTEXLIGHT ON | NONE2.222.00.00.07.90.01.42.5
DIRECTIONAL LIGHTPROBE SH VERTEXLIGHT ON | NONE4.922.00.00.010.40.01.64.0
DIRECTIONAL SHADOWS SCREEN VERTEXLIGHT ON | NONE2.422.00.00.08.40.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN VERTEXLIGHT ON | NONE5.422.00.00.011.20.02.14.5
POINT | NONE2.822.00.00.05.00.02.51.5
DIRECTIONAL | NONE2.320.00.00.04.40.02.51.0
SPOT | NONE3.022.00.00.05.30.02.52.0
POINT COOKIE | NONE2.822.00.00.05.30.02.52.0
DIRECTIONAL COOKIE | NONE2.922.00.00.04.50.02.51.5
SHADOWS DEPTH SPOT | NONE3.022.00.00.06.30.02.52.5
SHADOWS DEPTH SHADOWS SOFT SPOT | NONE3.022.00.00.06.70.02.54.0
DIRECTIONAL SHADOWS SCREEN | NONE2.520.00.00.04.90.03.01.5
DIRECTIONAL COOKIE SHADOWS SCREEN | NONE2.922.00.00.04.90.03.02.0
POINT SHADOWS CUBE | NONE2.822.00.00.05.80.02.52.0
POINT SHADOWS CUBE SHADOWS SOFT | NONE2.822.00.00.06.80.02.53.5
POINT COOKIE SHADOWS CUBE | NONE2.822.00.00.06.10.02.52.5
POINT COOKIE SHADOWS CUBE SHADOWS SOFT | NONE2.822.00.00.07.10.02.54.0
NONE | NONE2.320.00.00.01.00.00.61.0
LIGHTPROBE SH | NONE2.820.00.00.04.00.01.32.5
UNITY HDR ON | NONE2.320.00.00.01.00.00.61.0
LIGHTPROBE SH UNITY HDR ON | NONE2.820.00.00.03.60.01.32.5
DIRECTIONAL | NONE2.422.00.00.03.40.01.42.5
DIRECTIONAL LIGHTPROBE SH | NONE4.322.00.00.03.80.01.62.5
DIRECTIONAL SHADOWS SCREEN | NONE2.422.00.00.08.40.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN | NONE3.022.00.00.011.20.02.14.5
DIRECTIONAL VERTEXLIGHT ON | NONE2.422.00.00.03.40.01.42.5
DIRECTIONAL LIGHTPROBE SH VERTEXLIGHT ON | NONE6.322.00.00.03.80.01.62.5
DIRECTIONAL SHADOWS SCREEN VERTEXLIGHT ON | NONE2.422.00.00.08.40.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN VERTEXLIGHT ON | NONE5.422.00.00.011.20.02.14.5
POINT | NONE3.322.00.00.03.00.02.52.0
DIRECTIONAL | NONE2.520.00.00.02.50.02.51.5
SPOT | NONE3.322.00.00.03.20.02.52.5
POINT COOKIE | NONE3.322.00.00.03.20.02.52.5
DIRECTIONAL COOKIE | NONE3.122.00.00.02.80.02.52.0
SHADOWS DEPTH SPOT | NONE3.322.00.00.02.90.02.52.5
DIRECTIONAL SHADOWS SCREEN | NONE2.520.00.00.04.90.03.01.5
DIRECTIONAL COOKIE SHADOWS SCREEN | NONE2.922.00.00.04.90.03.02.0
POINT SHADOWS CUBE | NONE3.322.00.00.02.50.02.52.0
POINT COOKIE SHADOWS CUBE | NONE3.322.00.00.02.70.02.52.5

Standard Shader – Specular Setup (42 Variants)

Vertex ShaderFragment Shader
VariantALSVTALSVT
DIRECTIONAL | NONE2.222.00.00.07.50.01.42.5
DIRECTIONAL LIGHTPROBE SH | NONE3.022.00.00.010.30.01.64.0
DIRECTIONAL SHADOWS SCREEN | NONE2.422.00.00.08.20.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN | NONE3.022.00.00.011.00.02.14.5
DIRECTIONAL VERTEXLIGHT ON | NONE2.222.00.00.07.50.01.42.5
DIRECTIONAL LIGHTPROBE SH VERTEXLIGHT ON | NONE4.922.00.00.010.30.01.64.0
DIRECTIONAL SHADOWS SCREEN VERTEXLIGHT ON | NONE2.422.00.00.08.20.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN VERTEXLIGHT ON | NONE5.422.00.00.011.00.02.14.5
POINT | NONE2.822.00.00.04.80.02.51.5
DIRECTIONAL | NONE2.320.00.00.04.30.02.51.0
SPOT | NONE3.022.00.00.04.90.02.52.0
POINT COOKIE | NONE2.822.00.00.05.00.02.52.0
DIRECTIONAL COOKIE | NONE2.922.00.00.04.50.02.51.5
SHADOWS DEPTH SPOT | NONE3.022.00.00.06.00.02.52.5
SHADOWS DEPTH SHADOWS SOFT SPOT | NONE3.022.00.00.06.40.02.54.0
DIRECTIONAL SHADOWS SCREEN | NONE2.520.00.00.04.70.03.01.5
DIRECTIONAL COOKIE SHADOWS SCREEN | NONE2.922.00.00.04.70.03.02.0
POINT SHADOWS CUBE | NONE2.822.00.00.05.60.02.52.0
POINT SHADOWS CUBE SHADOWS SOFT | NONE2.822.00.00.06.90.02.53.5
POINT COOKIE SHADOWS CUBE | NONE2.822.00.00.05.90.02.52.5
POINT COOKIE SHADOWS CUBE SHADOWS SOFT | NONE2.822.00.00.07.00.02.54.0
NONE | NONE2.320.00.00.00.90.00.61.0
LIGHTPROBE SH | NONE2.820.00.00.03.80.01.32.5
UNITY HDR ON | NONE2.320.00.00.00.90.00.61.0
LIGHTPROBE SH UNITY HDR ON | NONE2.820.00.00.03.40.01.32.5
DIRECTIONAL | NONE2.422.00.00.03.20.01.42.5
DIRECTIONAL LIGHTPROBE SH | NONE4.322.00.00.03.40.01.62.5
DIRECTIONAL SHADOWS SCREEN | NONE2.422.00.00.08.20.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN | NONE3.022.00.00.011.00.02.14.5
DIRECTIONAL VERTEXLIGHT ON | NONE2.422.00.00.03.20.01.42.5
DIRECTIONAL LIGHTPROBE SH VERTEXLIGHT ON | NONE6.322.00.00.03.40.01.62.5
DIRECTIONAL SHADOWS SCREEN VERTEXLIGHT ON | NONE2.422.00.00.08.20.01.93.0
DIRECTIONAL LIGHTPROBE SH SHADOWS SCREEN VERTEXLIGHT ON | NONE5.422.00.00.011.00.02.14.5
POINT | NONE3.322.00.00.02.80.02.52.0
DIRECTIONAL | NONE2.520.00.00.02.40.02.51.5
SPOT | NONE3.322.00.00.03.00.02.52.5
POINT COOKIE | NONE3.322.00.00.03.10.02.52.5
DIRECTIONAL COOKIE | NONE3.122.00.00.02.60.02.52.0
SHADOWS DEPTH SPOT | NONE3.322.00.00.02.80.02.52.5
DIRECTIONAL SHADOWS SCREEN | NONE2.520.00.00.04.70.03.01.5
DIRECTIONAL COOKIE SHADOWS SCREEN | NONE2.922.00.00.04.70.03.02.0
POINT SHADOWS CUBE | NONE3.322.00.00.02.30.02.52.0
POINT COOKIE SHADOWS\_CUBE | NONE3.322.00.00.02.50.02.52.5

We all knew standard shaders are extremely expensive.

From the numbers, it looks as if the specular setup is slightly cheaper than the metallic version.

Get the Sortable List

That was a ton of numbers!

These metrics will help you balance the visual quality you want to achieve in your game with your performance requirements.

The lower the GPU cycles your shader takes, the faster it will run.

(I wish we could always run the standard shader… but as you see, its cost is prohibitive for mobile platforms)

To get a free sortable spreadsheet that you can save and keep at hand for quick reference in your projects, just subscribe to the performance newsletter with your e-mail below.

Stop guessing. Start doing.

Let me send you your free shader cost spreadsheet
Give it to me!

It’s super handy because you can filter the list by the shaders you want to compare.

Take care,

~Ruben (The Gamedev Guru)

The Gamedev Guru Logo

Performance Labs SL
Paseo de la Castellana 194, Ground Floor B
28046 Madrid, Spain

This website is not sponsored by or affiliated with Facebook, Unity Technologies, Gamedev.net or Gamasutra.

The content you find here is based on my own opinions. Use this information at your own risk.
Some icons provided by Icons8