Skip to main content

How to set up a scene for occlusion culling

By default, Unity will put the entire scene into one big chunk of space, called a View Volumes.

If you place an Occlusion Area into the scene, Unity will only calculate occlusion data for the inside of that space, which can make the occlusion data much smaller. If your scene is split into multiple seperate areas, consider covering them with Occlusion Areas instead of letting Unity calculate the entire scene as one big volume.

You can set occlusion settings from the Static flags on an object, or the Occlusion window.

image-1643384082055.png

Only big, solid things should be occluders!

This is a simple rule of thumb. If it's small, or transparent, or it has a hole in it, it shouldn't be an occluder. Trees shouldn't be occluders because they have leaves which create lots of tiny holes which can't be represented by the occlusion. Complex edges are bad.

If it's always visible, don't make it an occludee!

If you have a skybox, or an ocean made of a gigantic plane, there is no point in allowing it to be occluded. The number of false positives will exceed the performance gain.

Make smaller objects occludees, but not occluders.

Just because something is small doesn't mean it won't benefit from occlusion culling.

Use the EditorOnly tag to create fake occluders!

If an object has the "EditorOnly" tag, it won't render in-game. However, it'll still be considered during the baking process.

How do I preview occlusion culling?

In Unity 2018, occlusion culling affects the Scene camera. Besides that, if you select Visualization in the Occlusion window, you can see how the occlusion works on cameras in the scene.

When you select Visualization, the scene Hierarchy will be filtered to only show objects with Camera components, and the occlusion culling for the currently active camera's perspective will be shown.

To go back to normal, switch to the other tabs in the Occlusion window or close it.