unity-game-engineocclusionocclusion-culling

Unity 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:

Imgur

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][https://drive.google.com/open?id=1d-dsYILJfFvQ3OudoX9mqON0WozH95tO].

I have baked occlusion with the following settings:

alt text


Solution

  • 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.