Skip to content

[10.x.x] added information on how to enable post-processing #2010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* [Camera component reference](camera-component-reference.md)

* [Post-processing](integration-with-post-processing.md)
* [How to configure](integration-with-post-processing.md#post-proc-how-to)
* [Volumes](Volumes.md)
* [Volume Profile](VolumeProfile.md)
* [Volume Overrides](VolumeOverrides.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Volume Overrides

__Volume Overrides__ are structures which contain values that override the default properties in a [Volume Profile](VolumeProfile.md). The Universal Render Pipeline (URP) uses these Profiles within the [Volume](Volumes.html) framework. For example, you could use a Volume Override in your Unity Project to darken the outside edges of yours Scene.
__Volume Overrides__ let you change or extend the default properties in a [Volume Profile](VolumeProfile.md).

![__Vignette__ is an example of a Volume Override.](Images/Inspectors/Vignette.png)
URP implements post-processing effects as Volume Overrides. For example, the following image shows the Vignette post-processing effect in the URP Template SampleScene.

Each Volume Override property has a checkbox on its left. Enable the checkbox to make that property editable. This also tells URP to use that property for this Volume component rather than the default value. If you disable the checkbox, URP ignores the property you set and uses the Volume’s default value for that property instead.
![Vignette post-processing effect in the URP Template SampleScene](Images/post-proc/post-proc-as-volume-override.png)

Override checkboxes allow you to override as many or as few values on a Volume component as you want. To quickly toggle all the properties between editable or not, click the __All__ or __None__ shortcuts in the top left of the Volume Override respectively.
In a the Volume Override, checkboxes to the left of each property let you enable or disable specific properties. If you disable a property, URP uses the Volume’s default value for that property instead. To turn all properties on or off, use the __All__ or __None__ shortcuts above the property list.

## Using Volume Overrides
![Volume Override property list](Images/post-proc/volume-override-property-list.png)

To render both a global vignette and a local vignette in a certain area of your Scene:
## <a name="volume-add-override"></a>How to add a Volume Override to a Volume component

1. Create a global Volume (menu: __GameObjec > Volume > Global Volume__).
2. Click the __New__ button next to the __Profile__ property to add a new Volume Profile to the Volume.
3. Select __Add Override > Vignette__, and leave it with the default settings.
4. Create a local Volume. To add a **Local** Volume with a box boundary, select __GameObject > Volume > Box Volume__.
5. Select __Add Override > Vignette__.Then, in the __Vignette__ Inspector, override the properties them with your preferred values.
To add a Volume Override to a Volume component:

Now, whenever your Camera is within the bounds of the local Volume's Collider, URP uses the __Vignette__ values from that Volume. Whenever your Camera is outside the bounds of the local Volume's Collider, URP uses the __Vignette__ values from the global Volume
1. Select a GameObject with the Volume component.

2. In the Inspector window, click Add Override.

![Add Override](Images/post-proc/volume-add-override.png)

Use the search field to search for an Override, or select an Override from the menu.
54 changes: 46 additions & 8 deletions com.unity.render-pipelines.universal/Documentation~/Volumes.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
# Volumes

The Universal Render Pipeline (URP) uses a Volume framework. Each Volume can either be global or have local boundaries. They each contain Scene setting property values that URP interpolates between, depending on the position of the Camera, in order to calculate a final value. You can use local Volumes to control post processing effects.
The Universal Render Pipeline (URP) uses the Volume framework. Volumes can override or extend Scene properties depending on the Camera position relative to each Volume.

You can add a __Volume__ component to any GameObject, including a Camera, although it is good practice to create a dedicated GameObject for each Volume. The Volume component itself contains no actual data itself and instead references a [Volume Profile](VolumeProfile.md) which contains the values to interpolate between. The Volume Profile contains default values for every property and hides them by default. To view or alter these properties, you must add [Volume overrides](VolumeOverrides.md), which are structures containing overrides for the default values, to the Volume Profile.
URP uses the Volume framework for [post-processing](integration-with-post-processing.md#post-proc-how-to) effects.

Volumes also contain properties that control how they interact with other Volumes. A Scene can contain many Volumes. **Global** Volumes affect the Camera wherever the Camera is in the Scene and **Local** Volumes affect the Camera if they encapsulate the Camera within the bounds of their Collider.
URP implements dedicated GameObjects for Volumes: **Global Volume**, **Box Volume**, **Sphere Volume**, **Convex Mesh Volume**.

At run time, URP looks at all of the enabled Volumes attached to active GameObjects in the Scene and determines each Volume’s contribution to the final Scene settings. URP uses the Camera position and the Volume properties described above to calculate this contribution. It then uses all Volumes with a non-zero contribution to calculate interpolated final values for every property in all Volume Components.
![Volume types](Images/post-proc/volume-volume-types.png)

Volumes can contain different combinations of Volume Components.
The Volume component contains the **Mode** property that defines whether the Volume is Global or Local.

## Properties
![Volume Mode property](Images/post-proc/volume-mode-prop.png)

With Mode set to **Global**, Volumes affect the Camera everywhere in the Scene. With Mode set to **Local**, Volumes affect the Camera if the Camera is within the bounds of the Collider. For more information, see [How to use Local Volumes](#volume-local).

You can add a __Volume__ component to any GameObject. A Scene can contain multiple GameObjects with Volume components. You can add multiple Volume components to a GameObject.

The Volume component references a [Volume Profile](VolumeProfile.md), which contains the Scene properties. A Volume Profile contains default values for every property and hides them by default. [Volume Overrides](VolumeOverrides.md) let you change or extend the default properties in a [Volume Profile](VolumeProfile.md).

At runtime, URP goes through all of the enabled Volume components attached to active GameObjects in the Scene, and determines each Volume's contribution to the final Scene settings. URP uses the Camera position and the Volume component properties to calculate the contribution. URP interpolates values from all Volumes with a non-zero contribution to calculate the final property values.

## Volume component properties

Volumes components contain properties that control how they affect Cameras and how they interact with other Volumes.

![](/Images/Inspectors/Volume1.png)

Expand All @@ -26,6 +38,32 @@ Volumes can contain different combinations of Volume Components.

The __Profile__ field stores a [Volume Profile](VolumeProfile.md), which is an Asset that contains the properties that URP uses to render the Scene. You can edit this Volume Profile, or assign a different Volume Profile to the __Profile__ field. You can also create a Volume Profile or clone the current one by clicking the __New__ and __Clone__ buttons respectively.

## Configuring a local Volume
## <a name="volume-local"></a>How to use Local Volumes

This section describes how to use a Local Volume to implement a location-based post-processing effect.

In this example, URP applies a post-processing effect when the Camera is within a certain Box Collider.

1. In the Scene, create a new Box Volume (**GameObject > Volume > Box Volume**).

2. Select the Box Volume. In Inspector, In the **Volume** component, In the **Profile** field, click **New**.

![Create new Volume Profile.](Images/post-proc/volume-box-new-profile.png)

Unity creates the new Volume Profile and adds the **Add Override** button to the Volume component.

![New Volume Profile created.](Images/post-proc/volume-new-profile-created.png)

3. If you have other Volumes in the Scene, change the value of the Priority property to ensure that the Overrides from this Volume have higher priority than those of other Volumes.

![Volume priority](Images/post-proc/volume-priority.png)

3. Click [Add Override](VolumeOverrides.md#volume-add-override). In the Volume Overrides dialog box, select a post-processing effect.

4. In the Collider component, adjust the Size and the Center properties so that the Collider occupies the volume where you want the local post-processing effect to be.

![Adjust the Box Collider size and position.](Images/post-proc/volume-box-collider.png)

Ensure that the **Is Trigger** check box is selected.

If your select __Local__ from the __Mode__ drop-down on your Volume, you must attach a Trigger Collider to the GameObject to define its boundaries. Click the Volume to open it in the Inspector and then select __Add Component > Physics > Box Collider__. To define the boundary of the Volume, adjust the __Size__ field of the Box Collider, and the __Scale__ field of the Transform. You can use any type of 3D collider, from simple Box Colliders to more complex convex Mesh Colliders. However, for performance reasons, you should use simple colliders because traversing Mesh Colliders with many vertices is resource intensive. Local volumes also have a __Blend Distance__ that represents the outer distance from the Collider surface where URP begins to blend the settings for that Volume with the others affecting the Camera.
Now, when the Camera is within the bounds of the Volume's Box Collider, URP uses the Volume Overrides from the Box Volume.
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
# Post-processing in the Universal Render Pipeline

The Universal Render Pipeline (URP) includes its own implementation of [post-processing](https://docs.unity3d.com/Manual/PostProcessingOverview.html), so you do not need to install any other package. URP is not compatible with the post-processing version 2 package.
The Universal Render Pipeline (URP) includes an integrated implementation of [post-processing](https://docs.unity3d.com/Manual/PostProcessingOverview.html) effects. If you use URP, it's not necessary to install an extra package for post-processing effects. URP is not compatible with the [Post&nbsp;Processing&nbsp;Stack&nbsp;v2](https://docs.unity3d.com/Packages/com.unity.postprocessing@latest/index.html) package.

This implementation uses the same [Volume](http://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Volumes.html) system as the [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?preview=1). You can add post-processing effects to your Camera in the same way you add any other [Volume Override](VolumeOverrides.md).
URP uses the [Volume](Volumes.md) framework for post-processing effects.

The images below show a Scene with and without URP post-processing.

Without post-processing:

Without post-processing:<br/>
![](Images/AssetShots/Beauty/SceneWithoutPost.png)

With post-processing:

With post-processing:<br/>
![](Images/AssetShots/Beauty/SceneWithPost.png)

> **Note:** URP does not support Post-processing on OpenGL&nbsp;ES&nbsp;2.0.

## <a name="post-proc-how-to"></a>How to configure post-processing effects in URP

This section describes how to configure Post-processing in URP.

### Using post-processing in the URP Template Scene

Post-processing is preconfigured in the SampleScene Scene in URP Template.

To see the preconfigured effects, select **Post-process Volume** in the Scene.

![Add post-processing effects to the Camera by adding Volume Overrides to the Volume component.](Images/post-proc/volume-with-post-proc.png)

To add extra effects, [add Volume Overrides to the Volume](VolumeOverrides.md#volume-add-override).

To configure location-based post-processing effects, see [How to use Local Volumes](Volumes.md#volume-local).

### Configuring post-processing in a new URP Scene

To configure post-processing in a new Scene:

1. Select a Camera, and select the **Post Processing** check box.

![Select a Camera, select the Post Processing check box.](Images/post-proc/camera-post-proc-check.png)

2. Add a GameObject with a [Volume](Volumes.md) component in the Scene. This instruction adds a Global Volume. Select **GameObject > Volume > Global Volume**.

3. Select the **Global Volume** GameObject. In the Volume component, create a new Profile by clicking **New** button on the right side of the Profile property.

![Create new Profile.](Images/post-proc/volume-new-scene-new-profile.png)


3. Add post-processing effects to the Camera by adding [Volume Overrides](VolumeOverrides.md#volume-add-override) to the Volume component.

![Add post-processing effects to the Camera by adding Volume Overrides to the Volume component.](Images/post-proc/volume-new-scene-add-override.png)


Now you can adjust post-processing effect settings in Overrides in the Volume component.

![Editing post-processing effects using Overrides.](Images/post-proc/volume-new-scene-post-proc-from-scratch.png)

To configure location-based post-processing effects, see [How to use Local Volumes](Volumes.md#volume-local).

## Post-processing in URP for mobile devices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To upgrade built-in Shaders:

For [SpeedTree](https://docs.unity3d.com/Manual/SpeedTree.html) Shaders, Unity does not re-generate Materials when you re-import them, unless you click the **Generate Materials** or **Apply & Generate Materials** button.

<a name="built-in-to-urp-shader-mappings">
<a name="built-in-to-urp-shader-mappings"></a>

## Shader mappings

Expand Down