I’ve been developing a dynamic lighting system for my 2D game that can raycast shadows. For this, I’ve been using LibGDX, creating an FBO for a lightmap and drawing the shadow polygons to it (I’m a complete newbie at this so FBO’s might now be the most efficient way). From what I’ve read, most lightmaps are blended in by multiplying them on, which makes sense. If you use colors like blue as the base to your light maps, you can give a nice ambience to rooms.
However, in outdoors scenarios, sometimes it’s preferable to use white as the base color, so that the visuals appear clear and not darkened. This is where my problem is. For my lighting system, I’d also like to use additive blending to make lights have a gradient effect. In normal light maps, that’s fine, as it would lighten the base color, giving the effect regardless. But if the base color is white (or just a very bright color) then the light’s gradient can’t be blended onto the lightmap, because it would still result in white.
What is the best way to ensure that all lights have a visible gradient? Should I just use two FBO’s instead - one that’s multiplied and another that’s added? Would that be too expensive of an operation?
Thank you for your help.
To clarify, the above picture shows what would happen in a lightmap where the base color is white. Here, the sun is the light source. As you can see, the light doesn’t get shown on the left, because white is the highest value possible. The one of the right does show it, because it allocates all of the glows into a separate FBO with a black base and adds it. Are there better ways to achieve the same thing that the right one does?