Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

"Optimize Game Objects" performance question on android devices

Discussion in 'Animation' started by wanban, Jan 16, 2015.

  1. wanban

    wanban

    Joined:
    Aug 13, 2012
    Posts:
    7
    Hi !
    I test the performance of Model Importer option - "Optimize Game Objects" on Samsung Galaxy Note 3. When I test the option on my PC, Optimize-ON is much better than Optimize-Off. But the profiler results(Animator.Update + MeshSkinning.Update) are similar on Galaxy Note 3.

    Optimize-ON
    Animiate.Update 12.29ms
    MeshSkinning.Update 8.08ms

    Optimize-Off
    Animiate.Update 13.09ms
    MeshSkinning.Update 6.34ms

    The profiler pictures are in the attachment.

    There is extra cost(Animator.SendTransformChanged) in Optimize-Off, but its MeshSkinning.Update is less to compensate.

    My question is whether Optimize-ON is suited for mobile devices or not ?
    I hope the improvement of Optimize-ON on mobile devices is as good as using on the PC.
    What I need to pay attention to the use of Optimize-ON ?
     

    Attached Files:

  2. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi Wanban,

    Can you log a bug with your project? so we can investigate what going on. It should be faster.

    yes
    yes
    The only drawback is that you can't access anymore the transforms unless you expose them,.
    Also if you do have some special setup on your rig like extra transform used as handle for props they will all be removed too.
     
  3. wanban

    wanban

    Joined:
    Aug 13, 2012
    Posts:
    7
  4. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi wanban,

    I did past the information to our Android team, they will take a look.

    Best regards,
     
  5. hypnoticshark

    hypnoticshark

    Joined:
    Sep 20, 2012
    Posts:
    20
    Getting the same results on iOS. Selecting optimize game objects does get rid of the hierarchy but the performance is mostly the same or a little worse at times
     
  6. wanban

    wanban

    Joined:
    Aug 13, 2012
    Posts:
    7
    Hi Mecanim.Dev,
    Is there any progress about the question ?
    Do you suggest opening optimize-on for mobile devices ?
     
  7. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Not yet sorry.

    What do you mean by opening optimize-on for mobile devices?
     
  8. wanban

    wanban

    Joined:
    Aug 13, 2012
    Posts:
    7
    Sorry ! My English is a little weak.

    Our project is a game on iOS and android devices. I mean whether "Optimize Game Objects" is a better option in most mobile devices or not.
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It should *always* be a better option on all devices.

    It's only optional because some people want the transforms.
     
  10. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    So after some investigation it turn out that in your case the bottle neck is not the transform hierarchy but rather dynamic batching and single thread rendering.

    Here the answer from our android specialist
    "So turn off dynamic batching. In this case I would assume dynamic batching would only cause more harm than good. Secondly since we want to scale to multiple cores I would suggest enabling mutithreaded rendering.
    If they do that they should clearly see the difference between the optimized version and the non-optimized one."

    Let me know if does help,
    Regards,
     
    hippocoder likes this.
  11. wanban

    wanban

    Joined:
    Aug 13, 2012
    Posts:
    7
    Hi Mecanim.Dev,
    Thanks for your reply !
    We make a profiler about multithreaded rendering, dymamic batching and GPU skinning options. There are only 100 skinnedmesh characters in the scene and the results are as follows.

    Optimize Game Objects multithread dynamic GPU skinning FPS drall call
    • X O X X 38-45 112
    • O O X X 44-52 112
    • X X O X 30-40 112
    • O X O X 31-41 112
    • X X X O 33-36 212
    • O X X O 30-36 212
    • X O O X 39-48 112
    • O O O X 39-52 112
    • X O X O 38-42 112
    • O O X O 40-44 112
    • X X O O 32-36 212
    • O X O O 32-36 212
    • X O O O 38-42 112
    • O O O O 38-43 112
    • X X X X 28-32 112
    • O X X X 28-39 112
     

    Attached Files:

  12. wanban

    wanban

    Joined:
    Aug 13, 2012
    Posts:
    7
    Sorry, the layout of results looks a mess. We test all combinations of Optimize Game Objects, multi-threaded rendering, dynamic batching and GPU skinning options. X O X X 38-45 112 means disabling "Optimize Game Objects", enabling "multi-threaded rendering", disabling "dynamic batching", disabling "GPU skinning", FPS is 38-45 and draw call is 112.

    The enabling multi-threaded rendering and disabling dynamic batching is the best combination but I have some questions.
    1. There are only 100 characters using the same skinnedmesh(459 verts(position, normal, uv), 658 tris) in the scene. According to Unity documents dynamic batching is applied only to meshes containing less than 900 vertex attributes in total. And I always thought dynamic batching was not applied to skinnedmeshes. Why did dynamic batching work in this case ?
    2. GPU Skinning seems not to improve the performance. There are extra 100 draw call in some cases. Is this a bug of Unity profiler on mobile devices ?
     
  13. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Hi Wanban,

    I don't know enough this part of Unity to give you a good answer, I will try to find someone that can answer your specific question.

    Best regards,