This simple shader makes my game drop from a steady 60 to 30fps :
I thought using an opaque dither gradient instead of a smooth transparent gradient would improve performance but I was apparently wrong !
Am I using it the wrong way ?
you are setting the dither output to the alpha clip value, but I am not certain why you would want to change that rather than just multiplying/masking your gradient alpha by the dither output. Could you also check the settings on the pbr master node and make sure its set to be opaque and not transparent. What are you targeting as well?
I set the dither output to the alpha clip because that’s what the documentation recommands :
https://docs.unity3d.com/Packages/com.unity.shadergraph@7.3/manual/Dither-Node.html
The PBR master node is set to opaque, and the target platform is Android.
I wanted to convert this :

To this :

To improve performance, but it makes it far worse, so I’ll just stick with the transparent one ! (and it looks far better)
However I don’t know and I don’t think it’s a normal behaviour, opaque shaders should be faster right ?
Doh! My bad. ![]()
The general rule of thumb is certainly that opaque materials are easier to draw than transparent ones unless the overhead for “faking” the transparency gets too large. If you are familiar at all with profiling shaders, it would be worth seeing why it seems so much more expensive. I am not too familiar with mobile performance of different shader operations however, so someone with more experience may have a better answer for you.
“Opaque” shaders are more efficient, but only if they’re fully opaque. Any alpha testing (what the alpha threshold does) actually makes them much, much slower. A single alpha tested object compared to a single transparent object, I’d guess the alpha tested object is 2-3 times slower to render, and also makes everything else that renders after it slower too. They’re pretty bad for mobile.
If you really want to make the above faster, don’t use transparency. Instead lerp the albedo to black and emission to the fog color with the inverse of the value you were using as the alpha. You may need to use the Specular work flow and lerp the Specular color to black as well.
Thanks a lot for your answer ! I didn’t know that.
I can’t fade to a single color since the skybox looks like this (I disabled it in the screenshots above) :

Depending on how you’re doing your skybox, you could probably reproduce the skybox in the object’s shader using the screen position and/or view direction so you can fade to the exact same pattern while keeping things opaque.
Or just leave it transparent and don’t worry about it too much.