Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm currently having a problem with lights in Unity. They shine through walls for some reason.

Point, directional, etc. If a light is next to a wall on one side, you can see it on the floor on the other side. I believe this has something to do with culling masks or light culling.

I was wondering how I could go about culling the lights so they no longer shine through walls. Any help is greatly appreciated.

I'm on Unity 4.x Pro, so I have all the features for that.

Here's a picture of a light on one side of the wall:

And here's it shining through to the other side, which it's not supposed to do:

share|improve this question
3  
Free version? Dynamic lights can have no shadows in the free version. Shadows hide lighting through walls. –  snake5 Dec 21 '12 at 16:37
    
I accept questions whenever they're right, I make sure to. I just tend to have a lot of times where no one can help me or I solve it myself. I'll post some pics, and it's Pro version. –  Timothy Williams Dec 21 '12 at 16:54
    
So then shadows are turned on? –  Byte56 Dec 21 '12 at 17:10
    
Yeah, shadows are turned on for all the lights. –  Timothy Williams Dec 21 '12 at 17:15
    
How is the geometry defined? Is the wall properly connected to the floor (i.e. explicit edge), or is it just put straight onto or through the surface of the floor? –  Paul-Jan Dec 22 '12 at 10:06

2 Answers 2

I would double check on the shadows for that particular light, that's exactly what should happen in deferred rendering when you have shadows off for a point light.

share|improve this answer
    
That was my first thought as well. I checked the light's shadow settings, turned it completely off, tinkered with things, etc. No matter what it always went through the wall. –  Timothy Williams Dec 21 '12 at 19:10
    
Are you using forward or deferred rendering? –  Mike Dec 21 '12 at 20:26
    
We use deferred rendering currently. –  Timothy Williams Dec 23 '12 at 21:34
up vote 2 down vote accepted

I managed to fix the problem, turning the shadows to Soft Shadows, setting the strength to 1, and putting a culling mask on certain objects made the light shine on the proper surfaces and not pass through anything.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.