Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

QualitySettings still broken on Android

Discussion in 'Android' started by Devil_Inside, May 28, 2014.

  1. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Hi
    I was waiting for 4.5 in hope that it'll fix the texture corruption during quality level change on Android. I was really happy to see it in the changelog. Unfortunately the issue is still there.
    I also want to ask about a few other related issues, maybe there is a workaround.
    1. The method QualitySettings.SetQualityLevel() has applyExpensiveChanges as a second parameter. Passing "false" as the second parameter should avoid changing AntiAliasing during this function call. Unfortunately that is not the case on Android - AntiAliasing is still being changed.
    2. Before 4.5, changing AntiAliasing through SetQualityLevel during gameplay would corrupt some or all textures. Font characters would turn into white rectangles, the rest could turn black. After the 4.5 update, changin AntiAliasing during gameplay would turn the entire screen black. The game would still be running, music would play, the input would work, but the screen would be black.
    3. On an older Android device, changing Shadow Resolution during gameplay (when shadows are visible) causes a crash. As this crash doesn't happen on a small scene with few textures and objects, I think it is somehow related to limited RAM. What seems weird to me is that on a heavy scene, this change doesn't cause a crash if AntiAliasing is being changed as well in the same SetQualityLevel() call.

    I've been able to reproduce issues 1 and 2 on: HTC One Mini, HTC Desire HD, ASUS Transformer Pad TF300.
    Issue 3 happened only on the HTC Desire HD.
    I've submitted a bug report, Case number: 610150
     
  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    I also have this issue, reproduced on my Galaxy Note 10.1.

    Unity really needs to fix this - it's a total show stopper for releasing a title on Android.

    While the issue is different now (previously we'd just experience graphics/texture corruption) it's been an issue since at least 4.2.

    Seriously Unity, how do you expect us to handle devices with different performance characteristics when we can not change the quality settings at runtime?

    Do you take your mobile platform support seriously?

    There is no point in continually adding new features to Unity when the existing core features like this do not work.

    I have reported this bug (583594) on the 1/1/2014, but it has been closed but obviously not fixed.

    Very disappointed.
     
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    it was closed as *duplicate* of another bug, no worries
    http://issuetracker.unity3d.com/issues/anti-aliasing-does-not-work-on-android-devices
    on the other hand all internal discussion is lost from public issue tracker.
    So, about switching AA - it is very funny combo of android issues and drivers caveats. To make it short - we need to pick up 24bit Default Framebuffer on "newer" devices, because otherwise compositor will be using FBO alpha to blend view with others (most of the time - with black background - if you search the forum you will find lots of whining about it ;-)). Now, some IHV do not provide 24bit AA-enabled EGL config (which is weird, because nobody actually have 24bit RTs - it is just 32bit with alpha ignored). That should explain it i hope
     
  4. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Hi Alexey,

    That other bug (http://issuetracker.unity3d.com/issues/anti-aliasing-does-not-work-on-android-devices) was also submitted by me but I believe these are separate issues.

    That issue is about AA not working at all on some devices as per:

    But this issue is about graphics corruption when switching quality settings at run time (4.2 4.3), which now (in 4.5) results in a total black screen (not graphics corruption). Everything appears to be working in the background but nothing on the display. I can't see how this is related to the 24bit framebuffer AA issue.

    But while we're here discussing the 24bit framebuffer issue, I'm having difficulty believing that there is not a workable solution for having AA working on mali 400 GPU with Android - other engines seem to do it without issue. I never had an issue with 4.2 with AA working (perhaps I just never encountered the issue).

    I have just found that it is possible to get AA to work on these devices in 4.5. If I check "Use 32-bit display buffer" then I get no AA. If I uncheck it I get AA (awesome) but now I have colour banding. So it seems I get to choose between the two evils, AA with colour banding or no AA with nice gradients.

    Is that to be expected?
     
  5. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Regarding lack of anti aliasing on mali 400 - ARM actually released an updated version of the mali 400 driver which supports 24bit color buffer and AA. Of course many of the mali 400 devices out there will never see an update of their driver :-(

    As for the black screen on switching Quality level. Do you see any error messages in the log? All projects I tested worked fine on 4.5. Maybe your project hits a corner case somewhere - did you file a bug on 4.5?
     
  6. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Hey Martin, thanks for your input!

    Unfortunately no logcat output related to this issue.

    I'm aware of the driver update - though like you say, existing devices will never see this update (so it's somewhat moot :( ) I suppose I'm just having a whinge and desire something that can't be resolved. But given that our game (over a year of solid development) used to look gorgeous on Android now looks sub par on all tablets running the mali 400 GPU (that's a lot of devices) is very disappointing and frustrating.

    I understand some were having issues with the compositor using FBO alpha but I never suffered this issue - I'd be interested in which devices suffer this issue and if some heuristics can be employed to choose the best framebuffer for the device. If this FBO alpha issue is only present on some high density/small screen devices then I see no issue using the current framebuffer implementation on those devices since AA is not such an issue (in fact is often hard to discern the benefits of AA on them) but for lower density devices (tablets, etc) if this FBO alpha issue is less prevalent (I've never seen it on my Note 10.1) then for these devices use the 32bit framebuffer configuration to allow AA.

    A quick google search suggest at least the Nexus 4 and S3 minis have this issue (both high density displays).

    Even if Unity doesn't want to make this the default behaviour it would be great if they exposed an API for us to do this our selves (unless there is already some way that I don't know about).

    One thing that stands out to me is that AA does work when using the 24bit display buffer but does not work when using the 32bit display buffer - this seems to contradict Unity's conclusion that the issue is with a 24bit display buffer (I could just be missing something here).


    Anyway sorry Devil_Inside for hijacking your thread with this issue.

    I have not yet filed a bug regarding the black screen quality settings issues - I've only just tested this on 4.5 and want to research and gather as much information as I can before filing the bug to assist with getting it fixed. I filed bug report for this for version 4.2 4.3 where it was causing graphics corruption, but it was closed with no feedback (which Alexey said was closed for being a duplicate of another bug report I raised about the AA - though I don't see the relationship between the two bugs).
     
    Last edited: May 31, 2014
  7. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    I didn't see any errors. I've submitted the bug, as stated in the OP (Case number: 610150). It has a simple scene with UI buttons to change quality at runtime. Also, as I said, it happens on all Android devices I've tested on, old and new: HTC One Mini, HTC Desire HD, ASUS Transformer Pad TF300.
    P.S. Also, even though the game goes to black screen, the new changes are actually applied, and the game is still running. I can quit if I remember where the quit button is on the screen and if I restart the game, the new quality level is there and is working.
     
    Last edited: May 31, 2014
  8. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    @Devil_Inside, I'm sorry, I didn't read the whole thread just larkus response. Thank you for the case report!

    @larku, I think you are confusing 16 and 24 bit buffers? 16bit probably works but 24bit does not. For mali I think most issues with the compositor was related to external screen rendering.
     
  9. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Ah, most likely - I am somewhat ignorant of the mechanics and options for the display buffers. I assumed that unchecking the "Use 32-bit Display Buffer" would use a 24 bit buffer, but it seems it'll use a 16bit buffer. Where does the 24bit frame buffer come into this? Is the 32-bit display buffer 24bit + alpha or something? (sorry for my ignorance).

    External screen rendering? as in a secondary display? surely this is a very small use case no? Does this mean that the primary use case (mobile phone and tablet internal display) suffers this issue to eliminate the issue for use with an external display (which must be a very small percentage of use cases)?
     
  10. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    On android selecting 32bit display buffer will result in an EGL configuration with 24bit color buffer if supported. In earlier versions of Unity we dropped to 24bit buffer on a case by case bases but in the end there were just too many devices being buggy when using a 32bit display buffer. This issue not only affects mali, it was even worse on adreno and some pvr devices. I don't remember seeing the issue on tegra tho. The reason we are talking about mali400 specifically is because that driver does not support anti aliasing when running a 24bit configuration - at least not the driver installed on most mali 400 devices.

    It's also about deterministic behavior, I would rather have all devices ignore the display buffer alpha channel than some or most doing it.

    Still, we haven't completely given up on this problem yet. Not only because of the AA issue but we would like to have alpha channel in screen framebuffer.
     
  11. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Excellent :)

    The last official word I had from Unity was: "So this issue will not be fixed." which was obviously not what I was hoping for.
     
  12. LeoCeballos

    LeoCeballos

    Joined:
    Mar 16, 2011
    Posts:
    25
    Ah, I am having the same problem as Devil Inside's point #2. Changing quality settings works (as in, the change is made and remembered) but the screen goes black. All controls remain responsive, and thankfully I can easily quit the app (because of the WP8 version; MS requires that I set the back button to eventually quit!).

    Once I load it back up, the quality settings are at the correct (new) value. Very annoying as my game is already live and I just had a customer write about it. I fear I will have to add a dialogue and say that changing settings requires a quit, but that feels very unpolished. I'd like to avoid it if at all possible!

    Tested on a Galaxy S3 and S5, Nexus 7 2012 and EVGA Tegra Note. Same exact results.
     
  13. doppelmonster

    doppelmonster

    Joined:
    Apr 11, 2013
    Posts:
    19
    I have the same problem as Devil Inside's point #2 on a google nexus s and Unity 4.5.4. I am facing the same situation as LeoCeballos having to add a quit dialogue as a "feature update" to my live game....

    Any news?
     
    Last edited: Sep 18, 2014
  14. mamoniem

    mamoniem

    Joined:
    Jul 23, 2012
    Posts:
    174
    probably you are using some mouse events with android build (to emulate touch in the easy way). putting a small image (32*32) for the mouse icon in the build settings, will stop showing the blue/black screen !
    That's at least what happened in my case.
     
  15. doppelmonster

    doppelmonster

    Joined:
    Apr 11, 2013
    Posts:
    19
    hi mamoniem,
    i actually use mouse events. But your fix doesent work for me. I attached a picture to the mouse but the screen still turns black on a quality settings change with different AA settings.

    Are you sure this solved the problem for you or did you also change something else?
     
  16. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Hi guys, I'm having the same issue, when I call QualitySettings.SetQualityLevel() and switch to a quality level that has AA enabled the screen goes black, same thing when switching from an AA quality level to one without AA. This happens on a 2012 Nexus 7 tablet. Turning off AA on all quality settings removes this problem and the quality settings can be changed in-game without any problems. This only happens on Android. I've tried adding a mouse cursor but that makes no difference, same thing with changing the 32bit and 24bit settings in player settings.
     
  17. mamoniem

    mamoniem

    Joined:
    Jul 23, 2012
    Posts:
    174
    This was the only Change I made, and the game become perfect!
     
  18. NateJC

    NateJC

    Joined:
    Apr 10, 2012
    Posts:
    58
    I am also having this very frustrating issue. I have "Use 32-bit Display buffer" and "Use 24-bit Depth Buffer" both checked, but it didn't help. Any other solutions? =/
     
  19. AbandonedCart

    AbandonedCart

    Joined:
    Mar 4, 2014
    Posts:
    72
    To throw my hat in the ring, here is a general overview of what I have found:

    I imported the original November version of the Oculus mobile SDK and used a rendertexture for my gui.
    Set graphics level to force 2.0 and everything was beautiful. Only 24-bit was checked. AA is disabled.
    Imported the update (December) version of the Oculus mobile SDK that is targeted to 3.0 and suddenly my rendertexture is pitch black and since it's a fullscreen overlay, all that is left is the GUI. It seems the update brought some of the issues in this thread with it that were somehow sidestepped by the old version.
    Switched my graphics level to automatic and the view is back but my character looks like Frankenstein (artifacts and random pixel garbage). I am running the tests on a Note 4, so there is little speculation about it being inadequate.
    I am now trying with 32-bit also enabled. Ironically, Oculus documents 24-bit as being useless (despite is stopping a banding issue I was having before using it) but the Unity tooltip warns of performance loss with 32-bit, which seems like it would be the opposite of what I want with a game I already consider "heavy" for mobile.

    If anything, it seems like the use and configuration of these options should be better explained. I am not changing anything at runtime and with one checkbox my game can be rendered (no pun intended) useless. For someone that is fairly new to Unity and just invested thousands in it, that can be extremely frustrating if you aren't experienced enough to know what just happened when you are staring at your brand new... ga... no... black screen.

    I am only speculating, but I think there may be a need for AA and possibly VSync in the game, but Oculus specifically states that these should be disabled.
     
    Last edited: Dec 23, 2014