Does anyone know if shaders are compiled into bundles? Custom shaders only in asset bundles seem to load in fine even if I don’t have them in the application that loads those bundles.
I understand that code does not get stored in bundles but do the compiled shaders get stored in there?
Also will the shader be always overridden by the application that loads the bundles?
Thanks
Have you tried to put the custom shaders in “Resource” folder?
No I haven’t tried that because I’m building out assetbundles. The strange thing is that it is working because I always thought there was no code stored in the bundles.
I’m posting information in related threads of our community, to clarify how Shaders and Asset Bundles work together, and how to avoid some conflicts. The shader’s code is included with the asset bundle, whenever shaders are directly referenced as parameters in BuildPipeline.BuildAssetBundle(), or indirectly with option BuildAssetBundleOptions.CollectDependencies. This could cause a problem if you use BuildAssetBundle alone to create several asset bundles, since referenced shaders will be included in every generated bundle. There could be conflicts, i.e. when you mix different versions of a shader, so you will have to rebuild all your bundles for any modification. This also increases the size of bundles. To avoid these problems you can use BuildPipeline.PushAssetDependencies() to separate shaders in a single bundle, and that will allow you to update the shader bundle only. We are adding a page to the manual with more information on this topic and examples of the workflow to build a shader bundle.