Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Nexus 4 GUI sometimes renders font incorrectly and App Crashes on Quit

Discussion in 'Immediate Mode GUI (IMGUI)' started by Kybernetik, Jul 17, 2013.

  1. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,579
    Hi everyone.

    I posted on Unity Answers a few days ago and I'm still having the same problem.

    http://answers.unity3d.com/questions/493248/sometimes-the-gui-selectively-doesnt-render-some-l.html

    tl;dr
    Take a look at the two pictures in the link. They are the first and second time I opened the Options menu. Notice how the light blue fill is missing from most of the letters in the second image.

    Since then, I've changed the menu system to use different scenes as explained in my previous post. The bug no longer occurs in the menus, but it still occurs in the game. The first time I play a level, everything is fine. But once I finish a level and play again, the text in the HUD starts screwing up in a similar manner to what I showed previously, except that instead of not rendering specific characters, it seems to be rendering the wrong places on the font texture for each of them.

    Here are some screenshots. The first, second and third time I finished a level. This is with my outlining code removed so it only renders the base font.

    $Normal.png $Broken 1.png $Broken 2.png

    Everything I listed under "Notes on the Bug" in my previous post still applies.

    While nothing appears in the log when the bug itself occurs, when the App starts up, the following log message appears many times (like 30+ in a row).
    Tag: Adreno200-EGL
    Text: <eglGetConfigAttrib:491>: EGL_BAD_ATTRIBUTE
    This still happens if I build the project with only a single empty scene containing a camera, so I suspect it is something between Unity and my Nexus 4 rather than anything to do with my use of Unity.

    I tried googling parts of the above message and found someone claiming it had something to do with shaders, but I tried replacing all of the shaders in my game with unity default shaders and the message still appeared (and my bug still happened).

    Also, about 1 in 10 times that I close my game, it crashes the entire phone and I have to hold the power button to turn it off. It simply freezes somewhere between the last frame Unity rendered, a black screen and transitioning back into the launcher.

    Does anyone have any ideas what might be causing or how to fix these problems?
     
  2. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Well, I'm everything but an Unity expert (yet :) ) but the random phone crashes are interesting.
    From my experience with programming in general, when runtime issues that don't happen all the time but randomly occur, it's always good to check how you use your threads. Maybe race-conditions are the problem.

    Not sure in your case, but maybe worth looking into.
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,579
    Unity doesn't use threads for any of its stuff and I'm not using any in my code.

    Good idea though.
     
  4. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Have you access to try it on other Android-Smartphones?
    If it only happens on your Nexus 4 it might be a bug within that version of Android or a messed up installation rather than your game.
     
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,579
    Neither the crash nor the GUI bug happen on my brothers S3 and I should be able to test on my other brother's Galaxy Nexus later today.
     
  6. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,579
    I've now tested on a Galaxy Nexus. It doesn't crash or have the GUI bug.