I have a fullscreen shader that makes the camera it's applied to flash white. It works fine in the editor, but not on mobile devices.

Here is the code for the shader itself:

Shader "Hidden/WhiteFlash"
{
	Properties{
		_MainTex("Base (RGB)", 2D) = "white" {}
	_flash("Flash intensity", Range(0, 1)) = 0
	}
		SubShader{
		Pass{
		CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag

#include "UnityCG.cginc"

			uniform sampler2D _MainTex;
		uniform float _flash;

		float4 frag(v2f_img i) : COLOR{
			float4 c = tex2D(_MainTex, i.uv);

			//float lum = c.r*.3 + c.g*.59 + c.b*.11;

			float3 fl = float3(1, 1, 1);

			float4 result = c;
			result.rgb = lerp(c.rgb, fl, _flash);
			return result;
		}
			ENDCG
		}
	}
}

And here is the script that controls its values:

public class WhiteFlash : MonoBehaviour
{

    public float intensity;
    private Material material;

    // Creates a private material used to the effect
    void Awake()
    {
        material = new Material(Shader.Find("Hidden/WhiteFlash"));
    }

    // Postprocess the image
    void OnRenderImage(RenderTexture source, RenderTexture destination)
    {
        if (intensity == 0)
        {
            Graphics.Blit(source, destination);
            return;
        }

        material.SetFloat("_flash", intensity);
        Graphics.Blit(source, destination, material);
    }
}

Please understand that shaders are black magic to me, and the answer to my question is likely something extremely simple I’m just missing. The code itself is about 98% recycled from a tutorial I found online.

The code works find in the Unity editor, in normal and emulated (OpenGL es 2.0) mode. However, come build time, the flashes just don’t materialize. Can anyone point me in the right direction with this? My Google-fu was of no help.

Note that a shader might be not included into the player build if nothing references it! In that case, Shader.Find will work only in the editor, and will result in pink “missing shader” materials in the player build. Because of that, it is advisable to use shader references instead of finding them by name. To make sure a shader is included into the game build, do either of: 1) reference it from some of the materials used in your scene, 2) add it under “Always Included Shaders” list in ProjectSettings/Graphics or 3) put shader or something that references it (e.g. a Material) into a “Resources” folder.

Source: http://docs.unity3d.com/ScriptReference/Shader.Find.html

Its not a shader, but I’ll provide an alternate method for ya. You’re just trying to make the screen flash white, right? You could simply place a white texture just in front of the camera and set it inactive. Then to make it flash, set it active, then a frame or two later set it inactive again.