What is the fastest transparency shader on mobile?

Hello!

I want to create simple blob shadows with a quad using a texture with alpha blending. Its important to control the alpha value of the shader to slowly fade out the quad.

The “Standard” shader does the job (set to “Fade” and I can control the alpha value via Albedo color) but as you know its not the fastest on Mobile.

Unity has 4 mobile shaders that support transparency (Mobile/Particles/Alpha blended i.e.) but none of these allow me to MODIFY the alpha value via code.

Does anyone know what is the fastest Unity shader on mobile that allows control over the alpha value?

Thanks!

The fastest shader would be one you write yourself. There isn’t really a perfect shader for use as a blob shadow included with Unity.

However the Particles / Standard Unlit shader is a good option if you need a basic transparent shader that allows you to modify the opacity from script. Set the Rendering Mode to Fade, and don’t enable any of the options, and it’s close to as cheap of a shader as you can get. Just set the _Color from script to adjust the opacity. The Mobile / Particles / Alpha Blended is cheaper, but that’s because it doesn’t let you set a color on the material.

Both shaders make use of the vertex color though, which you don’t need. So neither is truly the “fastest”.

1 Like

Thanks for your reply bgolus!

I have do admit I was not brave enough to delve into writing my own shaders. Maybe I will search a good tutorial in the next weeks.

I tried the particles/Standard Unlit shader and indeed it fulfills my needs. Since it has less “PBR properties” I guess its also faster than the “Standard” shader I have used before.

Thanks!

The non-particle Standard shader does a lot of lighting calculations that the Particle / Standard Unlit does not. So yes, the Particle / Standard Unlit is faster.