• 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
7
Question by bmahloch · May 18, 2010 at 02:19 PM · iphoneipad

Universal Apps and Graphics Best Practices

I'm starting a 2D game in Unity iPhone and trying to understand a bit more about the graphics required to support universal apps (iPad/iPhone) at the same time. Currently for a background image i'm using a 1024 x 768 image (native iPad resolution) and when it renders on the iPhone i have "black bars" on the left and right side (landscape). I understand the resolutions are different on the iPad (1024 x 768 @132ppi) and iPhone (480 x 320 @163ppi). What is the best way to create your sprites/textures to support both platforms? Do i need assets for both? Is there Unity project settings that help? Being a first time game developer/Unity user this has me a bit confused. General explanations of how the "guts" work are also welcome.

Thanks!

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

1 Reply

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

Answer by equalsequals · May 18, 2010 at 03:15 PM

As a Technical Artist currently porting an iPhone game to iPad, I will tell you that it is necessary to have separate textures per resolution.

Keep in mind that Unity will not compile the unused assets so you do not have to worry about a bloated executable.

The best advice I can give you with Unity iPhone in the state that it is now is to concentrate your initial production on deliverable for the iPhone and then port to iPad following.

You should, however, keep in mind when programming anything dealing with the touch interface and screen space to expose the necessary properties [variables] so that you may easily change UI sizes during upscaling. If you build your UI with this in mind from the start it is going to make porting to iPad much, much easier.

You should also know that you will not have the clean workflow of building for iPhone when up-scaling for iPad because there is currently no Unity Remote that supports iPad's 1024x768 resolution. That means all of your touch interface Rects and debugging should be done when building for iPhone and set up fluidly so all you will need to do is change Rectangle dimensions and positions when converting to iPad. I really can't stress this enough because it is the source of all of my frustration during this port.

Sorry, I am drifting off topic...

On iPhone/iPad you should not have a texture be any larger than it needs to be. You will quickly notice that your graphics memory is the farthest thing from infinite. I will suggest that you read up on how Zombieville USA was built and all of the creator's forum threads concerning it as it is a wealth of information on how you can squeeze the best looking 2D iPhone game out with Unity.

A couple Rules of Thumb when building a 2D game for iPhone in Unity:

1) You probably shouldn't be using PVRTC compression on your textures as you will notice that your image quality will be awful.

FYI - PVRTC is good for "real world" textures and 3D graphics because of the skewing and stretching, perspective and mipmapping effects are less noticeable. With 2D (most commonly vector) you want crisp detail and optimum fidelity. For this I suggest that image compression is set to Uncompressed RGB(A) 16 or 24 (depending on the necessity of an Alpha channel)

2) Disable mip-mapping as it greatly increases your memory consumption. You also are going to be using an Orthographic 2D view so there will be no need for mipmapping anyway.

FYI - Mipmapping is LOD simulation that generates a cascading set of textures that decrease in size. Unity then applies the lower resolution textures by calculating how far the object is from the camera and how detailed it should be. This saves on processing power because you won't be taking a hi-res texture and drawing it on a surface that might only have a value of a few texels (pixels in a vector texture unit). This of course affects your memory consumption as these additional textures need to be cached.

3) If you are using 3D planes to draw your 2D sprites, use the iPhone specific shaders. They are optimized for the iPhone's GPU. Also, transparency/translucency should try to be avoided wherever possible.

Sorry for the long drawn out response but I figured that I'd consolidate some knowledge here instead of pointing you around to the various threads where bits and pieces get mentioned.

Cheers,

==

Comment
Add comment · Show 3 · 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 bmahloch · Jun 10, 2010 at 03:09 PM 0
Share

I know its been awhile but I really appreciated your thoughts. I've read it over and over and I believe I'm practiced enough now to realize all its wealth. Thanks again!

avatar image mcroswell · Jun 23, 2010 at 03:00 AM 0
Share

Yes, really nice that you shared this knowledge. Thanks, also!

avatar image Anxo · Oct 31, 2011 at 08:46 PM 0
Share

Thumbs up. The compression tip helped me a lot.

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

1 Person is following this question.

avatar image

Related Questions

Accelerometer Movement Problem 2 Answers

condition `!mono_debug_initialized' not met 0 Answers

IPhone 4 and IPad 2 lost audio on resume 0 Answers

question regarding buying from asset store 3 Answers

How do I destroy things properly to free up memory? (iOS) 3 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