Missing shader - lens flare shader missing from Unity 5?

Unity 5.

I’m trying to add the Bloom script to my main camera. I had Bloom (Optimized) working but when I switch to Bloom I get an error in the console.

Missing shader in Main Camera (UnityStandardAssets.ImageEffects.Bloom)
UnityEngine.Debug:Log(Object)
UnityStandardAssets.ImageEffects.PostEffectsBase:CheckShaderAndCreateMaterial(Shader, Material) (at Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs:18)
UnityStandardAssets.ImageEffects.Bloom:CheckResources() (at Assets/Standard Assets/Effects/ImageEffects/Scripts/Bloom.cs:88)
UnityStandardAssets.ImageEffects.PostEffectsBase:Start() (at Assets/Standard Assets/Effects/ImageEffects/Scripts/PostEffectsBase.cs:88)

When I debug the script the “lensFlareShader” value is null. Where does this value come from? It’s public but not available in the Editor. I tried re-importing the Effects standard asset but it didn’t help.

Thanks for the help.

Fixed it. This fix also applies to the Antialiasing.cs script and shaders.

The effects scripts don’t like running from cameras that are loaded from the “Resources” dynamically using Resources.Load(). They can’t find their shaders. So I modified the scripts to load shaders if they are null. Then I copied the shaders to the Resources/Shaders folder.

Bloom.cs

public override bool CheckResources ()
{
    CheckSupport (false);
    if ( lensFlareShader == null )
        lensFlareShader = (Shader) Resources.Load ("Shaders/LensFlareCreate");
...
}