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 mitaywalle · Feb 07, 2018 at 09:27 PM · resourcesstreamingunloadunloadingunloadunusedassets

Static mesh smooth, safe Unload ? 2018.1

I'm writing level-streaming system. Loading with

 Application.backgroundLoadingPriority = low 

is pretty smooth.

But

Resources.UnloadUnusedAssets() function is only way to unload everything SAFELY.

I've pretty large world, with lots of game object, LOD-groups cross-referenced materials and textures. Thats why :


  • Resources.UnloadAsset(something) can't be used with static. It's is ok with textures, acceptable, but if you try to unload Chunk A, and its static combined mesh, which consists of A and B chunk objects, objects in Chunk B will disappear.

  • Mesh.Combine() is bad idea cause of it breaks LOD-Group work, Isn't it?


    Questions:

  1. Is there way to combine static meshes ONLY INSIDE additively loaded scene? or

  2. is there way to SEPARATE static meshes "per-object" (runtime?) ?

  3. is there any way to TIME SLICE Resources.UnloadUnusedAssets()? AsyncOperation typical way doesn't help

  4. Alternatives, to unload static meshes from memory?

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 mitaywalle · Feb 08, 2018 at 11:01 AM 0
Share

Sorry for format, for some reason at unity answers I can't print new lines(

avatar image Bunny83 mitaywalle · Feb 08, 2018 at 01:14 PM 1
Share

Yes, due to a change which was about half a year ago suddenly paragraphs are no longer seperated and bullet-point lists are not indented anymore. It's sad as it breaks all previously posted answers and questions as well. I still hope that they revert this change... some day.

I've posted 6k+ answers so i'm not going to edit them all ^^. The paragraph issues can be worked around by adding additional <BR> tags. However the bullet point list issue is almost more annoying.

avatar image mitaywalle Bunny83 · Feb 13, 2018 at 01:33 PM 0
Share

Big thanks for workaround

2 Replies

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

Answer by mitaywalle · Feb 13, 2018 at 01:31 PM

Just turn off static batching in settings

Performance impact wasn't so big. It was replaced with dynamic batching / GPU-Instancing


And no need to unload meshes. No generated chunks, only original meshes, which are lightweight and don't dublicate in memory after reload chunk.

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

Answer by Bunny83 · Feb 08, 2018 at 01:06 PM

Well, when you say "static" i guess you mean statically batched objects, right? It highly depends how you made those objects to participate in static batching. Note that once several objects are batched together you can't seperate them. The only way would be to destroy all objects that have been batched together and recreate those you want to keep. This of course isn't very useful.


However you said that you have "chunks" you want to manage. What you can do is to manually batch the objects you want to be combined at runtime using the StaticBatchingUtility. Of course if you load permade levels as "chunks" those shouldn't be marked as static. When you call StaticBatchingUtility.Combine it should have a similar effect as if the object was marked as static. However it should only combine the child objects / the objects you specify. Though i can't guarantee that it will work. You may want to do some tests.


Obviously the performance gain when you create smaller batching groups would be less than when having the whole scene batch together. Also calling Combine manually may decrease your "smooth transition" performance.


.

If the loading / unloading is too heavy you may want to split your world into several smaller scenes / chunks. Thanks to the multi-scene edit feature it should be easy to seperate a single scene into multiple.

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 mitaywalle · Feb 08, 2018 at 04:30 PM 0
Share

Hello Bunny83. I've tried to not mark objects static and then use StaticBatchingUtility.Combine(), forget to write this in post. They unfortunatly combine with other objects, and if I destroy() / UnloadAsset() mesh where need, objects with same material disappear, where not need

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

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

Related Questions

Does Resouces.UnloadUnusedAssets frees asset bundles unused resources? 0 Answers

Issues with unloading textures and atlases 0 Answers

Does Unloadunusedassets unload unused assets loaded from Assetbundles? 0 Answers

reload texture after Resources.UnloadAsset() 0 Answers

Destroy single asset from AssetBundle 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