Class Fog
Fog Volume Component.
Inherited Members
Namespace: UnityEngine.Rendering.HighDefinition
Syntax
[Serializable]
[VolumeComponentMenuForRenderPipeline("Fog", new Type[]{typeof(HDRenderPipeline)})]
public class Fog : VolumeComponentWithQuality
Fields
albedo
Stores the fog albedo. This defines the color of the fog.
Declaration
public ColorParameter albedo
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.ColorParameter |
anisotropy
Controls the angular distribution of scattered light. 0 is isotropic, 1 is forward scattering, and -1 is backward scattering.
Declaration
[AdditionalProperty]
public ClampedFloatParameter anisotropy
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.ClampedFloatParameter |
baseHeight
Height fog base height.
Declaration
public FloatParameter baseHeight
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.FloatParameter |
color
Fog color.
Declaration
[Tooltip("Specifies the constant color of the fog.")]
public ColorParameter color
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.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 |
---|---|
UnityEngine.Rendering.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
[AdditionalProperty]
[Tooltip("When enabled, HDRP only includes directional Lights when it evaluates volumetric fog.")]
public BoolParameter directionalLightsOnly
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.BoolParameter |
enabled
Enable fog.
Declaration
[Tooltip("Enables the fog.")]
public BoolParameter enabled
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.BoolParameter |
enableVolumetricFog
Enable volumetric fog.
Declaration
[DisplayInfo(name = "Volumetric Fog")]
public BoolParameter enableVolumetricFog
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.BoolParameter |
globalLightProbeDimmer
Multiplier for ambient probe contribution.
Declaration
[DisplayInfo(name = "Ambient Light Probe Dimmer")]
public ClampedFloatParameter globalLightProbeDimmer
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.ClampedFloatParameter |
m_ResolutionDepthRatio
Declaration
[AdditionalProperty]
[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 |
---|---|
UnityEngine.Rendering.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 |
---|---|
UnityEngine.Rendering.MinFloatParameter |
maximumHeight
Height fog maximum height.
Declaration
public FloatParameter maximumHeight
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.FloatParameter |
meanFreePath
Fog mean free path.
Declaration
[DisplayInfo(name = "Fog Attenuation Distance")]
public MinFloatParameter meanFreePath
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.MinFloatParameter |
mipFogFar
Sets the distance at which HDRP uses the maximum mip image of the blurred sky texture as the fog color.
Declaration
[AdditionalProperty]
[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 |
---|---|
UnityEngine.Rendering.MinFloatParameter |
mipFogMaxMip
Controls the maximum mip map HDRP uses for mip fog (0 is the lowest mip and 1 is the highest mip).
Declaration
[AdditionalProperty]
[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 |
---|---|
UnityEngine.Rendering.ClampedFloatParameter |
mipFogNear
Sets the distance at which HDRP uses the minimum mip image of the blurred sky texture as the fog color.
Declaration
[AdditionalProperty]
[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 |
---|---|
UnityEngine.Rendering.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
[AdditionalProperty]
[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 |
---|---|
UnityEngine.Rendering.ClampedFloatParameter |
sliceDistributionUniformity
Controls the distribution of slices along the Camera's focal axis. 0 is exponential distribution and 1 is linear distribution.
Declaration
[AdditionalProperty]
[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 |
---|---|
UnityEngine.Rendering.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 |
---|---|
UnityEngine.Rendering.ColorParameter |
volumeSliceCount
Number of slices of the volumetric buffer (3D texture) along the camera's focal axis.
Declaration
[AdditionalProperty]
[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 |
---|---|
UnityEngine.Rendering.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
Declaration
public float resolutionDepthRatio { get; set; }
Property Value
Type | Description |
---|---|
Single |
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 |
---|---|
Single |
Remarks
Try to minimize this value to find a compromise between quality and performance.