How to fade a light with distance?

How can i set a maximum point or spotlight draw distance when using dynamic lighting, i want the light to fade after certain distance to the camera so how can this be done?

I would also be practical to know if its possible to change a lights shadows bias based in the current distance to the camera and if it would be possible to change light intensity or maybe even color depending on the distance.

This could be very useful for any game that requires lots of lights and shadows but still cant run them at maximum settings and beyond.

4 days bump.

Couldn’t you just loop through all dynamic lights and fade them out within a certain distance? You can do this in blueprint. And toggle them off if they are too far for the player to see.

Unreal uses a deferred renderer, so you can have an insane amount of light before the engine slows down. What is usually causing frame drops is the amount of lights casting shadows. So you could also just toggle that off when the player is far away. Or maybe not all lights need to cast shadow in the first place.