Help my first shader. Dual Texture Blended, Real Time Lit / Shadows

Hello all. Well as am pushing into 3 days of not being able to find this shader, i decided to pick up a copy of SSE, and start learning shaders a litttle myself. I must say , shaders are kinda cool, but im a total noob. So , what i have managed to do , is set up 3 textures in the material.

Texture1, Texture2, and AlphaMask.

The idea to this shader is that i would like to apply two seamless tiling textures, and a alpha map that is used to blend the two together. I would have prefered to use vertex alpha painting to accomplish this , but im way out of my league here so … So now, what i have managed to do so far with my shader , is subtract the alpha map from the RGBA of the Texture1. And it displays as it should, the other area has no color what so ever , or texture. This is where im having aproblem. I can not for the life of me , figure out what methods , functions, etc, to use to go about adding in the other texture, with the Inverse settings from the alpha map. I realise theres an Inverse function in SSE, but again , im total noob here.


Can anyone get me started in the right direction. Please thanks you.

Link to higher Quality image.

http://willcotter.elementfx.com/TempImages/Help01.png

PS : although i have found a number of misc shaders like this one, none of them support real time lighting + real time shadows + beast lightmapping. This is the ultimate goal of this shader.

Sorry to double post , but after much playing , i think i have it working. Heres a screenshot of my strumpy setup. What im now wondering though , the last peice of magic, would be if it is possible to instead of useing a Alpha map, have the vertice opacity , or color read instead , defining the areas that the two textures appear.

I would much rather vertex paint the color and have the shader understand that instead of using the alpha map. I just have no idea how to go about this. Total noob at shaders here. And again , kep in mind , at the moment this shade works with all lighting , shadows , and beast lightmaps… so a version using vertice blending , would as well have to support all of the above.

http://willcotter.elementfx.com/TempImages/Help02.png