Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Graphics Assetbundled materials / Always Included Shaders / Preloaded Shaders

Discussion in '5.4 Beta' started by Cygames_wzd, Mar 7, 2016.

  1. Cygames_wzd


    Mar 1, 2016

    At the moment, most 3D object in out projects are assetbundled and we have over 300 custom shaders.
    As you know, since shader compilation time is quite long on mobile devices we are trying to find a way to shorten their compilation time.
    So, now I'm trying to put some shader files in 'Edit->Project Settings->Graphics: Always Included Shaders / Preloaded Shaders'.
    Those shader files are used by assetbundled 3D objects as I mentioned above.

    Here is the problem.
    1. If I build a 3D object separately from those 'common shader' files, its assetbundle includes a shader file it uses as a local shader file.
    2. If I build a 3D object with those 'common shader' files to set its dependency, its assetbundle does not include a shader file it uses.

    In case 1, because it has its local shader file, it compiles the shader file when I load that assetbundle regardless of 'Always Included Shaders' list.

    In case 2, if I don't load 'common shader' assetbundle which I built with a 3D object to set its dependency, loaded 3D object lost its shader link(which means appear pink) regardless of 'Always included Shaders' list....

    Is there no way to link assetbundled objects to 'Always Included Shaders' or 'Preloaded Shaders'?