Movie GUI Texture Alpha?

I’ve searched but never found a real solution on how to get a GUI movie in unity to have an Alpha matte applied. Does anyone know a easy way to do this? Right now my movie is being created by:

public MovieTexture Loading_Movie;

void OnGUI()
{
GUI.DrawTexture(new Rect(295, 200, 147, 143), Loading_Movie, ScaleMode.ScaleToFit, true, 0F);
Loading_Movie.Play();
Loading_Movie.loop = true;
}

I created a separate movie that is a grayscale for an Alpha, but not sure how to apply this to the code so it makes my “Loading_Movie” have an Alpha.

So basically I have 2 movies. One is an RGB and is currently on my “Loading_Movie” public movieTexture. The second which is the grayscale for Alpha is not currently being called because Im not sure how to make it treat my RGB version as the alpha. Any suggestions?

Create a GUITexture and attach this script (uses Graphics.Blit which requires Unity Pro):

using UnityEngine;
using System.Collections;

public class GUIVideoWithAlpha : MonoBehaviour {

	private Texture colorTexture;
	private Texture matteTexture;

	public Shader blitShader;
	private Material blitMat;

	void Start () {

		//make the gui texture a render texture
		guiTexture.texture = new RenderTexture(colorTexture.width, colorTexture.height, 16, RenderTextureFormat.ARGB32);

		blitMat = new Material(blitShader);
		blitMat.SetTexture("_AlphaTex", matteTexture);

		if(colorTexture is MovieTexture){
			(colorTexture as MovieTexture).Play();
		}
		if(matteTexture is MovieTexture){
			(matteTexture as MovieTexture).Play();
		}
	}

	void Update () {
		if(guiTexture.enabled){
			Graphics.Blit(colorTexture, (RenderTexture)guiTexture.texture, blitMat);
		}
	}
}

Drop your video into the Color Texture, and the alpha matte into Mate Texture.
Use this as the blitShader:

Shader "Alpha Matte" {
Properties {
	_MainTex ("Base (RGB)", Rect) = "white" {}
	_AlphaTex ("Base (RGB)", Rect) = "white" {}
}

SubShader {
	Pass {
		ZTest Always Cull Off ZWrite Off
		Fog { Mode off }
				
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest 
#include "UnityCG.cginc"

uniform sampler2D _MainTex;
uniform sampler2D _AlphaTex;

fixed4 frag (v2f_img i) : COLOR
{
	fixed4 output = tex2D(_MainTex, i.uv);
	fixed4 alpha = tex2D(_AlphaTex, i.uv);
	
	output.a = Luminance(alpha.rgb);
	return output;
}
ENDCG

	}
}

Fallback off

}