Rectangular Attenuation "radius" for lights?

I have a situation where I’m using dynamic lights that don’t cast shadows, and I get really bad light leaking because buildings are rectangular and the attenuation radius of lights is spherical… I basically have to choose poor lighting (not lighting an entire wall, for example) or light leaking due to the attenuation sphere as the “Barn door length” doesn’t actually cut the light on the bottom like it does on the sides.

I’m using a rect light with the bounds set to the exact measurements of the rooms which looks fine in that room, but in a 2 story building the room below the well-lit room always gets light leaking from the top.

TLDR; is there any way to change the spherical attenuation radius to a rectangular box? (or use something else like light functions or IES profiles instead?)

I HAVE to use dynamic, and I also can’t cast shadows due to performance reasons.

maybe this can help

Ohhh maybe I can use lightmass importance volumes to keep light in certain rooms even without casting shadows on? If I’m understanding correctly. I can’t use baked lighting so I’m not sure if it works.

The rooms are modular and the lights must be dynamic, so i just need a way to prevent the lights in the room from exiting the room through the cracks.

This is not possible. In theory you could make a box mask with a light function but I suspect that would be less performant than just enabling cast shadows.

Also it would be a chore since light functions don’t have access to the convenience variables available to regular materials (such as actor position)

Well ■■■■ lol. Guess I have to settle for lighting that doesn’t completely cover walls :frowning:

Couldn’t you just enable shadows and only turn on shadowcasting for just the walls? If you’re using regular shadowmaps you might also be able to drop the resolution of the shadow depths a bit to reduce the cost further.

Another option is to disable problem lights or reduce their radius when the player isn’t in the room. Depending on how you do your room transitions, this may not be noticeable at all.

Hey +1 here,
Been looking for a decent way to mask lights. Especially rect lights since they’re presented as a rectangular surface of light, but the light bleeding is spherical. Gets really messy in buildings with multiple floors for instance.

Lowering the radius when the player is not in the room is not an option for me, and disabling shadow is not preferable since it would cause issues with other elements of the scene.

Is there no way to use a light function to mask light to a specific shape?

I suppose you could make a mask in a light function using the world position or something to make a boxmask, etc.