• 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
Question by allenwp · Apr 01, 2014 at 02:42 AM · mobilegraphicsqualitymobileoptimizationantialias

Anti Aliasing on Mobile

Hello,

I will soon be publishing a 2D game to the mobile stores. The core gameplay looks a little like this with 4x anti aliasing:

alt text

As you can see, it renders nicely... Without anti aliasing it, obviously, looks quite jagged.

I don't have the resources to test on many phones so I wanted to ask: What are the implications of using 4x anti aliasing on mobile platforms for a 2D game like this? Should performance be a major concern for a 2D game using 4x anti-aliasing? Which specific devices should I expect to have problems (and therefore test on)? Other drawn elements include a GUI created in 2D Toolkit.

Also, if a device doesn't support anti aliasing, but I have my setting at 4x: What will Unity do? Will it just drop down/disable anti aliasing? Or will it try to do the multisampling itself, causing an even bigger performance problem on those platforms? (I doubt it would, but I thought I'd ask)

My current draw statistics for this scene are:

Draw Calls: 4 Saved by batching: 66 Tris: 184 Verts 324 (This goes way up into the thousands when I add 2D toolkit items, especially those with spritefont rendering)

There are no textures on the core game, but lots throughout the GUI. The core game seen here is just a simple vertex/fragment shader that passes through the vertex color for each mesh.

Thanks!

Allen

EDIT: I did find this just now... It provides some insight: http://gamesfromwithin.com/trying-out-multisampling-on-ios

gamescreenshot.png (17.9 kB)
Comment
srmojuze

People who like this

1 Show 1
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 Leuthil · Apr 01, 2014 at 05:13 PM 0
Share

I've read in some places that it could decrease performance if the device doesn't support it (which apparently some devices don't), but I'm not sure if that's outdated or not as I haven't personally tested this.

3 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by allenwp · Apr 02, 2014 at 02:01 PM

Maybe I could monitor the framerate and set it through code using QualitySettings.antiAliasing. When the framerate drops consistently below 24fps, set antiAliasing to off.

 using UnityEngine;
 using System.Collections;
 
 public class FramerateMonitor : MonoBehaviour
 {
     public int ConsecutiveIntervalsFailedThreshold = 4;
     public float IntervalSeconds = 0.5f;
     public int TargetFramesPerInterval = 12;
 
     protected int frameCount = 0;
     protected float timeElapsed = 0;
     protected int failCount = 0;
     protected bool hasFailed = false;
 
     void Update()
     {
         if (!hasFailed)
         {
             frameCount++;
             timeElapsed += Time.deltaTime;
             if (timeElapsed >= IntervalSeconds)
             {
                 timeElapsed = 0;
 
                 if (frameCount < TargetFramesPerInterval)
                 {
                     failCount++;
                 }
                 else
                 {
                     failCount = 0;
                 }
                 frameCount = 0;
 
                 if (failCount == ConsecutiveIntervalsFailedThreshold)
                 {
                     hasFailed = true;
                     QualitySettings.antiAliasing = 0;
                 }
             }
         }
     }
 }

Does this sound like a good idea to you guys?

Comment

People who like this

0 Show 2 · 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 LightStriker · Oct 21, 2014 at 05:04 PM 0
Share

Sadly, for mobile, we have the following issues when dynamically changing the AA;

  • On Android, the screen turn black. The game continue and is still responsive, simply we have no rendering anymore.

  • On iOS, Scaleform starts flickering madly.

avatar image srmojuze · Oct 22, 2014 at 07:49 AM 0
Share

Cool idea. If you have Unity Pro then you can turn something like the FXAA camera filter on and off. As mentioned AA quality settings in Unity seems to have issues like Android or iOS black screen, etc.

avatar image

Answer by corriedotdev · Apr 01, 2014 at 04:34 PM

There are a few variables that could affect this. However a common one for 2D is that the sprites are set to bi linear when point should be used. Under the sprite in the inspector you can change this.

Comment

People who like this

0 Show 1 · 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 allenwp · Apr 02, 2014 at 01:38 PM 0
Share

Hmmm... At first, what you said did sound correct -- that the anti-aliasing would do the same work as the texture filtering, so there's no need to have both.

...But in the case of Unity, I will be using multisampling, which only supersamples the depth and stencil buffers. This means I still need to have texture filtering as well to get nice looking textures.

Thanks for getting me thinking about this, though!

avatar image

Answer by srmojuze · Aug 11, 2014 at 10:54 AM

I think you should make it possible in the GUI for the player to turn AA on or off. Some people may like nice AA like 4x, some may find it slows down the device.

Comment

People who like this

0 Show 0 · 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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

22 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 avatar image avatar image

Related Questions

How to manage images in good resolution in Mobile App 0 Answers

High quality giving more FPS against low quality on android? 1 Answer

3D performance on mobile platforms? 1 Answer

Deferred lighting: How to improve quality and anti-aliasing? 4 Answers

Help me to optimize my mobile game 1 Answer


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