Hey,
I'm trying to use light functions to light certains parts of the scene only when the player is close to it. Through my research I've come across light functions and they seem to fit the bill but I can't get them to work properly. Is it possible to make a distanced based material for light functions? (Distance from the camera, either by using PixelDepth or distance node on WorldPosition and CameraWorldPosition)
Thank you
P.S: If anyone is interested, the problem right now is that whenever I'm in range the falloff works properly but then I get out of the range I set in the material the light comes back on again when it should stay at 0.
Replies
Multiply by 0.00001 or such, add constantclamp after, connect to LERP alpha, and have 1 and 0 as A and B.
That did not work, or? Make sure to clamp it. And you could also use Matinee though the fading would be a bit harder than.
For close enough distances it seems to work but when I get really far the light turns back on. Also, weirdly enough, the radius of the light seems to affect the range at which the light "comes back on". The bigger the radius the bigger the distance.
See below:
Material for light function:
Within 600 units:
At roughly 600 units:
Way farther than 600 units:
If you assign a light function that is a solid red color on a white light, you see that it also loses its color at a certain distance. So the function as a whole is dropped at some point. Not sure how to override that. Couldn't immediately find anything in an ini file but I looked rather briefly.