Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Mobile, Non-rectangular GUI, Geo or Alpha blend

Discussion in 'Editor & General Support' started by Davain, Jun 1, 2013.

  1. Davain


    Dec 20, 2009
    Hi all,

    First I want to clear that this question is posted in the general forum as it involves shaders, mobile development and GUI. Please forgive me if still should have posted in another place.

    For the last month I am in a team developing our first game for the mobile platform (iOS and Android). At the moment we started implementing the final GUI for the game and came to a few obstacles we are unsure of the best way to overcome.
    This is the widget in question. Each color represent a separate button. The widget takes ~10% of the screen.
    The first problem is the non-rectangular shape of the GUI and as far as I could understand it would be nearly impossible to implement with the standard GUI systems. Am I wrong here? If you take the above, add to it the idea of slight transformations in 3D while interacted with and maybe we would be better off making it a 3D object all together? Are there any problems with a 3D GUI that need to be taken into account?
    Secondly there is the question of alpha blending. 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). This leads to an idea of making this widget a high poly object without the use of any transparent shader on it. What would be better performance wise, a ~13 tris mesh with alpha blended shader or a ~500 tris mesh with a regular unlit opaque shader, when we also take into account that it would take ~10% of the screen?
    In continuation of the alpha blend 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)? Not really needed for this GUI but just for general knowledge, does "blend One One" mode also gives a hit to performance?

    Any help would be great. Thanks!
    Last edited: Jun 1, 2013