- Home /
Shaders used by prefabs loaded from asset bundles not working in editor
Hi! Previously when the prefabs were loaded locally, all the shaders worked without a problem. However, after we put our prefabs into asset bundles and try to load them from those bundles, they stop working and display as some ugly pink patches. This only happens in the editor and works normally on devices.
After a lot of googling, I found out that this is because the shaders used by those prefabs get compiled into the asset bundles and become platform-specific. When loading the prefabs from the asset bundles, they will use the compiled shaders in the bundles instead of the ones stored in local. All the workarounds and fixes I can find suggest that I should separate the shaders into its own bundle.
However, I am still very confused how this can be a fix since it will still try to load those platform-specific compiled shaders from the asset bundle even if they exist in their own bundle. Simply separating the shaders from the prefabs obviously does not work and I am still getting those pink patches.
Am I missing something? Could anyone explain this a bit?
Your answer
![](https://koobas.hobune.stream/wayback/20220613200831im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Fallback shaders not working in Asset Bundle? 0 Answers
Shader/Material not displaying properly when attached model loaded from bundle 0 Answers
Asset Bundle breaks Materials 0 Answers
[Oculus Rift] AvatarSurfaceShaderSelfOcluding.shader will not import 0 Answers
unity 5.6 assetbundle shader name lost 2 Answers