Search Unity

  1. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  2. Unity 2017.1 is now released.
    Dismiss Notice
  3. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  4. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Shaders in Asset Bundles do not load.

Discussion in 'Shaders' started by goal2112, Mar 17, 2017.

  1. goal2112


    May 8, 2013

    I've been using asset bundles for a project for quite a while, and now we need to update it so we figured we'd bring it up to Unity 5.5. Now asset bundles don't seem to be able to load their contained shaders anymore. When I try to load all Shader objects in the bundle I get the right number of objects, but they're all blank. Their name is an empty string and their isSupported flag is false. This effectively renders some of the other techniques mentioned about this problem unusable, like including these shaders in the "Always Included Shaders" list and retrieving them by name, since I don't know the name of the shader the material actually wants to use.

    These shaders work fine when I put the objects directly in the editor, and when I package the bundle I tried both StandaloneWindows64 and StandaloneWindows. Neither seems to work.

    The only other workaround I can think of is to encode the shader name in the material name, but given how many materials my bundles use this might require a special script that will run through all of the relevant objects to rename them, and I fear that raises the risk for other problems.

    Has anyone else experienced something like this recently?