Search Unity

[Android] Is it worth to upgrade to OpenGL ES 3.0?

Discussion in 'Android' started by bart_the_13th, Jun 11, 2018.

  1. bart_the_13th

    bart_the_13th

    Joined:
    Jan 16, 2012
    Posts:
    498
    My game received some feedback about graphics which needs more detailing. Even as of now my shader is sampling 4 textures in one pass to thirds the draw calls, and that's the maximum number of sampling I can get without having to upgrade to Open GL ES 3.0.
    And now I'd like to add more details to the geometry, but in order to that I need to sample more texture in one pass(to avoid adding more draw calls), and in order to that I need to switch to open gl es 3.0 (or I will have the "not enough interpolators" shader error)...
    So the question is, is it worth it? Upgrading open gl version means less device supported but how many device is actually still using open gles 2.0?

    [Edit]
    Should this be posted on Android subforum? If it is, then please, admin, move this thread there :)
     
    dan_ginovker likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Noisecrime and bart_the_13th like this.
  3. bart_the_13th

    bart_the_13th

    Joined:
    Jan 16, 2012
    Posts:
    498
  4. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    You're reading it wrong :)
    It's the data for the last week.
    This just means that the last week was very different from the first week of May.
     
  6. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    just for information.

    OpenGL 3 is buggy in MANY Sony devices and others.
    You can expect a frame drop of around 30 FPS. Yes, no kidding.

    For example;
    Sony Xperia
    ARMv7 VFPv3 Neon
    Adreno 530
    OpenGL ES 3.1 v@145.0

    Frame rate of sample project
    32 Fps,

    Samsung Galaxy (Same specs)
    Sony Xperia
    ARMv7 VFPv3 Neon
    Adreno 530
    OpenGL ES 3.1 v@145.0

    Frame rate of sample project
    60Fps,


    Now, if I change the graphic setting in unity for OpenGL2.
    both phones go smoothly 60 Fps.
     
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    I think you misunderstand what's happening there a bit :)
    OpenGL ES 2 will likely use different (read: simpler) shaders.
    Same specs - I wouldn't be so sure about that. GPU clock frequency, for example, is controlled by the OS based on manufacturer settings, which might be different between different devices even for the same manufacturer.
    For example, is the resolution the same on both devices you're testing this on?
     
  8. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    Galaxy have better resolution (around 2k) so it is supposed to be slower against Sony full HD, both
    using same adreno 520. (Checking specs using Snapdragon profiler)

    Also in all test we set Resolution by script 1280, 720. (Checked the surface and bin in Profiler)
    Tested with 6 phones. (Sony, Google, Galaxy, Sharp and others), All devices have OpenGL 3.0+
    Using a simple shader output only color.
    Setting Unity to Open GL3 then Open GL2 we have a hit of around 30 fps down in certain devices.
    Setting Unity to Open GL2 then Open GL3, all devices are 60 fps.

    Even some older devices with Snapdragon 805 and unity set to OpenGL3 (Sony is Snapdragon 820) can go 60 fps with no problem, but some new devices more powerful will be at 30 Fps or less.
    Worst case is Sony Devices with Snapdragon 820 OpenGL 3.1. (Super frame hit).

    Im 99% sure is a problem with Phone Drivers and Unity OpenGL 3.0.

    This person also have the same problem,
    https://qiita.com/MARQUE/items/1bb48e8c8823014ba2db

    Aiming for all android user is better to set Open GL 2.
    I will test with more devices today.
     
    triangle154 likes this.
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    There's no such GPU :)

    I'm pretty sure you're wrong :)

    Which Unity version are you using? What shaders?
     
  10. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    Sorry, was Adreno 530.

    Im using;
    Unity 2017.3.1p4
    The blog who have the SAME problem with unity and Sony devices is using 5.4.

    We can't move to Unity 2018 as it have a bug with reading native depth buffer to rgb (confirmed by Unity, we have Premium Support).

    https://www.gsmarena.com/sony_xperia_x_performance-7949.php

    Only one shader.


    Shader Unlit.
    Code (CSharp):
    1. Shader "PF/Unlit"
    2. {
    3.     Properties
    4.     {
    5.         _Color ("Color", Color) = (0,0,0,0)
    6.     }
    7.     SubShader
    8.     {
    9.         Tags { "RenderType"="Opaque" }
    10.  
    11.         Pass
    12.         {
    13.             CGPROGRAM
    14.             #pragma vertex vert
    15.             #pragma fragment frag
    16.  
    17.             struct appdata
    18.             {
    19.                 half4 vertex : POSITION;
    20.             };
    21.  
    22.             struct v2f
    23.             {
    24.                 half4 vertex : SV_POSITION;
    25.             };
    26.             half4 _Color;
    27.            
    28.             v2f vert (appdata v)
    29.             {
    30.                 v2f o;
    31.                 o.vertex = UnityObjectToClipPos(v.vertex);
    32.                 return o;
    33.             }
    34.            
    35.             fixed4 frag (v2f i) : SV_Target
    36.             {
    37.                 half4 col = _Color;
    38.                 return col;
    39.             }
    40.             ENDCG
    41.         }
    42.     }
    43. }
     
  11. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    Found more inconsistency.

    Google Nexus 6.
    Unity Settings.
    OpenGL 3.0 -> read Depth Buffer, no good.
    OpenGL 2.0 -> read Depth Buffer, ok!

    For what I can see the devices that show inconsistency are all OpenGL 3.1.
     
  12. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Can you submit this a a bug report (ES3 vs ES2 performance)? I'd really like to take a look on that.
     
  13. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    Sure, I did ask it before yesterday direct to unity and the answer we had is driver issues on OpenGL 3.0.

    Idk if its allowed to post direct unity answer but was basically;
    OpenGl 3.0 driver and an issue with`glClientWaitSync` .

    So imo is best to go opengl 2.0 to get more android compatible.
     
  14. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Well, it might be. However, the problem should be there only on old drivers. Do you have the full driver versions used on both devices?
     
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Is there a way to force a device that supports OpenGL ES 3.0 to use ES 2.0? (without removing ES 3.0 from the build entirely)

    We too are running into issues with buggy device drivers, but we don't want to make an ES 2.0 only build. But we'd like to have an option in game to force it into ES 2.0 mode, to give more options to people that are having problems with the game with the ES 3.0 version.
     
  16. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    @AcidArrow Not at the moment. And it's quite complicated to provide that from the architectural point of view.
    We're discussing the possibilities for this internally, as there have been requests for this functionality.
     
    AcidArrow likes this.
  17. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    I thought this was the case but thanks for confirming it.

    Nice to know it is being worked on (or at least, discussed).
     
  18. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    Oh I completely forgot about this. We have many issues with cache server now.

    The solution Unity gave us was reporting to them all the devices we found with driver problem and they will add it at the next release. The plan is to release using opengl 2.0 as our target device are 3-4 year old but for that we must fix some minor issues (and gain FPS).

    If is a big game I recommend paying for unity support instead of using the forum.
     
  19. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    By now (May '19), Open GL ES 2 distribution has dropped to 1/5. I'm also guessing that an even smaller share of Android 5+ (Lollipop or upwards) phones still requires version 2, and that owners of such phones are less likely to play games. So we decided to target Lollipop+ and Open GL ES 3+.
     
    JamesArndt and Yury-Habets like this.
  20. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    I just saw the reply, one year later :D
    I read it correctly. What I meant is that since the graph posted above dated may 2018(see few posts above) and when I saw the updated graph on the website in October only 5 months had passed but the amount of users supporting only GL ES 2.0 had decreased a lot, 15% less.
    Which is an enormous amount considering the huge number of Android devices around.
     
  21. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    I'm not sure, how Google gathers stats for this page and what is considered an active device :)
    It can be "any device that visited Google Play Store at least once in this week" or something similar.
     
  22. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Keep in mind that the absolute # of devices supporting only ES2 is probably not increasing strongly, as most new devices support 3+.
     
    00christian00 likes this.
  23. majidarif

    majidarif

    Joined:
    Sep 11, 2015
    Posts:
    26
    the year 2020, and there is probably no point in using ES2 for android/ios, but I just wanted to be sure. I'm thinking of using linear colorsapce and ES3 for my 3d mobile project. Any thoughts?
     
    waltran likes this.
  24. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    well, every time i try to release for opengl 3 i get tons of complains about how the game stopped working. So I guess many devices still stuck on 2.0
     
    mbhagat likes this.
  25. FranFndz

    FranFndz

    Joined:
    Sep 20, 2018
    Posts:
    178
    some of our games are already opengl 3.
    there is random crash in some older devices, around 2015... but well, we need to move forward
     
    mbhagat likes this.
  26. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    And you can blacklist buggy devices from Google Play console. That way you can avoid unneeded support messages and one star reviews.
     
    JBR-games likes this.
  27. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    is there a way to find out the opengl market share? the google dashboard one is not updated any more and the last data is from march 2019
     
  28. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Interesting, thanks for the tip! It would make sense share such (black)lists of non-compatible devices, since they're probably affecting many games. Do you know of some widely-used culprits (or a way of finding them before release)?
     
  29. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    Unfortunately there isn't any straight answer for devices that should be blocked. That is because there are many reasons to block devices, e.g. shader issues (that might only happen with certain renderer), performance issues, crash issues, aspect ratio issues ...
     
  30. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    It's updated.
    https://developer.android.com/about/dashboards

    For the record,
    May 7, 2019: 21.1%
    April 10, 2020: 14.8%
     
    WendelinReich likes this.
  31. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Thanks. Finally they updated it. Was updated yesterday again. 14.5%
    Amazing it's still so high. I'm trying to enable ASTC compression and it seems half of the market still doesn't support that API level.
     
  32. WaqasGameDev

    WaqasGameDev

    Joined:
    Apr 17, 2020
    Posts:
    118
    Hi, I am just confused. If I check Android OpenGL ES Distribution chart, it shows the following distribution

    OpenGL ES Version-----------Distribution

    GL 1.1 only-------------------------0.0%

    GL 2.0--------------------------------14.1%

    GL 3.0-----------------------------------18.1%

    GL 3.1------------------------------------9.6%

    GL 3.2----------------------------------58.2%

    Here it shows that GL 2.0 supports 14% devices and Also Android website says

    Android supports several versions of the OpenGL ES API:

    OpenGL ES 1.0 and 1.1 - This API specification is supported by Android 1.0 and higher.

    OpenGL ES 2.0 - This API specification is supported by Android 2.2 (API level 8) and higher.

    OpenGL ES 3.0 - This API specification is supported by Android 4.3 (API level 18) and higher.

    OpenGL ES 3.1 - This API specification is supported by Android 5.0 (API level 21) and higher.

    Here it tells GL 2.0 is equivalent to API level 8 or higher.

    And If I check API Distribution chart from Android Studio it tells me 99.8% devices support API 16 and above. If it is so, why

    https://developer.android.com/about/dashboards

    shows that GL 2.0 supports 14% of devices. I am totally confused here. Can any one explain? Thanks.
     
  33. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    It means that 14% of devices only support GL 2.0 and lower. All devices that support 3.0 support 2.0.
     
  34. AlexiFullerman

    AlexiFullerman

    Joined:
    May 1, 2020
    Posts:
    6
    I had a huge drop on a 3d driving game, tried dividing terrain, using occlusion, you know the usual. Saw your note on GL3 reduced FPS, switched back and now I am hitting 40fps, thankyou thankyou thankyou!
     
    entropicjoey1 likes this.