Changing from one texture to another via global alpha map

[Edit: tl;dr How can I make cool looking transitions between textures?]

I am currently working on a game that is all about color with my fellow students. The mechanics themselves are in place but our problem is that the color-change of ingame objects is still instant. We want to be able to animate this change.

I already have an idea how this might work but I have no idea how to achieve this. Here is how I think this might work:

There is a custom shader. This shader takes the two textures that we are transitioning between and the alpha map which is a grayscale image (for example a gradient image). It also has a float that starts as 0. This float serves as a threshold.

Now when the player starts the change the game changes the original diffuse shader to this custom shader. Then everywhere where the grayscale image is black the target material will be drawn and everywhere else the start material is drawn. Now the threshold float changes over time (from 0 to 1 I guess). For example when it reaches 0.33 everywhere where the alpha map has an alpha value of 84 or less the target texture will be drawn on the object. Once it reaches 1 the shader will change to the diffuse shader but now with the target texture instead of the starting texture the change being complete.

The best possible thing is if the alpha map could be used globally so that when we start the change it would be positioned at the camera location and all objects would seem to change sychronously so we would have a nice looking and dynamic transition (it doesn’t need to be moved while changing though). An example how it might look could be the dimension switch in the game Quantum Conundrum (

Is this at all possible? Is there an easy way to achieve that? I have no idea how to do this for I have never programmed a shader. I guess we could do all that with animations but that would put a lot more work on the art team.

Interpolating between materials can be done by this function: