Occlusion culling and lights

Hello everyone,

I’m currently struggling getting a good performance in my game with the hundreds of light I have in my levels.

So, to improve the performance, I a) used lightmapping and b) used occlusion culling.

While the light mapping is ok, I only get a real performance boost if I almost disable all lighting by reducing the shadow distance to almost 0.

On the other side, occlusion culling does not work as I would expect it. (All objects but the doors had been set to static).

Imagine you have 3 adjacent rooms. I have set up one occlusion area per room, slightly overlapping the adjacent rooms occlusion area (in order to be sure that any door works).

The strange thing is that the rooms don’t get disabled as expected. They only are hidden when they aren’t in the camera frustum anymore. Object in that room get visible/invisible in a strange way.

So I set the doors to static and re-boke the occlusion map. I expected the rooms to be invisible as long as I wasn’t in the room with my camera… but the rooms were still visible.

First question: Does anyone know why this is happening?

In those rooms I have a bunch of lights… I really mean a BUNCH of lights. I expected them to be culled also, when their light volume is outside the view frustum. But this doesn’t happen. They are always active.

Second question: Why aren’t they culled and what can I do to disable them, when they are not visible/used in the current view?

Third question: Is it possible to let the occlusion culling handle the light activation?

Thanks for your help…

bump no one?

bumpidibump

+1 … We’re currently fighting Unity 3.5 hard on this exact matter as well.

Attached image shows point lights that are not occluded inside room full of meshes (balls) that are occluded … Even if standing outside the room facing the lights (you can not see) we have the same performance hit as when inside the room … although no pixels of light are on the screen!

Maybe there is a way to hack this at current implementation, but we’ve tried everything and will have to rely on a homemade script on all lights that fades lights out and disables them at a certain distance from the player … which is not entirely optimal! ;(

Hi,
I have been struggling with this issue for a week now and here is my approach.
First set the whole scene under the same occlusion area. Add occlusion portal component to the doors then bake.
Regarding the lights, i am still unable to find a solution. There is a function OnBecameInVisible which i am trying to use, but its opposite OnBecameVisible is being called when it shouldn’t be.
You can find here a reference to my post
http://forum.unity3d.com/threads/128226-Slow-FPS/page2
I am thinking this might be a unity bug, but i still don’t have any confirmation. If you happen to find a solution just let me know