Operating system or device - Godot version: Godot_v2.1.1-stable_win64.exe
Issue description (what happened, and what was expected):
My game has a darkness image, which fades to 100% opacity as time progresses.

Fire allows one to still see, by masking out a portion of that parent image.

But if I have a second fire instance, the lighting behaves unexpectedly if they're both over the darkness image simultaneously.

Intuitively, one would expect masks to only affect the area covered by the Light2D's sprite. Instead, the whole image blacks out as soon as more than one mask overlaps an image.
Steps to reproduce:
Create some image and a Light2D that masks it. Add another masking Light2D and watch it wig out when they're both within the bounds of the target image.
Link to minimal example project (optional but very welcome):
Mask.zip
This issue is present in master too (tested in b21a1232b)
just bumped into this working on my project, don't know yet how to work aroung it (v2.1.4)
Edit: According to https://github.com/godotengine/godot/issues/8685 it will be fixed in 3.1
problem with this is that lights are done in multiple passes. This could be
fixed by drawing them in a single pass, but then it would limit the size of
light textures as they would need to go to an internal atlas. Not really
sure if much can be done to fix it (and keep it compatible on low end
hardware and mobile).
On Wed, Nov 22, 2017 at 12:08 PM, Khin Baptista notifications@github.com
wrote:
just bumped into this working on my project, don't know yet how to work
aroung it—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/7485#issuecomment-346377880,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2y_IqVDeI4VZS_mgSddO7StzbmNPks5s5DjsgaJpZM4LehZX
.
@khinbaptista the only workaround I can think of (via scripting) is to modify the image data every time the light sources are moving (use instead a single light as mask on the screen and stamp the images to the texture), may hit performance and perhaps not too android friendly.
I have no experience with light shaders so no idea if something better can be done with these.
oh you can always use a viewport as a light texture for masking btw.
On Wed, Nov 22, 2017 at 1:21 PM, eon-s notifications@github.com wrote:
@khinbaptista https://github.com/khinbaptista the only workaround I can
think of (via scripting) is to modify the image data every time the light
sources are moving (use instead a single light as mask on the screen and
stamp the images to the texture), may hit performance and perhaps not too
android friendly.I have no experience with light shaders so no idea if something better can
be done with these.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/7485#issuecomment-346400486,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z23cZRujlYWATGRXEocnBi6J1pKqLks5s5EobgaJpZM4LehZX
.
Still having this problem in 3.0.2, when using a light mask in the scene. It is totally random if the other lights will work or not. Need to reset the game until all lights are working.
However it works when i use the canvasmodulate with solid black, just like the official 2D lighting demo does with a lighter grey.
Dont really know how to do the viewport thing that reduz suggested.
@fossegutten this issue is not solved yet, check related https://github.com/godotengine/godot/issues/8685#issuecomment-342995695
This should be solvable on Vulkan eventually since we will be able to do
this as single pass
On Sat, Mar 24, 2018, 09:34 eon-s notifications@github.com wrote:
@fossegutten https://github.com/fossegutten this issue is not solved
yet, check related #8685 (comment)
https://github.com/godotengine/godot/issues/8685#issuecomment-342995695—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/7485#issuecomment-375906046,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2wWEI88ynQHN90hfiD86s1Jt1WjDks5thnWbgaJpZM4LehZX
.
@reduz any chance to get something on GLES2?
oh you can always use a viewport as a light texture for masking btw.
I don't think that's possible right now, because of: #17067
Is there currently any other options to have multiple lights(2d) with masking or to combine multiple textures to a light mask?
I'll merge this issue together with the related #8685.
Most helpful comment
oh you can always use a viewport as a light texture for masking btw.
On Wed, Nov 22, 2017 at 1:21 PM, eon-s notifications@github.com wrote: