Version: Unity 6.2 (6000.2)
Language : English
DOTS Instancing shader functions reference for URP
Graphics performance and profiling in the Built-In Render Pipeline

Enable GPU occlusion culling in URP

GPU occlusion culling means Unity uses the GPU instead of the CPU to exclude objects from cameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
rendering when they’re occluded behind other objects. To speed up GPU rendering in scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
with many occluded objects, Unity uses depth information.

GPU occlusion culling works with GPU Resident Drawer, and restrictions apply similarly.

How GPU occlusion culling works

Unity generates depth textures from the perspective of cameras in the scene.

The GPU then uses the depth textures from the current and previous frames to cull objects. Unity renders only objects that are tested as unoccluded in either frame.

GPU occlusion culling uses a conservative approach to determine whether objects are visible in a given frame. The system works as follows:

  • Bounding sphere approximation: Each potentially occluded object is represented by a bounding sphere. As such, thin or elongated objects have a much coarser spherical representation than their actual meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
    See in Glossary
    , and Unity is less likely to detect that they are occluded.
  • Downsampled depth bufferA memory store that holds the z-value depth of each pixel in an image, where the z-value is the depth for each rendered pixel from the projection plane. More info
    See in Glossary
    : Unity uses multiple levels of a downsampled depth buffer to test occlusion. The level selected depends on the projected screen size of the bounding sphere, ensuring that the pixelThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
    See in Glossary
    size at that level is larger than the projected sphere. Unity tests larger bounding spheres against more coarsely approximated levels of the depth buffer.

Whether GPU occlusion culling speeds up rendering depends on your scene. GPU occlusion culling is most effective in the following setups:

  • Multiple objects use the same mesh, so Unity can group them into a single draw call.
  • The scene has a lot of occlusion, especially if the occluded objects have a high number of vertices.
  • Occluded objects have a small screen space bounding radius.

If occlusion culling doesn’t have a big effect on your scene, rendering time might increase because of the extra work the GPU does to set up GPU occlusion culling.

Enable GPU occlusion culling

  1. Make sure Compatibility Mode is disabled. Go to Graphics, select the URP tab, then in the Render Graph section, disable Compatibility Mode (Render Graph Disabled).
  2. Enable the GPU Resident Drawer.
  3. In the active Universal Renderer, enable GPU Occlusion.

Analyze GPU occlusion culling

You can use the following to analyze GPU occlusion culling:

Additional resources

DOTS Instancing shader functions reference for URP
Graphics performance and profiling in the Built-In Render Pipeline