Additive lights and light masks over the same node

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Eric De Sedas

Hey, I’ve been trying to figure out how to make some regular light2ds (with mode “add”) work alongside a light mask in a specific way, this is the setup:

I have a sprite which is illuminated by multiple light2d sources, which work as expected, and I’m using a light mask to effectively “hide” a part of said sprite (using a transparent rectangle as a texture) alongside any applied illumination it has.

Basically, I’m trying to do something like this:
expected output

But using three lights, the sprite and a mask I’m getting this result:

actual output

Notice how the two lights at the bottom are bleeding through the mask, and revealing the actual texture.

I’ve already tried assigning the same light_mask property to the the Light2d nodes as the mask’s item_cull_mask, but that doesn’t seem to be doing anything.

Is there a way for the mask to also affect the lights? Or is there a better approach I could use to achieve this effect?