Class Volume
A generic Volume component holding a VolumeProfile.
Inherited Members
Namespace: UnityEngine.Rendering
Syntax
[CoreRPHelpURL("Volumes", "com.unity.render-pipelines.high-definition", "")]
[ExecuteAlways]
[AddComponentMenu("Miscellaneous/Volume")]
public class Volume : MonoBehaviour, IVolume
Fields
blendDistance
The outer distance to start blending from. A value of 0 means no blending and Unity applies the Volume overrides immediately upon entry.
Declaration
[Tooltip("Sets the outer distance to start blending from. A value of 0 means no blending and Unity applies the Volume overrides immediately upon entry.")]
public float blendDistance
Field Value
Type | Description |
---|---|
Single |
priority
The Volume priority in the stack. A higher value means higher priority. This supports negative values.
Declaration
[Tooltip("When multiple Volumes affect the same settings, Unity uses this value to determine which Volume to use. A Volume with the highest Priority value takes precedence.")]
public float priority
Field Value
Type | Description |
---|---|
Single |
sharedProfile
The shared Profile that this Volume uses.
Modifying sharedProfile
changes every Volumes that uses this Profile and also changes
the Profile settings stored in the Project.
Declaration
public VolumeProfile sharedProfile
Field Value
Type | Description |
---|---|
VolumeProfile |
Remarks
You should not modify Profiles that sharedProfile
returns. If you want
to modify the Profile of a Volume, use profile instead.
See Also
weight
The total weight of this volume in the Scene. 0 means no effect and 1 means full effect.
Declaration
[Range(0F, 1F)]
[Tooltip("Sets the total weight of this Volume in the Scene. 0 means no effect and 1 means full effect.")]
public float weight
Field Value
Type | Description |
---|---|
Single |
Properties
colliders
The colliders of the volume if isGlobal is false
Declaration
public List<Collider> colliders { get; }
Property Value
Type | Description |
---|---|
List<Collider> |
Implements
isGlobal
Specifies whether to apply the Volume to the entire Scene or not.
Declaration
[Tooltip("When enabled, the Volume is applied to the entire Scene.")]
public bool isGlobal { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
profile
Gets the first instantiated VolumeProfile assigned to the Volume.
Modifying profile
changes the Profile for this Volume only. If another Volume
uses the same Profile, this clones the shared Profile and starts using it from now on.
Declaration
public VolumeProfile profile { get; set; }
Property Value
Type | Description |
---|---|
VolumeProfile |
Remarks
This property automatically instantiates the Profile and make it unique to this Volume so you can safely edit it via scripting at runtime without changing the original Asset in the Project. Note that if you pass your own Profile, you must destroy it when you finish using it.
See Also
Methods
HasInstantiatedProfile()
Checks if the Volume has an instantiated Profile or if it uses a shared Profile.
Declaration
public bool HasInstantiatedProfile()
Returns
Type | Description |
---|---|
Boolean |
|