Over the past several years working in Unity many of my projects have involved some kind of mixed reality, augmented reality, transparent MovieTexture, or something of the sort. One custom shader that I have reused a lot for these effects is an unlit alpha mask shader. Alpha masking is simply setting the opacity of a texture’s pixels, usually with a separate texture map.
I’m certainly no Unity shader expert, but creating this shader is relatively straightforward if we start with the right foundation. In this case we’ll be modifying the closest thing to what we want – Unity’s own unlit alpha shader. We’ll start with the completed version and then explain how it was modified from the source.