I’m currently investigating a bug I’m experiencing. The bug happens when i mid-game call QualitySettings.SetQualityLevel. This used to work on Android without problems when I used Unity 3.5.x, but now when I’ve upgraded to Unity 4.1.5f1 I suddenly see this. Unfortunately, the bug doesn’t happen on all devices. It happens on Samsung Galaxy Tab 10.1 and on Asus Transformer Prime tablet, but it doesn’t happen on Samsung Galaxy S2 phone or Google Nexus 7 tab.
I can’t see any other posts about this issue, so I’m not sure if this is a Unity bug or a bug in my code. But, after all, I would assume that calling QualitySettings.SetQualityLevel shouldn’t cause the app to crash all of the sudden?!?
Is anyone else experiencing problems with SetQualityLevel at runtime when using Unity 4.1?
The error I get reported from the device is the following:
java.lang.Error: FATAL EXCEPTION [GLThread 12459]
Unity version : 4.1.5f1
Device model : samsung GT-P7510
Device fingerprint: samsung/GT-P7510/GT-P7510:4.0.4/IMM76D/XWMPE:user/release-keys
at libGLESv2_tegra.0003d808(Native Method)
at libGLESv2_tegra.glDrawElements(glDrawElements:168)
at libunity.00385ccc(Native Method)
at libunity.00387480(Native Method)
at libunity.00205434(Native Method)
at libunity.0020549c(Native Method)
at libunity.001f8f6c(Native Method)
at libunity.00123b94(Native Method)
at libunity.00126620(Native Method)
at libunity.00127820(Native Method)
at libunity.00147d18(Native Method)
at libunity.0014f4bc(Native Method)
at libunity.00152bf4(Native Method)
at libunity.002a5474(Native Method)
at libunity.002a5dec(Native Method)
at libunity.003b1c38(Native Method)
at libunity.003b1cd8(Native Method)
at libdvm.dvmPlatformInvoke(dvmPlatformInvoke:112)
yep, we found the issue with gl context recreate (which seems to happen in your case - e.g. switching msaa level)
it should be fixed in 4.2 (should be out really soon)
I’ve been testing this in 4.2.0 which just was released. While the code no longer crashes and Android when changing quality setting runtime, I easily noticed that some materials started to render incorrectly. I noticed the following:
Materials with diffuse shaders were rendered way too brightly.
Texture on material was changed.
Text rendered in TextMesh got corrupted (may be related to above issue).
Material was rendered completely black (could also be related to previous isue).
It seems to be changing anti-alising level at runtime that triggers the problems. Switching between quality levels that have same anti-alising level seems to be ok according to the testing I did with the new version of Unity.
Is this a known issue in 4.2.0 which will be fixed in the next update?
Definitely still exists, I have 4.2 with a game on the Google Play Store doing the same thing and the first thing I do is check whether I need to change quality settings (which turns on anti aliasing).
I don’t have time to make a repro at this stage, removing the code will have to do…
java.lang.Error: FATAL EXCEPTION [GLThread 322]
Unity version : 4.2.0f4
Device model : TOSHIBA AT100
Device fingerprint: TOSHIBA/tostab03/tostab03:4.0.4/IMM76D/01.000072314:user/release-keys
at libGLESv2_tegra.00035428(Native Method)
at libGLESv2_tegra.glDrawElements(glDrawElements:168)
at libunity.003af8e0(Native Method)
at libunity.003b18e0(Native Method)
at libunity.00221cb4(Native Method)
at libunity.00221d1c(Native Method)
at libunity.00213a4c(Native Method)
at libunity.00134604(Native Method)
at libunity.00136fd0(Native Method)
at libunity.0013b9a8(Native Method)
at libunity.00144af0(Native Method)
at libunity.00164f1c(Native Method)
at libunity.00168f1c(Native Method)
at libunity.002c95e4(Native Method)
at libunity.002c9f98(Native Method)
at libunity.003f626c(Native Method)
at libunity.003f6310(Native Method)
at libdvm.dvmPlatformInvoke(dvmPlatformInvoke:112)