Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by RyanZimmerman87 · Sep 29, 2013 at 11:04 PM · androidlighting bugshadow bugquality settings

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?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Oct 08, 2013 at 01:01 AM 0
Share

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.

avatar image RyanZimmerman87 · Oct 20, 2013 at 04:11 PM 0
Share

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.

2 Replies

· Add your reply
  • Sort: 
avatar image
16
Best Answer

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
 

   
Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jtok4j · Apr 28, 2014 at 05:37 AM 0
Share

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!

avatar image jkraptor · Jun 05, 2015 at 05:01 PM 0
Share

@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.

avatar image Pixeldamage · Jul 01, 2015 at 07:32 PM 0
Share

"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

avatar image Databases · Sep 04, 2015 at 12:35 PM 0
Share

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.

avatar image Databases · Sep 04, 2015 at 12:39 PM 0
Share

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.

Show more comments
avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Unity + Android + Development Build = CompareBaseObjectsInternal can only be called from the main thread. 1 Answer

Unity Ads Unnecessary Android Permissions 1 Answer

FATAL EXCEPTION - dvm crash ? 1 Answer

How can I run an Android App in Foreground automatically? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges