Assetbundled materials / Always Included Shaders / Preloaded Shaders
Hello all.
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'?
I'm struggling with the same issues, would be good to get a response on this
Your answer
![](https://koobas.hobune.stream/wayback/20220612065141im_/https://answers.unity.com/themes/thub/images/avi.jpg)