Preventing multiple light2d sources from stacking.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MrMurlok
:warning: Old Version Published before Godot 3 was released.

Hello and thank you for your attention.

My issue is the following :

I have a player-centered light2d source and I wish to implement some other statics light2d sources. When the player is near another light source, the lights stacks and over-illuminate the area and the player :

light2d_exemple

  1. No shadow, no light source, colors are normal
  2. Shadows, player-centered light, colors are fine
  3. Shadows, player-centered light AND another light source above the player, colors are too bright.

Is there a way to “cap” the global light intensity so that when two light sources overlap it doesn’t over-illuminate what is under ?

Hello, in light mode try with Mix instead of Add, maybe it can work, another thing is that the ships are in a layer of light (Item Mask) next to other ships and objects and the other lights generate in another layer of light (Item Mask)

Aquiles | 2017-01-31 16:58

Using the “mix” instead of “add” is exactly what I needed here. Thank you !

MrMurlok | 2017-01-31 17:41

:bust_in_silhouette: Reply From: MrMurlok

As user Aquiles taught me, the solution is simply using the “mix” light mode instead of the default “add” mode.

Excellent that you use that solution, luck with your project.

Aquiles | 2017-02-01 01:42