Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assetbundles and Standard Shader, shader is stripped if not present on project and ABs don't add...

Discussion in 'Editor & General Support' started by JustAnotherDude, Oct 23, 2019.

  1. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    There is a massive amount of threads on this issue but I couldn't find a proper solution.

    If you make a game where assets come from assetbundles, the standard shaders never seem to work.

    Game builds with "Strip Unused" shaders, so it properly removes all Standard Shader variants not used.

    Assets use Standard Shader but when you put those assets in assetbundles to be used by the game later, the Standard Shader is not added to the assetbundles.

    So when you load the AB on the game there's no shader and it doesn't work, because the build stripped the shader variant as it's not used by assets referenced in any scenes.

    I couldn't find anywhere how to add the Standard Shader to the Assetbundle, which would be the solution.

    This does not happen with your own shaders because they are properly added to the Assetbundle.

    This basically means you can't use Standard Shader on Assetbundles?