So I've come up with a way to have 100s of dynamic lights in the scene. The overhead is about the same as rendering the shadow maps. So when the shadow maps turn off for the night...I switch on the dynamic light rendering code. So the game's frame rate stays the same throughout pretty much.
There are a number of things I'm doing to make this work...
1 - 'Window maps' [/ glow maps] for every building in the city. These window maps represent the reflectiveness in day; and the luminosity at night. They're usually a 128x128 or 256x256 texture of the building texture, with white representing window, and black representing everything else.
2 - Support for 100s of lights dynamically. This is pretty much faked using projective texturing and a light-lookup done by each object to determine the most influencing light source. So each entity isn't affected by more than 1 light source...hackish, but it works. Though any part in the city can theoretically be affected by 100s of lights at once. I use projective texturing for the car headlights, streetlights, etc. I'm still working on this area a bit. I'll have more once I finish everything up.
3 - Post process glow. I'm rendering these window maps into a separate texture and doing a blur and output of the result. This produces a washout effect.
I still need to tweak a lot of the window maps, I got better half way through the process of creating them, and so the first ones aren't as good/clean. Got to go back and touch them up.
Streetlights are still buggy, sometimes the projected light textures don't blend right at geometry intersections. I need to fix this. Should be done tonight.
Lots of other work to do as well...these are by no means final...just a work in progress. Let me know what you think...
//Just after sunset looking across the city. I enjoy the look of this screenshot.
//Though it's probably not representative of the final product, I do like the look. The 'window maps' really added a lot to the night time scenes.
//I still need to go through and 'turn off' some of the windows to make it look more realisitc. Right now they're all turned on, for testing.
//1000s of streetlights throughout the city.
//This is a screenshot of the buggy implementation.
//Numerous errors in this screenshot.
//I'll hopefully have this all wrapped up soon.
//Dynamic test light in the front center. It follows the cursor all over the city.
//I like this screenshot. The sky is pink because the sun is going down.
//Though if you're in a big city at night and you look up at the sky...it will have a similar pink glow due to all the lights in the city. That's why I like this screenshot so much.
//Up high. You can see one of the dynamic test lights following the cursor in the middle of the screenshot.
//This is how all streetlights/headlights are implemented.
//Yup...big time work in progress.
//New post process glow, high end ps2.0 version
//New post process glow, high end ps2.0 version
//New post process glow, high end ps2.0 version
//New post process glow, high end ps2.0 version
- Dan
Seriously though, it looks great, and I love the night scenes. When can we expect to be playing this?