Lighs penetrating walls.

Im sure you guys have had this before, the light from a lamp goes thrue a wall, and lights up anything on the other side too, its annoying, and ruins the game experience.
How do i stop that?

Hello
put the objects that shouldn’t be affected by the light in another layer, and enable the “Layer” buttom for the lights!
Bye

Thanks oto, good idea, but ive heard of this way of, by some settings, stop the light from affecting beond some point, but im not sure if that works in glsl.

Its a common problem, the only way to get lights to truly not penetrate a wall is to use the GLSL spotlight with shadows turned on. This can cause a large drop in fps depending on the nature of your game however.

This does work in GLSL. If your using a simple lamp just go to the lamp settings in the materials/lamp panel and change the value ‘Dist’ (Distance) which is by default 20. You can also mess around with the Lamp falloff drop down menu which is usually set to Inverse Linear. Some other options might give you the drop off effect your looking for.

well, the drop effect im looking for is when for the light to simply not illuminate anything on the other side of a mesh.
So, there is no real way, not even in 2.50?

Just bumping it up.
I nstill need a hint here.

Its just the nature of the game engine, if you think about it logically, to get the lighting to work the way youd like then the calculations would be immense. Every piece of geometry would have to be evaluated to work out where the light hits it and then how that effects any geometry behind it and so on. Effectivly it would be massive shadow support on every light in the scene. You should know that shadows are only just new to the BGE, and at this point pretty much unoptimised.

Basically the BGE hasnt been programed to do it that way.

aw damm!
'Hmm, more work for me i guess.

Have you tried a spot lamp with buffer shadows?

Yeah, but spotlights drain waay to much prossesor power…

lower the power of the spot lamp, then make it sphere, then lower the distance. total frame saver:yes:.

thanks for that :smiley:

Setting lights to “sphere” did the trick for me. However it only worked after I got my new graphics card and was able to run the GE in GLSL mode. If your graphics card can’t handle the GLSL option there is probably still a solution but I imagine its a lot more complicated. I remember trying to find a way around this problem for months before I finally just caved and got a halfway decent graphics card.

You can get one for cheap these days though. I only paid $60 for mine - a Geforce 8400 GS. As far as I know this is on the lower end of modern graphics cards - but it seems to run some impressive blender GLSL effects without much trouble or slowdown. I guess what I’m saying is you should probalby just go get a graphics card. They don’t cost an arm and a leg like they used to unless you get the really high end ones.

It just crossed my mind that you could bake the shadow maps and lighting details, I’ve seen it done really well before for horror games in the BGE which require a lot of darkness and shadows.
It would mean pretty much static lighting though.

Omg, that never even crossed my mind, but i that was a good idea, really.
The enemies dont need to be lit up, and cowered in darkness all the time either.
Thanks. =D

Should i use mist you think?

Ahh crap!
guys, i dont remember how to bake lightning…
That was a long time ago.

To bake shadow and Ao, that is what I think that ll give more realism to your scene, just create a new Uv layer , press U in edit mode and then use Lightmapuv pack, after just create a new Image on Uvimage editor panel, the image need to be lower than 2048x2048, I dont know why that s what I read, set up your lights, if you have something that uses alpha map you ll need a light withtraceshadow, go to the scene panel or press f10 then to bake subpanel, chose shadowmap or Ao map, you need to turn on the AO to make the Ao map, play with the settings and press bake, you cant make an Ao bake and a shadow bake on the same time so you ll nedd to create a new texture on the Uv image editor and then bake again.
now just tun the shadless on in your material panel to make the light not afect the other sside of the wall, if you are using normal maps for the floor or walls you ll need to use material nodes to make the bump effect work fine, just use an muliply color linking the both material the baked one and the bump, I just wonder this now, i dont know if will really work.
I hope that this help you.
Sorry about the english I m brazilian.

Wow, hey, nice answer!
Awsome, that helped a lot. =)