Is it possible for one texture to act as a mask for another texture?
For example, lets say I have two textures on a polygon, A, and B. Parts of texture A are completely transparent (alpha=0) and others are opaque (alpha=1). Is it possible to have the transparent parts of texture A also cause texture B to be transparent in the same place, essentially acting like a mask?
To put some perspective on things, I’m trying to implement a “fog of war” on a 2d landscape, I’m doing that by overlaying the entire landscape by a large plane that uses a very low resolution texture where each pixel in the texture corresponds to one “square” in the 2d landscape. If I want the fog to cover that square I simply make that pixel alpha=1, or alpha=0 if I want to remove the fog. This works very nicely for my purposes, especially with filtering that smooths out the pixel edges. However, the fog ends up being a solid color, I would like to texture it a little.
I imagine something like that would be pretty straightforward with pixel shaders. Is it possible to do it without pixel shaders?