Set up a volume in URP
Configure the default volumes, or create a volume in a scene.
阅读时间2 分钟最后更新于 23 天前
To set up a volume in your scene, you can configure the project's default volume settings, or add a new custom volume. For details, refer to the following sections:
Configure the default volumes
You can configure the default global volumes that all URP scenes use.
Configure the Default Volume
To configure the Default Volume, go to > Graphics > URP > Default Volume Profile.
Project Settings
?
By default, the Default Volume references a Volume Profile called . lists all possible Volume Overrides. You can change the properties, but you can't disable or remove Volume Overrides. Refer to Volume Overrides for more information about changing the properties.
DefaultVolumeProfileDefaultVolumeProfileYou can assign your own Volume Profile.
If you delete the Volume Profile, URP automatically reassigns .
DefaultVolumeProfileConfigure the global volume for a quality level
To configure the global volume for a quality level, follow these steps:
- Go to Project Settings > Quality and select the quality level.
- Go to Rendering > Render Pipeline Asset and open the URP asset.
- In the Inspector window for the URP asset, go to Volumes.
You can add or remove Volume Overrides and edit their properties. Refer to Volume Overrides for more information about changing the Volume Overrides and properties.
Add a volume
To add a volume to your scene and edit its Volume Profile, follow these steps:
- Go to > Volume and select a GameObject.GameObject
?
- In the or Hierarchy view, select the new GameObject to view it in the Inspector.Scene
?
- In the Volume component, assign a Volume Profile asset. To create a new Volume Profile, select New.
The list of Volume Overrides that the Volume Profile contains appears below the Volume Profile asset. You can add or remove Volume Overrides and edit their properties. Refer to Volume Overrides for more information about changing the Volume Overrides and properties.
Example: Create a local post-processing effect
The following example shows how to use a local Box Volume to implement a location-based post-processing effect.
-
In a scene, create a new Box Volume using GameObject > Volume > Box Volume.
-
Select the Box Volume. In the Inspector, in the Volume component, select New.Unity creates the new Volume Profile.
-
Select Add Override, then select a post-processing effect.
-
In thecomponent, adjust the Size and Center properties so the collider occupies the volume where you want the local post-processing effect to be.Box Collider
?
-
Ensure Is Trigger is enabled in the Box Collider component.
-
If you have other Volume components in the scene, change the value of the Priority property to ensure that the Volume Overrides from this volume have higher priority than those of other volumes.
Now, when the Camera is within the bounds of the GameObject's collider, URP uses the Volume Overrides from the Volume component.