Need help with masking a texture using alpha or gray-scale

There’s another thread on here about alpha masking. You can also find lots of help online related to alpha masking shaders. Here’s an example on StackOverflow, although it’s in GLSL, but you can get the general idea. I’m not sure what level of familiarity you have with shaders, but feel free to ask for more explicit examples. The main idea is that in your pixel shader, you sample from both textures, and multiply the output alpha by the grayscale or alpha of the mask.

EDIT: If you want to apply an alpha mask that is a function of position, rather than sampling from a texture, you can do the same thing, but evaluate your function in the vertex or pixel shader rather than sampling the alpha mask texture.