- Home /
Realtime light doesn't work in Game window when shadows enabled, works fine in Scene view
I have a weird issue with a shadow-casting spotlight; in the Scene view it works as expected, but in the Game view (and standalone builds) it doesn't illuminate anything. If I set Shadow Type to "No Shadows" the light reappears. Any spotlight with shadows enabled has this problem now.
This same light used to work fine and I'm not certain at what point it stopped working in Game view. I suspect it happened after one of the latest Unity updates but didn't notice since I was working on another project at the time I did all the recent updates.
It almost seems like there is some invisible object blocking the light at the source, but I don't see why it would only do so in the game view (even if the game isn't running).
I've checked my quality settings, I've tried hiding all objects except the light, disabled all other lights, changed rendering path, disabled UI, disabled camera effects, but nothing changes.
Does anyone have any suggestions? I'm stumped and I can't find any references to similar issues online (usually people have the opposite problem). Thanks!
I just stumbled across the cause: it's the occlusion culling, of all things. If I turn off Occlusion Culling on the camera, I can see the light in the Game view again, but I still don't know why this is a problem all of a sudden, or how to fix it. Rebuilding the occlusion doesn't fix it. I think I will enter a bug for this.
Bug ID https://fogbugz.unity3d.com/default.asp?737785_vhha520o0o88rv2i if anyone else needs to track it.
Your answer
Follow this Question
Related Questions
Shader - Directional Lights Depth 0 Answers
Lighting/Shadows: my cube did not cast nor receive any shadows 2 Answers
Shadow artifact 0 Answers