Hi, I’m adding lights to a night market in my game.
At first, everything went fine. But when I added more lights to the scene, some weird problems appeared. Looking at the player’s position, unexpected shadows appeared. I don’t know why there are shadows, and this appeared just after I added more lights to the scene (20-30, which I don’t think are a lot).
Has anyone encountered the same problem before?
Hi! Can you be more specific about which unexpected shadows appeared near the player’s position? It’s a little hard to see what the issue is from an outside perspective.
With that said, I remember learning that there is a limit to how many lights you can have affecting each sprite before things get weird. So if the issue started right after adding additional lights like you said, then you might be running into that limitation. However I’m not sure if that’s the case here because I’m having a hard time determining exactly what the problem you’re witnessing is. You can try decreasing the range of the lights so that each light is affecting less sprites and see if that changes anything.
Hi, thanks for your reply!
If it weren’t for you, I wouldn’t have known that Godot’s lighting system has a limited number of lights. In fact, most of my “lighting nodes” don’t need to be Lights, because I never use shadows. But I couldn’t light the night nodes with sprites, so I chose to use light2D. Now I have to figure out how to light the scene with sprites.
I tried it again, and the additive blending mode of Sprite2D doesn’t seem to work well in a very dark night. I’m curious if there is a proper solution to the problem of adding many lights in the dark night. Shadows, on the other hand, are not a big problem.
Good luck! There is one trick you can try, which is using a canvas modulate node with a very dark color on top of the entire scene to create darkness, and then use lights with their blend mode as subtractive to remove the darkness. Not sure if that helps but worth a shot!