Users have requested that light depth and light position are made available to Light Function Materials.
We seem to be calculating the per-pixel distance from the light to the surface in LightFunctionPixelShader.usf:
// Calculate radial view distance for stable fading float ViewDistance = length(View.WorldCameraOrigin - AbsoluteWorldPosition);
Users would like to have access to this value as an input in LightFunction materials in order to accomplish depth-based effects in light functions without incurring the additional cost of Blueprint or render target-based solutions described in these two UDN tickets:
https://udn.unrealengine.com/questions/529426/light-function-color-and-depth-features.html
The user in the second UDN ticket has found a way to access the ShadowMap and pass that into his light function instead as a halfway step, although I think a "LightDepth" Input node would have far more utility.
There currently is no clear way to get the light position from within the material itself. All options are flawed (list compiled thanks to [Link Removed] insights)
As the UDN user reports, the only working way so far is by passing the position with blueprints.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-81813 in the post.