+2 votes

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 lightmask property to the the Light2d nodes as the mask's itemcull_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?

Godot version 3.4.4
in Engine by (33 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.