Is custom attenuation on lights possible? (tricky lighting challenge)

Hi all,
In some offline renderers you can create custom attenuation curves for lights, so the light has say 0 intensity at the source, building up to max intensity 10 feet away, then fading out to 0 over the next 20 feet (or whatever, you can build wavy sine curves if that’s the effect you’re after). I was wondering if this was possible in Unreal5 with Lumen?

For context I’ve been tasked with lighting a narrow cave. The player has no lights. The cave is natural with no lights. I can have some glowing moss and the occasional patch of luminescent mushrooms but the art director doesn’t want the cave filled with these, just used sparingly here and there as pathfinding hints for the player.

I’m allowed to place dim cheat-lights, as long as they feel natural. The problem is if the player walks past a light, the player model gets lit really harshly as their head is only a couple feet away from the light source…If I could set a “near attenuation” distance this problem could be avoided.

Or else any other tips on how to light a natural, cramped space would be greatly appreciated!

Cheers,

Custom attenuation can be done with a light function by getting the distance between the pixel position and the light position (for point/spotlights). Unfortunately you can’t get the light position from the material editor which means you’ll need to make it a parameter and set it from Blueprint.


In your light, you’ll need to disable inverse square falloff and set your falloff exponent as low as you can get it (since you’re effectively overriding the attenuation yourself)

For what you described though, my advice would be to just disable inverse square falloff, and use the exponent and the light intensity so that you dont have such a bright hotspot. I don’t think you really need a custom attenuation curve.

3 Likes

Awesome, thanks for such a quick response!
Yeah it might be best to just use a very low intensity and play with the radius and exponent. I hadn’t thought about a light function for distance, I thought they were more for projecting textures. Today I learned!

thanks again.

2 Likes