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. Dismiss Notice

Anti aliasing causes graphical corruption

Discussion in 'Android' started by Freezy, Jul 23, 2013.

  1. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    234
    As soon as the AA setting is changed from the standard quality setting (either by changing to another quality setting with a different AA setting or by changing the setting AA directly), the scene will corrupt GUI and some 3D objects.
    I've already sent a bugreport and they were able to reproduce this problem.

    I was hoping they would have fixed it in 4.2, but unfortunatly they have not. It started happening around 4.1.5
    Does anyone know of a workaround for this behaviour?

    Not allowing the change of AA settings would limit high end devices from displaying higher quality or lower devices from increasing performance by disabling this setting.

    p.s. works fine within the editor, errors occur only when running on a device.
    I have tested multiple devices with different versions of android and finally found this to be the culprit of some parts of the scene dissapearing or getting corrupted.

    Try this in an android project

    Code (csharp):
    1.        
    2.  void OnGUI() {
    3.       int AA = 0;
    4.         switch(QualitySettings.antiAliasing) {
    5.             default:
    6.             case 0: AA = 0; break;
    7.             case 2: AA = 1; break;
    8.             case 4: AA = 2; break;
    9.             case 8: AA = 3; break;
    10.         }
    11.  
    12.  
    13.         int setAA = GUILayout.SelectionGrid(AA, AAopt, 4, gridButtons, btnHeight);
    14.         if(AA != setAA) {
    15.             switch(setAA) {
    16.                 case 0: QualitySettings.antiAliasing = 0; break;
    17.                 case 1: QualitySettings.antiAliasing = 2; break;
    18.                 case 2: QualitySettings.antiAliasing = 4; break;
    19.                 case 3: QualitySettings.antiAliasing = 8; break;
    20.             }
    21.         }
    22. }
    23.  
     
    Last edited: Jul 29, 2013
  2. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    286
    I can confirm this.

    I skipped updates after Unity 4.1.3f4 before jumping to 4.2, so that's the latest version I know didn't have the bug. Forcing AA on in the developer options works fine (unsurprisingly), so it's not something failing deeper in the pipeline than Unity.
     
  3. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    can i have bug case number please? Just drop it here (6 digits)
     
  4. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    234
    Case 548427
    they replied that the bug was reproduced and are passing it along.

    I guess for now the only thing to do is just using a single setting or try to trick unity into loading with a different default setting and require a restart of the app.
     
  5. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422

    Did you ever have any luck with this?
     
  6. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    234
    Well there was some differences between several versions. Most of the corruption I noticed was later gone, but the fonts were one of those items that got easily corrupted, it would be nice if we could manually purge the font buffer, which might just force it to pop back to a proper state.

    I havent tested this in a while though, so it might be resolved already with 4.5
     
  7. mathiassoeholm

    mathiassoeholm

    Joined:
    Jul 20, 2010
    Posts:
    104
    I'm having similar problems in Unity 4.5.2f1.

    The screen turns completely black after changing AA settings during runtime.
    I tested it on a Nexus 5 with Android 4.4.4 and a Samsung Galaxy S3 with Android 4.1.1.

    It works fine in the editor and all iOS devices so far.

    At one point the screen was visible though, and all dynamic fonts were rendered as solid rectangles.
    Some textures had been swapped and OnGUI buttons were using a random texture.