As I see it, you would need someway of telling the shader when and when not to be applied. One idea, if you don't need the alpha channels of the texture, is to make one of them fully transparent (still keeping the colours of course!). Then, in the shader, if check the texture's alpha channel and if it's higher or lower than half, apply the effect or pass the pixel unaffected.