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
1
Question by mlabbe · Apr 19, 2011 at 07:51 PM · iosbatchingprofiling

I am black box profiling draw calls on someone else's iOS unity game. How do I count what is incurring draw calls?

I am profiling a friend's Unity game and it is running at about 300 draw calls on iOS. It is good to know this is the time spend culprit, but I need some method or technique of identifying what in his complex code is actually incurring the draw calls.

Questions I would like to be able to answer:

  • For each mesh, how many draw calls per frame?
  • How many discreet materials in the scene? (essentially failing the dynamic draw call test)
  • Is there some way of debug visualizing draw calls? (ex: draw a point at the camera-transformed median point of each draw call)

Currently the draw call system is a big black box and it appears that I need intrinsic knowledge of the game's implementation to start making fixes. Are there profiling tools that simplify this?

I am using Unity Pro iOS

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
2

Answer by Fervent · Apr 19, 2011 at 09:30 PM

For each mesh, how many draw calls per frame? I usually brute force this by adding that 1 object into a scene and seeing how many draw calls it uses by opening the stats window. Then i slowly make copies of that object or other objects and verify that batching is occurring as expected. It's slow but it works.

How many discreet materials in the scene? (essentially failing the dynamic draw call test) you can write an editor script to log this information to the console. The editor scripting is pretty amazing once you get the hang of it. Write a script to get the current selection in the editor and recurse through it finding all of the renderers. Get the names of the materials used and do some processing on that.

as a side note, I did a LOT of testing last night and found this to be true. Currently in my app, (dunno if it is the same for you..you should test by placing quads in an empty scene and watching the draw calls as you duplicate the object over and over) the limit for a batch of objects is around 512 verts. Anything over 512 verts TOTAL in a batch will result in a new batch. I think the best approach is to organize objects based on vert count and frequency in any one scene. If a set of objects are going to break the 512 vert limit in any one view then take that model out of that material and place it in another one. Put objects together that are not likely to exceed 512 verts in any one view.

Dunno bout the other one.

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
0

Answer by Mortennobel · Apr 19, 2011 at 07:55 PM

Check out this official Unity page about performance tuning for iOS: http://unity3d.com/support/documentation/Manual/iphone-performance.html

There is also a nice article in Unity Creative Jan/Feb 2011

http://www.3dattack.us/3DAttack/Jan-Feb2011.html

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 mlabbe · Apr 19, 2011 at 08:01 PM 0
Share

Thanks, but this is the information I used to find out that draw calls were the problem. Now how do I find out which meshes are causing the specific draw calls?

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

1 Person is following this question.

avatar image

Related Questions

UpdateDepthNormalsTexture 0 Answers

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

AssetBundle memory profiling 0 Answers

Static batching not reducing draw calls but is creating batches 0 Answers

Why is there so much GC allocation with GameObject.Activate and Physics2D.SendTriggerContactCallbacks on iOS? 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