Game Engine Lighting

I have always had lighting problems with blender (GLSL), whenever I add a lamp, it goes through all faces, so a lamp’s light on one side of the map would show up on the other side. The only light I found that didn’t pass through faces was the spotlight (doesn’t light in all directions, so doesn’t help). I also lowered the distance of the lamp, but that didn’t help. I’ve seen some really good lighting in most BGE demos. how is this achieved?

Here is a video of the problem:

this is not a BGE problem…
in computer graphics not all lamp type has shadow

and if you use shadow, you must set the near and far clips, see lamp settings

this is true in all game engine…
please dont hurt BGE…

I know all about making shadows, spotlights, and other stuff. I just need to know how to set up lamps right (so that the light doesn’t go through walls).

There are a few possible solutions:

  • Seperate different sections of the map onto different layers. Then add a lamp to each layer and set it to only light objects on it’s layer. That way an outdoor lamp wont light any objects on an indoor layer.
  • Bake as much of the lighting as possible then just have a couple of lamps for overall level/map illumination.
  • Use python to dynamically control each lamps level (or add/remove them) as the player enters different areas.
  • Alternatively, use logic bricks to add and and remove lamps accordingly.
    Hope this helps! :smiley:

Another thing that helps is to set the Sphere button on - this will make it so that any surfaces outside of the range of the light won’t be lit by it at all. I assume that the problem you’re having is in part that a lamp can light across the whole map, regardless of its distance setting - the Sphere button can help you out with that. Battery’s solutions are also good.

Thanks a lot Solarlune. It’s been so long, that’s exactly what I needed. Thanks for the feedback, battery and abc123.