Windows 10 x64 - Gtx 680 - GD v.3.0 x64
Hello, Godot devs...
I have come across a very make or break issue for me in Godot, and that is when I use a light2D with the blending mode Mix or Mask and if that light2D gets close to some or sometimes all of them, light2D's then it will randomly turn off / or get cut in half... Now if I re-open the scene all the lights who is in or close to the light2D with mix/mask mode will be randomly on or of. I've been experiencing this since 2.1.x and up to now on my main win 10 computer and on my win 10 x86 laptop in the editor or exported version of the project.

How I reproduce this:
Example project:
https://www.dropbox.com/s/f0und6dkzzugxx2/Light2DModes_Project.zip?dl=0
Light2DModes_Project.zip
Related or maybe the same as #7485 on 2.x
I think Light2D was not touched since the migration to the new renderer thus it has the same and more bugs as before, I hope CanvasItems get some love before the 3 alpha proper.
This is because lighting in godot works with multiple passes in 2D, should be changed to single pass but it's a good amount of work, so kicking to 3.1
Getting issues with this too in 3.0 alpha2, I just can't have more than one light set as mask. If I do, they just all turn off, or I can see only their intersection somehow.
This will get fixed when single pass 2D lighting is implemented, ran out of
time to do this for 3.0
On Wed, Nov 8, 2017 at 6:58 PM, Marc notifications@github.com wrote:
Getting issues with this too in 3.0 alpha2, I just can't have more than
one light set as mask. If I do, they just all turn off, or I can see only
their intersection somehow.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/8685#issuecomment-342974467,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2-lIzZlUwi9tq_dpwTN1J-W_3pOqks5s0iQMgaJpZM4NTQX6
.
This is impossible to fix in 3.1, will have to wait for Vulkan and single pass rendering, so kicking to next version.
See also #7485 for related Light2D issues (potentially duplicate, didn't investigate fully). Both bug reports should be handled together eventually.
Chiming in on the issue. I read that there was concern with doing lighting in a single pass on GLES2 because it would have to be rendered to an internal atlas which means a limit on the number of lights and/or size. I personally think that's a totally acceptable trade-off (maybe it's configurable) because right now 2d lighting isnt very useful on mobile. Im planning on implementing my own atlas essentially to workaround it for mobile and would love to use the built in lighting if possible.
@giulianob at the current stable version you may be able to use a dynamic texture on lights to adjust the mask, a viewport texture or something like that.
How does that help it so the lights are rendered in a single pass?
Your mask will be on a single light, the problem is with many lights in mask mode.
I was mainly talking about performance of light because another issue linked to this one. I was referencing reduz comment
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.
I was just mentioning I personally would find that useful if it was done on a single pass even if it limited the size and number of lights as long as I could fine tune and adjust some parameters.
Still reproducible in the current master branch (966c68ba) with project from #22981:
light2d_as_mask.zip
According to @reduz's comment above, this should be fixed in 4.0 but will likely stay broken on 3.2 (unless someone else finds a way to solve it with refactoring the whole 3.x rendering).
It may remain broken for GLES2 on 4.x too.
Another reproduction project from #14361:
https://github.com/godotengine/godot/files/1537745/normal_mapped_lighting_bug.zip
See also GIFs there.
Wow did not expect this issue to hang in as long as it did, interesting. I don't even remember what that project was. : )
We are having the same issue here. I am thinking about baning Light2D, because it really can drive one craz.
A designer uses a light2d in a scene.
The scene gets instanciated multiple times.
Everything works fine, until the Light2D's touch.
Makes everything very unpredictable, and really cumbersome.
Even if it gets fixed in vulkan, HTML export will suffer.
Will this be fixed in v 4.0 / Vulkan?
It is vital for me because I'm currently developing a commercial project with a must-have 2D light in mask mode.
Thanks!
Most helpful comment
This is impossible to fix in 3.1, will have to wait for Vulkan and single pass rendering, so kicking to next version.