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
0
Question by cmart · Mar 13, 2013 at 07:16 PM · iosperformanceobjectsdrawcallscombine

Best way to optimize scene with multiple instances of a destroyable object

Ok, hopefully my question will make sense :)

Basically, I am making a platforming game for iOS and I am having issues with my frame rate. I recently discovered the "combine meshes" script and this has done WONDERS for my game, I can have massive levels with almost no performance hit...

Until I add in collectable coins. The trouble is, when you collect the coins I want to destroy them so they can't be collected again. Of course with the combine mesh scripts, the original coin and its collider etc is "destroyed" yet its representation in the combined mesh is still present. So I guess using the combine mesh script is out for these types of objects.

When I add in my coins, about 40 or so plain old Unity spheres (no scripts on them, just triggers), I take about a 10 FPS performance hit, and my scene has about 12 extra draw calls. for 40 spheres!

Is there any solution to this problem, something like a combine meshes script but for dynamic or destroyable objects?

I imagine pooling isn't the solution in this case, because they aren't being instantiated during the game, and when I destroy them, the FPS goes up!

All suggestions are welcome, I need to squeeze every FPS I can out of this game so I would truly appreciate any help!

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
0

Answer by Garth-Smith · Mar 13, 2013 at 07:22 PM

How many materials are on these spheres? If 40 spheres are all using the same material, no transparencies, same scale, and are the same distance from the camera, it sounds like they should be just 1 draw call.

In my case, I had a "pulsing" animation playing on my coins that were causing all of them to have slightly different scales. This up'd my draw calls and caused a performance hit on the iPad 1. In that case we disabled the animations or made all the coins animate at the same time so they all had the same scale.

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 cmart · Mar 13, 2013 at 08:06 PM 0
Share

Thanks for the reply! They are all the same prefab and share the same material (a basic diffuse material). The only difference between them is their x and y positions :/

edit: Here is a weird twist: I just created 10-20 new spheres, and I still get the same performance hit. I then created 10-20 Cubes, and this brings the draw call down where it should be. Weird! I replace my old sphere coin prefab with a cube, and I am still getting a great draw call in unity editor, but when I build out to my device, I am still getting the same -10 FPS hit.

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

11 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

Related Questions

What is better to preserve, Draw calls or Tris? [Mobile] 4 Answers

ios and onGUi performance / alternatives? 1 Answer

How can I combine UV's with the Combine Children? 0 Answers

Draw calls and atlas size trade off 0 Answers

What is a reasonable number of draw calls relative to one hardware configuration ? 6 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