Why Occlusion Culling Improves Performance- Game Dev Series 156
Objective: using occlusion culling in Unity.
The main issue of 3D game performance is about rendering of 3D environment. When a game scene becomes bigger, the time of spending to render would be longer.
However, Unity provides an setting option called Occlusion Culling that can help developers to improve the performance.
The function of Occlusion Culling is hiding the static objects that are not in the field of view of camera, by doing this to decrease the amount of rendering objects to improve the performance.
In this tutorial, I will show you how to make your game scene more efficient on optimizing.
Before we start using occlusion culling, we need to open the window to do the rest steps.
From drop down menu, select Window> Rendering> Occlusion Culling.
It will open a window besides Inspector.
Next, we will set the occlusion culling to all the static objects.
To do so, select objects you want to apply, and click on Static arrow from top right of Unity editor to call the menu.
In here we will check Occluder Static and Occludee Static. When it asks about enable for all the child objects, select yes and it will apply to all.
Then switch to Occlusion window to the Bake tab and press Bake button at the bottom.
You should see the game scene now just objects are in front of camera lens stay appear, and the others are gone.
If you could not see the result same as mine, make sure select Visualize from Occlusion Culling window in Scene.
Select camera and rotate on Y-axis, check the result of Occlusion Culling.
However, this would cause some new issue. If there has a Nav Mesh system in your game scene, it might cause some error since you deselect it from Static tab.
Here has a better way to get the same result and also keeps all your game function stay the same.
Select all the static objects and select Everything from Static label.
Then deselect the Contribute GI.
This mean we will keep all the effects on static objects except global illumination. Back to Bake tab of Occlusion window again, and press Bake.
Check the result and it should be the same.