I wanted to discuss with you lot ideas for transitioning between shadow lights in a level. This is an area of confusion for me, because I can't think of a good way to do it.
What I mean is, imagine you have 1 light in your game which can cast realtime shadows. This light is in the middle of a room on the ceiling. All the shadows cast from this light. Fine, but what happens when you leave the room and move into the adjacent room which also has a single light source in the middle? You want shadows cast from there too. (Assume this is an FPS and that only one shadow source is allowed).
In a previous game, I placed the shadow light source at blended points between game lights. So in the above example, as I moved from room 1 to room 2, I interpolate the shadow light position between the two light positions as the main character moves. This meant the shadows were always smooth, and the player had a correct looking shadow, but all the scenery and other characters ended up with bizarrely moving shadows which didn't really make sense.
So there has to be a better way ...
One thing I think is a given is that objects outside the range of the closest light source to the player shouldn't cast shadows. So while you could still have a light source in room 2, illuminating stuff correctly, nothing in that room should cast shadows while the shadow source in room 1 is active (because the player is there). Otherwise their shadows wouldn't make sense.
Using that method you could blend shadows in and out based on proximity to light sources. So when the player is right next to the light in room 1, the light source shadow intensity is full. Everything in range of that light source casts a full darkness shadow. As the player moves away, there is a point at which this shadow intensity dims, and when the player is exactly half way between light source 1 and 2, no shadows are cast at all. As the player moves closer to the light in room 2, the shadow intensity increases again and this becomes the new shadow source.
The problem with that method is, levels would have to be intelligently designed so that no shadow source is too close to another one, otherwise you would have noticeable shadow intensity changes. If light A had a range of 10 and light B had a range of 10, both lights would have to be at least 20 units apart, otherwise there would be a noticeable switch when the shadow source changed.
Anyway, there are probably other approaches, and I'd be curious to know what people think. I'm also interested in multiple shadow source locations, but I think single shadow sources are particularly interesting because of performance.