Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 AndreasScholl · May 17, 2016 at 05:43 PM · transformperformancetransform.positionperformance optimizationtransform.rotation

Possible way to improve performance moving large hierarchies?

In our project we have objects that consist of many child objects (i.e. object with ~2000-3000 childs). The childs are pure transforms with meshrenderers.

We noticed the following: Moving and rotating the root-object will consume more cpu time the more child objects are parented to the root-object.

In example to move and rotate such a hierarchy transform.position and transform.rotation has to be called, which both consume about the same time.

Are there any possible ways to get around this or speed up the process?

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 brunocoimbra · May 17, 2016 at 07:53 PM

The short answer is: no.

The long one:

When moving the root object, Unity needs to move all theirs childs to the relative position (the same goes to rotating and scaling). So, no, there is no way to "speed up the process", at least not one that doesn't relly on a new CPU or overclocking the one you already have (and even doing anything like that, the difference would not be that much).

One thing that I would reccomend is to not parent that large amount of objects to the same root one when you know that you will need to move the root one.

Also, the only reason I see to parent ~2000 objects with meshrenders to a commom root one would be to organize the scene, but a good practice is to keep the root one at the (0,0,0) JUST for the sake of keeping the hierarchy organized, not for moving that amount of objects at the same time.

Comment
Add comment · Show 2 · 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 AndreasScholl · May 17, 2016 at 10:41 PM 0
Share

Thanks for your response. I get your point. Although it is necessary for our project to have that amount of renderers on a moving object. The reason for this is, that we have very complex moving 3d-$$anonymous$$odels consisting of >20 million triangles. We are already combining meshes to reduce the amount of transforms needed.

What if we would do the rendering "ourselves" by setting up the transform matrices with Unity-GL interface (i.e. GL.$$anonymous$$ult$$anonymous$$atrix (transform.localToWorld$$anonymous$$atrix)? Or would that create way too much overhead.

avatar image brunocoimbra AndreasScholl · May 18, 2016 at 03:45 PM 0
Share

I am not sure, as I didn't ever touched the Unity-GL interface, but I guess that it would not change much.

Why do I guess that?

Pick that root object that contain ~3000 childs and put it's position, direct in the inspector, as 10. The overhead is still there, right? Put again it's position as 0. Same, right? I told you to try that because, that way, Unity would only need to recalculate those position once, as re-rendering once too (when dragging the transform, each mouse movement requires a new calculation, being "heavier" to do transform's modifications that way).

So, as you can see, even when only updating the render once, the overhead is still there.

$$anonymous$$eep combining meshes where you can and create smaller hiearchies to move not combined meshes together. You can still have a root gameobject to keep all your level stuff, but separate it's childs into "sub-root" objects (the ones you will change the position, rotation and scale) to not make those transforms modifications that heavy.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Issues with copying Y axisrotation of another object 2 Answers

Calling gameobject.transform vs. just calling transform directly - Performance negligible? 1 Answer

Coroutine - transform for every frame for duration? 0 Answers

How Do I Give Two Objects the Same Transform? 1 Answer

Changes of Transform cancel on next frame after change 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