Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Graphics Assetbundled materials / Always Included Shaders / Preloaded Shaders

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

  1. Deleted User

    Deleted User

    Guest

    Hello.

    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'?