- Home /
Unity 5.3.5 lightning
I'm working on a game and I've got some issues with lightning passing through several walls. I'm not so sure why this occurs, is it because of something with the model or is it because that's how Unity works.
Here's some pictures what I'm talking about:
from the outside from the inside
lower floor [3] http://i.imgur.com/vVu2L3e.jpg
upper floor, above the room [4] http://i.imgur.com/xqykXvP.jpg
What's causing the light passing through walls? Is it because of the model?
Are the walls joined to the floor in the mesh? Or seperate meshes?
You should think about how lighting works in real life and how it affects objects in real life. Anything with a gap will have light shining through. I'd suggest adjusting your geometry so that it is joined if it is not already.
After redoing the whole topology of the house, which should be perfect now, the light keeps co$$anonymous$$g inside. It's kinda annoying.
I agree with NicoLocke, also you can define a layer for those objects which you do not want to lighting them, then from your Light --> Culling $$anonymous$$ask uncheck that layer.
$$anonymous$$y topology seems to be fine, the floor and the walls are connected. Shadows are not enabled, but when I enabled them it made no difference. I guess I'm going to unlink them, and going to uncheck the culling mask. Thanks !
If you want shadows, make sure they are always enabled on both light sources and the objects themselves.
I've checked the topology again, and indeed there were some problems. Silly me, it was made a long ago.
Answer by IgorAherne · May 25, 2016 at 11:08 PM
Check the shader that is attached on the mesh, perhaps it's not using/writing to shadowmaps, so you won't see shadows.
As mentioned, topology might be freaking out, especially when you have concave polygons. In that case your triangles might be messed up.
Also, make sure that "recieve shadows" is checked on the house mesh
This picture is typical if you have no shadows enabled, since it's pure lambertian shading in that case (shader will highlight what's facing the light, then shades darker anything pointing away from light). Your floor faces towards the light, so it gets shaded. Shadowmaps would overlay shadows on top of such areas, hiding the anomaly.
Reworking the topology, checking the shader and then fiddling with the light's shadows = great success. Thanks for the help !
Your answer
Follow this Question
Related Questions
how to stop real time shadows in Unity5 from blinking flickering and fritzing 4 Answers
Is it possible to keep the same lighting but baked? 1 Answer
Unity5: Changing AmbientSkyColor doesn't change Skybox Color 2 Answers
Is there a way to change ambient lighting locally? (Unity 5) 0 Answers
What will be the best light baking settings when baking for mobile devices in Unity 5 1 Answer