Search Unity

Shaders in Asset Bundles do not load.

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

  1. goal2112

    goal2112

    Joined:
    May 8, 2013
    Posts:
    8
    Hi!

    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?