Image Effect not working in Build

I have added the built in Edge DetectNormals Image effect to my camera scene. It is working perfectly in the Unity editor, but it is not working in the Build (standalone), I get this error in the output log:

Missing shader in FPSCamera (EdgeDetectEffectNormals)

(Filename: C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 54)

NullReferenceException: Object reference not set to an instance of an object
at EdgeDetectEffectNormals.OnRenderImage (UnityEngine.RenderTexture source, UnityEngine.RenderTexture destination) [0x00000] in :0

(Filename: Line: -1)

But the Image effect component is correctly attached to my camera and as I said it is working Ok in the editor. I think it is an Unity bug.

Any idea?

I have Unity Pro 4.1.5

The Image Effect script doesn´t have any Shader var exposed in the Inspector, so how can I add the Shader missing manually?

Any help?

Any response?

Possibly a bug, I think EdgeDetectEffectNormals uses an editor script and serializes it which hides it from the inspector. I’m not entirely sure what the problem is, maybe someone more knowledgeable can help you.

Try putting the image effect’s shader into a folder called ‘Resources’. Sometimes shaders don’t get compiled with the build if they’re not included there, so Shader.Find can’t find it …who knows.

The shader is not loaded via Shader.Find but I have placed it in a folder renamed to “Resources” and it seems to work now.

Thanks to everybody.