Writing shaders for UE4; where do I start?

It comes to my mind that maybe your solution is too attached on the way Unity works regarding shaders, it is good that you see how is can be done in Unity, but the concept is compromissed because it is biased. When the concept is free of the implementation way if doing, it is clear. I still read your text and Im not really sure what the effect is, because you are telling the way you would implement it in Unity (which I never used). Try to describe what the idea behind the effect is, so people can translate the idea into the implementation, otherwise is greek for anyone reading.