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
5
Question by Matt 15 · Jan 07, 2011 at 05:37 AM · fpsiphonelimitationsiphone4

list of features that are BAD for iOS (iphone)

Hey there Unity Answers... Is there a list anywhere (or do any of you have tips) of features to stay away from when creating games for the iPhone4? I've heard fog, excessive instantiation.... are there other things that people have noticed have been a problem.

Currently, my game runs at 200FPS on my mac, but slows down on my iPhone. I know it is far less powerful, which is why I'm casting a wide net to see what things i might have in my app that are drastically killing the FPS once on the device.

Thanks in advance!

(also side note: anyone know of a bit of code to use that would run on the device to show it's FPS as it's running)

Comment
Add comment · Show 4
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 Eric5h5 · Jan 07, 2011 at 05:42 AM 1
Share

FPS code: http://www.unifycommunity.com/wiki/index.php?title=FramesPerSecond

avatar image Matt 15 · Jan 10, 2011 at 05:09 PM 0
Share

Hey there, i added this code, and it seems to work, however the code itself seems to eat up a TON of FPS... is this due to the inherent slowness of onGUI elements?

avatar image azzogat · Jan 15, 2011 at 08:43 AM 0
Share

The FPS you see using that snippet is closer to reality than what you see in the editor or simulator. It also doesn't use OnGui, it's just a guiText. It just adds 1 drawcall and some more text garbage collection.

avatar image dentedpixel · Jan 23, 2012 at 04:45 PM 0
Share

$$anonymous$$ake sure to un-tick "Pixel Correct" on the GUI Text, this was causing a lot of slowdown for me.

5 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by azzogat · Jan 09, 2011 at 12:50 PM

This is really not a complete list, but off the top of my head:

The most important things to consider are your drawcalls. For example, an iPhone 3G really starts doing funky things over 25-30 drawcalls.

You could reduce your physics Solver Iteration count (from Edit> Project Settings > Physics) and use interpolation.

Try avoding instantiating / destroying objects. In some cases, implementing a GameObject pool might improve performance drastically.

Try to stay away from comparing strings and never use GameObject.Find .

Try to use Switch statements instead of many if / if else nested statements.

I also try to use extremely simple shaders. I usually blend all my external lightmaps and any other maps into the diffuse one and use a Texture Only mini-shader.

You should also try to stay away from using alpha-testing shaders if you're planning to release for the ipad. Due to it's high resolution and really boring hardware if has quite a few fill-rate related problems.

Comment
Add comment · Show 17 · 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 Matt 15 · Jan 09, 2011 at 02:56 PM 0
Share

thanks for the tips! How do you recommend lessening draw calls?i currently have about 130 :/ what do you recommend ins$$anonymous$$d of GameObject.Find ? i have a few things that use gameObject.FindWithTag

Thanks again!

avatar image azzogat · Jan 09, 2011 at 03:55 PM 0
Share

The most common way to reduce drawcalls is by using texture atlases and/or combining meshes.

FindWithTag is perfectly fine as it only looks through your tags (which are usually not that many) ins$$anonymous$$d of looking for a string in your scene.

avatar image Matt 15 · Jan 10, 2011 at 03:51 AM 0
Share

I've been looking through some docs, and if I'm reading them correctly. Would it be better if i had one material, with all the parts on one texture? $$anonymous$$y situation is that i have cubes that are one texture, and action happens, their texture changes. Currently, i have one material assigned to all cubes, but reassign it's texture for the change. Would it be better to have the single texture, and change the offset to have the change occur? or am I completely missing the concept? - any chance of dynamic batching? i have one cube prefab with one material but currently, their textures are unique.

avatar image azzogat · Jan 11, 2011 at 10:22 AM 0
Share

Every separate texture will add to your draw-call count. Depending on the size of your textures, it might be beneficial to use a sprite-sheet and scroll them when needed. Automatic batching will kick in when you have identical objects with the same material/ texture.

avatar image Helkus · Feb 01, 2011 at 03:37 PM 2
Share

Any time you change anything in renderer.material (including texture offsets) it creates a material instance and definitely ensures that object will have its own draw call.. what you have to do is modify the UV's on the mesh, don't worry you can do this from script

Show more comments
avatar image
5

Answer by Thom Denick · Jan 15, 2011 at 06:27 PM

Another big one that has not been mentioned is to avoid using GUI objects. Each GUI Object adds to your draw calls, but if you use 3D objects, SpriteManager, or EZGUI and SM2 instead (EZGUI and SM2 cost money), you can reduce your GUI draw calls significantly.

This Answer has some good info on reducing draw calls in a 3D Environment: http://answers.unity3d.com/questions/30419/reducing-draw-calls-vs-culling

Very in-depth answer on reducing Draw Calls: http://answers.unity3d.com/questions/7247/whats-the-best-way-to-reduce-draw-calls

Also for testing on iPhone and iPad, I think this is a great answer everyone should read: http://answers.unity3d.com/questions/9269/confusing-ipad-performance-problems-help

Comment
Add comment · 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 Matt 15 · Jan 16, 2011 at 01:32 AM 0
Share

thanks for the tips. I'm still stumped though. :/ more on what I'm doing. I go through a for loop 120 times, and within it I run this. // var instance : GameObject = (Instantiate(myAsset, Vector3(transform.position.x + xAdjust, transform.position.y + yAdjust, transform.position.z), transform.rotation) as GameObject); // where myAsset is the cubePrefab that has the material with the texture atlas. I also set a random value on a variable on a script attached to that game object.

avatar image
3

Answer by Jeston · May 06, 2011 at 09:21 PM

  1. Use vertex lit shaders instead of vertex colored on anything that doesn't fade
  2. Avoid large amounts of blended pixels: 2 particles close to cam is worst than 25 particles far away.
  3. Make motion framerate indipendent:
    position += velocity * time;
  4. Avoid anything thats non diffuse when possible
  5. Skybox shader is your friend
  6. Avoid clear on camera if the background hits every pixel
  7. (Design) Many smaller scenes > 1 long loading scene
  8. Use UnloadUnusedAssets()
  9. Use very few cameras / lights
  10. Batch draw sprites
  11. Triangle limit is ~ 15k
  12. Be smart with LOD's if you can afford the ram.
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
avatar image
1

Answer by Mantas-Puida · Jan 28, 2011 at 11:42 AM

The best way to assess FPS and see what subsystem is "eating" most of your frame time is to enable built-in iOS profiler : http://unity3d.com/support/documentation/Manual/iphone-InternalProfiler.html

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

Answer by synapsemassage · Jun 26, 2011 at 03:06 PM

If you want precise answers you should read through the docs: http://unity3d.com/support/documentation/Manual/iphone-GettingStarted.html http://unity3d.com/support/documentation/Manual/iphone-performance.html http://unity3d.com/support/documentation/Manual/Reducing%20File%20size.html http://unity3d.com/support/documentation/Manual/Optimizing%20Graphics%20Performance.html http://unity3d.com/support/documentation/Manual/TroubleShooting.html#iPhoneTroubleShooting http://unity3d.com/support/documentation/Manual/Debugging.html

BTW it's absolutely possible to use GameObject.Find, but you should avoid it in Update functions. In Awake it's no problem at all. The built-in profiler is for Pro only.

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

6 People are following this question.

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

Related Questions

frames per second on iphone 1 Answer

FPS + Time.time not accurate on iPhone5 1 Answer

Does UNity iPHOne work 1.7 work with the new iPhone 4 os? 1 Answer

I want to have FPS iOS tutorials. 0 Answers

Perfomance disparity between 3G and iTouch (iPhone 4) 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