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 bpears · Aug 01, 2013 at 03:39 AM · memorydisablebatchingenablevideo memory

Stop batching at runtime? Still in memory?

During runtime, if you have an object and want to stop it from being batched, can you simply disable it? And if it was being batched previously, will it remain in memory if it is not actually being rendered once disabled? And then can you then re-enable it, and have it get batched again?

Comment
Add comment · Show 3
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 bpears · Aug 01, 2013 at 05:35 AM 0
Share

like gameObject.Find("someobject").static = false? or .static.enable = false? or just completely disabling the the object?

If I can do this, I would like to know if once batching for it is disabled, if the memory dumps it automatically, or will I have to do some sort of garbage collection?

avatar image bpears · Aug 01, 2013 at 09:59 PM 0
Share

i read the docs on batching and have looked into it different threads and such, but couldn't find anything about manipulating batching this way.

avatar image bpears · Aug 02, 2013 at 05:39 AM 0
Share

Another way to put it: Two objects, one hipoly one lowpoly, are in a LOD group. Both marked to statically batch. Is the non-visible object still getting batched? Is it still in VRA$$anonymous$$ memory?

1 Reply

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

Answer by whydoidoit · Aug 02, 2013 at 10:35 AM

I believe that static objects are batched the moment the level loads in the player - I don't think you can make an object marked static as visible or invisible after the fact due to this behaviour - it is already in the big static mesh.

Dynamic batching is well - Dynamic - so that does account for visibility.

It is certainly possible to write your own batching code that can know that things have changed and recalculate accordingly.

Perhaps make two copies of the scene, in one enable the high poly and in the other enable the low poly and then load the appropriate one?

Comment
Add comment · Show 6 · 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 bpears · Aug 02, 2013 at 10:43 AM 0
Share

Ok, so in an LOD group, an object would not dynamically batch if it is currently the unseen object?

I don't think two scene would work in my situation. As far as writing a batching code, that is probably beyond my coding skills, sadly.

Thanks for the reply :)

avatar image bpears · Aug 02, 2013 at 10:46 AM 0
Share

another thought: would putting a bunch of statically batched meshes into a group that is dynamically batched work? This would be good for open world, where I want to batch parts of the map at a time, but not all of it at once. $$anonymous$$now what I mean?

avatar image whydoidoit · Aug 02, 2013 at 11:02 AM 1
Share

No that doesn't work - a magic big mesh gets created at the start of the level from all of the static objects that share a material etc.

The other problem with batching is the limitation on the number of vertices in the meshes. For Dynamic I think it's quite low on the source meshes - but I can't recall the exact figure...

avatar image bpears · Aug 02, 2013 at 11:08 AM 0
Share

crap, well that makes sense. I might take a stab at coding it. Any key unityscript code terms I should focus on? Thanks for the help!

avatar image bpears · Aug 02, 2013 at 01:09 PM 0
Share

I had a look at the static utility, combine. Seems like this is a way to manually batch. So this could be used during runtime, not just at the start of a game right? If so this should be fairly easy to code. Now I just have to figure out how to dump old batches from memory. link text

Show more comments

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

16 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

Related Questions

Mouse click to select and Isolate 0 Answers

Please Help!!! Enable/Disable Script!!! 3 Answers

random respawn and respawn delay 1 Answer

Can't remove Rigidbody from transform in script? 8 Answers

Finding desabled gameobjects using know positions 0 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