Class Fog
Fog Volume Component.
Implements
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Runtime.dll
Syntax
[Serializable]
[VolumeComponentMenuForRenderPipeline("Fog", new Type[] { typeof(HDRenderPipeline) })]
public class Fog : VolumeComponentWithQuality, IApplyRevertPropertyContextMenuItemProvider
Fields
albedo
Stores the fog albedo. This defines the color of the fog.
Declaration
public ColorParameter albedo
Field Value
Type | Description |
---|---|
ColorParameter |
anisotropy
Controls the angular distribution of scattered light. 0 is isotropic, 1 is forward scattering, and -1 is backward scattering.
Declaration
public ClampedFloatParameter anisotropy
Field Value
Type | Description |
---|---|
ClampedFloatParameter |
baseHeight
Height fog base height.
Declaration
public FloatParameter baseHeight
Field Value
Type | Description |
---|---|
FloatParameter |
color
Fog color.
Declaration
[Tooltip("Specifies the constant color of the fog.")]
public ColorParameter color
Field Value
Type | Description |
---|---|
ColorParameter |
colorMode
Fog color mode.
Declaration
public FogColorParameter colorMode
Field Value
Type | Description |
---|---|
FogColorParameter |
denoisingMode
Controls which denoising technique to use for the volumetric effect.
Declaration
[Tooltip("Specifies the denoising technique to use for the volumetric effect.")]
public FogDenoisingModeParameter denoisingMode
Field Value
Type | Description |
---|---|
FogDenoisingModeParameter |
Remarks
Reprojection mode is effective for static lighting but can lead to severe ghosting artifacts with highly dynamic lighting. Gaussian mode is effective with dynamic lighting. You can also use both modes together which produces high-quality results, but increases the resource intensity of processing the effect.
depthExtent
Sets the distance (in meters) from the Camera's Near Clipping Plane to the back of the Camera's volumetric lighting buffer. The lower the distance is, the higher the fog quality is.
Declaration
public MinFloatParameter depthExtent
Field Value
Type | Description |
---|---|
MinFloatParameter |
directionalLightsOnly
Indicates whether Unity includes or excludes non-directional light types when it evaluates the volumetric fog. Including non-directional lights increases the resource intensity of the effect.
Declaration
[Tooltip("When enabled, HDRP only includes directional Lights when it evaluates volumetric fog.")]
public BoolParameter directionalLightsOnly
Field Value
Type | Description |
---|---|
BoolParameter |
enableVolumetricFog
Enable volumetric fog.
Declaration
public BoolParameter enableVolumetricFog
Field Value
Type | Description |
---|---|
BoolParameter |
enabled
Enable fog.
Declaration
[Tooltip("Enables the fog.")]
public BoolParameter enabled
Field Value
Type | Description |
---|---|
BoolParameter |
globalLightProbeDimmer
Multiplier for global illumination (APV or ambient probe).
Declaration
public ClampedFloatParameter globalLightProbeDimmer
Field Value
Type | Description |
---|---|
ClampedFloatParameter |
m_ResolutionDepthRatio
Controls how Unity shares resources between Screen (XY) and Depth (Z) resolutions.
Declaration
[SerializeField]
[FormerlySerializedAs("resolutionDepthRatio")]
[Tooltip("Controls how Unity shares resources between Screen (x-axis and y-axis) and Depth (z-axis) resolutions.")]
public ClampedFloatParameter m_ResolutionDepthRatio
Field Value
Type | Description |
---|---|
ClampedFloatParameter |
maxFogDistance
Maximum fog distance.
Declaration
[Tooltip("Sets the maximum fog distance HDRP uses when it shades the skybox or the Far Clipping Plane of the Camera.")]
public MinFloatParameter maxFogDistance
Field Value
Type | Description |
---|---|
MinFloatParameter |
maximumHeight
Height fog maximum height.
Declaration
public FloatParameter maximumHeight
Field Value
Type | Description |
---|---|
FloatParameter |
meanFreePath
Fog mean free path.
Declaration
public MinFloatParameter meanFreePath
Field Value
Type | Description |
---|---|
MinFloatParameter |
mipFogFar
Sets the distance at which HDRP uses the maximum mip image of the blurred sky texture as the fog color.
Declaration
[Tooltip("Sets the distance at which HDRP uses the maximum mip image of the blurred sky texture as the fog color.")]
public MinFloatParameter mipFogFar
Field Value
Type | Description |
---|---|
MinFloatParameter |
mipFogMaxMip
Controls the maximum mip map HDRP uses for mip fog (0 is the lowest mip and 1 is the highest mip).
Declaration
[Tooltip("Controls the maximum mip map HDRP uses for mip fog (0 is the lowest mip and 1 is the highest mip).")]
public ClampedFloatParameter mipFogMaxMip
Field Value
Type | Description |
---|---|
ClampedFloatParameter |
mipFogNear
Sets the distance at which HDRP uses the minimum mip image of the blurred sky texture as the fog color.
Declaration
[Tooltip("Sets the distance at which HDRP uses the minimum mip image of the blurred sky texture as the fog color.")]
public MinFloatParameter mipFogNear
Field Value
Type | Description |
---|---|
MinFloatParameter |
screenResolutionPercentage
Stores the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the screen.
Declaration
[Tooltip("Controls the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the screen.")]
public ClampedFloatParameter screenResolutionPercentage
Field Value
Type | Description |
---|---|
ClampedFloatParameter |
sliceDistributionUniformity
Controls the distribution of slices along the Camera's focal axis. 0 is exponential distribution and 1 is linear distribution.
Declaration
[Tooltip("Controls the distribution of slices along the Camera's focal axis. 0 is exponential distribution and 1 is linear distribution.")]
public ClampedFloatParameter sliceDistributionUniformity
Field Value
Type | Description |
---|---|
ClampedFloatParameter |
tint
Specifies the tint of the fog when using Sky Color.
Declaration
[Tooltip("Specifies the tint of the fog.")]
public ColorParameter tint
Field Value
Type | Description |
---|---|
ColorParameter |
volumeSliceCount
Number of slices of the volumetric buffer (3D texture) along the camera's focal axis.
Declaration
[Tooltip("Controls the number of slices to use the volumetric buffer (3D texture) along the camera's focal axis.")]
public ClampedIntParameter volumeSliceCount
Field Value
Type | Description |
---|---|
ClampedIntParameter |
Properties
fogControlMode
Controls which method to use to control the performance and quality of the volumetric fog.
Declaration
public FogControl fogControlMode { get; set; }
Property Value
Type | Description |
---|---|
FogControl |
Remarks
Balance mode allows you to use a performance-oriented approach to define the quality of the volumetric fog. Manual mode gives you access to the internal set of properties which directly control the effect.
resolutionDepthRatio
Controls how Unity shares resources between Screen (XY) and Depth (Z) resolutions.
Declaration
public float resolutionDepthRatio { get; set; }
Property Value
Type | Description |
---|---|
float |
Remarks
A value of 0 means Unity allocates all of the resources to the XY resolution, which reduces aliasing, but increases noise. A value of 1 means Unity allocates all of the resources to the Z resolution, which reduces noise, but increases aliasing. This property allows for linear interpolation between the two configurations.
volumetricFogBudget
Defines the performance to quality ratio of the volumetric fog. A value of 0 being the least resource-intensive and a value of 1 being the highest quality.
Declaration
public float volumetricFogBudget { get; set; }
Property Value
Type | Description |
---|---|
float |
Remarks
Try to minimize this value to find a compromise between quality and performance.