- Home /
Occlusion Culling breaks in fully enclosed room
In my game I have closed rooms with teleporters in them to bring you to the outside. However, when baking Occlusion in Unity, when the camera is inside of the enclosed room, it starts to cull away objects inside the room.
For example:
While flying around outside of the room it works perfectly. (Video of me going in the room and culling the inner walls away)
One stupid workaround I found was to create a small hole in the room so that when baking, the occlusion culling system things it's part of the outside.
Main question: Does anyone know how to instruct the Unity Culling System to calculate the occlusion culling for when inside of rooms too?
I have a tiny reproducible test scene which can be downloaded here.
I have baked occlusion with the following settings:
Answer by Marco_Stone · Jun 04, 2020 at 03:13 PM
So I contacted Unity support and they were quick to help me.
As it turns out, this is just a bug in Unity that they say they won't fix. This was the bug report that was put onto "Wont Fix": https://issuetracker.unity3d.com/product/unity/issues/guid/1211838
The workaround as mentioned in the issue, is to make one of the walls NOT "occluder static" to trick Unity into thinking that it's a hollow room.
In my scene objects marked as occluder static, not occludee static are also being switched off unexpectedly.