Class Volume
A generic Volume component holding a VolumeProfile.
Namespace: UnityEngine.Rendering
Syntax
public class Volume : MonoBehaviour
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
public float blendDistance
Field Value
Type | Description |
---|---|
Single |
isGlobal
Specifies whether to apply the Volume to the entire Scene or not.
Declaration
public bool isGlobal
Field Value
Type | Description |
---|---|
Boolean |
priority
The Volume priority in the stack. A higher value means higher priority. This supports negative values.
Declaration
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
public float weight
Field Value
Type | Description |
---|---|
Single |
Properties
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 |
|