Light functions and depth based effects

I’m trying to make a light function fading based on the distance from the camera… I tried pixel depth and dist(object position,camera position) also dist(world position,camera position) but none these seems to work. These work perfectly fine with meshes though.

I’m trying to do it with a point light. I can’t use the fading distance of the light function, because thats not what I want it to do. More like the opposite… When I’m close, its not showing, and when I’m far, it should show.

Any ideas?

A workaround might be to max out the fade distance of your light function and just gradually reduce the light’s intensity as you get closer. Your light could track the player’s location and adjust it’s intensity based on the distance.

I know about that I could update the light function from a blueprint, but I didn’t want to do that because of performance reasons. This would need to be applied on a lot of lights, so then a blueprint actor that updates this often, isn’t really the way to go for me. Thanks anyways.

1 Like