Light dependent materials

I managed to piece together (more like improvise) a decent solution (which is by no means complete) and I thought to share it with other people having the same problem. Anybody who knows more please help to improve this

Here is a video of it in action [UE4] Light dependent material (Light Vector workaround) - YouTube

and this is the shader logic used for it (the emissive channel logic)

So as workaround what I did was to manually put a vector parameter in the shader that indicates actual (or approximate) position of the light source to be used for calculating approximate light vector and then use the dot product and other common mathematics to determine if the light is falling on the current vertex and then feed the result to the emmissive channel

With blueprints and c++ logic a set up can be used in the game where the parameter regarding the position of light can be set during runtime

So far the shader technique have given decent result. There is a area between the lit and unlit area which the shader logic does not reach because of strict limit of if dot product =0 (needs to be fixed)