Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 unity_wh1FdBeIcLSBLg · Nov 22, 2018 at 02:17 AM · assetbundlewwwcullingocclusion cullingdownloadable content

Using Occlusion Culling with remotely downloaded Asset Package

In the Unity project I'm working on, I'm downloading a fairly large (potentially multiple hundreds of megabytes) unity Asset Package from my server. Every user's project is different, so I can't bundle these Asset Packages into my app - they have to be downloaded from a server.

I'm having a lot of performance issues since there are tons of meshes in the asset package, but only a few hundred are visible at a given time. I've read the docs on Occlusion Culling, but as I understand it you have to enable it in the Unity Editor for every object which you need culled, something that won't work for me since I'm downloading these packages from a server.

I'm using an asset bundle loader script similar to this:

 public class AssetBundleLoader : MonoBehaviour
 {
     void Start()
     {
         StartCoroutine(GetAssetBundle());
     }
 
     IEnumerator GetAssetBundle()
     {
         UnityWebRequest www = UnityWebRequestAssetBundle.GetAssetBundle("https:///myurl.com/myasset");
         yield return www.SendWebRequest();
 
         if (www.isNetworkError || www.isHttpError)
         {
             Debug.Log(www.error);
         }
         else
         {
             AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(www);
             AssetBundleRequest request = bundle.LoadAllAssetsAsync<GameObject>();
             yield return request;
 
             GameObject loadedObject = (GameObject)request.asset;
             GameObject.Instantiate<GameObject>(loadedObject, Vector3.zero, Quaternion.identity);
             Debug.Log("Successfully Loaded Asset Bundle");
         }
     }
 }

My current idea to get around this is that when I download the asset package and convert it into a GameObject, I'll walk through the tree of children GameObject and add an OcclusionArea component to them. Note that all these objects have non-transparent materials.

My question is - will this approach work? Is there a different approach I could be taking instead? Since the lack of dynamic occlusion culling here really slows down my app, I'm open to any ideas on how I could implement it, including writing my own scripts. Baking these asset packages into my app is not an option, though.

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

0 Replies

· Add your reply
  • Sort: 

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

99 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 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

Preloading asset bundles by unloading them after download - doesn't work with unity cache 3 Answers

loading asset bundle function 1 Answer

assetBundle.mainAsset exception 0 Answers

Can't import any packages? 6 Answers

LoadFromCacheOrDownload non asset bundles 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