Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Ony · May 25, 2010 at 11:20 PM · qualityantialias

Show current value of QualitySettings Anti Aliasing in script?

I want to be able to show the current anti alias setting on screen but there is no variable for antialiasing in the QualitySettings class.

Can someone tell me how to show the current antialising value (0X, 2X, 4X, 6X, 16X)?

Also, regarding antialiasing...

It's usually necessary to restart a game to set a new antialias level, but I see in the editor that when I set antialiasing higher or lower it updates immediately.

Will I have to require my end-users to restart if they change the antialias setting or does Unity do it on the fly?

Comment
Add comment
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

2 Replies

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

Answer by qJake · Jun 08, 2010 at 10:17 PM

Currently, the only way to change the Anti-aliasing property at runtime is to manually set the QualitySettings.currentLevel property. Calling IncreaseLevel() or DecreaseLevel() will not work as these functions are instantaneous and don't change anti-aliasing settings. However, changing the currentLevel property can take some time, and may lag for a bit, since it does change anti-aliasing settings. The only way to manually set anti-aliasing levels is through the Quality editor in the Unity interface, you can't only set the AA level through scripting (you need to use Unity's quality levels). This is because changing the AA settings in-game is expensive, and can take time.

As for showing the level, just give each setting in the Quality editor a different value, and align those with the values that QualitySettings.currentValue returns.

Comment
Add comment · Show 4 · 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 kirpigiller · May 22, 2012 at 01:53 PM 0
Share

Are there any changes in antialiasing controlling? I'm facing the same problem now.

avatar image cecarlsen kirpigiller · Aug 15, 2012 at 03:48 PM 0
Share

I still have the same problem as well.

avatar image Exalia kirpigiller · Nov 21, 2013 at 09:31 PM 0
Share

To change AA you have to destroy your GL Context and create a new one, until Unity implements that properly I don't believe this is possible

avatar image kirpigiller · Nov 22, 2013 at 06:42 AM 0
Share

Found this very old question. Actually, you don't need to do something special. Try to use smth like the code below. Your app will change the AA settings instantly. If QualitySettings.antiAliasing doesn't return expected result, just save the current AA property somewhere.

 private static void SetAA(int _aa)
 {
     if (_aa == 0 || _aa == 2 || _aa == 4)
     {
         QualitySettings.antiAliasing = _aa;
     }
     else
         Debug.LogWarning("Incorrect antialiasing setting: " + _aa.ToString());
 }

 
avatar image
0

Answer by VertexSoup · Feb 05, 2016 at 02:42 AM

I'd like to expand on @kirpigller comment with method that can be referenced directly from UI slider element. Slider should be set to work in range 0-4

  public void ApplyAASetting(int aa)
     {
         int level = (int)Mathf.Pow(2, Mathf.Clamp(aa, 0, 4));
     if (level <= 16)
     {
         QualitySettings.antiAliasing = (aa == 0) ? aa : level;
     }
     else
         Debug.LogWarningFormat("Incorrect antialiasing (AA) setting: <color=red>{0}</color>", level.ToString());
     }

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Way to know the power of a hardware on a mobile? 3 Answers

Anti-aliasing issue after upgrade to Unity 5.0 0 Answers

Pixelartifacts on edges when activating Antialiasing... 4 Answers

Quality settings problem 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