Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Built In Shaders dependency - is it necessary?

Discussion in 'Addressables' started by boatnik, May 23, 2020 at 1:24 AM.

  1. boatnik

    boatnik

    Joined:
    Mar 27, 2015
    Posts:
    15
    I've been testing out Addressables in an existing project which made use of asset bundles for providing remote content to players via a CDN. As a test, I created a new asset group for an existing prefab and built using the packed mode (default build script). It output 2 bundles:
    If I try to just upload the main bundle to my CDN and load that, the Addressables system throws a dependency exception looking for the the unitybuiltinshaders bundle.

    Ideally I would like to remove the main bundle's dependency on a separate unitybuiltinshaders bundle. What would be the best way to go about this? Shouldn't the built in shader already be included in the build and not be needed as a separate bundle? If not, could it simply be included inside the main asset's bundle?
    Thanks!

    EDIT: Using Unity 2019.1.14 and Addressables 1.8.3
     
    Last edited: May 23, 2020 at 1:32 AM
  2. boatnik

    boatnik

    Joined:
    Mar 27, 2015
    Posts:
    15
    I seem to have found the answer. I had to uncheck the "Include Resources Folders" toggle for the "Built In Data" group (see attached screenshot). Now when I rebuild only my single, expected bundle is created.
     

    Attached Files:

  3. alicht

    alicht

    Joined:
    Jan 22, 2019
    Posts:
    6
    I still get an InternalId and Key in the resulting catalog.
    Something like:
    Code (JavaScript):
    1. "{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/defaultlocalgroup_unitybuiltinshaders_9a6a042faae479a7c7d3c0c5bf797553.bundle"
    Since this bundle doesn't get built, where is it pointing? Or would there be a way to strip it out?
     
  4. boatnik

    boatnik

    Joined:
    Mar 27, 2015
    Posts:
    15
    I'm running into this now as well.It seems if I delete the Default Local Group then the builtinshader dependency gets added back to my Test Asset group.
    Reviewing the documentation again, if a group (Default Local Group in this case) is set to use the LocalLoadPath then it will be copied to StreamingAssets at application build time.
     
    Last edited: May 27, 2020 at 11:08 PM
  5. boatnik

    boatnik

    Joined:
    Mar 27, 2015
    Posts:
    15
    I tried moving the builtinshader.bundle from Library/com.unity.addressables/Android/Android into Assets/StreamingAssets, but had no luck. I get this exception:

    I'm using play mode script "Use Existing Build" so I can test functionality with my CDN. I have three asset groups (Built In Data, Default Local Group(empty), Test Asset Group(single prefab)). It seems to me that this builtinshader.bundle shouldn't be so hard to handle as it should be using the LocalLoadPath which is set to use the default Asset Bundle provider etc.
     
unityunity