Class VolumeManager
A global manager that tracks all the Volumes in the currently loaded Scenes and does all the interpolation work.
Inherited Members
Namespace: UnityEngine .Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public sealed class VolumeManager
Properties
baseComponentTypeArray
The current list of all available types that derive from Volume
Declaration
public Type[] baseComponentTypeArray { get; }
Property Value
Type | Description |
---|---|
Type[] |
baseComponentTypes
The current list of all available types that derive from Volume
Declaration
[Obsolete("Please use baseComponentTypeArray instead.")]
public IEnumerable<Type> baseComponentTypes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Type> |
customDefaultProfiles
Collection of additional default profiles that can be used to override default values for volume components
in a way that doesn't cause any overhead at runtime. Unity applies these Volume Profiles to its internal
component default state after global
Declaration
public ReadOnlyCollection<VolumeProfile> customDefaultProfiles { get; }
Property Value
Type | Description |
---|---|
Read |
globalDefaultProfile
Global default profile that provides default values for volume components. VolumeManager applies
this profile to its internal component default state first, before quality
Declaration
public VolumeProfile globalDefaultProfile { get; }
Property Value
Type | Description |
---|---|
Volume |
instance
The current singleton instance of Volume
Declaration
public static VolumeManager instance { get; }
Property Value
Type | Description |
---|---|
Volume |
isInitialized
Returns whether Initialize(Volume
Declaration
public bool isInitialized { get; }
Property Value
Type | Description |
---|---|
bool |
qualityDefaultProfile
Quality level specific volume profile that is applied to the default state after
global
Declaration
public VolumeProfile qualityDefaultProfile { get; }
Property Value
Type | Description |
---|---|
Volume |
stack
A reference to the main Volume
Declaration
public VolumeStack stack { get; set; }
Property Value
Type | Description |
---|---|
Volume |
See Also
Methods
CheckDefaultVolumeState()
Checks component default state. This is only used in the editor to handle entering and exiting play mode because the instances created during playmode are automatically destroyed.
Declaration
[Conditional("UNITY_EDITOR")]
public void CheckDefaultVolumeState()
CheckStack(VolumeStack)
Checks the state of a given stack. This is only used in the editor to handle entering and exiting play mode because the instances created during playmode are automatically destroyed.
Declaration
[Conditional("UNITY_EDITOR")]
public void CheckStack(VolumeStack stack)
Parameters
Type | Name | Description |
---|---|---|
Volume |
stack | The stack to check. |
CreateStack()
Creates and returns a new Volume
Declaration
public VolumeStack CreateStack()
Returns
Type | Description |
---|---|
Volume |
A new Volume |
See Also
Deinitialize()
Deinitialize VolumeManager. Should be called from RenderPipeline.Dispose().
Declaration
public void Deinitialize()
DestroyStack(VolumeStack)
Destroy a Volume Stack
Declaration
public void DestroyStack(VolumeStack stack)
Parameters
Type | Name | Description |
---|---|---|
Volume |
stack | Volume Stack that needs to be destroyed. |
GetVolumeComponentDefaultState(Type)
Retrieve the default state for a given VolumeComponent type. Default state is defined as "default-constructed VolumeComponent + Default Profiles evaluated in order".
Declaration
public VolumeComponent GetVolumeComponentDefaultState(Type volumeComponentType)
Parameters
Type | Name | Description |
---|---|---|
Type | volumeComponentType | Type of VolumeComponent |
Returns
Type | Description |
---|---|
Volume |
VolumeComponent in default state, or null if the type is not found |
Remarks
If you want just the VolumeComponent with default-constructed values without overrides from
Default Profiles, use Create
GetVolumes(LayerMask)
Get all volumes on a given layer mask sorted by influence.
Declaration
public Volume[] GetVolumes(LayerMask layerMask)
Parameters
Type | Name | Description |
---|---|---|
Layer |
layerMask | The LayerMask that Unity uses to filter Volumes that it should consider. |
Returns
Type | Description |
---|---|
Volume[] | An array of volume. |
Initialize(VolumeProfile, VolumeProfile)
Initialize VolumeManager with specified global and quality default volume profiles that are used to evaluate
the default state of all VolumeComponents. Should be called from Render
Declaration
public void Initialize(VolumeProfile globalDefaultVolumeProfile = null, VolumeProfile qualityDefaultVolumeProfile = null)
Parameters
Type | Name | Description |
---|---|---|
Volume |
globalDefaultVolumeProfile | Global default volume profile. |
Volume |
qualityDefaultVolumeProfile | Quality default volume profile. |
IsComponentActiveInMask<T>(LayerMask)
Checks if a Volume
Declaration
public bool IsComponentActiveInMask<T>(LayerMask layerMask) where T : VolumeComponent
Parameters
Type | Name | Description |
---|---|---|
Layer |
layerMask | The LayerMask to check against |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
T | A type derived from Volume |
OnVolumeComponentChanged(VolumeComponent)
Call when a VolumeComponent is modified to trigger default state update if necessary.
Declaration
public void OnVolumeComponentChanged(VolumeComponent component)
Parameters
Type | Name | Description |
---|---|---|
Volume |
component | VolumeComponent that has changed. |
OnVolumeProfileChanged(VolumeProfile)
Call when a VolumeProfile is modified to trigger default state update if necessary.
Declaration
public void OnVolumeProfileChanged(VolumeProfile profile)
Parameters
Type | Name | Description |
---|---|---|
Volume |
profile | VolumeProfile that has changed. |
Register(Volume)
Registers a new Volume in the manager. Unity does this automatically when a new Volume is enabled, or its layer changes, but you can use this function to force-register a Volume that is currently disabled.
Declaration
public void Register(Volume volume)
Parameters
Type | Name | Description |
---|---|---|
Volume | volume | The volume to register. |
See Also
Register(Volume, int)
Registers a new Volume in the manager. Unity does this automatically when a new Volume is enabled, or its layer changes, but you can use this function to force-register a Volume that is currently disabled.
Declaration
[Obsolete("Please use the Register without a given layer index #from(6000.0)", false)]
public void Register(Volume volume, int layer)
Parameters
Type | Name | Description |
---|---|---|
Volume | volume | The volume to register. |
int | layer | The LayerMask that this volume is in. |
See Also
ResetMainStack()
Resets the main stack to be the default one. Call this function if you've assigned the main stack to something other than the default one.
Declaration
public void ResetMainStack()
SetCustomDefaultProfiles(List<VolumeProfile>)
Assign the given VolumeProfiles as custom default profiles and update the default component state.
Declaration
public void SetCustomDefaultProfiles(List<VolumeProfile> profiles)
Parameters
Type | Name | Description |
---|---|---|
List<Volume |
profiles | List of VolumeProfiles to set as default profiles, or null to clear them. |
SetGlobalDefaultProfile(VolumeProfile)
Assign the given VolumeProfile as the global default profile and update the default component state.
Declaration
public void SetGlobalDefaultProfile(VolumeProfile profile)
Parameters
Type | Name | Description |
---|---|---|
Volume |
profile | The VolumeProfile to use as the global default profile. |
SetQualityDefaultProfile(VolumeProfile)
Assign the given VolumeProfile as the quality default profile and update the default component state.
Declaration
public void SetQualityDefaultProfile(VolumeProfile profile)
Parameters
Type | Name | Description |
---|---|---|
Volume |
profile | The VolumeProfile to use as the quality level default profile. |
Unregister(Volume)
Unregisters a Volume from the manager. Unity does this automatically when a Volume is disabled or goes out of scope, but you can use this function to force-unregister a Volume that you added manually while it was disabled.
Declaration
public void Unregister(Volume volume)
Parameters
Type | Name | Description |
---|---|---|
Volume | volume | The Volume to unregister. |
See Also
Unregister(Volume, int)
Unregisters a Volume from the manager. Unity does this automatically when a Volume is disabled or goes out of scope, but you can use this function to force-unregister a Volume that you added manually while it was disabled.
Declaration
[Obsolete("Please use the Register without a given layer index #from(6000.0)", false)]
public void Unregister(Volume volume, int layer)
Parameters
Type | Name | Description |
---|---|---|
Volume | volume | The Volume to unregister. |
int | layer | The LayerMask that this volume is in. |
See Also
Update(VolumeStack, Transform, LayerMask)
Updates the Volume manager and stores the result in a custom Volume
Declaration
public void Update(VolumeStack stack, Transform trigger, LayerMask layerMask)
Parameters
Type | Name | Description |
---|---|---|
Volume |
stack | The stack to store the blending result into. |
Transform | trigger | A reference Transform to consider for positional Volume blending. |
Layer |
layerMask | The LayerMask that Unity uses to filter Volumes that it should consider for blending. |
See Also
Update(Transform, LayerMask)
Updates the global state of the Volume manager. Unity usually calls this once per Camera in the Update loop before rendering happens.
Declaration
public void Update(Transform trigger, LayerMask layerMask)
Parameters
Type | Name | Description |
---|---|---|
Transform | trigger | A reference Transform to consider for positional Volume blending |
Layer |
layerMask | The LayerMask that the Volume manager uses to filter Volumes that it should consider for blending. |