- Home /
Transparent shader with alpha 1. Still a performance hit?
From what I could gather there is a performance issue, on non tegra mobile devices, with alpha blending (better then cutout but still an issue). Does the hit in performance happen at the moment your shader is defined as transparent and set to blend even if your alpha is 1 (in truth making the object opaque)? Does "blend One One" mode also gives a hit to performance?
Thanks!
Answer by electricsauce · Jun 01, 2013 at 03:17 PM
My understanding is that transparent shaders have to be rendered after all of the other shaders and then sorted by it's zbuffer depth. Since you would still be doing this sorting after everything else is rendered you would still have the performance impact of a semi-transparent shader. Use a diffuse shader if you can get away with it.
Thank you for the answer. This is an issue which is related to GUI. I posted the whole story here: http://forum.unity3d.com/threads/184463-$$anonymous$$obile-Non-rectangular-GUI-Geo-or-Alpha-blend Would it be better performance wise, to use a ~500 tris mesh with a regular unlit opaque shader ins$$anonymous$$d of a ~13 tris mesh with alpha blended shader, when we also take into account that it would take ~10% of the screen?
I'm assu$$anonymous$$g that it's for a menu that's used when the game is paused(like weapon selection in crysis). That being said, performance shouldn't be too bad with the 3d mesh version of the buttons and you have the added advantage of the look of 3d buttons, but it will be harder to get the rounded look on the edges of the buttons without making the mesh extremely high poly.
To be sure, you'll probably have to implement a test version of each on your lowest perfor$$anonymous$$g target device to see how well they run.
Yes that the conclusion we arrive to. Thanks for the help.
Answer by Eric5h5 · Jun 01, 2013 at 05:30 PM
A transparent shader is always a transparent shader; what you set the alpha to is irrelevant.
Your answer
Follow this Question
Related Questions
Reflect Fresnel Mobile VR 0 Answers
Mobile: Diffuse Cutout shader with NormalMap. Very bad performance. 0 Answers
Mobile blur shader 0 Answers
Image Effect problem on mobile & optimization 0 Answers
Setting Material Textures at runtime for the rest of the game 0 Answers