- Home /
Graphics Quality Settings on Android
So I added Graphics Quality Settings to my game somewhat recently. Right now I'm just cycling between the 6 default settings of Unity:
-Fastest -Fast -Simple -Good -Beautiful -Fantastic
It seems to work fine now for PC but with Android it can cause all kinds of problems.
The most common one is that all GUI text will just disappear completely. Other times the GUI text will turn all blocky and becomes unreadable.
It also seems that shadow quality is best on the phone with "Good" quality and becomes more blocky with "Fantastic"?
And finally it seems that certain lights like halo's or variatons of the fire asset will not display correctly and will appear as a square. The squares look like the right color or texture, but that's about the only thing working here.
Also wondering if it makes any difference whether you use:
QualitySettings.SetQualityLevel(qualityLevel, true);
compared to:
QualitySettings.SetQualityLevel(qualityLevel, false);
Right now I'm using the true variation on game start-up before start screen, and I use false when they do it in the options menu.
I think iOS has some kind of script stuff to determine what kind of iOS device is running the game so you could probably easily customize settings for each generation.
Is there any equivalent way to see how powerful the device is with Android? Right now I am attempting to just allow the player to set their level with the default set to "Fastest" when you delete the save.
I've done a bit of searching and can't seem to find anything helpful so far. If anyone has experience or advice with quality settings on Android, or a link to a nice guide that would be nice!
It seems the Galaxy S4 can handle the game without lag on "Fantastic" although it looks best on "Good" due to the lighting and shadow problems. Surprisingly the Galaxy Nexus struggles even on "Simple" which is the lowest setting with shadows.
I just want to make the game future proof on Android, but I don't really know what to do can't find any good info.
Edit: Still really to find some good advice/info on this! The mobile marketplace is so hot right now but it seems difficult to master Android graphics quality with the info I've seen. Is it just kind of trial and error since the devices advancing so rapidly in processing and GPU power these days?
It seems different GPUs have different texture format and compression support. To get the best out of all GPU's you need to add specific code for each of them. They all have their quirks and shaders that work best or don't work at all. It's a ballache. To futureproof is good, but the real 'Value Add' is targetting devices back to 2.3.1, where the real majority of the customer base still lies as of 2013.
Is there a way to detect which GPU they are using for the specific code? Although I solved the S4 problems I had this is kind of an open ended question since Android devices are so varied.
Answer by RyanZimmerman87 · Oct 20, 2013 at 04:01 PM
K after having some time to try to troubleshoot these issues I've found some tips that might be helpful for certain Android or mobile users.
All these tips are based on my testing for the Samsung Galaxy S4 so this is probably a good representation of what Android is capable of currently.
1) Do not use Anti-Aliasing! This was the reason why my OnGUI was breaking and also why my particles and lights were showing up as squares instead of their natural shapes.
QualitySettings.antiAliasing = 0;
2) Your maximum shadow.Cascades should not exceed 2! It seems going to 4 is not worth it and may even decrease shadow quality!
QualitySettings.shadowCascades = 0; or: QualitySettings.shadowCascades = 2;
3) QualitySettings.shadowDistance should not exceed 70! Doing so appears to automatically lower the quality of all shadows regardless of distance. Max distance should probably be:
QualitySettings.shadowDistance = 70;
I'm not sure why the shadow quality get's worst with higher settings maybe not enough CPU power and it just automatically craps out?
I was kind of expecting the pixelLightCount was the problem with my lights and particles, but turned out to be anti-aliasing!
So I'm now able to cycle through all 6 of the unity default settings on the Samsung S4 without any bugs or glitches so far!
Right now my project runs for both PC/MAC and Android which is partially why I had all the high settings on my phone, but to be honest I had no idea what would work previously.
I need to try to run another Unity Profiler later today or very soon and if I find anything worthwhile I can update thread.
This is an example of how to manage the settings for both PC and Android just in case it helps someone, and it kinda shows the different settings I needed to change that were causing the Android problems.
#if UNITY_ANDROID
Application.targetFrameRate = 30;
QualitySettings.vSyncCount = 0;
QualitySettings.antiAliasing = 0;
if (qualityLevel == 0)
{
QualitySettings.shadowCascades = 0;
QualitySettings.shadowDistance = 15;
}
else if (qualityLevel == 5)
{
QualitySettings.shadowCascades = 2;
QualitySettings.shadowDistance = 70;
}
Screen.sleepTimeout = SleepTimeout.NeverSleep;
#endif
#if UNITY_STANDALONE_WIN
Application.targetFrameRate = 60;
QualitySettings.vSyncCount = 1;
if (qualityLevel == 0)
{
QualitySettings.antiAliasing = 0;
}
if (qualityLevel == 5)
{
QualitySettings.antiAliasing = 8;
}
#endif
Thank-You Ryan, This was a really fantastic post, with helpful information that I'm referencing, as I pull my (almost finished) hair out, while porting my project to Android. \ $$anonymous$$uch appreciated!
@RyanZimmerman87 - This was very helpful. Thank you. It solved my problem with blocky shadows on Android. I tried setting the quality in the editor but that did not work. The script settings override did the trick for me.
"I'm not sure why the shadow quality get's worst with higher settings maybe not enough CPU power and it just automatically craps out?" The Shadow Distance represents the area that the shadow map draws to. A larger area means the same number of shadow pixels are spread over a greater number of screen pixels. Thus the texel resolution of the shadows will go down as Shadow Distance goes up
Guys i need some help here
where should i use the code, i have added it to the Awake function in the main camera, but i'm getting an error message saying that the name qualityLevel doesn't exist, i guess i have to create it?
Please help.
Sounds weird, but after a while of adding my comment i have found how to create the variable qalityLevel, here it is for anyone who needs it:
http://docs.unity3d.com/ScriptReference/QualitySettings.GetQualityLevel.html
Thanks.
Answer by vanceagrig · Jan 31 at 12:07 PM
I have done it like this: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class SettingsAndroid : MonoBehaviour
{
private void Start()
{
#if UNITY_ANDROID
Application.targetFrameRate = 30;
QualitySettings.vSyncCount = 0;
QualitySettings.antiAliasing = 0;
if (QualitySettings.GetQualityLevel() == 0)
{
QualitySettings.shadowCascades = 0;
QualitySettings.shadowDistance = 15;
}
else if (QualitySettings.GetQualityLevel() == 5)
{
QualitySettings.shadowCascades = 2;
QualitySettings.shadowDistance = 70;
}
Screen.sleepTimeout = SleepTimeout.NeverSleep;
#endif
#if UNITY_STANDALONE_WIN
Application.targetFrameRate = 60;
QualitySettings.vSyncCount = 1;
if (qualityLevel == 0)
{
QualitySettings.antiAliasing = 0;
}
if (qualityLevel == 5)
{
QualitySettings.antiAliasing = 8;
}
#endif
}
}
Thank you RyanZimmerman87
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Control basics - NGUI 1 Answer
Andoroid Pictures 0 Answers
Upgrading to Unity 3.4 question 1 Answer