Unexpected behaviour when using Light2D and particles

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

I have a Light2D node on Mix mode. It works as expected, darkening the screen based on the texture alpha which I change using canvas modulate. However there are two situations where it doesn’t work.

  1. Overlapping particles change colour. A single particle on its own seems to look normal, but overlapping areas of the particles are darker – almost as if their colours were being added.
Correct - particles don't change colour when Light2D disabled
![Correct][1]

Incorrect - overlapping particles get darker
![Incorrect][2]
  1. When exported to HTML5 the problems get even worse. The red particles in the first part are not rendered and the silhouettes of any textures rendered on top of each other are all visible, as if the colours were being added and not masked.
Correct - textures and sprites obscured by those with higher z-index
![Correct][3]

Incorrect - Weird x-ray effect as silhouettes of hidden nodes are visible
![Incorrect][4]

Have I misunderstood the way Light2D works or are these bugs?

:bust_in_silhouette: Reply From: camarones

It appears to be a bug. I have submitted a report to Github. Rendering problems with Light2D and particles for WebGL 2 and desktop export · Issue #20098 · godotengine/godot · GitHub