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 bpears · Jan 25, 2014 at 07:34 AM · staticinstanceduplicatepooling

Should static duplicates be pooled?

Would there be any benefit from pooling objects that are duplicates if they are never moved or destroyed anyway?

For example. Let's say you've got a prop, and that prop is all over in your game. So you could either pool it, into its position needed, or you could just always have all of them "in place" but only the ones you can see are rendered.

So, I'm not really sure if there would be anything to gain from pooling duplicate static objects? I mean, besides maybe loading time, and if that was the only benefit, I would think pooling might put more stress than just having the duplicates present.

Comment
Add comment · Show 12
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 Benproductions1 · Jan 25, 2014 at 07:38 AM 0
Share

The only benefits you would "gain" from doing this are already gained by the use of shared$$anonymous$$esh and batching. Also you can't move static objects. That would destroy other optimisations.

avatar image bpears · Jan 25, 2014 at 07:56 AM 0
Share

I think you can move them so long as you move them by the static objects root gameobject

avatar image bpears · Jan 25, 2014 at 08:02 AM 0
Share

maybe this would be a reasonable alternative to batching them? I think batching creates one big mesh from all the parts. So maybe you would save a bit from not having that mesh in memory? Hm....

avatar image Benproductions1 · Jan 25, 2014 at 08:03 AM 0
Share

Well you can technically, but you definitely shouldn't. The whole point of static objects is that they never move, and they are optimised so that movement checks are never performed. $$anonymous$$oving them just breaks this optimisation.

avatar image Benproductions1 · Jan 25, 2014 at 09:34 AM 2
Share

Batching would probably give you more of a performance boost than object pooling. Batching also has no overhead unlike the pooling you're suggesting.
Colliders on objects marked as static are also very optimised using trees to significantly reduce the amount of comparisons. If you constantly move objects, that tree will have to be rebuilt, causing even more overhead. If you're objects don't have colliders this isn't a problem of course.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Benproductions1 · Jan 25, 2014 at 12:01 PM

By pooling you basically want to reduce the overhead by introducing another overhead that scales better. It's impossible to tell without a very intricate knowledge of how Unity works under the hood, whether or not it can give any performance benefit. The same goes for losing performance of statics when moving their parent. It might be that the tree is on a per object basis along the parent-child tree, ot it might just be one whole tree for the entire scene.

In any case, I don't think it would be a good idea to try some hack like this to maybe possibly get a little bit of a performance benefit. There are much better optimisations (such as batching) you should be using.

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

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

Related Questions

Create an Instance? 2 Answers

Should I pool thousands of box colliders 0 Answers

Avoid NullReferenceException with Singleton 3 Answers

Having trouble with static references. 1 Answer

Instantiating a Coroutine? 2 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