Godot Version
4.3
Question
Is there a way to know the lights count used in a canvas_item shader?
I have a shader that creates a custom shadow in the light() function, one shadow per light, which works as intended. The problem is, wherever shadows overlap they make the pixels too dark, I would prefer to reduce the shadows alpha depending on the number of lights hitting the pixel.
I tried to create a varying to count the light passes, but Godot does not allow to assign varyings in the light pass, so I can’t count them.
I only found a proposal for this: https://github.com/godotengine/godot-proposals/issues/10527
…
Another thing that would be good enough for my case would be to be able to read the pixel color considering the previous light pass. But reading the screen_texture seem to always return the color before any light passes.