Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.0.8] - 2023-04-17

### Added

* Support for CPU-based (Burst) masked occlusion culling on Neon processors.
* Explicit usage of Burst's FMA optimization, parallel sort, and missing changes from previous review feedback of boc-neon branch

### Changed

* Greatly improved performance of CPU-based (Burst) masked occlusion culling.
* Greatly improved performance of Depth and Test debug views used with CPU-based (Burst) masked occlusion culling.
* Reduced the amount of memory allocated by allocating based on the maximum number of worker threads the running platform requires rather than defaulting to using a theoretical upper-bound of 128 worker threads.

### Fixed

* Entities Graphics Occlusion shader throws errors when building the project
* Fixed a GraphicsBuffer leak that could occur in cases where Entities Graphics is running without any entities to render.
* enabling/disabling per-view occlusion
  • Loading branch information
Unity Technologies committed Apr 17, 2023
1 parent 5cf4226 commit 51d4814
Show file tree
Hide file tree
Showing 41 changed files with 2,043 additions and 724 deletions.
1 change: 0 additions & 1 deletion .footignore

This file was deleted.

21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@

# Changelog

## [1.0.8] - 2023-04-17

### Added

* Support for CPU-based (Burst) masked occlusion culling on Neon processors.
* Explicit usage of Burst's FMA optimization, parallel sort, and missing changes from previous review feedback of boc-neon branch

### Changed

* Greatly improved performance of CPU-based (Burst) masked occlusion culling.
* Greatly improved performance of Depth and Test debug views used with CPU-based (Burst) masked occlusion culling.
* Reduced the amount of memory allocated by allocating based on the maximum number of worker threads the running platform requires rather than defaulting to using a theoretical upper-bound of 128 worker threads.

### Fixed

* Entities Graphics Occlusion shader throws errors when building the project
* Fixed a GraphicsBuffer leak that could occur in cases where Entities Graphics is running without any entities to render.
* enabling/disabling per-view occlusion


## [1.0.0-pre.65] - 2023-03-21

### Added
Expand Down
18 changes: 9 additions & 9 deletions Documentation~/TableOfContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* [Hybrid Entities](hybrid-entities.md)
* [The BatchRendererGroup API](batch-renderer-group-api.md)
* [Mesh deformations](mesh_deformations.md)
* [Burst occlusion culling](burst-occlusion-culling.md)
* [Requirements and compatibility](burst-occlusion-culling-requirements.md)
* [Overview](burst-occlusion-culling-overview.md)
* [Setup](burst-occlusion-culling-setup.md)
* [Optimize occlusion culling](burst-occlusion-culling-optimize.md)
* [Rendering Debugger Culling tab reference](burst-occlusion-culling-debug.md)
* [Components](burst-occlusion-culling-components.md)
* [Occluder component](burst-occlusion-culling-components-occluder.md)
* [Occlusion View component](burst-occlusion-culling-components-occlusion-view.md)
* [Burst Occlusion Culling](burst-occlusion-culling.md)
* [Requirements and compatibility](burst-occlusion-culling-requirements.md)
* [Overview](burst-occlusion-culling-overview.md)
* [Setup](burst-occlusion-culling-setup.md)
* [Optimize occlusion culling](burst-occlusion-culling-optimize.md)
* [Rendering Debugger Culling tab reference](burst-occlusion-culling-debug.md)
* [Components](burst-occlusion-culling-components.md)
* [Occluder component](burst-occlusion-culling-components-occluder.md)
* [Occlusion View component](burst-occlusion-culling-components-occlusion-view.md)
* [Runtime Usage](runtime-usage.md)
* [Runtime Entity Creation](runtime-entity-creation.md)
* Sample Content
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Occlusion View component

An Occlusion View MonoBehaviour component specifies which cameras, lights, and reflection probes use Burst occlusion culling. It also configures the size of the buffer to use for occlusion culling calculations which affects the resource intensity and precision of the calculations.
An Occlusion View MonoBehaviour component specifies which cameras, lights, and reflection probes use Burst Occlusion Culling. It also configures the size of the buffer to use for occlusion culling calculations which affects the resource intensity and precision of the calculations.

## Occlusion View Inspector reference

| **Property** | **Description** |
| --------------------------- | ------------------------------------------------------------ |
| **Occlusion Enabled** | Controls whether the attached cameras, light, or reflection probes uses Burst occlusion culling. |
| **Occlusion Enabled** | Controls whether the attached cameras, light, or reflection probes uses Burst Occlusion Culling. |
| **Occlusion Buffer Width** | The width of the buffer to use for occlusion culling calculations. This value should always be a multiple of 16. |
| **Occlusion Buffer Height** | The height of the buffer to use for occlusion culling calculations. This value should always be a multiple of 16. |

Expand Down
6 changes: 3 additions & 3 deletions Documentation~/burst-occlusion-culling-components.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Burst occlusion culling components
# Burst Occlusion Culling components

This section contains information on the MonoBehaviour components that configure Burst occlusion culling.
This section contains information on the MonoBehaviour components that configure Burst Occlusion Culling.

| **Topic** | **Description** |
| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [Occluder component](burst-occlusion-culling-components-occluder.md) | Understand the Occluder component, which creates and configures occluders. |
| [Occlusion View component](burst-occlusion-culling-components-occlusion-view.md) | Understand the Occlusion View component, which configures Burst occlusion culling for individual cameras, lights, and reflection probes. |
| [Occlusion View component](burst-occlusion-culling-components-occlusion-view.md) | Understand the Occlusion View component, which configures Burst Occlusion Culling for individual cameras, lights, and reflection probes. |

## Additional resources

Expand Down
2 changes: 1 addition & 1 deletion Documentation~/burst-occlusion-culling-debug.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rendering Debugger Culling tab reference

The **Culling** tab in the [Rendering debugger](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/Render-Pipeline-Debug-Window.html) includes debugging options and visualizations to help you investigate Burst occlusion culling issues.
The **Culling** tab in the [Rendering debugger](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/Render-Pipeline-Debug-Window.html) includes debugging options and visualizations to help you investigate Burst Occlusion Culling issues.

<table>
<thead>
Expand Down
8 changes: 4 additions & 4 deletions Documentation~/burst-occlusion-culling-optimize.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Optimize Burst occlusion culling
# Optimize Burst Occlusion Culling

If Burst occlusion culling is a good fit for a scene (refer to [When to use Burst occlusion culling](burst-occlusion-culling-overview.md#when-to-use-burst-occlusion-culling)), you can configure it to be bespokely optimized for the scene. This page explains the different methods you can use to get the best performance out of Burst occlusion culling for a particular scene.
If Burst Occlusion Culling is a good fit for a scene (refer to [When to use Burst Occlusion Culling](burst-occlusion-culling-overview.md#when-to-use-burst-occlusion-culling)), you can configure it to be bespokely optimized for the scene. This page explains the different methods you can use to get the best performance out of Burst Occlusion Culling for a particular scene.

## Optimize occlusion views

The Burst occlusion culling system can use a different buffer resolution for each view it processes. A lower-resolution buffer is less resource-intensive to process but produces a less precise culling result. If a view doesn't require precise occlusion culling results, you can reduce the resolution of its occlusion buffer to increase the performance of the Burst occlusion culling process.
The Burst Occlusion Culling system can use a different buffer resolution for each view it processes. A lower-resolution buffer is less resource-intensive to process but produces a less precise culling result. If a view doesn't require precise occlusion culling results, you can reduce the resolution of its occlusion buffer to increase the performance of the Burst Occlusion Culling process.

If an occlusion view uses a lower resolution buffer, the Burst occlusion culling system can misidentify some totally hidden objects as being visible. This means that the rendering system must unnecessarily process the objects. If you reduce the resolution of an occlusion view buffer, it's best practice to [profile](xref:Profiler) the scene to make sure that the reduced resolution doesn't degrade overall performance.
If an occlusion view uses a lower resolution buffer, the Burst Occlusion Culling system can misidentify some totally hidden objects as being visible. This means that the rendering system must unnecessarily process the objects. If you reduce the resolution of an occlusion view buffer, it's best practice to [profile](xref:Profiler) the scene to make sure that the reduced resolution doesn't degrade overall performance.

## Additional resources

Expand Down
16 changes: 8 additions & 8 deletions Documentation~/burst-occlusion-culling-overview.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Burst occlusion culling overview
# Burst Occlusion Culling overview

The Burst occlusion culling system disables rendering for entities that are hidden behind other entities. This reduces the amount of data that Unity uploads to the GPU every frame and the amount of unnecessary work that the GPU must do.
The Burst Occlusion Culling system disables rendering for entities that are hidden behind other entities. This reduces the amount of data that Unity uploads to the GPU every frame and the amount of unnecessary work that the GPU must do.

## How Burst occlusion culling works
## How Burst Occlusion Culling works

From the point of view of the cameras, lights, and reflection probes you specify, the Burst occlusion culling system determines which entities are completely hidden and don't need to be sent to the GPU for rendering. To do this, the system splits entities into occluders and occludees. The system gets all occluders and calculates which occludees are hidden by them.
From the point of view of the cameras, lights, and reflection probes you specify, the Burst Occlusion Culling system determines which entities are completely hidden and don't need to be sent to the GPU for rendering. To do this, the system splits entities into occluders and occludees. The system gets all occluders and calculates which occludees are hidden by them.

For performance reasons, the culling system doesn't use the same meshes in its culling calculations that the rendering system uses to draw entities. Instead, each occluder entity needs an additional lower-resolution mesh for the culling system to use instead. This occlusion mesh must be completely inscribed within the original mesh to avoid artifacts such as visible popping which is where objects appear and disappear visibly on-screen.

Entities that use the Mesh Renderer component with **Dynamic Occlusion** set at [author time](https://docs.unity3d.com/Packages/com.unity.entities@latest?subfolder=/manual/editor-authoring-runtime.html) will be occludees. It's your responsibility to specify which entities are occluders. For help on how to decide which entities should be occluders, refer to [How to choose occluders](#how-to-choose-occluders).

## When to use Burst occlusion culling
## When to use Burst Occlusion Culling

Burst occlusion culling isn't appropriate for every application or scene. Scenes with many unique objects (with unique meshes or materials) that produce a lot of overdraw are perfect for Burst occlusion culling. Examples of this type of scene include large open worlds, dense cities, or interiors with separate rooms.
Burst Occlusion Culling isn't appropriate for every application or scene. Scenes with many unique objects (with unique meshes or materials) that produce a lot of overdraw are perfect for Burst Occlusion Culling. Examples of this type of scene include large open worlds, dense cities, or interiors with separate rooms.

Entities graphics can render instanced objects very quickly so it's often not beneficial to calculate which instanced objects are or aren't occluded and instead pass them all to the GPU to render. This is because the overhead of the occlusion culling calculations can exceed the overhead saved by reducing the number of instanced objects to draw.

If there is a mix of unique and instanced objects in a scene, you can enable Burst occlusion culling for the scene, but make the instanced objects not occludees (disable **Dynamic Occlusion** on their Mesh Renderer component). This makes Burst occlusion culling optimize the draw submission for unique objects without wasting resources processing the instanced objects.
If there is a mix of unique and instanced objects in a scene, you can enable Burst Occlusion Culling for the scene, but make the instanced objects not occludees (disable **Dynamic Occlusion** on their Mesh Renderer component). This makes Burst Occlusion Culling optimize the draw submission for unique objects without wasting resources processing the instanced objects.

## How to choose occluders

Expand All @@ -36,4 +36,4 @@ Entities likely to be unsuitable occluders are:

## Additional resources

- [Set up Burst occlusion culling](burst-occlusion-culling-setup.md)
- [Set up Burst Occlusion Culling](burst-occlusion-culling-setup.md)
14 changes: 7 additions & 7 deletions Documentation~/burst-occlusion-culling-requirements.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Burst occlusion culling requirements and compatibility
# Burst Occlusion Culling requirements and compatibility

This page contains information on requirements and feature compatibility of Burst occlusion culling. Burst occlusion culling currently only supports [Entities](https://docs.unity3d.com/Packages/com.unity.entities@latest/index.html)-based applications.
This page contains information on requirements and feature compatibility of Burst Occlusion Culling. Burst Occlusion Culling currently only supports [Entities](https://docs.unity3d.com/Packages/com.unity.entities@latest/index.html)-based applications.

## Hardware requirements

Burst occlusion culling requires the target CPU to support SSE4 or Neon instructions. Burst doesn't support 32-bit intrinsics for Neon so, to build for ARM, you must use a 64-bit build target.
Burst Occlusion Culling requires the target CPU to support SSE4 or Neon instructions. Burst doesn't support 32-bit intrinsics for Neon so, to build for ARM, you must use a 64-bit build target.

## Renderer compatibility

The following table shows which renderers Burst occlusion culling supports.
The following table shows which renderers Burst Occlusion Culling supports.

| Renderer | Occludee support | Occluder support |
| ------------------------ | ---------------- | ---------------- |
Expand All @@ -23,7 +23,7 @@ The following table shows which renderers Burst occlusion culling supports.

## Occlusion view compatibility

The following table shows which components Burst occlusion culling supports as views:
The following table shows which components Burst Occlusion Culling supports as views:

| Component | View support |
| ------------------------ | ------------ |
Expand All @@ -35,11 +35,11 @@ The following table shows which components Burst occlusion culling supports as v

## Feature compatibility

Burst occlusion culling doesn't support the following:
Burst Occlusion Culling doesn't support the following:

* [Mesh deformations](mesh_deformations.md).
* Concurrent usage with Unity's [built-in occlusion culling system](xref:OcclusionCulling).

## Additional resources

* [Burst occlusion culling overview](burst-occlusion-culling-overview.md)
* [Burst Occlusion Culling overview](burst-occlusion-culling-overview.md)
16 changes: 8 additions & 8 deletions Documentation~/burst-occlusion-culling-setup.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Set up Burst occlusion culling
# Set up Burst Occlusion Culling

To set up Burst occlusion culling in your Unity project:
To set up Burst Occlusion Culling in your Unity project:

1. Enable the feature.
2. Enable and configure Burst occlusion culling for individual cameras, lights, and reflection probes.
2. Enable and configure Burst Occlusion Culling for individual cameras, lights, and reflection probes.
3. Configure some entities to be occluders.

## Enable Burst occlusion culling
## Enable Burst Occlusion Culling

The first step to set up Burst occlusion culling is to enable the feature for your project. To do this:
The first step to set up Burst Occlusion Culling is to enable the feature for your project. To do this:

1. Set the `ENABLE_UNITY_OCCLUSION` custom scripting symbol. For information on how to do this, refer to [Custom scripting symbols](xref:CustomScriptingSymbols).
2. Ensure that [Burst](https://docs.unity3d.com/Packages/com.unity.burst@latest/index.html) is enabled. To do this, select **Jobs** > **Burst** > **Enable Compilation**.
3. Select **Occlusion** > **Enable**.
4. Burst occlusion culling requires the target CPU to support SSE4 instructions. To be able to build a Unity Player, go to **Edit** > **Project Settings** > **Burst AOT Settings** and set **Target CPU architectures** to **SSE4**.
4. Burst Occlusion Culling requires the target CPU to support SSE4 instructions. To be able to build a Unity Player, go to **Edit** > **Project Settings** > **Burst AOT Settings** and set **Target CPU architectures** to **SSE4**.

## Configure per-view occlusion culling

You can enable and configure Burst occlusion culling on a per-camera, per-light, and per reflection probe basis. By default, only the [main camera](xref:UnityEngine.Camera.main) uses Burst occlusion culling. To enable Burst occlusion culling for a camera, light, and reflection probe, add the **Occlusion View** component and enable the **Occlusion Enable** property. The Occlusion View component also controls the resolution of the occlusion buffer for the camera, light, or reflection probe. The occlusion buffer resolution affects the resource intensity of the occlusion culling calculations. For more information about configuration options and performance, refer to [Optimize Burst occlusion culling](burst-occlusion-culling-optimize.md)
You can enable and configure Burst Occlusion Culling on a per-camera, per-light, and per reflection probe basis. By default, only the [main camera](xref:UnityEngine.Camera.main) uses Burst Occlusion Culling. To enable Burst Occlusion Culling for a camera, light, and reflection probe, add the **Occlusion View** component and enable the **Occlusion Enable** property. The Occlusion View component also controls the resolution of the occlusion buffer for the camera, light, or reflection probe. The occlusion buffer resolution affects the resource intensity of the occlusion culling calculations. For more information about configuration options and performance, refer to [Optimize Burst Occlusion Culling](burst-occlusion-culling-optimize.md)

## Create occluders

Expand All @@ -34,4 +34,4 @@ To set up an entity as an occluder:

## Additional resources

- [Optimize Burst occlusion culling](burst-occlusion-culling-optimize.md)
- [Optimize Burst Occlusion Culling](burst-occlusion-culling-optimize.md)
Loading

0 comments on commit 51d4814

Please sign in to comment.