Class DepthOfField
A volume component that holds settings for the Depth Of Field effect.
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
[Serializable]
[VolumeComponentMenu("Post-processing/Depth Of Field")]
[SupportedOnRenderPipeline(typeof(HDRenderPipelineAsset))]
public sealed class DepthOfField : VolumeComponentWithQuality, IApplyRevertPropertyContextMenuItemProvider, IPostProcessComponent
Fields
coCStabilization
Enables the Circle of Confusion Reprojection used when anti-aliasing or an upsampling technique requiring jittering (TAA, DLSS, STP, etc.) is enabled. Disabling this option can get rid of ghosting artifacts in the depth of field."
Declaration
[Tooltip("Enables the CoC Reprojection used when anti-aliasing or an upsampling technique requiring jittering (TAA, DLSS, STP, etc.) is enabled. Disabling this option can get rid of ghosting artifacts in the depth of field.")]
[SerializeField]
[InspectorName("CoC Stabilization")]
public BoolParameter coCStabilization
Field Value
Type | Description |
---|---|
BoolParameter |
farFocusEnd
Sets the distance from the Camera at which the far field blur reaches its maximum blur radius.
Declaration
[Tooltip("Sets the distance from the Camera at which the far field blur reaches its maximum blur radius.")]
public MinFloatParameter farFocusEnd
Field Value
Type | Description |
---|---|
MinFloatParameter |
farFocusStart
Sets the distance from the Camera at which the far field starts blurring.
Declaration
[Header("Far Range")]
[Tooltip("Sets the distance from the Camera at which the far field starts blurring.")]
public MinFloatParameter farFocusStart
Field Value
Type | Description |
---|---|
MinFloatParameter |
focusDistance
The distance to the focus plane from the Camera.
Declaration
[Tooltip("The distance to the focus plane from the Camera.")]
public MinFloatParameter focusDistance
Field Value
Type | Description |
---|---|
MinFloatParameter |
focusDistanceMode
Specifies where to read the focus distance from.
Declaration
[Tooltip("Specifies where to read the focus distance from..")]
public FocusDistanceModeParameter focusDistanceMode
Field Value
Type | Description |
---|---|
FocusDistanceModeParameter |
focusMode
Specifies the mode that HDRP uses to set the focus for the depth of field effect.
Declaration
[Tooltip("Specifies the mode that HDRP uses to set the focus for the depth of field effect.")]
public DepthOfFieldModeParameter focusMode
Field Value
Type | Description |
---|---|
DepthOfFieldModeParameter |
See Also
nearFocusEnd
Sets the distance from the Camera at which the near field does not blur anymore.
Declaration
[Tooltip("Sets the distance from the Camera at which the near field does not blur anymore.")]
public MinFloatParameter nearFocusEnd
Field Value
Type | Description |
---|---|
MinFloatParameter |
nearFocusStart
Sets the distance from the Camera at which the near field blur begins to decrease in intensity.
Declaration
[Header("Near Range")]
[Tooltip("Sets the distance from the Camera at which the near field blur begins to decrease in intensity.")]
public MinFloatParameter nearFocusStart
Field Value
Type | Description |
---|---|
MinFloatParameter |
Properties
adaptiveSamplingWeight
The adaptive sampling weight is a factor that modifies the number of samples in the depth of field depending on the radius of the blur. Higher values will reduce the noise in the depth of field but increases its cost.
Declaration
public float adaptiveSamplingWeight { get; set; }
Property Value
Type | Description |
---|---|
float |
farMaxBlur
Sets the maximum radius the far blur can reach.
Declaration
public float farMaxBlur { get; set; }
Property Value
Type | Description |
---|---|
float |
farSampleCount
Sets the number of samples to use for the far field.
Declaration
public int farSampleCount { get; set; }
Property Value
Type | Description |
---|---|
int |
highQualityFiltering
When enabled, HDRP uses bicubic filtering instead of bilinear filtering for the depth of field effect.
Declaration
public bool highQualityFiltering { get; set; }
Property Value
Type | Description |
---|---|
bool |
limitManualRangeNearBlur
Adjust near blur CoC based on depth distance when manual, non-physical mode is used.
Declaration
public bool limitManualRangeNearBlur { get; set; }
Property Value
Type | Description |
---|---|
bool |
nearMaxBlur
Sets the maximum radius the near blur can reach.
Declaration
public float nearMaxBlur { get; set; }
Property Value
Type | Description |
---|---|
float |
nearSampleCount
Sets the number of samples to use for the near field.
Declaration
public int nearSampleCount { get; set; }
Property Value
Type | Description |
---|---|
int |
physicallyBased
When enabled, HDRP uses a more accurate but slower physically based method to compute the depth of field effect.
Declaration
public bool physicallyBased { get; set; }
Property Value
Type | Description |
---|---|
bool |
resolution
Specifies the resolution at which HDRP processes the depth of field effect.
Declaration
public DepthOfFieldResolution resolution { get; set; }
Property Value
Type | Description |
---|---|
DepthOfFieldResolution |
See Also
Methods
IsActive()
Tells if the effect needs to be rendered or not.
Declaration
public bool IsActive()
Returns
Type | Description |
---|---|
bool |
|
IsFarLayerActive()
Returns the state of the far field blur. This is only relevant when Manual is set.
Declaration
public bool IsFarLayerActive()
Returns
Type | Description |
---|---|
bool |
|
IsNearLayerActive()
Returns the state of the near field blur. This is only relevant when Manual is set.
Declaration
public bool IsNearLayerActive()
Returns
Type | Description |
---|---|
bool |
|