Lighting a whole city

Hey all,

If I have a massive city scene, with dozens of buildings onscreen, is it completely unfeasable to light them using spotlights in GLSL or should the lighting effects be baked using light maps? I, personally, would prefer to have everything dynamically lit, but is there a limit to how many lamps that can be rendered at once on screen? It’s just streetlights should ovviously use spotlights, and to make the light shining up the buildings it’s easy to use spotlights. Oh well. Here’s some fireworks for your trouble: http://www.youtube.com/watch?v=G8sPADP2UU0&feature=channel

Many thanks,

1/1 credit(s)

Only use dynamic lighting for the dynamic objects, the static objects (like the buildings) should have shadeless (I think?) checked in the materials tab and use baked lighting (and ambient occlusion while you’re at it). It may be worth while to also disable lights that are a given distance away from the player.

Dynamic lighting is possible. Like andrew said, it’s most economical to just bake the lighting, but you could use a giant spotlight for a shadow and a hemisphere light for even ambient lighting - that’s not too bad on the Rasterizer.

Also, baking the details allows you to increase the quality significantly. Have a coffee while you bake 20 passes of ambient occlusion ^^

A good trick is to parent a spotlight to the player so the player’s shadow always casts in a single direction - I believe Yo Frankie! does this.

Ambient Occlusion really does help make lighting look great - you’d probably be surprised at the number of current games that don’t actually use realtime ambient occlusion and other such things and just stick with standard baked AO.

Actually it’s really bad idea to enable shadeless. Here is short brief of how to bake and use lightmaps correctly.

Make your scene, adjust your lights until you are satisfied with lighting, then disable ALL textures on every material you need to have lightmap, this is really important to do.

Lightmap should look like this

not like this.


Then just use Full Render bake mode to bake lightmaps.

After you have your new shiny lightmap, make it as new texture for your material, change mapping to UV and layer to which ever you need. Now most important thing at the influence panel is to check RBG to intensity and from shading influence enable emit and adjust emit value as you like, now your lightmap works just like it should work and you can enable all other textures. Just remember if you need to bake lightmap again, disable textures.

Would be nice to have option which will only bake lighting without any color textures, would save alot of time when baking complex scenes.

Awesome ideas! I think that baking lightmaps will be the best solution - and yes, AO does look great. Perhaps dynamic lights can be enabled when the player is closer to buildings, so the “lights” light him up or something. I suppose this can all be done using python, by disabling the lights?

Just a quick question - do you know the best method to make window lights in buildings? I was thinking of adding lots of shadeless planes with white colour and arrange them on the sides, although this might be inefficient due to lots of time wasted and the engine considering each window to be a separate object. I guess it could be done using textures. Hm…

Use an Emit map. Basically, a white and black image where the black is no light emitting, and white is complete emission. Use that to make the windows shadeless.

Emit map:


Here’s my window maps on TS. Not trying to sell them or anything, it’s just the easiest way to show you what I mean.

http://www.turbosquid.com/FullPreview/Index.cfm/ID/565886