Ultimate Unity 3 MiniMap

I need to render a camera positioned above my scene to a pixel perfect area of my gui, with an alpha mask applied to give it smooth edges.

After playing around with a couple different techniques, it seems that using an image postprocessing effect on a camera with a small viewportrect is the way to go. I have attempted to modify the standard vignette postprocessing effect asset, but can't get it to work right.

Does anyone have a better/more efficient way to to this, or know how to craft a proper shader to get this technique to work? Extra points for a radial blur, and the ability to use a custom mask image instead of just a circle.

I would also be more than happy to build this myself, but can't find any documentation that covers this area of Unity. If there are any tutorials on crafting postprocessing effects (especially on anything to do with alpha channels in rendertextures), please point me to them!

Cheers,

-Aubrey

Got everything working perfectly with the below shader! The trick was to write the image to the screen as a GUITexture instead of directly with the camera object. Once I did that, the alpha channel began behaving as I expected it to.

Shader "MiniMapMask"

{

   Properties

   {

      _MainTex ("Base (RGB)", RECT) = "white" {}

      _Mask ("Culling Mask", 2D) = "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 _Mask;

            float4 frag (v2f_img i) : COLOR

            {

                float4 org = tex2D(_MainTex, i.uv);

                float4 msk = tex2D(_Mask, i.uv);

                if(org.a > msk.a || org.a == 0) org.a = msk.a;

                return org;

            }

            ENDCG

        }

    }

    Fallback off

}

do you have a complete code for this mini map?!